Spreadsheet formulas explained, side by side

IF Function in Excel, Google Sheets, Airtable & Notion

IF checks a condition and returns one value when it is TRUE and another when it is FALSE. IF(78 >= 60, "Pass", "Fail") returns "Pass".

Syntax in each app

AppSupportSyntax & notes
Excel✔ Built inIF(logical_test, [value_if_true], [value_if_false])
Google Sheets✔ Built inIF(logical_expression, value_if_true, value_if_false)
Airtable✔ Built inIF(expression, value1, [value2])
Leave out value2 to get an empty cell when the test is false.
Notion✔ Built inif(condition, value_if_true, value_if_false)
Both results should be the same type (both text or both numbers).
Try IF with your own values
Result (as Excel & Google Sheets return it)
Pass 4 characters
Your formula, ready to paste
Excel=IF(78 >= 60, "Pass", "Fail") open excel.new ↗
Google Sheets=IF(78 >= 60, "Pass", "Fail") open sheets.new ↗
AirtableIF(78 >= 60, "Pass", "Fail")
Notionif(78 >= 60, "Pass", "Fail")

In a real sheet the score would be a cell such as B2, a field such as {Score} in Airtable, or prop("Score") in Notion.

Arguments

ArgumentWhat it means
logical_testAnything that is TRUE or FALSE: a comparison such as B2>=60, a TRUE/FALSE cell, or a function like AND.
[value_if_true] optionalWhat to return when the test is TRUE. Text must be in quotes.
[value_if_false] optionalWhat to return when the test is FALSE. If omitted, Excel and Google Sheets return FALSE.

Examples

FormulaResultWhyCopy
=IF(78>=60, "Pass", "Fail")Pass
=IF(B2>1000, B2*5%, 0)5% bonus or 0Results can be calculations, not just text.
=IF(A2="", "Missing", A2)A2 or "Missing"Test for an empty cell with ="".
=IF(5>10, "Yes")FALSEWith no value_if_false, Excel and Sheets return FALSE.

Examples use Excel / Google Sheets syntax unless noted.

How IF works

IF is the basic decision-maker of every spreadsheet: flag overdue invoices, label pass or fail, apply a discount only above a threshold, or hide a result until its inputs are filled in. The test can be any comparison (=, <>, >, <, >=, <=) or any function that returns TRUE or FALSE. To combine several tests, put AND or OR inside the IF.

For more than two outcomes you can nest IFs — =IF(B2>=90, "A", IF(B2>=80, "B", "C")) — but they get hard to read fast. IFS lists the conditions in order without nesting, and SWITCH is cleaner when you are matching one value against a list of exact codes. Text comparisons in Excel and Google Sheets ignore case, so "yes"="YES" is TRUE.

Airtable uses the same IF but writes not-equal as != and returns an empty value if you leave out the false result. Notion's if() is lowercase and works with properties: if(prop("Score") >= 60, "Pass", "Fail"). Notion expects both results to have the same type, so wrap a number in format() if the other branch is text.

Frequently Asked Questions

How many IFs can I nest?
Excel allows 64 nested IFs, but anything beyond three or four is hard to maintain. Use IFS, SWITCH or a lookup table with XLOOKUP instead.
How do I check if a cell is not empty?
Use =IF(A2<>"", "Has value", "Empty"). In Airtable write IF({Field}, …) or {Field} != ""; in Notion use if(empty(prop("Field")), …, …).

Part of the Logical functions. Results in the tester follow Excel and Google Sheets behaviour; always double-check important work in your own file.