IF & Nested IF Formula Builder
The IF function returns one value when a condition is true and another when it's false. When you have several conditions, you either nest IFs or use the cleaner IFS function. Add your branches below and this builder writes both versions — correctly parenthesized — for Excel or Google Sheets.
Runs in your browser; no sign-up needed.
=IF(A1>=90, "A", IF(A1>=80, "B", "C"))
=IFS(A1>=90, "A", A1>=80, "B", TRUE, "C")
Nested IF vs IFS
A nested IF chains conditions inside each other: =IF(A1>90,"A",IF(A1>80,"B","C")). It works everywhere but gets hard to read and easy to mis-parenthesize.
IFS is flatter and clearer: =IFS(A1>90,"A",A1>80,"B",TRUE,"C"). The final TRUE acts as the catch-all 'else'. IFS is available in Excel 2019+/365 and Google Sheets.
Tips for reliable IF formulas
Order matters in nested IF and IFS: put the most specific or highest-priority condition first, because the formula stops at the first match.
Wrap text results in quotes; leave numbers and cell references unquoted.
For two conditions that must both be true, use AND(cond1, cond2); for either, use OR(cond1, cond2) inside the IF.
Frequently asked questions
What is the IF formula syntax?
=IF(logical_test, value_if_true, value_if_false). For multiple conditions, nest another IF in the value_if_false slot, or use IFS.
How many IFs can you nest in Excel?
Excel allows up to 64 nested IFs, but anything beyond a few becomes unreadable. Use IFS, or a lookup table with VLOOKUP/XLOOKUP, for many conditions.
What's the difference between IF and IFS?
IF handles one condition. IFS handles many without nesting and reads left to right; add a final TRUE for the default case. IFS needs Excel 2019+ or Google Sheets.
Keep exploring
Analyze a whole spreadsheet with AI
Upload an Excel or CSV file and get pivots, outlier detection, and Smart BI dashboards in seconds. Free to start — no credit card.
Open the App Free