Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
hsg hsg is offline
external usenet poster
 
Posts: 40
Default counting no. of times a character occurs in a cell

Can a function tell the number of times a particular character is occuring in
a text string in a particular cell?

A1 contains ABCD,ACDT,AKBL,BCDF,PIZQ

I would like to count no. of "commas" appearing (",") in this cell.

hellp appreciated, thanks

hsg
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default counting no. of times a character occurs in a cell

Try

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

Mike


"hsg" wrote:

Can a function tell the number of times a particular character is occuring in
a text string in a particular cell?

A1 contains ABCD,ACDT,AKBL,BCDF,PIZQ

I would like to count no. of "commas" appearing (",") in this cell.

hellp appreciated, thanks

hsg

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 257
Default counting no. of times a character occurs in a cell

VERY slick! I wouldn't have thought of that one.

--- "Mike H" wrote:
=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
hsg hsg is offline
external usenet poster
 
Posts: 40
Default count no. of commas in a cell

excellent!
Never figured it out that way!

Thanks Mike, Gary's student, Ashish


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
count no. of times a character occurs in a cell hsg Excel Worksheet Functions 2 March 24th 09 06:46 PM
Counting number of times a value occurs da Excel Discussion (Misc queries) 6 September 9th 08 03:51 PM
Counting the number of times more than 1 variable occurs chrisdedobb Excel Discussion (Misc queries) 5 January 3rd 06 06:20 PM
I would like to count the # of times a value occurs in Col B base shopaholic Excel Worksheet Functions 3 December 9th 05 04:25 PM
Counting the number of times a specific character appears in a cell PCLIVE Excel Worksheet Functions 3 November 4th 05 05:08 AM


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