IF

Logicalbeginner

IF is Excel's core decision-making formula. It evaluates a condition and returns one result when true, another when false. You can nest multiple IFs or combine with AND/OR for complex logic. It's essential for flagging, categorizing, and building conditional calculations.

Syntax

Excel:=IF(logical_test, value_if_true, value_if_false)
Google Sheets: Same syntax

Parameters

logical_testThe condition to evaluate (e.g., A2 > 10000).
value_if_trueWhat to return if the condition is true.
value_if_false?What to return if false. Defaults to FALSE if omitted.

? = optional parameter

Worked Example

You want to flag any invoice over $10,000 as 'Large' and everything else as 'Standard'.

Row numbersAE
Header rowinvoice_idamount
2INV-1001$12,500.00
3INV-1002$487.50
4INV-1003$18,750.00
5INV-1004$3,200.00
6INV-1005$7,600.00
7INV-1006$9,800.00

Formula

=IF(B2>10000, "Large", "Standard")

Result

Large

IF checks whether the amount in B2 is greater than 10,000. Because B2 is $12,500.00, the condition is TRUE and the formula returns 'Large'.

Practice Exercises

2 exercises - work through each one using the data table below

Exercise 1 of 2beginner
#IF-001

Question

Your team wants to flag any invoice that's been sitting unpaid. Write a formula that returns 'Action Needed' if the status is 'Overdue', and 'OK' otherwise. What would the result be for invoice INV-1008?

Dataset

Showing rows 1-10

Download CSV
Row numbersABCD
Header row
2INV-1001Cloudline Software$12,500.00Paid
3INV-1002Apex Office Supply$487.50Paid
4INV-1003Summit Consulting Group$18,750.00Paid
5INV-1004Meridian Travel Co.$3,200.00Paid
6INV-1005Forge & Frame Creative$7,600.00Paid
7INV-1006NovaTech Solutions$9,800.00Pending
8INV-1007Atlas Hardware Co.$2,150.00Paid
9INV-1008Clearview Data Systems$15,300.00Overdue
10INV-1009Redstone Marketing$4,250.00Paid
11INV-1010Keystone Legal Advisors$8,900.00Paid
12

Scroll to explore the table, then sort or filter by column as needed.

Hints

Your Answer

Exercise 2 of 2intermediate
#IF-002

Question

Finance wants to categorize invoices by size: anything $10,000 or above is 'High Value', everything below is 'Standard'. How many of the first 10 invoices (INV-1001 through INV-1010) would be categorized as 'High Value'?

Dataset

Showing rows 1-10

Download CSV
Row numbersAB
Header row
2INV-1001$12,500.00
3INV-1002$487.50
4INV-1003$18,750.00
5INV-1004$3,200.00
6INV-1005$7,600.00
7INV-1006$9,800.00
8INV-1007$2,150.00
9INV-1008$15,300.00
10INV-1009$4,250.00
11INV-1010$8,900.00
12

Scroll to explore the table, then sort or filter by column as needed.

Hints

Your Answer

Want more practice?

Test Me mode randomizes exercises across all formulas without telling you which formula to use.

Try Test Me ->