View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Average of a string containing multiple values

I guess I should've also timed the array formula for a true comparison...

Average calc time of 5 tests on a single cell.

A1 = 10 10 10 40

Ron's UDF = 0.000310
Rick's UDF = 0.000362
Biff's array = 0.000968

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Ron's is slightly faster.

Average calc time of 5 tests on a single cell.

A1 = 10 10 10 40

Ron's = 0.000310
Rick's = 0.000362

--
Biff
Microsoft Excel MVP


"Rick Rothstein" wrote in message
...
To Ron
===========
You know me and one-liners... see below for an even simpler (well, at
least
shorter) UDF. <g

To Peter
===========
Install this UDF using the same instructions Ron gave you for his UDF...

Function AvgString(S As String) As Double
AvgString = Evaluate("=AVERAGE(" & Replace(S, " ", ",") & ")")
End Function

But is it faster?


I'm not sure, but my gut says no, it is not faster; however, for the size
strings I think will be passed into it, I believe the time difference
would be negligible.

--
Rick (MVP - Excel)