Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default stupid count question

Hi
I have searched the forums and Google w/ no luck. Please help this is such a
basic question that I cannot find the answer.

1.) I only have 1 cell (say A1) with multiple values (e.g.
=123+125+125+....) which gives me a total of 373.

2.) In cell A2 only want to count the numbers with in cell A1 (e.g. 3) would
be the answer.

3.) I do not want to use the =(Count(value1,value2,....). Because then I
would have to enter the numbers in twice. I realize it is like the text
count idea, but cannot figure out how to cross implement the idea.

Thanks
Rich
--
Love programming but suck at it. Thanks for your help. Maybe I ought to
think of doing something else!!!!!!!
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default stupid count question

The number of items in the example formula is the number of "+" signs plus
one. First enter the following UDF:

Function formla(r As Range) As String
formla = r.Formula
End Function

If your formula is in A1, then in another cell:

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

--
Gary''s Student - gsnu200795


"Rich31730" wrote:

Hi
I have searched the forums and Google w/ no luck. Please help this is such a
basic question that I cannot find the answer.

1.) I only have 1 cell (say A1) with multiple values (e.g.
=123+125+125+....) which gives me a total of 373.

2.) In cell A2 only want to count the numbers with in cell A1 (e.g. 3) would
be the answer.

3.) I do not want to use the =(Count(value1,value2,....). Because then I
would have to enter the numbers in twice. I realize it is like the text
count idea, but cannot figure out how to cross implement the idea.

Thanks
Rich
--
Love programming but suck at it. Thanks for your help. Maybe I ought to
think of doing something else!!!!!!!

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default stupid count question

Hi and thank you,
I entered the function into vba under the "general declartations" heading
for the given sheet.
1.) when entered in vba changes the r.Formula to r.formula then when I place
the given formula =LEN(formla(A1))-LEN(SUBSTITUTE(formla(A1),"+",""))+1
into cell A2.

I get a "#NAME?" error. What am I doing wrong

--
Love programming but suck at it. Thanks for your help. Maybe I ought to
think of doing something else


"Gary''s Student" wrote:

The number of items in the example formula is the number of "+" signs plus
one. First enter the following UDF:

Function formla(r As Range) As String
formla = r.Formula
End Function

If your formula is in A1, then in another cell:

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

--
Gary''s Student - gsnu200795


"Rich31730" wrote:

Hi
I have searched the forums and Google w/ no luck. Please help this is such a
basic question that I cannot find the answer.

1.) I only have 1 cell (say A1) with multiple values (e.g.
=123+125+125+....) which gives me a total of 373.

2.) In cell A2 only want to count the numbers with in cell A1 (e.g. 3) would
be the answer.

3.) I do not want to use the =(Count(value1,value2,....). Because then I
would have to enter the numbers in twice. I realize it is like the text
count idea, but cannot figure out how to cross implement the idea.

Thanks
Rich
--
Love programming but suck at it. Thanks for your help. Maybe I ought to
think of doing something else!!!!!!!

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default stupid count question

The error indicates that the UDF is in the wrong place.

Erase it first, so we will not have two copies.


UDFs are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the UDF will be saved with it.

To use the UDF from the normal Excel window, just enter it like a normal
Excel Function

To remove the UDF:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about UDFs, see:

http://www.cpearson.com/excel/Writin...ionsInVBA.aspx


--
Gary''s Student - gsnu200795


"Rich31730" wrote:

Hi and thank you,
I entered the function into vba under the "general declartations" heading
for the given sheet.
1.) when entered in vba changes the r.Formula to r.formula then when I place
the given formula =LEN(formla(A1))-LEN(SUBSTITUTE(formla(A1),"+",""))+1
into cell A2.

I get a "#NAME?" error. What am I doing wrong

--
Love programming but suck at it. Thanks for your help. Maybe I ought to
think of doing something else


"Gary''s Student" wrote:

The number of items in the example formula is the number of "+" signs plus
one. First enter the following UDF:

Function formla(r As Range) As String
formla = r.Formula
End Function

If your formula is in A1, then in another cell:

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

--
Gary''s Student - gsnu200795


"Rich31730" wrote:

Hi
I have searched the forums and Google w/ no luck. Please help this is such a
basic question that I cannot find the answer.

1.) I only have 1 cell (say A1) with multiple values (e.g.
=123+125+125+....) which gives me a total of 373.

2.) In cell A2 only want to count the numbers with in cell A1 (e.g. 3) would
be the answer.

3.) I do not want to use the =(Count(value1,value2,....). Because then I
would have to enter the numbers in twice. I realize it is like the text
count idea, but cannot figure out how to cross implement the idea.

Thanks
Rich
--
Love programming but suck at it. Thanks for your help. Maybe I ought to
think of doing something else!!!!!!!

  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default stupid count question

Hi again and thanks for the reply.
Had to start all over and it worked fine and thank you very much.
Rich


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
big stupid question Wu Excel Discussion (Misc queries) 4 May 17th 08 05:33 PM
Stupid Question Justin Kreamer Excel Discussion (Misc queries) 1 May 2nd 08 07:47 AM
Probably a Stupid Question Paige Excel Discussion (Misc queries) 10 February 4th 08 06:52 PM
stupid question Kimberly New Users to Excel 4 May 18th 07 08:55 PM
Stupid Question mastermind Excel Worksheet Functions 1 August 5th 06 07:03 PM


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