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.
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”.
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?