+ Reply to Thread
Results 1 to 14 of 14

Help with calculating portfolio returns over rolling 30 yr periods

  1. #1
    Registered User
    Join Date
    11-10-2007
    MS-Off Ver
    365
    Posts
    46

    Help with calculating portfolio returns over rolling 30 yr periods

    Hi All

    Attached is workbook in which annual data for stocks, bonds and inflation. I'd like to calculate rolling 30 yr portfolio returns from 1928 thru 2019. The portfolio starts at 90% stocks and 10% bonds The bond portion starts increasing as shown starting in the 17th year. The portfolio starts with $1000 and an inflation adjusted $1000 is added each year. I've calculated the results for the first 30 year period. I don't know how to combine the rolling periods with the annual bond adjustments. Any help is greatly appreciated!

    Charlie
    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: Help with calculating portfolio returns over rolling 30 yr periods

    You are not calculating a "30yr rate of return", as the term is usually used. Instead, you are calculating an annual rate of return for each of the first 30 yrs.

    To that end, there is no need for a "rolling" formula. Simply copy the formula in G2 down the column. If you want to allow for inserting new rows after 2019, change the formula to:

    =IF(ISNUMBER(B2), D2*F2 + (1-F2)*E2, "")

    If you want a rolling 30yr rate of return (i.e. the cumulative return over 30 yrs), array-enter (press ctrl+shift+Enter instead of just Enter) the following formula into G2 (or G31) and copy down the column:

    =IF(COUNT(B2:B31)=30, PRODUCT(1 + D2:D31*F2:F31 + (1-F2:F31)*E2:E31) - 1, "")

    If want an average annual 30yr rate of return, array-enter the following formula into G2 and copy down the column:

    =IF(COUNT(B2:B31)=30, PRODUCT(1 + D2:D31*F2:F31 + (1-F2:F31)*E2:E31)^(1/30) - 1, "")

    or

    =IF(COUNT(B2:B31)=30, GEOMEAN(1 + D2:D31*F2:F31 + (1-F2:F31)*E2:E31) - 1, "")

  3. #3
    Registered User
    Join Date
    11-10-2007
    MS-Off Ver
    365
    Posts
    46

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    Thank you. I hope to know what the account balance is at the end of each 30 year period. 1928 thu 1957, 1929 thru 1959.... up to 2019. That's 62, 30 yr periods. The portfolio is 90/10 stock/bond for the first 15 years of each 30 year period. The bond portion then increases by 2.667 percentage points until the portfolio reaches 50/50 in year 30. Each 30 year period starts with $1000. Each year an inflation adjusted $1000 (real dollars) is added. Those cash flows simulate what a worker might save over time and will highlight the impact the annual return has on the portfolio as it grows over time. (money weighted return?)

    At my level, I would have to copy columns F thru I 62 times.

    Thank you for any help.

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

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    I believe I understand what you want: a single formula that would do the 30yr calculation for a given starting year 1928, 1929, etc.

    I cannot think of a formula construct that allows us to copy it down a column. Perhaps someone more clever than I can offer an Excel solution.

    I would write the following VBA function (UDF).

    Please Login or Register  to view this content.
    The attached Excel file demonstrates its use. Enter the following formula into M2, then copy down the column:

    =totalreturn(1000, B2, $B$2:$E$93, $F$2:$F$31)

    For a proof of concept, columns J, K and L demonstrate how I would calculate the year-by-year cumulative total for each of the first three 30yr periods starting in 1928, 1929 and 1930.

    Compare column J with your column I. Column N compares each of the totals returned from the VBA function with the end of columns J, K and L.

    -----

    Some unrelated obvservations....

    1. The total return over 30 yrs that you calculate is based on the time-weighted return (TWR or TWRR), not a money-weighted (sic) return like the IRR. IMHO, both terms are misnomers; and at best, they are reversed. But so be it.

    2. You are decreasing the %stock by 2.666667%, not 2.667% (sic). Neither is correct. I would decrease by 40%/15 = 8%/3, rather than an approximation of it. Then the final %stock is indeed 50.0000000000001% instead of 49.999995%. (The infinitesimal 0.0000000000001% is an anomaly of binary floating-point arithmetic.) Arguably, using 8%/3 does not make a significant difference in your example. But it might affect other examples. The point is: avoid approximations when you can calculate an exact amount, unless your process mandates an approximation rounded to a some precision. (But in that case, pick one, not two.)
    Attached Files Attached Files
    Last edited by joeu2004; 05-18-2020 at 01:11 PM. Reason: attachment; annoated VBA function

  5. #5
    Registered User
    Join Date
    11-10-2007
    MS-Off Ver
    365
    Posts
    46

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    Thank you for taking so much time to help! What are the values in M? They don't match J-K. I tried to decipher the VBA but failed

    Charlie in Maryland

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

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    Quote Originally Posted by lc130 View Post
    What are the values in M? They don't match J-K. I tried to decipher the VBA but failed
    Sorry about that. First, I added some comments in the posting here, but I neglected to put them into the Excel file. Second, I have now embellished the comments in both.

    So please download the Excel file again. And I hope the comments help you decipher the VBA code.

    Essentially, the VBA function emulates the calculations in columns J, K and L, which are examples. Column J emulates your original calculations in column I.

    (Note: With column M, columns H:L can be deleted, as well as columns N:O.)

    Column M is intended to be the "rolling 30yr total return" that you wanted, I believe.

    For example, M2 is the 30yr total return for 1928-1957 (rows 2:31). In a single formula, it emulates the calculations in I2:I31 (and J2:J31). Thus, M2 should equal I31. And it does, as demonstrated in N2.

    Likewise, M3 is the 30yr total return for 1929-1958 (rows 3:32). It emulates the calculations in K3:K32. M3 should and does equal K32, as demonstrated in N3.

    And M4 is the 30y total return for 1930-1959 (rows 3:33). It emulates the calculations in L4:L33. M4 should and does equal L33, as demonstrated in N4.

    M5 is the 30y total return for 1931-1960. M6 is the 30yr total return for 1932-1961. Etc.

    Note: M65 is the 29yr total return for 1991-2019 (rows 65:93), not a 30yr total return, simply because there only 29 yrs remaining. Likewise, M66 is the 28yr total return for 1992-2019 (rows 66:93). Etc.

    If you would prefer to calculate only 30yr total returns, change the formula in M2 to the following and copy down the column:

    =IF(COUNT(B2:B31)=30, totalreturn(1000, B2, $B$2:$E$93, $F$2:$F$31), "")

    Thus, M65:M93 will appear blank. (Actually, their value is the null string "".)

    Is that more clear? Any questions?

    Does the totalReturn VBA function do what you want? If not, what did I misunderstand?

    Regardless, is a VBA solution acceptable? Again, I cannot imagine an Excel-only solution. But someone else might.
    Last edited by joeu2004; 05-18-2020 at 03:40 PM.

  7. #7
    Registered User
    Join Date
    11-10-2007
    MS-Off Ver
    365
    Posts
    46

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    Got it! Many thanks. The goal was to test a generic target date retirement mutual fund to a static 80/20 stock bond mix. That mix is always 80/20 and gets the same inflation adjusted cash flows.
    I thought I could do the 80/20 myself but now realize I cant. While you've already done too much, can I convince you to add that 80/20? Also, I'd like to send you an Amazon gift card but need a number to text to or email address. Please private message me that info.

    Thank you

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

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    I'm not sure I understand the problem or the difficulty. See the 80-20 worksheet in the attached Excel file.

    I think we just create a new column of %stock (all 80%) in column I, and enter the following formula in to J2 and copy down:

    =totalreturn(1000, $A2, $A$2:$D$93, I$2:I$31)

    I made a few adjustments in the original design, eliminating unnecessary columns.

    By comparison, the original column of %stock (90% to 50%) is in column F, and the original formula is in G2 and copied down, to wit:

    =totalreturn(1000, $A2, $A$2:$D$93, F$2:F$31)

    I have included a chart that "compares" the two rolling 30yr outcomes visually.

    (Note: Remember that the total returns for 1991 through 2019 are not for a full 30 yrs.)
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-10-2007
    MS-Off Ver
    365
    Posts
    46

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    I can't thank you enough! You're fortunate to have this talent. I'm not at all familiar with VBA. Not even sure I can spell VBA.

    Charlie
    helpless in Maryland.

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

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    Quote Originally Posted by lc130 View Post
    I'm not at all familiar with VBA. Not even sure I can spell VBA
    VBA is spelled V-B-A. Hey, we're here to help.

  11. #11
    Registered User
    Join Date
    11-10-2007
    MS-Off Ver
    365
    Posts
    46

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    Follow up please... if I wanted to see portfolio returns net of inflation (real returns) would I simply add -vHist(i, 2) to the portRtn line?

    portRtn = vHist(i, 3) * vPctStk(j, 1) + vHist(i, 4) * (1 - vPctStk(j, 1)) - vHist(i, 2) ???

    Seems like it worked but I'm seldom lucky.

    Thank you

    Charlie

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

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    [.... deleted by me; premature ....]
    Last edited by joeu2004; 05-19-2020 at 04:06 PM.

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

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    Quote Originally Posted by lc130 View Post
    if I wanted to see portfolio returns net of inflation (real returns) would I simply add -vHist(i, 2) to the portRtn line?
    Inflation gives me a headache. I defer to the explanation at https://www.investopedia.com/terms/i...ted_return.asp .

    The changes are highlighted in red below. See the attached Excel file.

    Please Login or Register  to view this content.
    I assume that you might want to calculate both the actual and the inflation-adjusted total returns. So I added an optional parameter (adjRtn). It defaults to FALSE, the actual total return.

    In the attached Excel file, column K is the rolling 30yr inflation-adjusted total return. Column J is the original (actual) rolling 30yr total return. The formulas are:

    J2: =totalreturn(1000, $A2, $A$2:$D$93, I$2:I$31)

    K2: =totalreturn(1000, $A2, $A$2:$D$93, I$2:I$31, TRUE)

    I include a chart that "compares" the two results.

    -----

    There is an issue that I struggled with. I decided to implement the easy answer.

    The question is: which inflation rate applies to the year-end portfolio rate of return (portRtn)?

    The contribution at the beginning of each year is the previous-year contribution adjusted by the current-year inflation rate -- except for the first year, which is not adjusted.

    Similarly, in my design, the year-end portfolio rate of return is (optionally) adjusted by the current-year inflation rate -- including the first year.

    Arguably, the year-end portfolio rate should be (optionally) adjusted by the next-year inflation rate.

    But in that case, we do not have sufficient information to adjust the portfolio rate of return when the last year is 2019.

    What do you think?
    Attached Files Attached Files
    Last edited by joeu2004; 05-19-2020 at 06:43 PM.

  14. #14
    Registered User
    Join Date
    11-10-2007
    MS-Off Ver
    365
    Posts
    46

    Re: Help with calculating portfolio returns over rolling 30 yr periods

    Interesting question concerning inflation timing. Not sure if there's an agreed upon convention. I'll have to defer to Yale Prof. Robert Shiller's online data of US Stock Mkts 1871-Present here http://www.econ.yale.edu/~shiller/data.htm. This is the data used for his CAPE 10 ratio. In adjusting the SP 500 price level for a given month he uses the CPI level reported for that month. Shiller won the Nobel in 2013 and one finance author described his spreadsheet as the most downloaded in the world. I'll take it as correct.

    I used your spreadsheet data for a writeup that I'll post on my website http://atlanticfinancialplan.com/. I may expand it and try to get it published in the non-peer reviewed NAPFA Advisor. If successful I'll then ask if you want programming credit in the article.
    Thank you!
    Attached Files Attached Files

+ 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. Standard Deviation, Portfolio Returns Shortcuts
    By davidvanpatten in forum Excel General
    Replies: 2
    Last Post: 06-16-2015, 03:49 AM
  2. [SOLVED] Rolling 12 month return by portfolio using product(if()) array
    By spcw in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-21-2014, 04:47 PM
  3. [SOLVED] How to calculate a rolling average over X periods
    By Johnex777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-03-2013, 10:37 AM
  4. Comparing attendance occurrences with rolling periods
    By amybrown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-07-2012, 01:19 AM
  5. Performance of a stock over 20 day rolling periods
    By yamar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2009, 04:26 AM
  6. Rolling Time Periods
    By mttlltt75 in forum Excel General
    Replies: 4
    Last Post: 06-13-2008, 09:46 AM
  7. average rolling periods
    By RobPatrick in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2007, 05:26 AM

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