+ Reply to Thread
Results 1 to 4 of 4

VBA Function to calculate Mean and Standard Deviation

  1. #1
    Registered User
    Join Date
    12-05-2007
    Posts
    16

    VBA Function to calculate Mean and Standard Deviation

    In 3 rows (B1:B3) and in 5151 columns (till column GPD) I got alle the combinations which sum up to 1. (Thanx for the help in an other thread).

    The first return I calculated in the following way.
    =MMULT(TRANSPOSE(B1:B3);H12:H14)-1

    The Standard Deviation is calculated in this way.
    =SQRT(MMULT(MMULT(TRANSPOSE(B1:B3);C24:E26);B1:B3))

    See attached excel sheet.

    It would be very helpful if a VBA script can be written which automatically calculates the 5151 returns and the 5151 standard deviation.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Divius,

    You state a worksheet formula to compute the SD. Why do you need VBA? Please be more clear when you post. I am sure this is why you haven't received an answer yet. You should also include a link back to your previous post so we can follow what you are doing. If you don't know how, just ask.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    12-05-2007
    Posts
    16
    I apologize for the some unclear things in my post.
    As there have to be calculated 5151 combinations with the given formula the
    given excel function doesn't work (there are too less resources availabe) to calculate all the value's.

    In this thread all the combinations can be fount, I converted these results to percentages.
    http://www.excelforum.com/showthread.php?t=625796.

    I thought A VBA script could handle these large amount of calculations.

    Thank you in advance.

  4. #4
    Registered User
    Join Date
    12-05-2007
    Posts
    16
    Oke let me simplify my question.

    Is there a way to calculate a VBA script which repeats the following formula for all possible combinations:
    =(C1*$H$13+C2*$H$14+C3*$H$15)-1

    I hope I made my question more clear.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1