Quick Links
IF statements in Excel are my secret sauce for transforming spreadsheets into intelligent decision-making tools. They respond to changing data, allowing me to streamline my work. Here’s how you can get started using them.
What Is the IF Statement in Excel?
The IF statement in Excel is a logical function that evaluates a condition to determine if it’s true or false. If it’s true, it returns one value, and if it’s false, it returns another.
The IF statement in Excel has the following syntax:

You only need to specifyvalue_if_truewhilevalue_if_falseis optional. However, it’s always good practice to specifyvalue_if_falseas well. If you don’t, Excel will return the valueFALSE, which can be confusing or have unintended results.
Also, to use the IF statement effectively, you need to familiarize yourself with thelogical operators in Excel. These will allow you to make comparisons in the function.

How to Use the IF Statement
Using an IF statement in Excel is simple once you break it down into simple terms. If a condition is true, it should return X; otherwise, it should return Y.
Let’s look at a simple budget, where the expenses are summed up intoTotal Expenses. We will then compare this toBudget, and display a message telling us whether we are within or over the budget. Take a look at the screenshot below of what the spreadsheet looks like.

I am going to put the IF statement in cellC7, which is next toTotal Expenses. Here is how the formula should look:
Basically, this is saying that if the total expenses (B7) are less than (<) the total budget (B8), displayWithin budget. If they are not, showExceeds budget.

You can use the IF statement alongsideExcel’s conditional formattingto change the cell’s color based on conditions.
How to Use Nested IF Statements
You can also put IF statements within others to test multiple conditions within a single formula. These are called nested IF statements, and they allow you to add more complex logic to your spreadsheets.
Here is what the syntax of a nested IF statement generally looks like:
Continuing with our scenario, we will tweak our formula to show a message that tells us if we are slightly or significantly over budget. This will be dependent on whether we exceed the total budget by $100. We will use the<=operator, which stands for equal to or less than, for the comparison.
Here is what the formula looks like:
Combining IF Statements With Other Functions
You can also insert other functions into IF statements to perform calculations based on specific conditions. In our scenario, we are going to use a combination of calculations andconcatenation in Excelto display a more descriptive message. It will show us exactly how much we are over or under the budget.
Here is what that formula looks like:
Here, we use the CONCAT function to combine strings into a sentence. We also use the ABS function to get the absolute value of the difference between the total budget and total expenses.
You can use functions like SUM, AVERAGE, COUNT, DATE, and VLOOKUP within the IF statement as well.
If you find it challenging to keep track of nested IF formulas, you canuse the IFS function, which is an upgraded version of IF capable of handling multiple criteria.
The IF statement isone of the most useful functions in Excel. Now that you know the basics, you can use it to do more interesting things. These includeperforming calculations with formulas, applying conditional formatting, handling errors, or validating inputs. Combined with nested IFs, they can become even more complex and make your spreadsheets even smarter.