Microsoft Office Tutorials and References
In Depth Information
The SEARCH function returns an error if Text is not found in Data. The preceding formula counts one for
every cell where SEARCH does not find an error. Because SEARCH is not case sensitive, neither is this for-
If you need a case-sensitive count, you can use the following array formula:
If the Text cell contains the text Alpha, the preceding formula returns 2 because the string appears in two cells
(A2 and A8).
Like the SEARCH function, the FIND function returns an error if Text is not found in Data, as in this alternat-
ive array formula:
Unlike SEARCH, the FIND function is case sensitive.
Total occurrences in a range
To count the total number of occurrences of a string within a range of cells, use the following array formula:
If the Text cell contains the character B, the formula returns 7 because the range contains seven instances of the
string. This formula is case sensitive.
The following array formula is a modified version that is not case sensitive:
Counting the number of unique values
The following array formula returns the number of unique values in a range named Data:
To understand how this formula works, you need a basic understanding of array formulas. (See Chapter 14 for
an introduction to this topic.) In Figure 7-5, range A1:A12 is named Data. Range C1:C12 contains the follow-
ing multicell array formula. A single formula was entered into all 12 cells in the range.