PC Review


Reply
Thread Tools Rate Thread

Counting instances of text???

 
 
=?Utf-8?B?dHBtYXg=?=
Guest
Posts: n/a
 
      27th Jun 2007
I need to count the number of instances of "1" in a cell range. Here's the
catch, the range may contain more than one instance of it in a single cell,
but I need to account for each independently. So one cell may contain 11 and
the next 111, but I need to count the number of times (in this case, 5) that
the value is displayed.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VGVldGhsZXNzIG1hbWE=?=
Guest
Posts: n/a
 
      27th Jun 2007
=SUMPRODUCT(LEN(A1:A100)-LEN(SUBSTITUTE(A1:A100,1,"")))


"tpmax" wrote:

> I need to count the number of instances of "1" in a cell range. Here's the
> catch, the range may contain more than one instance of it in a single cell,
> but I need to account for each independently. So one cell may contain 11 and
> the next 111, but I need to count the number of times (in this case, 5) that
> the value is displayed.

 
Reply With Quote
 
Ragdyer
Guest
Posts: n/a
 
      27th Jun 2007
With the number you're looking for entered in C1, and the range to count is
A1 to A100, try this:

=SUMPRODUCT(LEN(A1:A100)-LEN(SUBSTITUTE(A1:A100,C1,"")))/LEN(C1)

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"tpmax" <(E-Mail Removed)> wrote in message
news:5022F0E3-9B01-4283-A804-(E-Mail Removed)...
>I need to count the number of instances of "1" in a cell range. Here's the
> catch, the range may contain more than one instance of it in a single
> cell,
> but I need to account for each independently. So one cell may contain 11
> and
> the next 111, but I need to count the number of times (in this case, 5)
> that
> the value is displayed.



 
Reply With Quote
 
=?Utf-8?B?dHBtYXg=?=
Guest
Posts: n/a
 
      27th Jun 2007
Fantastic! Is there an easy way for me to control the function so that it
only counts values to the left of a decimal point (e.g., 11.0101 would only
count 2)?

"Teethless mama" wrote:

> =SUMPRODUCT(LEN(A1:A100)-LEN(SUBSTITUTE(A1:A100,1,"")))
>
>
> "tpmax" wrote:
>
> > I need to count the number of instances of "1" in a cell range. Here's the
> > catch, the range may contain more than one instance of it in a single cell,
> > but I need to account for each independently. So one cell may contain 11 and
> > the next 111, but I need to count the number of times (in this case, 5) that
> > the value is displayed.

 
Reply With Quote
 
Ragdyer
Guest
Posts: n/a
 
      27th Jun 2007
Just realized that your subject line mentions TEXT.

The formula I posted will work with text, BUT ... it will be case sensitive,
meaning,
Tpmax in C1 will *not* count tpmax in A1 to A100.

To make the formula work with text and *not be case sensitive*, try this:

=SUMPRODUCT(LEN(A1:A100)-LEN(SUBSTITUTE(UPPER(A1:A100),UPPER(C1),"")))/LEN(C1)

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Ragdyer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> With the number you're looking for entered in C1, and the range to count
> is A1 to A100, try this:
>
> =SUMPRODUCT(LEN(A1:A100)-LEN(SUBSTITUTE(A1:A100,C1,"")))/LEN(C1)
>
> --
> HTH,
>
> RD
>
> ---------------------------------------------------------------------------
> Please keep all correspondence within the NewsGroup, so all may benefit !
> ---------------------------------------------------------------------------
>
> "tpmax" <(E-Mail Removed)> wrote in message
> news:5022F0E3-9B01-4283-A804-(E-Mail Removed)...
>>I need to count the number of instances of "1" in a cell range. Here's the
>> catch, the range may contain more than one instance of it in a single
>> cell,
>> but I need to account for each independently. So one cell may contain 11
>> and
>> the next 111, but I need to count the number of times (in this case, 5)
>> that
>> the value is displayed.

