Explanation

In this example, the goal is to count codes in a case-sensitive way.

The solution is to use theEXACT functionto compare codes and theSUMPRODUCT functionto add up the results.

EXACT function

The EXACT function’s sole purpose is to compare text in a case-sensitive manner.

Excel formula: Summary count with COUNTIF

EXACT takes twoarguments:text1andtext2.Iftext1andtext2match exactly (considering upper and lower case), EXACT returns TRUE.

Because we are giving EXACTmultiplevalues in the second argument, it returnsmultipleresults.

Each FALSE represents a value in B5:B15 that does not match “ABC”.

Excel formula: Count cells that contain case sensitive

The resulting array looks like this:

Using the double-negative like this is an example ofBoolean logic.

In Excel 365, you’re free to use theSUM functioninstead of SUMPRODUCT.

To read more about this, seeWhy SUMPRODUCT?

Excel formula: Count cells that contain specific text

Boolean operations in array formulas

Excel formula: Case sensitive lookup

Excel formula: Count specific words in a cell

Excel formula: VLOOKUP case-sensitive

Excel SUMPRODUCT function

Excel EXACT function

Article image