How to use COUNTIFS with case sensitive criteria

Mike H 61 Reputation points
2026-07-25T20:39:55.87+00:00

I'm trying to use COUNTIFS function where the criteria is upper and lower case characters. However the COUNTIFS result counts both upper and lower characters. That is two "b" instead of one "b" and one "B".

countifs

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments

Answer accepted by question author

EmilyS726 256K Reputation points Independent Advisor
2026-07-25T21:18:10.9+00:00

For your C2 cell, use this instead. COUNTIF and COUNTIFS are not case-sensitive.

=SUMPRODUCT(--EXACT(Dtype,C$1))

OR

=SUMPRODUCT(--EXACT($A:$A,C$1))

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

3 additional answers

Sort by: Most helpful
  1. IlirU 2,571 Reputation points Volunteer Moderator
    2026-07-31T07:22:19.2333333+00:00

    User's image

    Use this formula in cell C2:

    =BYCOL(C1:G1, LAMBDA(a, SUM(--EXACT(A2:A6, a))))

    or this formula and drag it right:

    =SUM(--EXACT($A$2:$A$6, C1))

    HTH

    IlirU

    Was this answer helpful?

    0 comments No comments

  2. Ashish Mathur 102.2K Reputation points Volunteer Moderator
    2026-07-30T23:05:09.5166667+00:00

    Hi,

    In cell C2, enter this formula

    =BYCOL(C1:G1,LAMBDA(c,SUM(1*(REGEXTEST($A$2:$A$6,c)))))

    Hope this helps.

    User's image

    Was this answer helpful?

    0 comments No comments

  3. Mike H 61 Reputation points
    2026-07-30T21:20:59.4133333+00:00

    Still investigating.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.