Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default I need to count occurr. of the character "," in a single cell

i need a formula to count the occurence of the comma character (",") in a
single cell. That's the easiest way I can think of to count dates that are
exported into a single excel file. I know I could use the text to column
function and use "," as the delimiter and then count the cells, but there are
a lot of dates and I might run out of columns.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default I need to count occurr. of the character "," in a single cell

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


"orchid11652" wrote:

i need a formula to count the occurence of the comma character (",") in a
single cell. That's the easiest way I can think of to count dates that are
exported into a single excel file. I know I could use the text to column
function and use "," as the delimiter and then count the cells, but there are
a lot of dates and I might run out of columns.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default I need to count occurr. of the character "," in a single cell

On Mar 21, 2:47 pm, orchid11652
wrote:
i need a formula to count the occurence of the comma character (",") in a
single cell. That's the easiest way I can think of to count dates that are
exported into a single excel file. I know I could use the text to column
function and use "," as the delimiter and then count the cells, but there are
a lot of dates and I might run out of columns.


Since you are trying to count the data that the commas separate, you
need to add 1 to the formula that Teethless Mama proposed. One way
would be with this formula:

=LEN(A1)-LEN(SUBSTITUTE(A1,",",E1)) + ISNUMBER(SEARCH(",", A1))

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default I need to count occurr. of the character "," in a single cell

Thank you. I'll try it.

"Kevin Vaughn" wrote:

On Mar 21, 2:47 pm, orchid11652
wrote:
i need a formula to count the occurence of the comma character (",") in a
single cell. That's the easiest way I can think of to count dates that are
exported into a single excel file. I know I could use the text to column
function and use "," as the delimiter and then count the cells, but there are
a lot of dates and I might run out of columns.


Since you are trying to count the data that the commas separate, you
need to add 1 to the formula that Teethless Mama proposed. One way
would be with this formula:

=LEN(A1)-LEN(SUBSTITUTE(A1,",",E1)) + ISNUMBER(SEARCH(",", A1))


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default I need to count occurr. of the character "," in a single cell

Thank you - I'll try it out.

"Teethless mama" wrote:

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


"orchid11652" wrote:

i need a formula to count the occurence of the comma character (",") in a
single cell. That's the easiest way I can think of to count dates that are
exported into a single excel file. I know I could use the text to column
function and use "," as the delimiter and then count the cells, but there are
a lot of dates and I might run out of columns.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default I need to count occurr. of the character "," in a single cell

On Mar 22, 2:54 pm, "Kevin Vaughn" wrote:
On Mar 21, 2:47 pm, orchid11652

wrote:
i need a formula to count the occurence of the comma character (",") in a
single cell. That's the easiest way I can think of to count dates that are
exported into a single excel file. I know I could use the text to column
function and use "," as the delimiter and then count the cells, but there are
a lot of dates and I might run out of columns.


Since you are trying to count the data that the commas separate, you
need to add 1 to the formula that Teethless Mama proposed. One way
would be with this formula:

=LEN(A1)-LEN(SUBSTITUTE(A1,",",E1)) + ISNUMBER(SEARCH(",", A1))


I realized on Saturday that this is incorrect where there is only one
item in A1. More appropriate would have been something like this:
=LEN(A1)-LEN(SUBSTITUTE(A1,",",E1)) + (A1<"")
Sorry about that, Chief!

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
Does the cell contain the character "-" within the string? Eric Excel Discussion (Misc queries) 4 December 3rd 06 03:46 PM
bunch of "yes" or "no" entered in row, output 1 if a single yes dan2201 Excel Worksheet Functions 9 September 7th 06 05:05 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Change data in a single column from "last, first" to "first last" Jeanne Excel Discussion (Misc queries) 2 March 27th 06 08:40 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


All times are GMT +1. The time now is 08:42 PM.

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"