PC Review


Reply
Thread Tools Rate Thread

Counting occurrences in a range

 
 
nclorguy
Guest
Posts: n/a
 
      29th Aug 2010
I did a survey where the data in one column looks something like this:
Texas, California, Iowa
Iowa, California, Vermont
Texas, Vermont, California

etc.

I do not want to parse the data, but rather want to count, for
example, all occurrences of Vermont. I tried count and countif but
nothing worked. Any ideas?
 
Reply With Quote
 
 
 
 
nclorguy
Guest
Posts: n/a
 
      29th Aug 2010
On Aug 29, 9:43*am, nclorguy <thermomete...@gmail.com> wrote:
> I did a survey where the data in one column looks something like this:
> Texas, California, Iowa
> Iowa, California, Vermont
> Texas, Vermont, California
>
> etc.
>
> I do not want to parse the data, but rather want to count, for
> example, all occurrences of Vermont. *I tried count and countif but
> nothing worked. *Any ideas?


Got the answer:
=SUM(LEN(E2:E880)-LEN(SUBSTITUTE(E2:E880,"Vermont","")))/LEN("Vermont")
 
Reply With Quote
 
The Chief Instigator
Guest
Posts: n/a
 
      29th Aug 2010
On Sun, 29 Aug 2010 06:43:17 -0700 (PDT), nclorguy <(E-Mail Removed)> wrote:
> I did a survey where the data in one column looks something like this:
> Texas, California, Iowa
> Iowa, California, Vermont
> Texas, Vermont, California
>
> etc.
>
> I do not want to parse the data, but rather want to count, for
> example, all occurrences of Vermont. I tried count and countif but
> nothing worked. Any ideas?


Try countifs...I put up a 3x3 grid with those states, and used
"countifs($a$1:$c$3,"=Vermont")", which produced 2. Replace that with
"=California" and you'll get 3.

--
Patrick L. "The Chief Instigator" Humphrey ((E-Mail Removed)) Houston, TX
www.io.com/~patrick/aeros.php (TCI's 2009-10 Houston Aeros) AA#2273
LAST GAME: San Antonio 3, Houston 2 (April 11)
NEXT GAME: Saturday, October 9 at Oklahoma City, 7:05
 
Reply With Quote
 
joeu2004
Guest
Posts: n/a
 
      29th Aug 2010
On Aug 29, 6:43*am, nclorguy <thermomete...@gmail.com> wrote:
> I did a survey where the data in one column looks something like this:
> Texas, California, Iowa
> Iowa, California, Vermont
> Texas, Vermont, California
> etc.
>
> I do not want to parse the data, but rather want to count, for
> example, all occurrences of Vermont. *I tried count and countif but
> nothing worked. *Any ideas?


=COUNTIF(A1:A100,"*vermont*")

should do the trick. If that does not work for you, provide example
data, the formula you tried (copy-and-pasted from the Formula Bar),
the result you got, and the result you want.

Some caveats:

1. It is important that "vermont" is not a substring of a longer word
that you do not want to count. Is that an issue for you?

2. The COUNTIF solution will count multiple occurrences in the same
cell as only one. Is that an issue for you?

PS: For broader participation, you might want to post future
inquiries using the MS Answers Forums at
http://social.answers.microsoft.com/...ry/officeexcel.
It's not that I like that forum. It's just that MS has ceased to
support the Usenet newsgroups. Hence, participation here is limited
to the sites that share a common newsgroup mirror, which is no longer
centralized at MS.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting occurrences GARY Microsoft Excel Misc 3 13th Aug 2008 10:06 PM
Counting occurrences GARY Microsoft Excel Misc 3 13th Aug 2008 09:51 PM
Counting occurrences over range of sheets DailyRich Microsoft Excel Worksheet Functions 3 9th Jan 2006 10:49 PM
counting occurrences in a range =?Utf-8?B?SnVkeSBGZWxmZQ==?= Microsoft Excel Misc 3 20th Jul 2005 07:25 PM
Counting UNIQUE occurrences within a range lindasf Microsoft Excel Misc 3 25th Jun 2004 01:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:14 PM.