+ Reply to Thread
Results 1 to 26 of 26

Rolling Calculation

  1. #1
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Rolling Calculation

    Hi everyone.

    I've provided an example of what I'm trying to achieve. Each month new revenue is added and I have to constantly shift my formulas over to compare month over month, year over year, compared to 6 months, and 12 months in columns W-Z. Is there a way to automate when new month data is added to shift the formulas over?
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    In W3:

    =LET(t,TAKE(FILTER(B3:V3,B3:V3<>""),,-2),IFERROR((TAKE(t,,-1)-TAKE(t,,1))/ABS(TAKE(t,,1)),"N/A"))

    In X3:

    =LET(t,TAKE(FILTER(B3:V3,B3:V3<>""),,-2),IFERROR((TAKE(t,,-1)-B3)/ABS(B3),"N/A"))

    In Y3:

    =LET(t,TAKE(FILTER(B3:V3,B3:V3<>""),,-7),IFERROR((TAKE(t,,-1)-(AVERAGE(TAKE(t,,6))))/AVERAGE(TAKE(t,,6)),"N/A"))

    In Z3:

    =LET(t,TAKE(FILTER(B3:V3,B3:V3<>""),,-13),IFERROR((TAKE(t,,-1)-(AVERAGE(TAKE(t,,12))))/AVERAGE(TAKE(t,,12)),"N/A"))
    Attached Files Attached Files
    Last edited by AliGW; 09-12-2023 at 09:54 AM. Reason: Workbook added.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    Any good to you?

  4. #4
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    AliGW thank you so much! I've checked these and the only one that seems to be off is X3. For example, when August data is added, it is now comparing August 2023 to July 2022, and it should be comparing to August 2022.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Rolling Calculation

    One formula, W3, copied down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Rolling Calculation

    I forgot to add... delete ALL expected results first!!

  7. #7
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    Thank you Glenn, this is great! However I am noticing that it isn't working quite correct when there are blank values or negative values in certain months. In my original calculations I am dividing by ABS value to get accurate numbers and to also show NA when there are blanks. Let me know if this is still possible with your method.
    Last edited by ZDR23; 09-12-2023 at 02:51 PM.

  8. #8
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    @AliGW is there a way to fix X3. For example, when August data is added, it is now comparing August 2023 to July 2022, and it should be comparing to August 2022.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Rolling Calculation

    Show what you mean in a sample sheet.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    Yes, try this:

    =LET(t,TAKE(FILTER(B3:V3,B3:V3<>""),,-13),IFERROR((TAKE(t,,-1)-TAKE(t,,1))/ABS(TAKE(t,,1)),"N/A"))
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    Glenn, example attached. Discrepancies shown in orange between the original calculation and the formula driven one.
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    See post #10.

  13. #13
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    AliGW take a look at attached. The bottom table is using your formulas. It doesn't like when there are blank values.
    Attached Files Attached Files

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    Were there blank values in the original sample file? No - so before I look, is there anything else that needs considering?

    Easiest if you just add 0s to those blank cells.
    Attached Files Attached Files
    Last edited by AliGW; 09-13-2023 at 10:58 AM.

  15. #15
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    No sorry there weren't any in the original sample file. I was just testing in my real data set and noticed this. So no, there is nothing else that needs considering.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    So just make sure those cells are populated with 0 instead of blank. Otherwise it means a complete formula rewrite ... Full disclosure in future, please! Otherwise you are effectively wasting our time.

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  18. #18
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    Yea thanks I'm just waiting on additional feedback from Glenn before I mark the thread as solved. And I've already added reputation for you both.

  19. #19
    Forum Contributor
    Join Date
    10-22-2022
    Location
    Santa Cruz, Bolivia
    MS-Off Ver
    MSO 365
    Posts
    149

    Re: Rolling Calculation

    hi there, I allow to propose this alternative solution that spills all the expected results:

    Please Login or Register  to view this content.
    I hope it resuls useful.

    Example (Alternative Solution).xlsx

  20. #20
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    Thanks alot ExceLogan! Your formula works great with blank values and negative values. The only one that's not computing correctly is Column X "PY". When new month data is added is doesn't shift over to the new month to compare to. For example, when I added data into Sept 2023, it should compare to Sept 2022.

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    Regarding your PM to me, the way to resolve the issue is in post #16 in this thread. Give me one good reason why those cells should not contain 0s.

  22. #22
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    One great reason is that the source of my data has it as a blank and not a 0. I'm talking thousands of rows of data that I copy and paste into my template. So instead of me changing them all to 0's, I might as well stick to my original calculation and manually shift my formulas.

  23. #23
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    Select just the the populated columns - Home ribbon - Find & Replace - leave the Find box blank and put 0 into the Replace box - Replace All - done. Twenty seconds, maybe???

  24. #24
    Registered User
    Join Date
    12-13-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    365
    Posts
    23

    Re: Rolling Calculation

    I'm aware of how to use find & replace. The purpose of me seeking assistance within this forum is to eliminate having to do such things.

    Given that I didn't provide all scenarios, my bad. Thanks anyway.

  25. #25
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: Rolling Calculation

    Well, I am not aware of what you are and are not aware of, but I'd have thought that it would be easy to use on your data.

    The problem with the formula approach is that Excel sees all blank cells as equal, so telling it what to include and what not to include becomes very tricky in your scenario. I spent quite some time trying to overcome it and couldn't, hence my advice.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  26. #26
    Forum Contributor
    Join Date
    10-22-2022
    Location
    Santa Cruz, Bolivia
    MS-Off Ver
    MSO 365
    Posts
    149

    Re: Rolling Calculation

    Quote Originally Posted by ZDR23 View Post
    Thanks alot ExceLogan! Your formula works great with blank values and negative values. The only one that's not computing correctly is Column X "PY". When new month data is added is doesn't shift over to the new month to compare to. For example, when I added data into Sept 2023, it should compare to Sept 2022.
    hi ZDR23, try with this formula:

    Please Login or Register  to view this content.
    I hope it results useful.

+ 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. 12 month rolling calculation
    By debony in forum Excel General
    Replies: 5
    Last Post: 11-06-2019, 01:19 PM
  2. Rolling AFR calculation
    By Callingavan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-15-2013, 05:57 AM
  3. Rolling Depreciation Calculation
    By BW78 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-19-2013, 04:47 PM
  4. Rolling weeks calculation
    By portucale in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-23-2012, 07:21 AM
  5. [SOLVED] Rolling Calculation
    By Northumberland81 in forum Excel General
    Replies: 3
    Last Post: 06-05-2012, 07:18 AM
  6. Excel 2008 : YTD Rolling calculation
    By samjam in forum Excel General
    Replies: 0
    Last Post: 07-25-2011, 01:20 PM
  7. Rolling calculation
    By tanksalevikrant in forum Excel General
    Replies: 1
    Last Post: 01-20-2008, 01:02 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