0
0
Google Sheetsspreadsheet~10 mins

COUNTIF and COUNTIFS in Google Sheets - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This table lists fruits in column A and their quantities in column B.

CellValue
A1Fruit
A2Apple
A3Banana
A4Apple
A5Orange
A6Banana
B1Quantity
B210
B35
B415
B58
B67
Formula Trace
=COUNTIF(A2:A6, "Apple") + COUNTIFS(A2:A6, "Banana", B2:B6, ">5")
Step 1: COUNTIF(A2:A6, "Apple")
Step 2: COUNTIFS(A2:A6, "Banana", B2:B6, ">5")
Step 3: 2 + 1
Cell Reference Map
     A       B
  +-------+-------+
1 | Fruit |Quantity|
  +-------+-------+
2 | Apple |  10   | <--
3 | Banana|   5   | <--
4 | Apple |  15   | <--
5 | Orange|   8   | <--
6 | Banana|   7   | <--

Arrows show cells referenced in formula ranges A2:A6 and B2:B6.
The formula uses the fruit names in A2:A6 and their quantities in B2:B6 to count specific conditions.
Result
     A       B       C
  +-------+-------+-------+
1 | Fruit |Quantity|Result |
  +-------+-------+-------+
2 | Apple |  10   |       |
3 | Banana|   5   |       |
4 | Apple |  15   |       |
5 | Orange|   8   |       |
6 | Banana|   7   |   3   |

Cell C6 contains the formula result 3.
The final result 3 is shown in cell C6, representing the total count from the formula.
Sheet Trace Quiz - 3 Questions
Test your understanding
How many times does 'Apple' appear in the range A2:A6?
A1
B2
C3
D4
Key Result
COUNTIF counts cells matching one condition; COUNTIFS counts cells matching multiple conditions across ranges.