Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Count names and occurrences

I have a long list of cities (Col. A) and states (Col. B). I would like to
count the number of times each city occurs without having to input the city
name each time; with the results appearing like this:

Col. A Col. B Col. C
City State Number of occurrences

Boston Massachusetts 300
Denver Colorado 250
New Orleans Louisiana 256
etc.

Anyone know how to do this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 207
Default Count names and occurrences

in C2, type =COUNTIF(A:A,A1) and copy down.

is this what you want?

I am just wondering that when you copy the furmula down and a city is
repeated in column A, the number will also be repeated in column C. Would
you be ok with that?

"Midjack" wrote in message
...
I have a long list of cities (Col. A) and states (Col. B). I would like to
count the number of times each city occurs without having to input the
city
name each time; with the results appearing like this:

Col. A Col. B Col. C
City State Number of occurrences

Boston Massachusetts 300
Denver Colorado 250
New Orleans Louisiana 256
etc.

Anyone know how to do this?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Count names and occurrences

Thanks Gaurav. That kinda works if I sort the city, state first, but I have a
list of several thousand cities, and I was hoping that I could wind up with
one line per city with a total on the same line.

"Gaurav" wrote:

in C2, type =COUNTIF(A:A,A1) and copy down.

is this what you want?

I am just wondering that when you copy the furmula down and a city is
repeated in column A, the number will also be repeated in column C. Would
you be ok with that?

"Midjack" wrote in message
...
I have a long list of cities (Col. A) and states (Col. B). I would like to
count the number of times each city occurs without having to input the
city
name each time; with the results appearing like this:

Col. A Col. B Col. C
City State Number of occurrences

Boston Massachusetts 300
Denver Colorado 250
New Orleans Louisiana 256
etc.

Anyone know how to do this?

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 207
Default Count names and occurrences

If I understand correct....select the entire range where you have cities, go
to DATA | FILTER | ADVANCED FILTER, check COPY TO OTHER LOCATION and UNIQUE
RECORDS ONLY, in COPY TO box, type say..G2, press OK.

now you have all the unique cities in column G..means no city is repeated.
Now in H2 type =COUNTIF(A:A,G2) and copy down.

I think this should give you what you want.


"Midjack" wrote in message
...
Thanks Gaurav. That kinda works if I sort the city, state first, but I
have a
list of several thousand cities, and I was hoping that I could wind up
with
one line per city with a total on the same line.

"Gaurav" wrote:

in C2, type =COUNTIF(A:A,A1) and copy down.

is this what you want?

I am just wondering that when you copy the furmula down and a city is
repeated in column A, the number will also be repeated in column C. Would
you be ok with that?

"Midjack" wrote in message
...
I have a long list of cities (Col. A) and states (Col. B). I would like
to
count the number of times each city occurs without having to input the
city
name each time; with the results appearing like this:

Col. A Col. B Col. C
City State Number of occurrences

Boston Massachusetts 300
Denver Colorado 250
New Orleans Louisiana 256
etc.

Anyone know how to do this?

Thanks






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Count names and occurrences

I tried that and got a list of unique cities, but when I ran =COUNTIF(A:A,G2)
all I got were 0's.

"Gaurav" wrote:

If I understand correct....select the entire range where you have cities, go
to DATA | FILTER | ADVANCED FILTER, check COPY TO OTHER LOCATION and UNIQUE
RECORDS ONLY, in COPY TO box, type say..G2, press OK.

now you have all the unique cities in column G..means no city is repeated.
Now in H2 type =COUNTIF(A:A,G2) and copy down.

I think this should give you what you want.


"Midjack" wrote in message
...
Thanks Gaurav. That kinda works if I sort the city, state first, but I
have a
list of several thousand cities, and I was hoping that I could wind up
with
one line per city with a total on the same line.

"Gaurav" wrote:

in C2, type =COUNTIF(A:A,A1) and copy down.

is this what you want?

I am just wondering that when you copy the furmula down and a city is
repeated in column A, the number will also be repeated in column C. Would
you be ok with that?

"Midjack" wrote in message
...
I have a long list of cities (Col. A) and states (Col. B). I would like
to
count the number of times each city occurs without having to input the
city
name each time; with the results appearing like this:

Col. A Col. B Col. C
City State Number of occurrences

Boston Massachusetts 300
Denver Colorado 250
New Orleans Louisiana 256
etc.

Anyone know how to do this?

Thanks








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 207
Default Count names and occurrences

well....that should not happen. send me the file if you can.


"Midjack" wrote in message
...
I tried that and got a list of unique cities, but when I ran
=COUNTIF(A:A,G2)
all I got were 0's.

"Gaurav" wrote:

If I understand correct....select the entire range where you have cities,
go
to DATA | FILTER | ADVANCED FILTER, check COPY TO OTHER LOCATION and
UNIQUE
RECORDS ONLY, in COPY TO box, type say..G2, press OK.

now you have all the unique cities in column G..means no city is
repeated.
Now in H2 type =COUNTIF(A:A,G2) and copy down.

I think this should give you what you want.


"Midjack" wrote in message
...
Thanks Gaurav. That kinda works if I sort the city, state first, but I
have a
list of several thousand cities, and I was hoping that I could wind up
with
one line per city with a total on the same line.

"Gaurav" wrote:

in C2, type =COUNTIF(A:A,A1) and copy down.

is this what you want?

I am just wondering that when you copy the furmula down and a city is
repeated in column A, the number will also be repeated in column C.
Would
you be ok with that?

"Midjack" wrote in message
...
I have a long list of cities (Col. A) and states (Col. B). I would
like
to
count the number of times each city occurs without having to input
the
city
name each time; with the results appearing like this:

Col. A Col. B Col. C
City State Number of occurrences

Boston Massachusetts 300
Denver Colorado 250
New Orleans Louisiana 256
etc.

Anyone know how to do this?

Thanks








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying names and frqequency of occurrences. pms240 Excel Worksheet Functions 3 March 19th 07 03:10 PM
trying to COUNT occurrences when certain criteria is met Allan from Melbourne Excel Discussion (Misc queries) 4 August 2nd 06 11:01 AM
Count number of occurrences MarkM Excel Discussion (Misc queries) 1 July 27th 06 10:14 PM
how do I count the occurrences of multiple conditions Debi Excel Worksheet Functions 8 July 18th 06 02:28 PM
Count unique occurrences of name jhicsupt Excel Discussion (Misc queries) 4 October 5th 05 05:46 PM


All times are GMT +1. The time now is 03:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"