Search code examples
google-sheetscasecountif

Countif with case sensitive google-sheets


I'm trying to do a case-sensitive count in Google Sheets.

For example, I have these values :

A
A
A
B
a
b

The countif function : =COUNTIF(A1:A6;"A") give me 4 whereas I expected to have the number 3

All results :

Letter/Word Number give by countif Expected number
A 4 3
a 4 1
b 2 1
B 2 1

How could I create a case-sentive countif ?


Solution

  • There are a couple of ways to achieve that. Here's one way:

    =SUMPRODUCT(REGEXMATCH(A1:A6, "A"))
    

    Or, depending on your locale:

    =SUMPRODUCT(REGEXMATCH(A1:A6; "A"))