Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Counting instances of text???

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Counting instances of text???

=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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Counting instances of text???

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" wrote in message
...
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.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Counting instances of text???

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.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Counting instances of text???

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" wrote in message
...
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" wrote in message
...
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.







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Counting instances of text???

Check out my suggestion!
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"tpmax" wrote in message
...
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.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Counting instances of text???

=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.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Counting instances of text???

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" wrote in message
...
=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
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 Multiple Instances Curtis Excel Worksheet Functions 3 January 31st 07 06:22 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
cell formula for counting instances of text? Samuel Excel Discussion (Misc queries) 12 May 24th 06 01:41 PM
counting unique instances of text in a list WadeSansing Excel Worksheet Functions 5 June 1st 05 06:57 PM
Counting instances in a cell [email protected] Excel Discussion (Misc queries) 2 December 11th 04 03:14 PM


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