Quick, clean, and to the point

Count cells equal to case sensitive

Excel formula: Count cells equal to case sensitive
Generic formula 

To count cells that contain specific text, taking into account upper and lower case, you can use a formula based on the EXACT function together with the SUMPRODUCT function. In the example shown, E5 contains this formula, copied down:


Where "names" is the named range B5:B11. This provides a case-sensitive count of each name listed in column D.


The EXACT function takes two arguments, text1 and text2. When text1 and text2 match exactly (respecting case), EXACT returns TRUE. Otherwise, EXACT returns FALSE:

=EXACT("ayako","ayako") // returns TRUE
=EXACT("ayako","Ayako") // returns FALSE

In the example shown, we need check all values in column B each time we count a name in column D. Because we are giving EXACT multiple values, it returns multiple results. In E5, EXACT returns:


Each TRUE represents an exact match of "ayako" in B5:B11. Because we want to count results, we use a double-negative (--) to convert TRUE and FALSE values into 1's and 0's. The resulting array is:


Finally, SUMPRODUCT sums the values in the array and returns 3.

Note: Because SUMPRODUCT can handle arrays natively, it's not necessary to use Control+Shift+Enter to enter this formula.

Dave Bruns

Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.

Download 100+ Important Excel Functions

Get over 100 Excel Functions you should know in one handy PDF.