View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Using the Countif option

=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

On Thu, 5 Nov 2009 10:50:01 -0800, mlkkrs
wrote:

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