Ravindra BagaleCourses & study guides मराठी Track your progress

3. Formulas and Functions

3.3 COUNT, COUNTA, COUNTBLANK, COUNTIF and COUNTIFS

COUNTIF and COUNTIFS with example — in 30 seconds

What: COUNTIF counts rows that match one condition. COUNTIFS counts rows that match all conditions.

Why: "How many orders?" is the first question in every review meeting, and it always comes with a condition.

Tiny example: Pune has 4 orders. 3 of them are Delivered. =COUNTIFS(C2:C11,"Pune",I2:I11,"Delivered")

First look at the data (before → after):

COUNTIF and COUNTIFS with example: before and after tables, fictional FreshGo Maharashtra data

Expected result — Counts

Formula Answer
=COUNTIF(C2:C11,"Pune") 4
=COUNTIFS(C2:C11,"Pune",I2:I11,"Delivered") 3
=COUNTIF(H2:H11,">12") 5

About this data: Teaching sample for a fictional shop “NovaCraft Tools”. Figures and names (e.g. Sana Sheikh) are made up for this lesson on count counta countblank countif and countifs.

Before table and formula as text

Before — Columns used from the mini dataset

C: City H: Mins I: Status
Pune 9 Delivered
Nashik 12 Delivered
Pune 14 Delivered
Nagpur 11 Cancelled
Kolhapur 16 Delivered
Pune 8 Delivered
Solapur 18 Delivered
Sambhaji Nagar 10 Returned
Pune 13 Cancelled
Nashik 17 Delivered

About this data: Demo table only — not real customer or company data. Built to practise count counta countblank countif and countifs.

Formula / click path

=COUNTIF(C2:C11,"Pune")
=COUNTIFS(C2:C11,"Pune",I2:I11,"Delivered")
=COUNTIF(H2:H11,">12")

Do it step by step:

  1. Click an empty cell.
  2. Type =COUNTIF(C2:C11,"Pune") and press Enter.
  3. Now type =COUNTIFS(C2:C11,"Pune",I2:I11,"Delivered").
  4. For "more than 12 minutes", put the operator inside quotes: =COUNTIF(H2:H11,">12").
  5. Check your three answers: 4, 3 and 5.
Function Counts Example Result
COUNT Cells with numbers =COUNT(G2:G11) 10
COUNTA Non-empty cells (any type) =COUNTA(A2:A11) 10
COUNTBLANK Empty cells =COUNTBLANK(A2:I11) 0
COUNTIF Cells meeting one condition =COUNTIF(C2:C11,"Pune") 4
COUNTIFS Rows meeting all conditions =COUNTIFS(D2:D11,"FreshGo",I2:I11,"Delivered") 5

About this data: Made-up rows so you can copy the pattern for count counta countblank countif and countifs. Currencies may use ₹, £, € or $.

More examples: late deliveries =COUNTIF(H2:H11,">15") → 3; orders in any city starting with "Na" (Nashik, Nagpur) =COUNTIF(C2:C11,"Na*") → 3.

Steps in Excel – delivery performance table

  1. K10 Delivered : =COUNTIF(I2:I11,"Delivered") → 7.
  2. K11 Cancelled : =COUNTIF(I2:I11,"Cancelled") → 2.
  3. K12 Cancellation % : =K11/COUNTA(A2:A11) → 20%.

Ravindra Bagale's Tip

COUNT counts only numbers – many students use COUNT on Order ID (text) and get 0. Use COUNTA for text. Also, COUNTA treats a cell that "looks empty" but contains a space as filled, so sometimes the count comes out higher – clean the data first (Module 5).

Practice task

Count: orders per platform, orders in Pune that took ≤ 10 minutes, and blank cells in the Status column of the full Orders sheet.

Loading practice tasks...

  1. How many amounts? (Easy): Count how many numbers are in the Amount column.
  2. Orders from Pune (Easy): Count how many orders have City "Pune".
  3. Clinic: how many ages? (Easy): On the Clinic sheet, count how many numbers are in the Age column.
  4. Clinic: heart patients (Easy): On the Clinic sheet, count how many patients have Department "Cardiology".
  5. Orders without a note (Medium): Count the orders where the Note column is empty.
  6. Slow deliveries (Medium): Count the orders where Mins is more than 12.
  7. Clinic: no follow-up (Medium): On the Clinic sheet, count the patients where the Follow-up note column is empty.
  8. Pune and Delivered (Hard): Count the orders where City is "Pune" and Status is "Delivered".
  9. Notes written (Hard): Count how many orders have something written in the Note column.
  10. Clinic: senior heart patients (Hard): On the Clinic sheet, count the patients where Department is "Cardiology" and Age is more than 60.

Quick revision cards

Three standalone cards. Each one explains the idea with its own example. Scan the QR to open this lesson.

Revision card: COUNT, COUNTA and COUNTBLANK compared. Example data table with How many orders have the minutes recorded as a number?: 3 (9, 14 and 8); How many Minutes cells contain something?: 4; How many Minutes cells are truly empty?: 1.
Card 1: COUNT, COUNTA and COUNTBLANK compared · Download PNG
Revision card: COUNTIF: count the orders that meet one condition. Example data table with How many orders came from Pune?: 4; How many orders have a recorded time above 12 minutes?: 5.
Card 2: COUNTIF: count the orders that meet one condition · Download PNG
Revision card: COUNTIFS: count the orders that meet every condition. Example data table with How many Pune orders were delivered?: 3; How many Pune orders have a recorded time over 12 minutes?: 2.
Card 3: COUNTIFS: count the orders that meet every condition · Download PNG