Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Count occurrences of text within a cell

I need to count the number of characters repeating within a cell. For
example, assuming the following in range A1 through A4:

eee
ee
aaaae
af

A count of "e" would return

3
2
1
0


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Count occurrences of text within a cell

Try this:

=SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"E","")))

--
Biff
Microsoft Excel MVP


"Stan Sitek" wrote in message
...
I need to count the number of characters repeating within a cell. For
example, assuming the following in range A1 through A4:

eee
ee
aaaae
af

A count of "e" would return

3
2
1
0




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Count occurrences of text within a cell

If you only use one cell then this will suffice

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"E",""))

you probably meant


=SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(UPPER(A1:A10),"E","")))



--
Regards,

Peo Sjoblom



"T. Valko" wrote in message
...
Try this:

=SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"E","")))

--
Biff
Microsoft Excel MVP


"Stan Sitek" wrote in message
...
I need to count the number of characters repeating within a cell. For
example, assuming the following in range A1 through A4:

eee
ee
aaaae
af

A count of "e" would return

3
2
1
0






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Count occurrences of text within a cell

Ooops!

Yeah, I meant your first example:

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"E",""))



--
Biff
Microsoft Excel MVP


"Peo Sjoblom" wrote in message
...
If you only use one cell then this will suffice

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"E",""))

you probably meant


=SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(UPPER(A1:A10),"E","")))



--
Regards,

Peo Sjoblom



"T. Valko" wrote in message
...
Try this:

=SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"E","")))

--
Biff
Microsoft Excel MVP


"Stan Sitek" wrote in message
...
I need to count the number of characters repeating within a cell. For
example, assuming the following in range A1 through A4:

eee
ee
aaaae
af

A count of "e" would return

3
2
1
0








  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Count occurrences of text within a cell


Can you please tell me where a good tutorial on this subject is? Or what is
the significance of each part of this formula? I'm trying to expand my
knowledge of Excel. The formula works to count the number of 'V's' (in my
spreadsheet) in a range but I would like to return a value of 4 for each 'V'
counted.

Thanks.

"T. Valko" wrote:

Try this:

=SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"E","")))

--
Biff
Microsoft Excel MVP


"Stan Sitek" wrote in message
...
I need to count the number of characters repeating within a cell. For
example, assuming the following in range A1 through A4:

eee
ee
aaaae
af

A count of "e" would return

3
2
1
0







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Count occurrences of text within a cell

=SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"V","")))*4

For more on SUMPRODUCT see Bob Phillips' site.

http://www.xldynamic.com/source/xld.SUMPRODUCT.html


Gord Dibben MS Excel MVP


On Wed, 20 Aug 2008 11:51:04 -0700, Deena
wrote:


Can you please tell me where a good tutorial on this subject is? Or what is
the significance of each part of this formula? I'm trying to expand my
knowledge of Excel. The formula works to count the number of 'V's' (in my
spreadsheet) in a range but I would like to return a value of 4 for each 'V'
counted.

Thanks.

"T. Valko" wrote:

Try this:

=SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"E","")))

--
Biff
Microsoft Excel MVP


"Stan Sitek" wrote in message
...
I need to count the number of characters repeating within a cell. For
example, assuming the following in range A1 through A4:

eee
ee
aaaae
af

A count of "e" would return

3
2
1
0






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
trying to COUNT occurrences when certain criteria is met Allan from Melbourne Excel Discussion (Misc queries) 4 August 2nd 06 11:01 AM
Count number of occurrences MarkM Excel Discussion (Misc queries) 1 July 27th 06 10:14 PM
Count occurrences of values in a column??!! me123 Excel Worksheet Functions 5 May 10th 06 08:24 PM
Count unique occurrences of name jhicsupt Excel Discussion (Misc queries) 4 October 5th 05 05:46 PM
how to count the nr of occurrences of a text string in a cell rang eagerbuyer Excel Worksheet Functions 1 November 4th 04 12:27 PM


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