Formula Fixer

IF, AND, OR and IFS: Writing Formulas With Conditions

Updated 2026-11-03

Basic IF

=IF(B2>=50, "Pass", "Fail")

IF with AND / OR

=IF(AND(B2>=50, C2="Yes"), "Approved", "Review")
=IF(OR(B2="", C2=""), "Missing data", "OK")

Several outcomes: IFS

=IFS(B2>=90, "A", B2>=80, "B", B2>=70, "C", TRUE, "F")

The final TRUE acts as the "everything else" case. IFS is in Excel 2019 and later and Google Sheets. In older versions, nest IFs instead: =IF(B2>=90,"A",IF(B2>=80,"B","C"))

Tips

Text in conditions needs double quotes; numbers do not. Order the conditions from strictest to loosest, since the first match wins. The same conditions work inside conditional formatting: see how to highlight an entire row based on a cell value.

← More guides