Bird
Raised Fist0
Excelspreadsheet~10 mins

COUNTIF and COUNTIFS in Excel - Cell-by-Cell Formula Trace

Choose your learning style10 modes available
Sample Data

This table shows names and their scores in a test.

CellValue
A1Name
B1Score
A2Alice
B285
A3Bob
B390
A4Alice
B478
A5David
B590
A6Bob
B670
Formula Trace
=COUNTIF(A2:A6, "Alice") + COUNTIFS(B2:B6, ">=80", A2:A6, "Bob")
Step 1: COUNTIF(A2:A6, "Alice")
Step 2: COUNTIFS(B2:B6, ">=80", A2:A6, "Bob")
Step 3: 2 + 1
Cell Reference Map
    A      B
1 |Name  |Score |
2 |Alice |  85  |
3 |Bob   |  90  |
4 |Alice |  78  |
5 |David |  90  |
6 |Bob   |  70  |
The formula uses the name list in A2:A6 and the scores in B2:B6 to count matching conditions.
Result
    A      B      C
1 |Name  |Score |Result|
2 |Alice |  85  |      |
3 |Bob   |  90  |      |
4 |Alice |  78  |      |
5 |David |  90  |      |
6 |Bob   |  70  |  3   |
The formula result 3 is shown in cell C6 (or any chosen cell), representing the total count matching the conditions.
Sheet Trace Quiz - 3 Questions
Test your understanding
How many times does 'Alice' appear in the list?
A1
B3
C2
D4
Key Result
COUNTIF counts cells matching one condition; COUNTIFS counts cells matching multiple conditions together.

Practice

(1/5)
1. What does the Excel function COUNTIF(range, criteria) do?
easy
A. Counts the number of cells in a range that meet a single condition
B. Adds all numbers in a range that meet a condition
C. Counts cells with numbers only, ignoring text
D. Finds the maximum value in a range

Solution

  1. Step 1: Understand the function purpose

    The COUNTIF function is designed to count cells that match one specific condition.
  2. Step 2: Compare with other options

    B describes adding numbers meeting a condition (like SUMIF), C describes counting numbers only (like COUNT), and D describes finding the maximum (like MAX), none of which is COUNTIF.
  3. Final Answer:

    Counts the number of cells in a range that meet a single condition -> Option A
  4. Quick Check:

    COUNTIF counts matching cells [OK]
Hint: COUNTIF counts cells matching one condition only [OK]
Common Mistakes:
  • Confusing COUNTIF with SUMIF
  • Thinking COUNTIF counts multiple conditions
  • Assuming COUNTIF only counts numbers
2. Which of the following is the correct syntax for counting cells in range A1:A10 that equal 5 using COUNTIF?
easy
A. =COUNTIF(A1:A10, 5)
B. =COUNTIF(5, A1:A10)
C. =COUNTIF(A1:A10, ">=5")
D. =COUNTIF(A1:A10; 5)

Solution

  1. Step 1: Recall COUNTIF syntax

    The correct syntax is COUNTIF(range, criteria). The criteria can be a number without quotes.
  2. Step 2: Evaluate each option

    A uses ">=5" which counts cells greater than or equal to 5, not exactly 5; B reverses arguments, which is wrong; C uses 5 directly, which is correct and simpler; D uses semicolon which is locale-dependent and may cause error in some Excel versions.
  3. Final Answer:

    =COUNTIF(A1:A10, 5) -> Option A
  4. Quick Check:

    COUNTIF(range, criteria) with number criteria [OK]
Hint: Use =COUNTIF(range, number) without quotes for numbers [OK]
Common Mistakes:
  • Swapping range and criteria arguments
  • Using semicolon instead of comma in some locales
  • Using '>=5' instead of '5' for exact match
3. Given the data in cells A1:A5: {3, 5, 5, 7, 5}, what is the result of =COUNTIFS(A1:A5, ">=5", A1:A5, "<7")?
medium
A. 1
B. 2
C. 3
D. 4

