Countif Case sensitive Letters

coliervile

Well-known Member
Joined
May 19, 2006
Messages
724
Can the COUTNIF function count small letters and Capital letters. For example A1:A50 contains the letters (random) L, l, T, n, W, a, A, F, E, a, e..... and so on what formula would be used to count all of the Small -a-

=Countif(A1:A50,"a") would count all of the a's

Regards

Charlie
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi Charlie

You can do this with Sumproduct:

Code:
=SUMPRODUCT(LEN(A1:A50)-LEN(SUBSTITUTE(A1:A50,"A","")))

or:

Code:
=SUMPRODUCT(LEN(A1:A50)-LEN(SUBSTITUTE(A1:A50,B1,"")))

Where B1 holds the character you are counting (such as "a","b","B" etc).

EDIT: I initially thought you might have more than individual letters in each of your cells (eg "HGAavbga" in a single cell) and my formula will work for single occurrences too, altho it possibly isn't the most efficient. if there are only single letters in your cells then maybe:

Code:
=SUMPRODUCT(ISNUMBER(FIND("A",A1:A50))+0)

again you can replace the "A" with a cell reference holding the value (like B1 if B1 held "A" w/o quotes).
 
Upvote 0
Can the COUTNIF function count small letters and Capital letters. For example A1:A50 contains the letters (random) L, l, T, n, W, a, A, F, E, a, e..... and so on what formula would be used to count all of the Small -a-

=Countif(A1:A50,"a") would count all of the a's

Regards

Charlie

If A1:A50 consists of single char entries, that is, T, not cT...

=SUMPRODUCT(EXACT(A1:A50,"A")+0)
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,182
Members
448,872
Latest member
lcaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top