BBampaa

Lessons › Excel & Google Sheets

Excel & Google Sheets lesson

IF with OR

O101 is Earbuds, so the first test passes and the sheet shows Promote, even though it's worth only 70.

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

Example

OR is TRUE when at least one test inside it is true. Use it as the test inside IF:

=IF(OR(D2="Earbuds",F2>100),"Promote","Skip")

Typed into cell G2 of this sheet:

OrderDayLocationProductQtyRevenueLabel
O101MonLagosEarbuds270
O102MonAbujaCharger115
O103TueLagosPhone case324
O104WedLagosEarbuds135
O105WedAbujaEarbuds4140
O106ThuLagosCharger230
O107FriAbujaPhone case540
O108FriLagosEarbuds3105

Key points

OR(test1, test2)TRUE if at least one test is true.
D2="Earbuds"One test. Each test goes inside OR, separated by a comma.
IF(OR(...),"Promote","Skip")Put OR where IF's test goes.

Put together: =IF(OR(D2="Earbuds",F2>100),"Promote","Skip"). AND needs every test; OR needs just one.

Practice

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

1. In G4, show Promote if the product is Earbuds OR the revenue is over 100, otherwise Skip.
=IF(OR(D4="Earbuds",F4>100),"Promote","Skip")
2. In G3, show Edge if the order was placed on Mon OR Fri, otherwise Mid.
=IF(OR(B3="Mon",B3="Fri"),"Edge","Mid")
3. In G9, show Promote if the product is Earbuds OR the revenue is over 100. Otherwise show Skip.
=IF(OR(D9="Earbuds",F9>100),"Promote","Skip")
4. In G8, show Phone if the product is Phone case OR Charger. Otherwise show Audio.
=IF(OR(D8="Phone case",D8="Charger"),"Phone","Audio")
5. In G5, show Check if the order is from Abuja OR the quantity is 3 or more. Otherwise show OK.
=IF(OR(C5="Abuja",E5>=3),"Check","OK")

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