IF Statements in Excel

 

« Back to videos

Additional Information:

This video introduces the basic IF statement and demonstrates how the ability to test if a statement is true or false can be used to auto-fill a column with data.

An IF Statement takes the form "=IF(ThingToTest, ValueIfTrue, ValueIfFalse)". So if we wanted to test whether cell A1 contained a positive number, ThingToTest would become A1>0. Let's say we wish to copy cell A1 to the cell containing our formula, if it is positive. ValueIfTrue should simply be A1. ValueIfFalse can be 0. Our IF statement should therefore read "=IF(A1>0, A1, 0)".

Note that all IF statements can be turned around. We could have got the same result if we said "=IF(A1<0, 0, A1)". You can use any mathematical function in the ThingToTest. If your condition is based on the text in a cell, you should use quotation marks e.g. "=IF(A1="Expense", B1, 0)" would return the value of cell B1, if cell A1 said it was an expense.