Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Henrik
 
Posts: n/a
Default Counting number of time a character appears in a string

Does anyone know a way to automatically count how many times a certain
character counts in a text string?
  #2   Report Post  
Henrik
 
Posts: n/a
Default Counting number of time a character appears in a string

I meant to say:

Does anyone know a way to automatically count how many times a certain
character appears in a text string?

(i.e. "w" appears 3 times in the string above)




"Henrik" wrote:

Does anyone know a way to automatically count how many times a certain
character counts in a text string?

  #3   Report Post  
Harlan Grove
 
Posts: n/a
Default Counting number of time a character appears in a string

Henrik wrote...
Does anyone know a way to automatically count how many times a certain
character counts in a text string?


To count the number of Xs in s, try

=LEN(s)-LEN(SUBSTITUTE(s,"X",""))

  #4   Report Post  
Peo Sjoblom
 
Posts: n/a
Default Counting number of time a character appears in a string

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

will count the occurrence of a in cell A1, if you have a range with strings
use

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


--

Regards,

Peo Sjoblom

"Henrik" wrote in message
...
Does anyone know a way to automatically count how many times a certain
character counts in a text string?



  #5   Report Post  
Henrik
 
Posts: n/a
Default Counting number of time a character appears in a string

FYI, I figured it out:

=LEN(cell_ref)-LEN(SUBSTITUTE(cell_ref,"character",""))




"Henrik" wrote:

I meant to say:

Does anyone know a way to automatically count how many times a certain
character appears in a text string?

(i.e. "w" appears 3 times in the string above)




"Henrik" wrote:

Does anyone know a way to automatically count how many times a certain
character counts in a text string?



  #6   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default Counting number of time a character appears in a string

On Thu, 20 Oct 2005 14:25:02 -0700, Henrik
wrote:

Does anyone know a way to automatically count how many times a certain
character counts in a text string?


To count the number of appearances of a character in a text string:

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


--ron
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
converting number string to number with decimal rortiz Excel Worksheet Functions 2 September 15th 05 08:34 PM
Insert a Seperator into a number string. DraCo Excel Discussion (Misc queries) 3 August 22nd 05 02:24 PM
last number array from string Michael Excel Worksheet Functions 17 August 1st 05 07:30 PM
Counting the number of times a word appears in a worksheet Jig Bhakta Excel Worksheet Functions 4 February 3rd 05 03:01 AM
how do i convert a number into minutes for a time of completion c. dhelmers Excel Discussion (Misc queries) 2 January 29th 05 08:49 AM


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