PC Review


Reply
Thread Tools Rate Thread

count number of occurances of a word in a range

 
 
=?Utf-8?B?Sm9obiBEYXZpZXM=?=
Guest
Posts: n/a
 
      23rd Feb 2006
I have a range that has different car models. Is it possible to have a
formula to count the number of occurances of a particular world.

e.g. range has ther following data Panda Active, Panda Dynamic, Punto
Active, Punto Dynamic, Punto Eleganza etc. Is it possible to have a formula
that will return the number of times "Punto" is listed in the range, or
"Dynamic" is listed in the range.

Thanks in advance for any help

Regards
John
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Um9uIENvZGVycmU=?=
Guest
Posts: n/a
 
      23rd Feb 2006
Try something like this:

This formula counts the number of times the text in Cell A1 occurs in D110

=SUMPRODUCT(LEN(D110)-LEN(SUBSTITUTE(UPPER(D110),UPPER(A1),"")))/LEN(A1)

Example:
A1: Sugar

D1: Sugar and Spice
D2: Sugar Bears contain no Sugar.

Count of Sugar is 3.
Note: SUBSTITUTE is case sensitive, hence the UPPER function.

Change range references to suit your situation.

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"John Davies" wrote:

> I have a range that has different car models. Is it possible to have a
> formula to count the number of occurances of a particular world.
>
> e.g. range has ther following data Panda Active, Panda Dynamic, Punto
> Active, Punto Dynamic, Punto Eleganza etc. Is it possible to have a formula
> that will return the number of times "Punto" is listed in the range, or
> "Dynamic" is listed in the range.
>
> Thanks in advance for any help
>
> Regards
> John

 
Reply With Quote
 
=?Utf-8?B?Sm9obiBEYXZpZXM=?=
Guest
Posts: n/a
 
      24th Feb 2006
Thanks for your help

This almost does the job, however on some lines e.g. I have Stilo 3 door
Saloon, Stilo 5 Door Saloon and Stilo Multiwagon. How can I get it to
differentiate between different Stilo models?

Thanks

"Ron Coderre" wrote:

> Try something like this:
>
> This formula counts the number of times the text in Cell A1 occurs in D110
>
> =SUMPRODUCT(LEN(D110)-LEN(SUBSTITUTE(UPPER(D110),UPPER(A1),"")))/LEN(A1)
>
> Example:
> A1: Sugar
>
> D1: Sugar and Spice
> D2: Sugar Bears contain no Sugar.
>
> Count of Sugar is 3.
> Note: SUBSTITUTE is case sensitive, hence the UPPER function.
>
> Change range references to suit your situation.
>
> Does that help?
>
> ***********
> Regards,
> Ron
>
> XL2002, WinXP-Pro
>
>
> "John Davies" wrote:
>
> > I have a range that has different car models. Is it possible to have a
> > formula to count the number of occurances of a particular world.
> >
> > e.g. range has ther following data Panda Active, Panda Dynamic, Punto
> > Active, Punto Dynamic, Punto Eleganza etc. Is it possible to have a formula
> > that will return the number of times "Punto" is listed in the range, or
> > "Dynamic" is listed in the range.
> >
> > Thanks in advance for any help
> >
> > Regards
> > John

 
Reply With Quote
 
=?Utf-8?B?Um9uIENvZGVycmU=?=
Guest
Posts: n/a
 
      24th Feb 2006
If I understand you correctly, you don't want to count the occurrences of a
word in the range. You want to count the occurrences of a model in the range.

See if this is something you can use:

This one returns the count of cells that contain "Stilo 4 door saloon":
A1: Stilo 4 door saloon
B1: =COUNTIF(D110,A1)

This formula counts the number of cells that start with "Stilo " and end
with " door saloon":
A1: Stilo * door saloon
B1: =COUNTIF(D110,A1)

It would count:
Stilo 4 door saloon
Stilo with no door saloon
Stilo green with 2 door saloon

Note: The asterisk (*) is a wildcard that matches multiple characters. A
question mark (?) would match any single character.

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"John Davies" wrote:

> Thanks for your help
>
> This almost does the job, however on some lines e.g. I have Stilo 3 door
> Saloon, Stilo 5 Door Saloon and Stilo Multiwagon. How can I get it to
> differentiate between different Stilo models?
>
> Thanks
>
> "Ron Coderre" wrote:
>
> > Try something like this:
> >
> > This formula counts the number of times the text in Cell A1 occurs in D110
> >
> > =SUMPRODUCT(LEN(D110)-LEN(SUBSTITUTE(UPPER(D110),UPPER(A1),"")))/LEN(A1)
> >
> > Example:
> > A1: Sugar
> >
> > D1: Sugar and Spice
> > D2: Sugar Bears contain no Sugar.
> >
> > Count of Sugar is 3.
> > Note: SUBSTITUTE is case sensitive, hence the UPPER function.
> >
> > Change range references to suit your situation.
> >
> > Does that help?
> >
> > ***********
> > Regards,
> > Ron
> >
> > XL2002, WinXP-Pro
> >
> >
> > "John Davies" wrote:
> >
> > > I have a range that has different car models. Is it possible to have a
> > > formula to count the number of occurances of a particular world.
> > >
> > > e.g. range has ther following data Panda Active, Panda Dynamic, Punto
> > > Active, Punto Dynamic, Punto Eleganza etc. Is it possible to have a formula
> > > that will return the number of times "Punto" is listed in the range, or
> > > "Dynamic" is listed in the range.
> > >
> > > Thanks in advance for any help
> > >
> > > Regards
> > > John

 
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
Count the number of occurances in a cell bobbroda Microsoft Excel Worksheet Functions 2 1st Jun 2009 04:10 PM
How do I count occurances of a specific character in a range? Viridel Microsoft Excel Worksheet Functions 1 18th Jan 2008 01:55 AM
Count occurances within a date range =?Utf-8?B?TWFyYw==?= Microsoft Excel Misc 6 6th Mar 2007 04:29 PM
Count occurances in range of cells Ed Gregory Microsoft Excel Worksheet Functions 1 7th Sep 2005 04:12 PM
count date occurances in range of dates... =?Utf-8?B?QWxleA==?= Microsoft Excel Worksheet Functions 2 27th Jul 2005 04:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:30 PM.