+ Reply to Thread
Results 1 to 8 of 8

quarterly and yearly returns in vba

  1. #1
    Registered User
    Join Date
    02-28-2019
    Location
    amsterdam
    MS-Off Ver
    excel
    Posts
    4

    quarterly and yearly returns in vba

    I have monthly returns of 10 portfolios from 1927 till 2018. I already multiplied the percentages by 0,01 and calculated each month quarterly and yearly returns. The problem is however that in two consecutive months this gives results with overlapping observations (for instance March*April*May). Hence, I need to create a function in VBA to calculate those returns without overlapping observations. So that for instance quarterly returns are only on a quarterly basis (Jan-Mar)

    Hope anyone can help me out and thanks in advance!

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: quarterly and yearly returns in vba

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    02-28-2019
    Location
    amsterdam
    MS-Off Ver
    excel
    Posts
    4

    Re: quarterly and yearly returns in vba

    Thank you for your reply.

    Please see attached a sample workbook. In the "before" sheet is the data. First the percentages and next to that the percentages multiplied by 0,01
    In the "after" sheet are two examples of what I need. The compounded returns of those data but only per actual quarter and year, so jan, feb, mar and so on instead of feb, mar, apr.
    I alsno need a VBA code for yearly returns.

    I hope this clears it up a bit
    Attached Files Attached Files

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: quarterly and yearly returns in vba

    Which version of Excel are you using? This would be really simple using PowerPivot.

  5. #5
    Registered User
    Join Date
    02-28-2019
    Location
    amsterdam
    MS-Off Ver
    excel
    Posts
    4

    Re: quarterly and yearly returns in vba

    2016. Problem is that it needs to be a VBA function but I'm not that good in it at the moment. I know how to make a compund formula in VBA but not how to make sure that there are no overlapping observations. That is what I need in order to be able to perform a financial time series regression.

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: quarterly and yearly returns in vba

    I don't understand why it must be VBA...

    Attachment has a quick powerpivot model, which shows the compound return for each aggregate period (Quarter, Year). Of course, you can easily change the report layout to suit...
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-28-2019
    Location
    amsterdam
    MS-Off Ver
    excel
    Posts
    4

    Re: quarterly and yearly returns in vba

    Ah it is helpful, thank you! Reason a VBA code was requested is to make it more easily tranferable between various datasets but im not sure how to get it aggregated by using VBA....

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: quarterly and yearly returns in vba

    With PowerPivot, you could simply merge your datasets with an identifier, and switch them in the report...

+ 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. X axis Excel Quarterly/Yearly Chart Urgent
    By AK123 in forum Excel General
    Replies: 5
    Last Post: 02-24-2017, 08:33 AM
  2. Weekly, Monthly, Quarterly & Yearly Sales Dashboard
    By Neilesh Kumar in forum Excel General
    Replies: 0
    Last Post: 06-07-2016, 08:21 AM
  3. Replies: 3
    Last Post: 12-16-2014, 07:05 PM
  4. Calculate monthly, quarterly, and yearly averages from daily data
    By jhound in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-27-2013, 11:16 AM
  5. Making monthly, quarterly and yearly reports
    By donsveto in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-04-2013, 02:19 PM
  6. Quarterly or half yearly cash flow
    By sing_ideas in forum Excel General
    Replies: 1
    Last Post: 03-28-2012, 11:26 AM
  7. Replies: 5
    Last Post: 05-19-2008, 02:18 PM

Tags for this Thread

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