Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
BaseballFan
 
Posts: n/a
Default Counting multiple occurances of a specific string

I am trying to sift through a list of names and cities and determine come up
with a number for each name: 0=no city listed, 1=a city is listed, but not in
my city, and 2=my city.

Example: (my city is Seattle)
Sheet 1 (named "All Players")
Last First City
Jones James Chicago
Smith John Seattle
Doe Jason
Jones Frank Seattle

So, then in sheet 2, it would look like this:
Jones James 1
Smith John 2
Doe Jason 0
Jones Frank 2

I will mannually enter the names in Sheet 2, columns A & B, but I want a
function for automatically generating a number based on column C of sheet 1.
I don't want to reference specific cells because I will be inserting,
deleting, and rearanging several thousand names.

What I have so far is almost working, but I can't quite get the final touch.
If I enter in Seattle in Column C, next to the names in Columns A & B of
Sheet 1, then the corresponding name in Sheet 2 will pop up with a 2 in
column C - just like it is supposed to.... however, I always have a 1 for
names with both a different city, or with no listed city. I cannot get a
blank city to show me a 0.

Here is the formula I have so far:
=SUM(IF('All Players'!$A$1:$A$1309=A3,(IF('All
Players'!$B$1:$B$1309=B3,(IF('All
Players'!$AM$1:$AM$1309="Seattle",2,(IF((COUNTA('A ll
Players'!AM1:AM1309,""))1,1)))))),0))

My logic is that IF the city = "Seattle", then the value-if-true = 2. This
works. However, the value-if-false being another formula of COUNTA must be
counting the entire C column instead of just the corresponding columns of A &
B

Thanks for any help.
Jim
  #2   Report Post  
CLR
 
Posts: n/a
Default

Put in D2 and copy down...........

=IF(C2="seattle",2,IF(LEN(A1)0,1,0))

Vaya con Dios,
Chuck, CABGx3



"BaseballFan" wrote in message
...
I am trying to sift through a list of names and cities and determine come

up
with a number for each name: 0=no city listed, 1=a city is listed, but not

in
my city, and 2=my city.

Example: (my city is Seattle)
Sheet 1 (named "All Players")
Last First City
Jones James Chicago
Smith John Seattle
Doe Jason
Jones Frank Seattle

So, then in sheet 2, it would look like this:
Jones James 1
Smith John 2
Doe Jason 0
Jones Frank 2

I will mannually enter the names in Sheet 2, columns A & B, but I want a
function for automatically generating a number based on column C of sheet

1.
I don't want to reference specific cells because I will be inserting,
deleting, and rearanging several thousand names.

What I have so far is almost working, but I can't quite get the final

touch.
If I enter in Seattle in Column C, next to the names in Columns A & B of
Sheet 1, then the corresponding name in Sheet 2 will pop up with a 2 in
column C - just like it is supposed to.... however, I always have a 1 for
names with both a different city, or with no listed city. I cannot get a
blank city to show me a 0.

Here is the formula I have so far:
=SUM(IF('All Players'!$A$1:$A$1309=A3,(IF('All
Players'!$B$1:$B$1309=B3,(IF('All
Players'!$AM$1:$AM$1309="Seattle",2,(IF((COUNTA('A ll
Players'!AM1:AM1309,""))1,1)))))),0))

My logic is that IF the city = "Seattle", then the value-if-true = 2.

This
works. However, the value-if-false being another formula of COUNTA must

be
counting the entire C column instead of just the corresponding columns of

A &
B

Thanks for any help.
Jim



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
counting Multiple answers in 1 cell + column the6thlee Excel Discussion (Misc queries) 1 February 21st 05 09:19 AM
counting Multiple answers in 1 cell + column help me i have an excel problem Excel Discussion (Misc queries) 0 February 21st 05 08:41 AM
Counting unique entries in column A but only if specific values appear in columns B and C markx Excel Worksheet Functions 1 February 10th 05 11:52 AM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
Counting rows based on criteria in multiple cells Margaret Excel Discussion (Misc queries) 11 December 2nd 04 11:04 PM


All times are GMT +1. The time now is 06:24 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"