+ Reply to Thread
Results 1 to 4 of 4

Caluculation of Formulas

  1. #1
    Registered User
    Join Date
    07-31-2016
    Location
    India
    MS-Off Ver
    2007
    Posts
    3

    Caluculation of Formulas

    Hello ,

    If any one can explain about the below calculation, Please let me know.


    =SQRT(1/B$5*SUM(OFFSET(Sheet1!$E$2,MATCH(Sheet1!$N3,Sheet1!$A$2:$A$504,1)-1,0,-B$5)))*SQRT(252)

    Please find the attachment regarding this.

    Thanks,
    Naidu.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Caluculation of Formulas

    Quote Originally Posted by naidu8978359996 View Post
    If any one can explain about the below calculation, Please let me know.
    Please Login or Register  to view this content.
    First, a style comment: 1/B$5*SUM(...) is somewhat ambiguous as to the author's intent. IMHO, it is better to write:
    Please Login or Register  to view this content.
    which is also slightly more efficient and potentially slightly more accurate numerically.

    -----

    It would help if you indicated exactly what it is about the formula that you do not understand.

    For example, is it the use of MATCH and OFFSET? Is it the multplication of SQRT(252)?

    The formula calculates the annualized standard deviation of daily (natural) log returns, which are the values in column Sheet1!E. It is a measure of volatility.

    The MATCH expression returns the row index (relative to row 2) of the closest date in column Sheet1!A before or equal to the date in Sheet1!N3.

    The notation $N3 means that we use N3, N4, N5 etc as we move down each column of formulas.

    In contrast, the notation $A$2:$A$504 means that we always use A2:A504 in each formula.

    The OFFSET expression returns the cell range of values (log returns) from column Sheet1!E corresponding to the last B5 (number of) dates ending with the relative row index returned by MATCH.

    The notation B$5 means that we use B5, C5, D5 etc as we move across each row of formulas.

    In contrast, the notation $E$2 means that we always use E2 in each formula.

    The expression SUM(...)/B$5 calculates the (population or exact) variance of the daily log returns referenced by OFFSET.

    The expression SQRT(SUM(...)/B$5) calculates the standard deviation of the daily log returns.

    The daily standard deviation is annualized by multiplying by SQRT(252) according to the "square root of time" rule, assuming 252 trade days per year (on average).

    -----

    The (population or exact) variance of a set of data is Sigma((x[i]-xhat)^2) / n, where x[i] is each of n data points, and xhat is the mean of the data. (The operation ^2 is the square of the calculation. Sigma is the sum of the calculations.)

    Ostensibly, the values (x[i]-xhat)^2 are calculated in column Sheet1!E, based on the calculation of x[i]-xhat in column Sheet1!D.

    However, the calculation in column Sheet1!D seems to be incorrect.

    At a minimum, the reference to J4 in Sheet1!D3 should probably be written $J$4, so that J4 is referenced in each formula down the column.

    Also, Sheet1!J4 should probably contain the formula =AVERAGE(C3:C510). [Errata]
    Last edited by joeu2004; 08-02-2016 at 11:00 AM. Reason: cosmetic; corrected variance definition; J4 errata

  3. #3
    Registered User
    Join Date
    07-31-2016
    Location
    India
    MS-Off Ver
    2007
    Posts
    3

    Re: Caluculation of Formulas

    Hello ,

    Thank you*so much for helping me out today.
    I spent lots of time to understand but could not get the logic behind this, now finally learnt the concept.
    Very easy to understand the way you explained and I will ask you if I have any doubts further.

    Thanks & Regards,
    Naidu.

  4. #4
    Registered User
    Join Date
    07-31-2016
    Location
    India
    MS-Off Ver
    2007
    Posts
    3

    Re: Caluculation of Formulas

    Quote Originally Posted by joeu2004 View Post
    First, a style comment: 1/B$5*SUM(...) is somewhat ambiguous as to the author's intent. IMHO, it is better to write:
    Please Login or Register  to view this content.
    which is also slightly more efficient and potentially slightly more accurate numerically.

    -----

    It would help if you indicated exactly what it is about the formula that you do not understand.

    For example, is it the use of MATCH and OFFSET? Is it the multplication of SQRT(252)?

    The formula calculates the annualized standard deviation of daily (natural) log returns, which are the values in column Sheet1!E. It is a measure of volatility.

    The MATCH expression returns the row index (relative to row 2) of the closest date in column Sheet1!A before or equal to the date in Sheet1!N3.

    The notation $N3 means that we use N3, N4, N5 etc as we move down each column of formulas.

    In contrast, the notation $A$2:$A$504 means that we always use A2:A504 in each formula.

    The OFFSET expression returns the cell range of values (log returns) from column Sheet1!E corresponding to the last B5 (number of) dates ending with the relative row index returned by MATCH.

    The notation B$5 means that we use B5, C5, D5 etc as we move across each row of formulas.

    In contrast, the notation $E$2 means that we always use E2 in each formula.

    The expression SUM(...)/B$5 calculates the (population or exact) variance of the daily log returns referenced by OFFSET.

    The expression SQRT(SUM(...)/B$5) calculates the standard deviation of the daily log returns.

    The daily standard deviation is annualized by multiplying by SQRT(252) according to the "square root of time" rule, assuming 252 trade days per year (on average).

    -----

    The (population or exact) variance of a set of data is Sigma((x[i]-xhat)^2) / n, where x[i] is each of n data points, and xhat is the mean of the data. (The operation ^2 is the square of the calculation. Sigma is the sum of the calculations.)

    Ostensibly, the values (x[i]-xhat)^2 are calculated in column Sheet1!E, based on the calculation of x[i]-xhat in column Sheet1!D.

    However, the calculation in column Sheet1!D seems to be incorrect.

    At a minimum, the reference to J4 in Sheet1!D3 should probably be written $J$4, so that J4 is referenced in each formula down the column.

    Also, Sheet1!J4 should probably contain the formula =AVERAGE(C3:C510). [Errata]
    Hello ,

    Thank you*so much for helping me out today.
    I spent lots of time to understand but could not get the logic behind this, now finally learnt the concept.
    Very easy to understand the way you explained and I will ask you if I have any doubts further.

    Thanks & Regards,
    Naidu.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 9
    Last Post: 12-04-2015, 05:19 PM
  2. Using Cell references in file paths for formulas to create dynamic formulas
    By MichaelStokesJr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-04-2013, 11:49 AM
  3. Replies: 5
    Last Post: 09-25-2013, 02:51 PM
  4. [SOLVED] VBA to enter various formulas every 10 rows and show dynamic formulas not values
    By faby2203 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-04-2013, 07:05 AM
  5. Caluculation for adding up cells if the cells are a certian colour
    By beaker28 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-22-2013, 07:48 AM
  6. Help modifying macro to wrap iferror formulas around existing formulas
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2012, 02:04 PM
  7. Replies: 5
    Last Post: 05-05-2008, 02:22 PM

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