Return one value when a condition is true and another when it is false.
Syntax
IF(logical_test, value_if_true, value_if_false)Arguments
logical_testrequired
A condition that evaluates to TRUE or FALSE.
value_if_truerequired
What to return when the test is TRUE.
value_if_falserequired
What to return when the test is FALSE.
IF is the core decision function in Excel. It evaluates a logical test and branches between two outcomes. You can nest IFs for multiple conditions, though IFS or a lookup is usually cleaner once you have more than two branches.
=IF(B2>=60, "Pass", "Fail")→PassReturns Pass when the score is at least 60.
=IF(C2>1000, C2*0.1, 0)→125Applies a 10% bonus only when sales exceed 1000.
Write the condition
Build a comparison that returns TRUE or FALSE, e.g. B2>=60.
Define both outcomes
Give the value for the true branch and the false branch.
Nest or switch to IFS
For three or more outcomes, use IFS to keep the formula readable.
Combine conditions with AND() or OR() inside the logical test, e.g. IF(AND(A2>0, B2>0), ...). For many separate outcomes, use IFS.