Free, no sign-up required

IF Formula Generator

Describe the condition and outcomes you need in plain English and get a ready-to-use IF, nested IF, or IFS formula for Excel or Google Sheets.

5 free tries without an account

IF syntax

Syntax
=IF(logical_test, value_if_true, value_if_false)

logical_test is the condition to check, value_if_true is what's returned when it's true, value_if_false is what's returned otherwise (and can itself be another IF, to chain multiple conditions). Formulon handles the nesting for you when you describe more than one condition.

Examples

Simple pass/fail check

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

If the value in B2 is 60 or higher, returns "Pass"; otherwise returns "Fail".

Grade letters with nested IF

=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","D")))

Checks each grade threshold in order — if none of the higher thresholds match, it falls through to the next IF, ending with "D" as the default.

Frequently asked questions

How many conditions can I check with IF?

A single IF checks one condition. To check several conditions in order, you nest IFs inside each other's value_if_false argument, or use IFS (Excel 2019+/365 and Google Sheets), which lists each condition and result as pairs without nesting.

What's the difference between IF and IFS?

Nested IFs work everywhere but get hard to read past 2-3 levels. IFS lets you list condition/result pairs flatly — much easier to read, but only available in newer Excel versions and Google Sheets, not old Excel.

How do I combine IF with AND or OR?

Put the AND(...) or OR(...) function directly as the first argument of IF, e.g. =IF(AND(A2>10,B2="Yes"),"Pass","Fail") — the result is TRUE only if every condition inside AND is true (or at least one inside OR).

Is IF the same in Excel and Google Sheets?

Yes, IF, nested IF, IFS, AND, and OR all have identical syntax in both.

Don't want to write it by hand?

Describe what you need in plain English and get a ready-to-use formula in seconds.

Try the formula generator