The information in this article applies to:
SUMMARYIn Microsoft Excel, you can use worksheet functions to count the number of occurrences of a specific number or text string in a range of cells on a worksheet. The "More Information" section of this article contains sample formulas you can use to do this. MORE INFORMATIONIn the cell you want the result to appear in, enter the appropriate formula from the following examples. To Count the Occurrences of a NumberUse this formula
where <range> is the range you want to search and <number> is the number
you want to find.
To Count the Occurrences of a Text StringUse this formula
where <range> is the range you want to search and <text> is the text you
want to find (the text must be enclosed in quotation marks).
NOTE: The above formulas must be entered as array formulas. To enter a formula as an array formula in Microsoft Excel for Windows, press CTRL+SHIFT+ENTER. In Microsoft Excel for the Macintosh, press COMMAND+ENTER. To Count the Occurrences of a Text String (Version 5.0 and Later)Use the COUNTIF() function to count the occurrences of a text string. For example, use the formula
where <range> is the rang of cells you are evaluating and <text> is the
text string you want to count instances of (note that <text> must be
enclosed in quotation marks).
NOTE: The above formula must be entered as an array formula. To enter a formula as an array formula in Microsoft Excel for Windows, press CTRL+SHIFT+ENTER. In Microsoft Excel for the Macintosh, press COMMAND+ENTER. Wildcard characters can be used within the COUNTIF function. The asterisk character (*) represents more than one character. For example, to count all the cells in the range a1:a10 that contained an "x," we can use the following formula:
The question mark character (?) can also be used to represent one wildcard
character. For example, to count all cells in the range whose second
character is the letter, such as "ax" or "bx."
Additional query words: howto answer XL98 XL97 XL7 XL5 XL4 XL3
Keywords : |
Last Reviewed: September 28, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |