Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Counting Unique Values That Are Separate by Commas in a Column

I have a column like so, with each text line equalling a cell (the names are
U.S. Counties; 11 cells are below, excerpted from my dataset of around 600
rows):

Mobile, Baldwin
Sumter, Greene, Tuscaloosa, Jefferson, St. Clair, Talladega, Calhoun, Cleburne
Sumter, Greene, Tuscaloosa, Jefferson, St. Clair, Etowah, Dekalb
Mobile, Baldwin, Escambia, Conecuh, Butler, Lowndes, Montgomery, Elmore,
Autauga, Chilton, Shelby, Jefferson, Blount, Cullman, Morgan, Limestone
Montgomery, Macon, Lee, Chambers
Mobile
Tuscaloosa
Jefferson
Limestone, Madison
Etowah

I've used this formula to count all the counties in an individual cell:

=IF(F7<"",LEN(F7)-LEN(SUBSTITUTE(F7,",",""))+1,0)

However, now I need a state total that counts the counties in the column.
Is there any way of counting only unique values so I don't double count
counties when coming up with my state total?

Thanks again!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Counting Unique Values That Are Separate by Commas in a Column

Assuming G1 contains the name of the county you want to search for and
Column F contains your listing, try this formula...

=SUMPRODUCT(--ISNUMBER(SEARCH(G1,F1:F1000)))

Rick


"Rothman" wrote in message
...
I have a column like so, with each text line equalling a cell (the names
are
U.S. Counties; 11 cells are below, excerpted from my dataset of around 600
rows):

Mobile, Baldwin
Sumter, Greene, Tuscaloosa, Jefferson, St. Clair, Talladega, Calhoun,
Cleburne
Sumter, Greene, Tuscaloosa, Jefferson, St. Clair, Etowah, Dekalb
Mobile, Baldwin, Escambia, Conecuh, Butler, Lowndes, Montgomery, Elmore,
Autauga, Chilton, Shelby, Jefferson, Blount, Cullman, Morgan, Limestone
Montgomery, Macon, Lee, Chambers
Mobile
Tuscaloosa
Jefferson
Limestone, Madison
Etowah

I've used this formula to count all the counties in an individual cell:

=IF(F7<"",LEN(F7)-LEN(SUBSTITUTE(F7,",",""))+1,0)

However, now I need a state total that counts the counties in the column.
Is there any way of counting only unique values so I don't double count
counties when coming up with my state total?

Thanks again!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Counting Unique Values That Are Separate by Commas in a Column

I'm sorry, but it seems once again my powers of explanation have proven to be
inadequate.

I don't have a listing of counties that I'm comparing my column against.
All I'm looking for is a number that represents "number of counties covered"
for a particular state. Given my column, which has cells which contain more
than one county, and that the same county may appear in two or more different
cells, I just need to count the unique counties in the column (as opposed to
summing up the formula I used to count the counties per cell, which double
counts).



"Rick Rothstein (MVP - VB)" wrote:

Assuming G1 contains the name of the county you want to search for and
Column F contains your listing, try this formula...

=SUMPRODUCT(--ISNUMBER(SEARCH(G1,F1:F1000)))

Rick


"Rothman" wrote in message
...
I have a column like so, with each text line equalling a cell (the names
are
U.S. Counties; 11 cells are below, excerpted from my dataset of around 600
rows):

Mobile, Baldwin
Sumter, Greene, Tuscaloosa, Jefferson, St. Clair, Talladega, Calhoun,
Cleburne
Sumter, Greene, Tuscaloosa, Jefferson, St. Clair, Etowah, Dekalb
Mobile, Baldwin, Escambia, Conecuh, Butler, Lowndes, Montgomery, Elmore,
Autauga, Chilton, Shelby, Jefferson, Blount, Cullman, Morgan, Limestone
Montgomery, Macon, Lee, Chambers
Mobile
Tuscaloosa
Jefferson
Limestone, Madison
Etowah

I've used this formula to count all the counties in an individual cell:

=IF(F7<"",LEN(F7)-LEN(SUBSTITUTE(F7,",",""))+1,0)

However, now I need a state total that counts the counties in the column.
Is there any way of counting only unique values so I don't double count
counties when coming up with my state total?

Thanks again!



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 on two separate values Leif Excel Worksheet Functions 5 February 4th 08 11:40 PM
counting the # of unique values bobby769 Excel Worksheet Functions 3 January 10th 07 04:08 AM
Counting unique values giantwolf Excel Discussion (Misc queries) 4 August 28th 06 01:31 PM
Counting Unique Values carl Excel Worksheet Functions 9 July 25th 05 12:44 PM
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


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