Custom Spreadsheet Solutions
Productivity – powered by Excel

IF – powerful word, just ask Rudyard Kipling.

If is a little word with a big impact. Likewise, the IF function in Excel is one of the smallest (in letters) of the Excel functions, but can be powerful, and is often a gateway to formula use.

=IF(logical_test, [value_if_true], [value_if_false])

The IF function looks like it requires a minimum of 1 input, (note the square brackets) but that is misleading and omitting these inputs can lead to some weird behaviour, so it is always best to supply both, even if that is TRUE and FALSE.
But IF really comes into its own when you give it more interesting output. Yes, No. Over, Under. Pass, Fail. These give a lot more information in most contexts than TRUE, FALSE.
Note the TRUE and FALSE are values not words in Excel. If you are wanting words as output you need to put them in quote marks. “yes”, “no”.

If Function in action.

The IF Function tests a condition and then returns the given result depending on whether the condition is true or false.

You can also nest functions inside the IF statement, even other IF statements to test multiple conditions, but care must be taken as that can get quite confusing and easily lead to mistakes. There are other good options to use if you have multiple criteria to meet.

You can use AND, or OR to test multiple conditions.

If and AND to test two conditions.

Here we are looking for a score of 50 or over AND runs against of less than 30. If both of those conditions are meet then return Yes, otherwise return No.