Counting Values in Excel
Counting Values in Excel
The following worksheets have various examples to count values in a spreadsheet. Refer to the following Suppor
Worksheet
Count numbers with AutoSum
Add subtotals
SUBTOTAL function
COUNT function
COUNTIF function
DCOUNT function
COUNTIFS function
COUNT nested with IF
SUM nested with IF
PivotTable
COUNTA function
DCOUNTA function
COUNTBLANK function
SUM, IF, MATCH, LEN and FREQUENCY
ROWS and COLUMNS functions
SUM, LEN, TRIM and SUBSTITUTE
• Cells highlighted like this are for user input. Click on the cell for further information.
ount values in a spreadsheet
ve various examples to count values in a spreadsheet. Refer to the following Support.Office.com article
are for user input. Click on the cell for further information.
Use the AutoSum Wizard
Example
Hours Hours
worked worked
Name (week 1) (week 2)
Bob 8 2
Rishna 4
Sue 8 8
Mo 5 4
Total number of entries logged 4
Formula =COUNT(A4:A12)
Output 3
=COUNTIF(B4:B9,"< 20000") 4
Number of invoice
values less than 20,000
Number of invoice
=COUNTIF(B4:B9,">="&B7) 2
values greater than or
equal to 20,000
Number of invoice
#N/A values greater than
4000 and lesser than
15000
Formula Output
=COUNTIFS(C4:C17, "2",B4:B17, "Finance") 2
Formula {=COUNT(IF((A4:A13="South")*(C4:C13="Meat"),D4:D13))}
Description Number of sales of meat in the South region.
Output 3
Formula {=COUNT(IF((B4:B13="Suyama")*(D4:D13>=1000),D4:D13))}
Description Number of sales greater than $1,000 by Suyama.
Output 2
Formula =COUNTA(D4:D13)
Output 6
Product ID Ratings
>=2000 >=50
Formula =DCOUNTA(A3:B9,"Ratings",A11:B12)
Ouput 2
Formula =COUNTBLANK(A4:D9)
Output 3
Formula {=SUM(IF(FREQUENCY(A4:A12,A4:A12)>0,1))}
Output 4
that meet one or more conditions by using IF, SUM, FREQUENCY, MA
FREQUENCY, MATCH, and LEN functions
Count the total number of cells in a range by using ROWS and
Employee ID Department Region No.
20552 Sales 2
21268 Finance 2
23949 Operations 1
24522 Operations 4
28010 IT 3
29546 Sales 4
31634 IT 3
32131 Human Resources 1
35106 Finance 4
40499 IT 2
42051 Human Resources 1
43068 Finance 3
45382 IT 3
47971 Finance 2
Formula Output
=ROWS(A4:C17) * COLUMNS(A4:C17) 42
g ROWS and COLUMNS functions
Use a nested formula to count words in a range
Sample data
Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;
Formula
=SUM(IF(LEN(TRIM(A4:A8))=0,0,LEN(TRIM(A4:A8))-LEN(SUBSTITUTE(A4:A8," ",""))+1))
Output
#VALUE!