Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default how to count the number of occurences of a letter ?

If I have a text "once upon a time" in a cell A1.
How can I know the number of 'o' or 'n' contained in that text ?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default how to count the number of occurences of a letter ?

You can put this in B1:

=LEN(A1)-LEN(SUBSTITUTE(A1,"o",""))

to count the number of 'o' - just change the "o" to "n" for other
letters - or put n in C1 and change B1 to:

=LEN(A1)-LEN(SUBSTITUTE(A1,C1,""))

then you can easily put other letters in C1 to get a count of each.

Hope this helps.

Pete


On Nov 26, 12:55*pm, wrote:
If I have a text "once upon a time" in a cell A1.
How can I know the number of 'o' or 'n' contained in that text ?
Thanks


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default how to count the number of occurences of a letter ?

And a non case sensitive version

=(LEN(A1)-LEN(SUBSTITUTE(LOWER(A1),LOWER("o"),"")))/LEN("o")

Mike

" wrote:

If I have a text "once upon a time" in a cell A1.
How can I know the number of 'o' or 'n' contained in that text ?
Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default how to count the number of occurences of a letter ?

On Nov 26, 1:28*pm, Mike H wrote:
And a non case sensitive version

=(LEN(A1)-LEN(SUBSTITUTE(LOWER(A1),LOWER("o"),"")))/LEN("o")

Mike



" wrote:
If I have a text "once upon a time" in a cell A1.
How can I know the number of 'o' or 'n' contained in that text ?
Thanks- Hide quoted text -


- Show quoted text -


thanks very much Pete and Mike. The idea is excellent.
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
Lookup a value and count the number of associated occurences reddy Excel Discussion (Misc queries) 3 August 27th 08 11:37 PM
How to count number of occurences of two different things at once? Cairan O'Toole Excel Worksheet Functions 6 August 12th 07 10:12 AM
COUNTIF cannot count decimal number occurences Ignorasmus Excel Worksheet Functions 2 January 20th 07 09:13 PM
count number of occurences on a particular date [email protected] Excel Worksheet Functions 4 December 7th 06 09:11 PM
count number of occurences within a string Gabriel Excel Worksheet Functions 2 November 25th 04 04:17 PM


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