• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help in formula please

If d4="2h" and e4=class1
Then 1500*2
If d4="1h" and e4=class1
Then 1500*1
If d4="2h" and e4=class2
Then 3000*2
If d4="1h" and e4=class2
Then 3000*1
 

GraH - Guido

Well-Known Member
Hi JunaidZahoor1985 , please read the forum rules to understand the best practices of posting here.

Basic formula = IF (AND (D4= "2H", E4="class1") , 3000 , IF ( AND (D4 = "1H", E4 = "class1") , 1500 , IF ... ) ) )
or using a vlookup on the combination of D4 and E4 and making a reference table to avoid the nesting of IF. = VLOOKUP (D4&E4, lookuptable , 2 , 0)

Lookuptable can be ( 2 columns)
1Hclass1 1500
2Hclass1 3000
1Hclass2 3000
2Hclass2 6000

Why 1500*2 , 3000*2 as hardcoded calculations and not values in your formula?
 
Hi JunaidZahoor1985 , please read the forum rules to understand the best practices of posting here.

Basic formula = IF (AND (D4= "2H", E4="class1") , 3000 , IF ( AND (D4 = "1H", E4 = "class1") , 1500 , IF ... ) ) )
or using a vlookup on the combination of D4 and E4 and making a reference table to avoid the nesting of IF. = VLOOKUP (D4&E4, lookuptable , 2 , 0)

Lookuptable can be ( 2 columns)
1Hclass1 1500
2Hclass1 3000
1Hclass2 3000
2Hclass2 6000

Why 1500*2 , 3000*2 as hardcoded calculations and not values in your formula?
 
Top