BBampaa

Lessons › Excel & Google Sheets

Excel & Google Sheets lesson

IF

F2 is 70, which is more than 50, so the sheet shows Big.

Try this lesson free →
About 5–10 minutes · no sign-up needed

Example

IF runs a test, then shows one answer if it's true and another if it's false:

=IF(F2>50,"Big","Small")

Typed into cell G2 of this sheet:

OrderDayStoreProductQtyRevenueLabel
O101MonLagosEarbuds270
O102MonAbujaCharger115
O103TueLagosPhone case324
O104WedLagosEarbuds135
O105WedAbujaEarbuds4140
O106ThuLagosCharger230
O107FriAbujaPhone case540
O108FriLagosEarbuds3105

Key points

F2>50The test: is the revenue more than 50?
"Big"What to show if the test is true.
"Small"What to show if it's false. Text always goes in quotes.

Put together: =IF(F2>50,"Big","Small"). Tests can use > < >= <= = and <>.

Practice

Try each one in your head first, then open the answer.

1. In G3, label order O102 Big if its revenue is over 50, otherwise Small.
=IF(F3>50,"Big","Small")
2. In G4, show Local if the store is Lagos, otherwise Ship.
=IF(C4="Lagos","Local","Ship")
3. In G5, show Bulk if the quantity is 3 or more, otherwise Single.
=IF(E5>=3,"Bulk","Single")
4. In G6, show Over 100 if the revenue is more than 100, otherwise Under 100.
=IF(F6>100,"Over 100","Under 100")
5. In G9, show Yes if the product is Earbuds, otherwise No.
=IF(D9="Earbuds","Yes","No")

Learn it by doing. This lesson is a short hands-on level on Bampaa: see it work, then build and write it yourself, with instant feedback.

Try this lesson free →
About 5–10 minutes · no sign-up needed