Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Countif with multiple text values in cell

I have a column of state abbreviations and am simply trying to count how many
times each state appears in the column.

Unfortunately, there are some cells in the column that contain two or more
states. Countif doesn't like that (i.e if VA is in one cell and "MD VA NY"
is in another, it doesn't count VA twice).

What do I do? This isn't the only data in my sheet, so adding columns would
be...messy.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Countif with multiple text values in cell

hi
=countif(A1:A50,"*VA*")

use the wildcard * in the search. adjust range to suit.

Regards
FSt1

"Rothman" wrote:

I have a column of state abbreviations and am simply trying to count how many
times each state appears in the column.

Unfortunately, there are some cells in the column that contain two or more
states. Countif doesn't like that (i.e if VA is in one cell and "MD VA NY"
is in another, it doesn't count VA twice).

What do I do? This isn't the only data in my sheet, so adding columns would
be...messy.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Countif with multiple text values in cell

Works like a charm! Thanks!

"FSt1" wrote:

hi
=countif(A1:A50,"*VA*")

use the wildcard * in the search. adjust range to suit.

Regards
FSt1

"Rothman" wrote:

I have a column of state abbreviations and am simply trying to count how many
times each state appears in the column.

Unfortunately, there are some cells in the column that contain two or more
states. Countif doesn't like that (i.e if VA is in one cell and "MD VA NY"
is in another, it doesn't count VA twice).

What do I do? This isn't the only data in my sheet, so adding columns would
be...messy.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Countif with multiple text values in cell

Try this:

=COUNTIF(A1:A10,"*Va*")

Or, use a cell to hold the criteria:

C1 = Va

=COUNTIF(A1:A10,"*"&C1&"*")

If a cell might hold:

MD VA VA

And you need to count that as 2 then you'll need a different formula. Let us
know if that's the case.


--
Biff
Microsoft Excel MVP


"Rothman" wrote in message
...
I have a column of state abbreviations and am simply trying to count how
many
times each state appears in the column.

Unfortunately, there are some cells in the column that contain two or more
states. Countif doesn't like that (i.e if VA is in one cell and "MD VA
NY"
is in another, it doesn't count VA twice).

What do I do? This isn't the only data in my sheet, so adding columns
would
be...messy.



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
Adding multiple values in one column based on multiple values of the same value (text) in another column [email protected] Excel Discussion (Misc queries) 1 May 16th 07 06:02 PM
Countif Multiple with text [email protected] Excel Worksheet Functions 3 June 27th 06 04:39 PM
COUNTIF formula multiple text exclusions [email protected] Excel Discussion (Misc queries) 4 June 1st 06 09:58 PM
using =COUNTIF to count two text values John in Surrey Excel Worksheet Functions 1 October 25th 05 07:05 PM
Using COUNTIF to check values in multiple columns DTomSimpson Excel Worksheet Functions 2 March 29th 05 04:47 AM


All times are GMT +1. The time now is 07:53 AM.

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

About Us

"It's about Microsoft Excel"