You are on page 1of 4

Simple IF

Let’s use this data for our sample formulas:


 
A B

1 First

Number Second Number

2 13 20

3 12 2

4 44 325

5 100 10

6 3 50

7 40 100

Using the examples above, your formulas would look something like this:
 
A B C D

1 First

Number Second Number Formula  

2 13 20=IF(A2>B2,"yes","no") 500

3 12 2=IF(A3>B3,1,2)  

4 44 325=IF(A4>B4,"yes","")  

5 100 10=IF(A5>B5,"contact this salesperson","give this one a raise")  

6 3 50=IF(A6>B6,"contact this salesperson",$D$2)  


7 40 100=IF(A7>B7,"contact this salesperson",(B7*50%))  
And your results would look something like this:
 
A B C D

1 First Number Second Number Result  

2 13 20no 500

3 12 2 1 

4 44 325   

5 100 10contact this salesperson  

6 3 50 500 

7 40 100 50 

Complex IF

For this, let’s use some new data. Open a blank workbook in Excel and enter this data:

 
A B C D E

1 Name District Sales Emp. Yrs Job Level

2Linda East $20,000.00 2  


3Joe West $42,302.00 9  

4Bill East $53,001.00 3  

5Mary South $12,000.00 12  

6Mark South $ 2,050.00 6  

7John North $9,000.00 0  

8Ted East $40,000.00 4  

IF

=IF(A2>B2,"yes","no")

=IF(A3>B3,1,2)

=IF(A4>B4,"yes","")

=IF(A5>B5,"contact this salesperson","give this one a raise")

=IF(A6>B6,"contact this salesperson",$D$2)

=IF(A7>B7,"contact this salesperson",(B7*50%))

1.
2. =IF((AND(D2>5,C2>10000)),2,1)

3. =IF((OR(D2>5,C2>10000)),2,1)

4. =IF((AND(D2>5,C2>10000)),3,(IF((OR(D2>5,C2>10000)),2,1)))
5. =IF((B2="East"),4,IF((B2="West"),3,IF((B2="North"),2,IF((B2="South"),1,"")
)))

6. =IF((AND(CONDITION)),(IF((OR((CONDITION)),TRUE,FALSE),FALSE)

7. =IF((AND(CONDITION)),TRUE VALUE, (IF((OR((CONDITION)), TRUE


VALUE, FALSE VALUE))

You might also like