Thursday, 30 January 2025

Count Functions 10 examples

 Here are 10 Excel count functions, including examples with data and formulas:


1. COUNT

Counts the number of cells that contain numbers.

Example:

Copy
A1: 10
A2: 20
A3: "Text"
A4: 30

Formula: =COUNT(A1:A4)
Result: 3 (counts only numeric values).


2. COUNTA

Counts the number of non-empty cells.

Example:

Copy
A1: 10
A2: "Text"
A3: ""
A4: 30

Formula: =COUNTA(A1:A4)
Result: 3 (counts non-empty cells, excluding A3).


3. COUNTBLANK

Counts the number of empty cells.

Example:

Copy
A1: 10
A2: ""
A3: "Text"
A4: ""

Formula: =COUNTBLANK(A1:A4)
Result: 2 (counts blank cells in A2 and A4).


4. COUNTIF

Counts cells that meet a single condition.

Example:

Copy
A1: Apple
A2: Banana
A3: Apple
A4: Orange

Formula: =COUNTIF(A1:A4, "Apple")
Result: 2 (counts cells containing "Apple").


5. COUNTIFS

Counts cells that meet multiple conditions.

Example:

Copy
A1: Apple, B1: 10
A2: Banana, B2: 20
A3: Apple, B3: 30
A4: Orange, B4: 10

Formula: =COUNTIFS(A1:A4, "Apple", B1:B4, ">10")
Result: 1 (counts "Apple" with a value greater than 10 in column B).


6. SUBTOTAL (with COUNT)

Counts visible cells in a filtered range.

Example:

Copy
A1: 10
A2: 20
A3: 30
A4: 40

Filter the range to show only values greater than 15.
Formula: =SUBTOTAL(2, A1:A4)
Result: 3 (counts visible cells after filtering).


7. FREQUENCY

Counts how often values occur within a range.

Example:

Copy
A1: 10
A2: 20
A3: 30
A4: 40
Bins: 15, 25, 35

Formula: =FREQUENCY(A1:A4, B1:B3)
Result: {1; 1; 1; 1} (counts values in each bin).


8. SUM with COUNT

Combines SUM and COUNT for conditional counting.

Example:

Copy
A1: 10
A2: 20
A3: 30
A4: 40

Formula: =SUM(COUNT(A1:A4), COUNTIF(A1:A4, ">20"))
Result: 5 (counts all numbers and adds counts of values greater than 20).


9. AGGREGATE (with COUNT)

Counts while ignoring errors or hidden rows.

Example:

Copy
A1: 10
A2: #DIV/0!
A3: 30
A4: 40

Formula: =AGGREGATE(2, 6, A1:A4)
Result: 3 (counts numeric values, ignoring errors).


10. ARRAY FORMULA with COUNT

Counts unique values in a range.

Example:

Copy
A1: Apple
A2: Banana
A3: Apple
A4: Orange

Formula: =SUM(1/COUNTIF(A1:A4, A1:A4))
Result: 3 (counts unique values: Apple, Banana, Orange).

No comments:

Post a Comment