LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default counting instances of a character within a string

Hello,
I'm trying to count the number of times a character appears within a string.
I thought there was a function that could do this (i.e. one line of code),
but can't seem to find it.

For example, if I have a cell that contains "27,45,8,19,13" and want to
count the commas, I'm looking for something like this:

Num = CountChars("," , Cell.Value)
where CountChars is the mystery function that I'm seeking.

I can get the result I want with the Search function and a Do...Loop, but if
there was a function it would make it much cleaner.

Thanks.

Mike
 
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 No of character in a string Chandrashekar B Excel Worksheet Functions 1 October 28th 09 06:44 AM
Counting instances in string John in Wembley Excel Discussion (Misc queries) 11 September 18th 07 06:51 PM
counting x instances of a string across columns... [email protected] Excel Worksheet Functions 9 July 19th 07 12:57 AM
counting the number of instances of a string within another string Keith R Excel Worksheet Functions 3 March 5th 07 06:54 PM
Counting specific character in text string Bob Excel Worksheet Functions 3 January 18th 07 08:44 PM


All times are GMT +1. The time now is 08:17 AM.

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"