+ Reply to Thread
Results 1 to 14 of 14

Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is add

  1. #1
    Registered User
    Join Date
    11-11-2015
    Location
    Belvidere, IL
    MS-Off Ver
    2010
    Posts
    12

    Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is add

    Hello!

    I am working with Dynamic Ranges for the first time. I have figured out the rest of my table, but I cannot get the YTD column to calculate correctly. It continues to add on from the beginning with data from last year. I only want to show the total for the last 12 months. I have attached the sheet and highlighted the cells. I currently have a simple sum function in Row 6 to show that it just continues to add up, which is what I need to avoid. I have been trying combinations of the Offset function, but I am getting no where. I know I am making this more difficult than it needs to be!

    Copy of Warranty Cost Tracking.xlsx
    Last edited by lkndllsgrl; 02-05-2016 at 01:27 PM.

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    Keeping rest of your formulas same, you could have simply used this in L5 and copy across to the right-
    Please Login or Register  to view this content.

    For a one stop formula just use this in B6 and copy across-
    Please Login or Register  to view this content.
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,430

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    B6:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and copy across.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    Another possibility

    In B6 copied right

    =SUM(OFFSET($B$5, 0, MAX(COLUMNS($B$6:B$6)-12,0),1, MIN(12, COLUMNS($B$6:B$6))))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    11-11-2015
    Location
    Belvidere, IL
    MS-Off Ver
    2010
    Posts
    12

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    I appreciate the answers. I think ChemistB's formula works best. However, now my YTD Dynamic Range is not updating on the chart. It has become static. Any idea on why this would happen?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,430

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    How would you define "works best". With all due respect to ChemistB, it is the only formula that uses a volatile function, OFFSET. Generally speaking, they are to be avoided, particularly if they are used to "excess".

  7. #7
    Registered User
    Join Date
    11-11-2015
    Location
    Belvidere, IL
    MS-Off Ver
    2010
    Posts
    12

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    Maybe that is the problem I am having now. It seems that the final answer is not right. I am having trouble getting the calculations due to the row that the calculation is done in is part of the previous formula, so I cant be sure that the answer is correct. I have found some inconsistencies that I am still trying to work out. I may try one of the other formulas to determine if that gives me a better result.

  8. #8
    Registered User
    Join Date
    11-11-2015
    Location
    Belvidere, IL
    MS-Off Ver
    2010
    Posts
    12

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    I have used sourabhg98's second formula and I seem to get consistent correct results. I still cannot get my chart, which is a combination chart, to work right. Only the YTD line graph is giving me trouble! Its always something... lol

  9. #9
    Registered User
    Join Date
    11-11-2015
    Location
    Belvidere, IL
    MS-Off Ver
    2010
    Posts
    12

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    With a little luck and rewriting of my range formula I got my chart to work as well. Thank you all for responding to my issue. I greatly appreciate your help. I am just learning more complex formulas and can only hope to be able to solve some of the harder issues like you all one day!

    Thanks Again!~

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,430

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    Thanks for the rep

    and rewriting of my range formula I got my chart to work as well.
    Might be worth sharing your updated sample workbook so that others may benefit from a fully working example.

    Regards, TMS

  11. #11
    Registered User
    Join Date
    11-11-2015
    Location
    Belvidere, IL
    MS-Off Ver
    2010
    Posts
    12

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is


  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,430

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    Thank you

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    In defense of my formula, while I freely admit it's not the best, with the amount of data in this sheet, it shouldn't create any noticeable lag. The key with volatile functions is knowing when you are able to use them and when you can't.

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,430

    Re: Need to Sum YTD Dynamically, So when 1 month is over it drops off and the new month is

    No criticism, just a question and comparison. My question was "how do you define works best"? ... that, given that three solutions all produced the same, the required, and the correct answer. The comparison being that your formula used a volatile function. The concern being that it may, eventually, be dragged across many months and years. Add to that, the dynamic named ranges for the chart are also volatile.

    My point was not that your formula was not the best, nor that the others were better.

    So, no defence necessary; your point regarding using volatile functions wisely and is well made and accepted.


    Regards, TMS

+ 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. [SOLVED] Getting the last day of month value dynamically from a row of multiple dates
    By rparada in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-28-2016, 05:09 PM
  2. [SOLVED] Calculation of days per month for dates beginning in one month and ending in another month
    By Fahrettin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-07-2015, 04:52 PM
  3. [SOLVED] Determine work days in current month or next month based on day of the month
    By sbrnard in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-29-2014, 05:14 PM
  4. [SOLVED] Dynamically create columns for each month
    By mgoutam in forum Excel General
    Replies: 2
    Last Post: 03-13-2014, 08:24 AM
  5. [SOLVED] Counting & summing formula (until last month,this month,until this month..
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-12-2014, 01:14 PM
  6. [SOLVED] Auto instert Month names for This month, Last month and Next month
    By hemal89 in forum Word Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2013, 12:01 PM
  7. Dynamically determining when a month ends
    By Moomancow3k in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-11-2006, 07:00 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