BBampaa

Lessons › Excel & Google Sheets

Excel & Google Sheets lesson

SUMIF and AVERAGEIF

It looks down the Store column, and wherever it finds Lagos, adds that row's revenue.

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

Example

SUMIF checks one column and adds up another:

=SUMIF(C2:C9,"Lagos",F2:F9)

Typed into cell I2 of this sheet:

OrderDayStoreProductQtyRevenueReportAnswer
O101MonLagosEarbuds270Lagos revenue
O102MonAbujaCharger115Earbuds revenue
O103TueLagosPhone case324Abuja revenue
O104WedLagosEarbuds135Chargers sold
O105WedAbujaEarbuds4140Avg Lagos order
O106ThuLagosCharger230Avg Earbuds order
O107FriAbujaPhone case540
O108FriLagosEarbuds3105

Key points

C2:C9First, the range to check: the Store column.
"Lagos"Second, what to look for.
F2:F9Last, the range to add up: Revenue.

Put together: =SUMIF(C2:C9,"Lagos",F2:F9). AVERAGEIF has the same shape but averages instead.

Practice

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

1. In I2, total the revenue from Lagos.
=SUMIF(C2:C9,"Lagos",F2:F9)
2. In I3, total the revenue from Earbuds.
=SUMIF(D2:D9,"Earbuds",F2:F9)
3. In I7, find the average Earbuds order value. AVERAGEIF has the same shape as SUMIF: the range to check, what to look for, then the range to average.
=AVERAGEIF(D2:D9,"Earbuds",F2:F9)
4. In I4, total the revenue from Abuja.
=SUMIF(C2:C9,"Abuja",F2:F9)
5. In I5, total how many Chargers were sold. Add up the Qty column this time.
=SUMIF(D2:D9,"Charger",E2:E9)

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