Using the Countif option

M

mlkkrs

I'm attempting to count how many a's, b's, c's, d's, etc are in a column. How
do I get started doing this? Any help is well appreciated.

Thank you
 
G

Gord Dibben

=COUNTIF(A1:A100,"a") if nothing else in the cell.

Are these letters part of strings within cells?

A1 = aardvark would have 3 "a"'s but =COUNTIF(A1,"a") would return 0

Try this UDF

Function CountChar(InRange As Range, Letter As String) As Long
Dim rng As Range
For Each rng In InRange
CountChar = CountChar + Len(rng.text) - _
Len(Application.WorksheetFunction.Substitute(UCase(rng.text) _
, UCase(Letter), ""))
Next rng
End Function

=CountChar(A1:A100,"a")


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top