# IF function

Ever tried to create a formula with a condition but could not? Perhaps you intend to have different answers depending on the status (true or false) of the condition? The answer to your problem is the IF function.

The IF function is one of Excel’s most useful and most used functions. What it does, basically, is test to see whether a certain condition is true or false. If the condition is true, the function will do one thing, if the condition is false, the function will do something else.

Syntax: =IF(logic test, value if true, value if false)

Applies To: MS Excel 2003, 2007 and 2010

1.  We are going to calculate the commission figures for the following employees based on this criteria:

If the above target figure is above the target benchmark of \$10,000, multiply the value by 20%, if the above target figure is below \$10,000, then multiply the figure by 5%.

2. You can use the IF Statement to work this out.

3. Use the following formula and copy down =IF(B5>10000,B5*20%,B5*5%)

4. The commission figures will be automatically calculated based on the IF function.

5. The logic test is always a comparison between two values. Comparison operators are used, for example, to see if the first value is greater than or less than the second, or equal to it.

6. While the logic test section is limited to answering a true or false question, you have greater flexibility in what you place in the last two arguments.

7. The IF function can perform different calculations depending on whether the function returns a true value or not.

Note: There is no comma separator used for the number in 10,000 in the above example. This is because the IF function uses the comma to separate the three sections of the IF function contained within the round brackets.