This article explains how to write and use the IF function (also known as IF-THEN) in Excel. Instructions apply to Microsoft 365, Excel 2021, 2019, 2016, 2013, 2010; Excel for Mac, and Excel Online.
Building "If-Then" Statements in Excel: Advanced Microsoft Excel
The IF function in Excel is a way to add decision-making to your spreadsheets. It tests a condition to see if it is true or false and then executes a specific set of instructions based on the results.
For example, you can set an IF to reverse results if a specific cell is greater than 900. If it is, you can have the formula return the text "PERFECT." If it is not, you can have the formula return "TOO SMALL."
The syntax of the IF-THEN function includes the function name and the function arguments in parentheses.