- Posts: 4
- Joined: Thu May 06, 2021 4:48 pm
How can I count the number of unique values in a column?
For instance suppose the column A contains:
I would like to have in a new worksheet:
- SoftMaker Team
- Posts: 1520
- Joined: Wed Mar 11, 2020 5:31 pm
Please use COUNTIF function to this task. Below is the complete details of COUNTIF:
Counts those cells in a cell range that fulfill the specified criterion.
Range is the cell range to be evaluated.
Criterion is the condition that the values in Range have to fulfill to be included:
Use numbers or text (like "42" or "bolts") to count all cells that contain that value.
Tip: To count all non-empty cells, use "*" as criterion. For example COUNTIF(D2:D4, "*") counts all cells in the specified area that are not empty.
Use conditions (like ">10" or "<=5") to count all cells that match the specified condition.
Note: Criteria always have to be surrounded by double quotation marks (").
If the cells A1:A5 contain the values 1, 2, 3, 2, 1: The following applies:
COUNTIF(A1:A5, "2") returns 2
COUNTIF(A1:A5, ">=2") returns 3
Please check this sample file also for better understanding.