BBampaa

Lessons › Excel & Google Sheets

Excel & Google Sheets lesson

COUNT and COUNTIF

COUNTIF counts the cells that match a condition. Plain COUNT just counts how many numbers there are.

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

Example

Instead of counting rows by hand, ask the sheet to count the ones that match:

=COUNTIF(C2:C9,"Lagos")

Typed into cell I3 of this sheet:

OrderDayStoreProductQtyRevenueReportAnswer
O101MonLagosEarbuds270Orders
O102MonAbujaCharger115Lagos orders
O103TueLagosPhone case324Earbuds orders
O104WedLagosEarbuds135Orders over 50
O105WedAbujaEarbuds4140Abuja orders
O106ThuLagosCharger230Orders over 100
O107FriAbujaPhone case540
O108FriLagosEarbuds3105

Key points

COUNTHow many numbers are in a range.
COUNTIFHow many cells match a condition.
"Lagos"The condition, in quotes. It can be text, or a test like ">50".

Put together: =COUNTIF(C2:C9,"Lagos") counts the Lagos orders.

Practice

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

1. In I2, count all the orders, using the Revenue column.
=COUNT(F2:F9)
2. In I3, count the orders from Lagos.
=COUNTIF(C2:C9,"Lagos")
3. In I7, count the orders worth more than 100. A test like "more than 100" goes in quotes too: ">100".
=COUNTIF(F2:F9,">100")
4. In I4, count the Earbuds orders.
=COUNTIF(D2:D9,"Earbuds")
5. In I5, count the orders worth more than 50.
=COUNTIF(F2:F9,">50")

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