Solution

  1. Step 1: Understand the COUNTIFS conditions

    COUNTIFS counts cells where values are >=5 AND <7.
  2. Step 2: Check each value in A1:A5

    Values: 3 (no), 5 (yes), 5 (yes), 7 (no, equals 7 but <7 fails), 5 (yes). So three 5s qualify, but 7 does not.
  3. Step 3: Confirm the count

    Three values are 5, but condition is >=5 and <7, so 5 counts. So count is 3.
  4. Final Answer:

    3 -> Option C
  5. Quick Check:

    Values between 5 and less than 7 = 3 [OK]
Hint: COUNTIFS counts cells meeting all conditions simultaneously [OK]
Common Mistakes:
  • Counting values equal to 7 incorrectly
  • Confusing COUNTIF with COUNTIFS
  • Misreading the logical AND in COUNTIFS
4. You want to count cells in B1:B10 that are greater than 10 and less than 20. Which formula has an error?
medium
A. =COUNTIFS(B1:B10, ">10", B1:B10, "<20")
B. =COUNTIF(B1:B10, ">10") + COUNTIF(B1:B10, "<20")
C. =COUNTIFS(B1:B10, "<20", B1:B10, ">10")
D. =COUNTIFS(B1:B10, ">10",B1:B10,"<20")

Solution

  1. Step 1: Understand the goal

    You want to count cells greater than 10 AND less than 20, meaning both conditions must be true simultaneously.
  2. Step 2: Analyze each formula

    A adds two COUNTIF results, which counts cells greater than 10 plus cells less than 20 separately, causing double counting. The other options use COUNTIFS correctly with both conditions combined.
  3. Final Answer:

    =COUNTIF(B1:B10, ">10") + COUNTIF(B1:B10, "<20") -> Option B
  4. Quick Check:

    Adding counts separately causes double counting [OK]
Hint: Use COUNTIFS for multiple conditions, not sum of COUNTIFs [OK]
Common Mistakes:
  • Adding COUNTIF results instead of using COUNTIFS
  • Misunderstanding AND vs OR logic
  • Using wrong operators in criteria
5. You have a sales table with columns: Region (A2:A10), Sales (B2:B10). Which formula counts sales greater than 1000 in the "East" region?
hard
A. =COUNTIF(A2:A10, "East") + COUNTIF(B2:B10, ">1000")
B. =COUNTIFS(A2:A10, ">1000", B2:B10, "East")
C. =COUNTIF(A2:A10, "East" & B2:B10, ">1000")
D. =COUNTIFS(A2:A10, "East", B2:B10, ">1000")

Solution

  1. Step 1: Identify conditions and ranges

    You want to count rows where Region is "East" AND Sales > 1000. Region is in A2:A10, Sales in B2:B10.
  2. Step 2: Match conditions to correct ranges

    =COUNTIFS(A2:A10, "East", B2:B10, ">1000") correctly uses COUNTIFS with Region range and criteria "East", and Sales range with ">1000". =COUNTIF(A2:A10, "East") + COUNTIF(B2:B10, ">1000") adds separate COUNTIFs, which is incorrect. =COUNTIF(A2:A10, "East" & B2:B10, ">1000") concatenates ranges incorrectly. =COUNTIFS(A2:A10, ">1000", B2:B10, "East") swaps criteria and ranges incorrectly.
  3. Final Answer:

    =COUNTIFS(A2:A10, "East", B2:B10, ">1000") -> Option D
  4. Quick Check:

    COUNTIFS matches multiple conditions on correct ranges [OK]
Hint: Use COUNTIFS with each condition and its range paired [OK]
Common Mistakes:
  • Adding separate COUNTIF results instead of COUNTIFS
  • Mixing up criteria and ranges
  • Concatenating ranges incorrectly
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard