Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 |
#3
|
|||
|
|||
Counting Expression in a Single formula
if always + then try this
=SUM(LEN(SUBSTITUTE(F10,"+","")))+1 -- Don Guillett SalesAid Software "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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide formula | Excel Worksheet Functions | |||
Can I create an IF formula for single cell w/ dif. text in Excel? | Excel Discussion (Misc queries) | |||
IF & VLOOKUP FORMULA | Excel Worksheet Functions | |||
Help with counting formula | Excel Discussion (Misc queries) | |||
Help with macro formula and variable | Excel Worksheet Functions |