View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Getting count of entries in a column


Hi Pawan

The below formula will give you the count of CA entries

'should return 2 with your example
=COUNTIF(A:A,"CA.*")

'should return 1 with your example
=COUNTIF(A:A,"WV.*")

If this post helps click Yes
---------------
Jacob Skaria


"Pawan" wrote:

Hello

I have an excel sheet with following data in column A:

CA
CA.SanFransisco
CA.PLeasanton
WV
WV.Matinsburg

There are hundreds of such entries in column A. I want to write a code which
will tell me how many entries are there for each state. e.g. In the above
case, I should get the result showing that CA has 2 entries and WV has 1
entry.

Is this possible and how?

Thanks in advance
Regards,
prm