>
>



 
Reply With Quote
 
Ragdyer
Guest
Posts: n/a
 
      27th Jun 2007
Check out my suggestion!
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"tpmax" <(E-Mail Removed)> wrote in message
news:C3C62D53-7C63-4BF9-B774-(E-Mail Removed)...
> Fantastic! Is there an easy way for me to control the function so that it
> only counts values to the left of a decimal point (e.g., 11.0101 would
> only
> count 2)?
>
> "Teethless mama" wrote:
>
>> =SUMPRODUCT(LEN(A1:A100)-LEN(SUBSTITUTE(A1:A100,1,"")))
>>
>>
>> "tpmax" wrote:
>>
>> > I need to count the number of instances of "1" in a cell range. Here's
>> > the
>> > catch, the range may contain more than one instance of it in a single
>> > cell,
>> > but I need to account for each independently. So one cell may contain
>> > 11 and
>> > the next 111, but I need to count the number of times (in this case, 5)
>> > that
>> > the value is displayed.



 
Reply With Quote
 
=?Utf-8?B?VGVldGhsZXNzIG1hbWE=?=
Guest
Posts: n/a
 
      27th Jun 2007
=SUMPRODUCT(LEN(INT(A1:A100))-LEN(SUBSTITUTE(INT(A1:A100),1,"")))


"tpmax" wrote:

> Fantastic! Is there an easy way for me to control the function so that it
> only counts values to the left of a decimal point (e.g., 11.0101 would only
> count 2)?
>
> "Teethless mama" wrote:
>
> > =SUMPRODUCT(LEN(A1:A100)-LEN(SUBSTITUTE(A1:A100,1,"")))
> >
> >
> > "tpmax" wrote:
> >
> > > I need to count the number of instances of "1" in a cell range. Here's the
> > > catch, the range may contain more than one instance of it in a single cell,
> > > but I need to account for each independently. So one cell may contain 11 and
> > > the next 111, but I need to count the number of times (in this case, 5) that
> > > the value is displayed.

 
Reply With Quote
 
Ragdyer
Guest
Posts: n/a
 
      27th Jun 2007
Don't know if the OP's subject line is truly descriptive, but this won't
work with text.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Teethless mama" <(E-Mail Removed)> wrote in message
news:3617FAD2-3DB5-40CC-98A8-(E-Mail Removed)...
> =SUMPRODUCT(LEN(INT(A1:A100))-LEN(SUBSTITUTE(INT(A1:A100),1,"")))
>
>
> "tpmax" wrote:
>
>> Fantastic! Is there an easy way for me to control the function so that it
>> only counts values to the left of a decimal point (e.g., 11.0101 would
>> only
>> count 2)?
>>
>> "Teethless mama" wrote:
>>
>> > =SUMPRODUCT(LEN(A1:A100)-LEN(SUBSTITUTE(A1:A100,1,"")))
>> >
>> >
>> > "tpmax" wrote:
>> >
>> > > I need to count the number of instances of "1" in a cell range.
>> > > Here's the
>> > > catch, the range may contain more than one instance of it in a single
>> > > cell,
>> > > but I need to account for each independently. So one cell may contain
>> > > 11 and
>> > > the next 111, but I need to count the number of times (in this case,
>> > > 5) that
>> > > the value is displayed.



 
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 instances of predefined text in a row Zing Microsoft Excel Worksheet Functions 3 17th Jan 2010 05:51 PM
Counting Instances of Text dhil@blarg.net Microsoft Excel Worksheet Functions 2 29th Mar 2007 04:06 AM
cell formula for counting instances of text? Samuel Microsoft Excel Misc 12 24th May 2006 01:41 PM
Excel - Counting Text Instances Cameron Microsoft Excel Worksheet Functions 1 17th Nov 2003 10:40 AM
Re: Counting instances of char within text Andy Brown Microsoft Excel Misc 3 27th Aug 2003 02:18 AM


Features
 

Advertising
 

Newsgroups
 


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