The information in this article applies to:
SUMMARYIn Microsoft Excel, you can use the FREQUENCY function in an array formula to count the unique elements in a cell range. MORE INFORMATION
The following formula counts the number of unique values found in the
range A1:A10 and does not count blank cells and text entries:
NOTE: The formula above, and those that follow, are array formulas and must be entered by pressing COMMAND+ENTER (if you are using Microsoft Excel for Windows, press CTRL+SHIFT+ENTER). The FREQUENCY function returns a range of numbers. 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. Thus, this function counts the number of unique values. Because the FREQUENCY function works only with numbers, you must add a level for evaluating unique text entries (or mixed numbers and text), as in the following example:
The above formula counts the number of unique text and numeric entries for A1:A10, where A1:A10 contains no blanks cells. Adding an additional test allows unique numeric and text elements to be counted in a range that includes blank cells:
By substituting the final a1:a10 for the 1 in the original formula it will now sum unique values for a range of cells.
NOTE: These formulas must be entered as array formulas in order to work correctly. For more information regarding SUM(IF()) formulas, use the appropriate reference below:
REFERENCES"Microsoft Excel Function Reference," version 4.0, pages 178-179 Additional query words: 5.00a 5.00c 7.00a 97 98 XL98 XL97 XL7 XL5 XL4
Keywords : |
Last Reviewed: March 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |