|
Home > Formulas > Statistical > Count 7 Ways to Count in Excel - Examples
|

Video: 7 Ways to Count in ExcelTo see a quick overview of 7 ways to get a total count of cells in Excel, watch my 77-second video. There are written steps for each count function example, below the video. |
1) Count Numbers - COUNTThe COUNT function will count cells that contain numbers. For example, in the list shown below, there are 2 cells with numbers -- A2 and A4 (dates are stored as numbers in Excel).
|
1.1) COUNT FormulaTo count the numbers, I used this COUNT formula in cell C2:
The formula result is 2, because the text value and blank cell are not counted. |

1.2) COUNT Function NotesSyntaxThe COUNT function syntax has one required argument, and up to 255 additional items, that are optional
ArgumentsFor the COUNT function arguments, you can use any combination of valid cell references, or typed values. For example:
|
2) Count All Data - COUNTAThe Excel COUNTA function will count cells that are not empty. For example, in the list shown below, there are 2 cells with numbers -- A2 and A5. Cell A3 contains text, and cell A5 is blank (no data)
|
To count the cells that contain any type of data, I used this COUNTA formula in cell C2:
The formula result is 3, because the blank cell is not counted.
2.2) COUNTA Function NotesSyntaxThe COUNTA function syntax has one required argument, and up to 255 additional items, that are optional
What Does It Count?COUNTA counts the following items:
However, COUNTA does not count blank (empty) cells |
| ▶ |
Tip: If COUNTA appears to be counting blank cells, check the troubleshooting suggestions on the Fix Blank Cells page. |
3) Count Empty Cells - COUNTBLANKThe COUNTBLANK function will count the following:
For example, in the list shown below, there are 2 cells with numbers -- A2 and A5. Cell A3 contains text, and cell A5 is blank (no data)
|
To count the blank cells, I entered this formula in cell C2:
In the example shown above, the formula result is 1, because there is one completely empty cell in the range A2:A5.
3.2) COUNTBLANK Function NotesSyntaxThe COUNTBLANK function argument syntax
is: |
4) Count Specific Items - COUNTIFThe COUNTIF function will count cells that match one specific criterion. For example, count cells that contain an exact match for the text string, "Pen".
|
To count the cells that match the criterion, I entered this formula in cell D2:
In the example shown above, the formula result is 2, because there are two cells that match the criterion in cell D1.
In the COUNTIF function syntax, there are two required arguments:
=COUNTIF(range, criteria)
5) Count Partial Match - COUNTIF & WildcardIn Excel, you can use wildcard characters, such as an asterisk (*), or question mark (?), to count cells that are a partial match for a criterion.
|
5.1) Partial Match FormulaThe following COUNTIF formula is entered in cell D2, and it refers to the criterion cell, D1:
In this example, the formula result is 3, because there are 3 items that contain the string "pen", exactly or partially. |
6) Count With Multiple Criteria - COUNTIFSThe COUNTIFS function will count cells that match one or more specific criteria. For example, count rows based on the following 2 criteria:
|

The following COUNTIFS formula is entered in cell D3, and it refers to the two criteria cells, D1 (Pen) and D2 (>=6):
In this example, the formula result is 1, because there is one pen item with a quantity greater than or equal to 6.

In the COUNTIFS function syntax, there are two required arguments:
=COUNTIFS(criteria_range1, criteria1,...)
Note: Additional pairs of criteria ranges and criteria can be included in the formula.
7) Count in Filtered List - SUBTOTALAfter you filter the rows in a list, you can use the SUBTOTAL function to count the visible rows in the filtered data. The SUBTOTAL function will ignore hidden items, and only count the visible items.
|
In the screen shot shown above, there is a list on the worksheet, from cell A1 to B6. In column A, a filter has been applied, to show Pen and Pencil items only.
In cell D1, I entered this formula, to count the visible cells in the Qty column:
In this example, the formula result is 3, because there are 3 visible numbers in column B, in the filtered list.
7.2) SUBTOTAL NotesSyntax
In the SUBTOTAL function syntax, there are two required arguments:
|
In the example shown above, I used function number 102, which tells Excel to use the COUNT function.
There are two sets of function numbers, in the SUBTOTAL drop-down list.
a) Function Numbers 1 to 11

b) Function Numbers 101 to 111

Get the Sample Files
|
More Ways to Count in ExcelCount Criteria in Other Column |
Last updated: May 22, 2024 6:44 PM