Return one value when a condition is true and another when it is false.
This function works the same in Google Sheets as it does in Excel — same syntax and arguments.
IF(logical_test, value_if_true, value_if_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")Result: Pass
Returns Pass when the score is at least 60.
=IF(C2>1000, C2*0.1, 0)Result: 125
Applies a 10% bonus only when sales exceed 1000.
Combine conditions with AND() or OR() inside the logical test, e.g. IF(AND(A2>0, B2>0), ...). For many separate outcomes, use IFS.