Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
GarrettD78
 
Posts: n/a
Default Counting Expression in a Single formula

I am trying to figure out a way to count up the number of expressions in a
formula that was created. So for example

=8+10+44+53

This would give me 4. Seems like you should be able to do it but I am not
sure how. Thanks in advance
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default Counting Expression in a Single formula

I gave a simple UDF the other day that works for simple + delimiters

Function CountList(rng As Range, Optional delimiter As String = "+")
Dim arg
If rng.Count 1 Then
CountList = CVErr(xlErrRef)
Else
arg = Split(rng.Formula, delimiter)
CountList = UBound(arg) - LBound(arg) + 1
End If
End Function



--

HTH

RP
(remove nothere from the email address if mailing direct)


"GarrettD78" wrote in message
...
I am trying to figure out a way to count up the number of expressions in a
formula that was created. So for example

=8+10+44+53

This would give me 4. Seems like you should be able to do it but I am not
sure how. Thanks in advance



  #4   Report Post  
GarrettD78
 
Posts: n/a
Default Counting Expression in a Single formula

Thanks. That was perfect

"Bob Phillips" wrote:

I gave a simple UDF the other day that works for simple + delimiters

Function CountList(rng As Range, Optional delimiter As String = "+")
Dim arg
If rng.Count 1 Then
CountList = CVErr(xlErrRef)
Else
arg = Split(rng.Formula, delimiter)
CountList = UBound(arg) - LBound(arg) + 1
End If
End Function



--

HTH

RP
(remove nothere from the email address if mailing direct)


"GarrettD78" wrote in message
...
I am trying to figure out a way to count up the number of expressions in a
formula that was created. So for example

=8+10+44+53

This would give me 4. Seems like you should be able to do it but I am not
sure how. Thanks in advance




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
Hide formula skateblade Excel Worksheet Functions 10 October 15th 05 08:36 PM
Can I create an IF formula for single cell w/ dif. text in Excel? bennymichael Excel Discussion (Misc queries) 1 July 21st 05 08:59 PM
IF & VLOOKUP FORMULA taxmom Excel Worksheet Functions 3 March 2nd 05 04:35 PM
Help with counting formula Ian Excel Discussion (Misc queries) 1 January 7th 05 11:25 AM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 02:27 AM


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