Re: Square Root in VBA

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Lucy,

It appears to me that your problem is more about finding the standard
deviation via the variance. If that is the case, read on.

Depending on what you are doing, it is possible to derive the standard
deviation from the variance using a matrix and row construct with MMULT
and the TRANSPOSE function.

But to get your FUNCTION to work, first re-write it thus:

Function test1( RegionR, CovarMatrix) As Variant
test1 =
Application.MMult(Application.MMult(RegionR, CovarMatrix),
Application.Transpose(RegionR))
End Function

where, *RegionR * is a Row range and *CovarMatrix* is a Square matrix
range. Then, supposing RegionR="A1:A3" and CovarMatrix = "E1:J6", the
following *entered as an ARRAY* will return the variance (the *square
root* of which yields the standard deviation)


=Test1(A1:A3,E1:J6) Control+Shift+Enter


As hinted by earlier posts, the SQR function will simply convert the
variance to standard deviation.


HTH,

David


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=20645
View this thread: http://www.excelforum.com/showthread.php?threadid=483954

.



Relevant Pages

  • Re: How to fit normal distribution to histogram
    ... How to fit normaldistribution to histogram based its mode ... deviation). ... is), for variance, find the area around the mean which is about 68% of total ... this gives you 2 standard deviations as measured on the x-axis under ...
    (comp.soft-sys.matlab)
  • Re: How do I do recursive rolling average and variance fast?
    ... Study my variance filter demo and write back if you have any questions ... % Demo to take the local mean, variance, and standard deviation ... title('Original Image', 'FontSize', fontSize); ...
    (comp.soft-sys.matlab)
  • Re: F-test: Varying standard deviations for populations in a 2 way ANOVA
    ... the populations are normally distributed. ... deviation values for each: ... similar standard deviations for each population. ... ANOVA is quite robust to departures from homogeneity of variance, ...
    (sci.stat.math)
  • Re: Sample Size and Standard Deviation
    ... I'm trying to calculate the accumulated return history and standard ... deviation of mutual funds which have only been around since 1993, ...  A portfolio which is held in a taxable account and; ...  A portfolio which is split between a taxable account and a tax- ...
    (sci.stat.math)
  • Sample Size and Standard Deviation
    ... I'm trying to calculate the accumulated return history and standard ... deviation of mutual funds which have only been around since 1993, ... A portfolio which is held in a taxable account and; ... A portfolio which is split between a taxable account and a tax- ...
    (sci.stat.math)