Академический Документы
Профессиональный Документы
Культура Документы
Sign in
Office
Apps
Install
Account
Training
Admin
Excel / Formulas and functions / Errors / Count unique values among duplicates
Let's say you want to find out how many unique values exist in a range that contains duplicate values. For
example, if a column contains:
The values "Bradley", "Doyle", "Doyle", "Doyle", the result is two unique values "Bradley" and "Doyle".
1. Select the range of cells, or make sure the active cell is in a table.
2. On the Data tab, in the Sort & Filter group, click Advanced.
Alternatively, click Collapse Dialog to temporarily hide the dialog box, select a cell on the worksheet,
and then press Expand Dialog .
5. Select the Unique records only check box, and click OK.
https://support.office.com/enus/article/Countuniquevaluesamongduplicates8d9a69b3b867490e82e0a929fbc1e273 2/8
4/10/2017 CountuniquevaluesamongduplicatesOfficeSupport
The unique values from the selected range are copied to the new location beginning with the cell you
specified in the Copy to box.
6. In the blank cell below the last cell in the range, enter the ROWS function. Use the range of unique
values that you just copied as the argument, excluding the column heading. For example, if the range of
unique values is B2:B45, you enter =ROWS(B2:B45).
Top of Page
Count the number of unique values by using the FREQUENCY function. The FREQUENCY function ignores
text and zero values. For the first occurrence of a specific value, this function returns a number equal to
the number of occurrences of that value. For each occurrence of that same value after the first, this
function returns a zero.
Return the position of a text value in a range by using the MATCH function. This value returned is then
used as an argument to the FREQUENCY function so that the corresponding text values can be evaluated.
Find blank cells by using the LEN function. Blank cells have a length of 0.
Example
https://support.office.com/enus/article/Countuniquevaluesamongduplicates8d9a69b3b867490e82e0a929fbc1e273 3/8
4/10/2017 CountuniquevaluesamongduplicatesOfficeSupport
3. Press CTRL+C.
5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+`
grave accent, or on the Formulas tab, in the Formula Auditing group, click the Show Formulas
button.
1 A B
https://support.office.com/enus/article/Countuniquevaluesamongduplicates8d9a69b3b867490e82e0a929fbc1e273 4/8
4/10/2017 CountuniquevaluesamongduplicatesOfficeSupport
2 Data Data
3 986 Bradley
4 Doyle 563
5 67 789
6 235
7 Bradley Doyle
8 689 789
9 Doyle 143
10 56 237
67 235
Formula Description
Result
https://support.office.com/enus/article/Countuniquevaluesamongduplicates8d9a69b3b867490e82e0a929fbc1e273 5/8
4/10/2017 CountuniquevaluesamongduplicatesOfficeSupport
https://support.office.com/enus/article/Countuniquevaluesamongduplicates8d9a69b3b867490e82e0a929fbc1e273 6/8
4/10/2017 CountuniquevaluesamongduplicatesOfficeSupport
Notes
The formulas in this example must be entered as array formulas. Select each cell that contains a formula,
press F2, and then press CTRL+SHIFT+ENTER.
To see a function evaluated step by step, select the cell containing the formula, and then on the Formulas
tab, in the Formula Auditing group, click Evaluate Formula.
Function details
The FREQUENCY function calculates how often values occur within a range of values, and then returns a
vertical array of numbers. For example, use FREQUENCY to count the number of test scores that fall
within ranges of scores. Because this function returns an array, it must be entered as an array formula.
The MATCH function searches for a specified item in a range of cells, and then returns the relative
position of that item in the range. For example, if the range A1:A3 contains the values 5, 25, and 38, the
formula =MATCH25,A1:A3,0 returns the number 2, because 25 is the second item in the range.
The SUM function adds all the numbers that you specify as arguments. Each argument can be a range, a
cell reference, an array, a constant, a formula, or the result from another function. For example,
SUMA1:A5 adds all the numbers that are contained in cells A1 through A5.
The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that
condition evaluates to FALSE.
Top of Page
https://support.office.com/enus/article/Countuniquevaluesamongduplicates8d9a69b3b867490e82e0a929fbc1e273 7/8
4/10/2017 CountuniquevaluesamongduplicatesOfficeSupport
https://support.office.com/enus/article/Countuniquevaluesamongduplicates8d9a69b3b867490e82e0a929fbc1e273 8/8