View Single Post
  #20   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Given that, it would be much more efficient to write something like:

Public Function RSD(rng As Excel.Range) As Variant
Dim dAvg As Double
Dim dStdDev As Double
On Error GoTo ErrHandler
With Application
dAvg = .Average(rng)
If dAvg = 0 Then
RSD = CVErr(xlErrDiv0)
Else
RSD = 100 * .StDev(rng) / dAvg
End If
End With
Resume_He
Exit Function
ErrHandler:
RSD = CVErr(xlErrValue) 'can get more sophisticated here
Resume Resume_Here
End Function




In article ,
"ASokolik" wrote:

I was hoping to be able to write a "quick" program that I could install as
an add-in on their machines so they could just type =RSD(cells) instead of

=stdev(cells)/average(cells)*100

which leaves lots of room for errors in remembering the function for
standard deviation and for mean. One function, easily titled RSD as it is
generally referred to, is much simpler to remember and enter than a 3-part
equation with two functions, each with names different than what they are
typically referred to.