#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Krista
 
Posts: n/a
Default Count ; in cell

I've got another software program that will be filling a cell in Excel based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Count ; in cell

Try this:

For a value in A1
B1: =LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+1

That formula counts the semicolons in cell A1 and adds 1 to the total

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Krista" wrote:

I've got another software program that will be filling a cell in Excel based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Count ; in cell

=LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+1

what if there are no semicolons, do you want 0 + 1 or 0 only, for the former
the above formula works, for the latter

=LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+ISNUMBER(FIND(";",A1))

which will work for the former as well


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com


"Krista" wrote in message
...
I've got another software program that will be filling a cell in Excel
based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Krista
 
Posts: n/a
Default Count ; in cell

Perfect -- Thanks much!
--
Krista


"Peo Sjoblom" wrote:

=LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+1

what if there are no semicolons, do you want 0 + 1 or 0 only, for the former
the above formula works, for the latter

=LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+ISNUMBER(FIND(";",A1))

which will work for the former as well


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com


"Krista" wrote in message
...
I've got another software program that will be filling a cell in Excel
based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Count ; in cell

One more variation:

=LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+(A1<"")

If you have
Schaumburg
in a cell by itself.



Krista wrote:

I've got another software program that will be filling a cell in Excel based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Krista
 
Posts: n/a
Default Count ; in cell

I guess there is one more thing ... I do still want it to +1 if there is one
item in A1, which would not have any ; ... however, I want the value to be
blank if A1 is also blank ... if possible.

Thanks!

--
Krista


"Krista" wrote:

Perfect -- Thanks much!
--
Krista


"Peo Sjoblom" wrote:

=LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+1

what if there are no semicolons, do you want 0 + 1 or 0 only, for the former
the above formula works, for the latter

=LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+ISNUMBER(FIND(";",A1))

which will work for the former as well


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com


"Krista" wrote in message
...
I've got another software program that will be filling a cell in Excel
based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Krista
 
Posts: n/a
Default Count ; in cell

No, that doesn't help because if I have Schaumburg in the field I do still
want it to +1. I'm now looking for what it should be if the field is blank
so it returns blank.

Thanks.
--
Krista


"Dave Peterson" wrote:

One more variation:

=LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+(A1<"")

If you have
Schaumburg
in a cell by itself.



Krista wrote:

I've got another software program that will be filling a cell in Excel based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Count ; in cell

Per your second request...

Try this:
B1: =IF(A1="","",LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Ron Coderre" wrote:

Try this:

For a value in A1
B1: =LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+1

That formula counts the semicolons in cell A1 and adds 1 to the total

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Krista" wrote:

I've got another software program that will be filling a cell in Excel based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Krista
 
Posts: n/a
Default Count ; in cell

Yes, thank you!
--
Krista


"Ron Coderre" wrote:

Per your second request...

Try this:
B1: =IF(A1="","",LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Ron Coderre" wrote:

Try this:

For a value in A1
B1: =LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+1

That formula counts the semicolons in cell A1 and adds 1 to the total

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Krista" wrote:

I've got another software program that will be filling a cell in Excel based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Count ; in cell

This should return 0 if A1 is empty. But it'll return 1 if you only have a
single city name in A1.

Krista wrote:

No, that doesn't help because if I have Schaumburg in the field I do still
want it to +1. I'm now looking for what it should be if the field is blank
so it returns blank.

Thanks.
--
Krista

"Dave Peterson" wrote:

One more variation:

=LEN(A1)-LEN(SUBSTITUTE(A1,";",""))+(A1<"")

If you have
Schaumburg
in a cell by itself.



Krista wrote:

I've got another software program that will be filling a cell in Excel based
on a multi-select drop-down list. The Excel cell could read

Algonquin;Bloomingdale;Burr Ridge

I'm trying to count the occurrences of ; in that cell then add 1 to get a
total of the number of drop-down selections made from the other program.

The value that I'm looking for here in this example is 3. I've tried
everything that I know to no avail.

Thanks much in advance!!!
--
Krista


--

Dave Peterson


--

Dave Peterson
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
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
Count # of A's in a Cell JavyD Excel Worksheet Functions 0 February 6th 06 09:31 PM
Cell Count bombayterror New Users to Excel 2 January 21st 06 09:33 PM
Count on cell for each time it is changed Jelinek Excel Discussion (Misc queries) 3 January 9th 06 02:22 PM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM


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