Logical & Boolean Last updated: 2026-08-20

IF Function in Excel & Google Sheets (Logical Conditions & Nested IFs)

Master the IF function in Excel and Google Sheets. Learn single condition tests, nested IF statements, and combining IF with AND / OR.

Quick Answer & Formula
Excel Sheets Beginner
=IF(logical_test, value_if_true, [value_if_false])

The IF function tests whether a condition is TRUE or FALSE, returning one value if TRUE and another if FALSE. For multiple conditions, combine with AND / OR or use IFS.

IF Function in Excel & Google Sheets

The IF function is the foundational logical decision-maker in spreadsheets.


1. Basic Logical Test

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

2. Combining IF with AND (Multiple Mandatory Rules)

To award a bonus only if Sales are $>=$100,000$ AND Customer Satisfaction $\ge 90%$:

=IF(AND(B2 >= 100000, C2 >= 0.90), B2 * 0.10, 0)

3. Combining IF with OR (Alternative Rules)

To flag accounts that need follow-up if Days Overdue $> 60$ OR Outstanding Balance $> $10,000$:

=IF(OR(B2 > 60, C2 > 10000), "⚠️ Follow-Up Required", "Normal")
?

Frequently Asked Questions

How many nested IF statements can Excel handle?

Excel allows up to 64 nested IF functions. However, if nesting more than 3 levels, use IFS, SWITCH, or XLOOKUP for cleaner, easier-to-read formulas.