|
Back to "If Statement" Menu |
Using the IF function with calculationsOverview:
The “IF” function is composed of three parts separated by commas: A condition, what to calculate if the condition is met, and what to calculate if the condition isn’t met.
Building the IF function step by step:
1. Select the cell in which you want the IF function to be.
2. Type the following code: =if( 3. Type the condition. 4. Type a comma. 5. Type what to calculate in case the condition is met. 6. Type a comma. 7. Type what to calculate in case the condition isn’t met. 8. Close the bracket and hit the [Enter] key. Function Examples=if(A2<5,A2*2,A2*3)
In words: If the value of cell A2 is smaller than 5 then multiply this value with 2, otherwise multiply this value by 3.
=if(A6>=80,A6*110%,A6)
In words: If the value of cell A6 is greater or equal to 80, then give this value bigger by 10%, else return simply this value (with no change).
=if(C4=100,””,B5*E5+4)
In words: If the value of cell C4 equals to 100 then leave this cell blank, else multiply cell B5 with cell E5 and add 4 to it.
Advanced IF examples (using it with more functions):
=if(and(B5<10,C5<10),B5*C5,B5+C5)
In words: If both the values of cells B5 and C5 are smaller than 10, then multiply these cells, otherwise add up these cells.
=if(A4>average(B2:B15),”Cell A4 is bigger than the average”,””)
In words: If the value of cell A4 is greater than the average of the cells of the range B2:B15, then write “Cell A4 is bigger than the average”, otherwise leave this cell empty.
|