+ Reply to Thread
Results 1 to 14 of 14

Formula to pick up last 6 months data.

  1. #1
    Registered User
    Join Date
    05-22-2019
    Location
    london
    MS-Off Ver
    Office 365
    Posts
    85

    Formula to pick up last 6 months data.

    Hi.

    Is it possible to build a formula in excel to sum the last 6 months numbers on a different worksheet and next month it rolls forward so it again captures the last 6 months?

    In my attachment, (Summary tab, cell H7) I want to sum the figures in the raw tab for past 6 months. I.e I9+H9+G9+F9+E9+D9

    Can this be automated via way of a formula or can only be done via VBA?? I know how to sum the cells, but just want to know if this can be automated so the formula automatically rolls forward.
    Attached Files Attached Files

  2. #2
    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,617

    Re: Formula to pick up last 6 months data.

    Probably be easy enough if all the dates and figures were on the same rows. Split as you have them, not so much so.

    Where do you put the date you want the 6 month calculation based on?
    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


  3. #3
    Registered User
    Join Date
    05-22-2019
    Location
    london
    MS-Off Ver
    Office 365
    Posts
    85

    Re: Formula to pick up last 6 months data.

    Haven't put a date as wasn't sure if it was required. Feel free to add a date wherever you want.

  4. #4
    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,432

    Re: Formula to pick up last 6 months data.

    It isn't if we use TODAY() as the date, but this might not give exactly the results you expect.

    Is a change in layout possible?
    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.

  5. #5
    Registered User
    Join Date
    05-22-2019
    Location
    london
    MS-Off Ver
    Office 365
    Posts
    85

    Re: Formula to pick up last 6 months data.

    Yes nothing is fixed. Change as you wish.

  6. #6
    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,432

    Re: Formula to pick up last 6 months data.

    But when does the calculation have to run from? Today or the first of this month, or the last day of last month? These are important questions that you need to answer, please.

  7. #7
    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,617

    Re: Formula to pick up last 6 months data.

    Feel free to add a date wherever you want.
    That's not really the way this works. And you haven't commented on the fact that you have made a rod for your own back by splitting the dates and figures.

    Probably easier to put them in, ideally, a single pair of columns or, less ideal, a single pair of rows. I'd recommend columns as you can AutoFilter the rows whereas you can't AutoFilter columns.

    As you're using 365, filtering is less of a problem as you can use the Filter function.

    Please restructure your sample and repost it.

  8. #8
    Registered User
    Join Date
    05-22-2019
    Location
    london
    MS-Off Ver
    Office 365
    Posts
    85

    Re: Formula to pick up last 6 months data.

    yeah sorry. Should have been more specific. Last day of the month last month. So 31st Jan.

  9. #9
    Registered User
    Join Date
    05-22-2019
    Location
    london
    MS-Off Ver
    Office 365
    Posts
    85

    Re: Formula to pick up last 6 months data.

    Ok. I've now arranged the dates and the values into columns for ease of use on the raw tab.

    I've also put the date I wish to work from in n3 on the summary worksheet
    Attached Files Attached Files
    Last edited by AliGW; 02-14-2022 at 10:18 AM. Reason: PLEASE don't quote unnecessarily!

  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,432

    Re: Formula to pick up last 6 months data.

    All in one:

    =SUMIFS(Raw!$D$2:$D$23,Raw!$C$2:$C$23,">="&EOMONTH(TODAY(),-8)+1,Raw!$C$2:$C$23,"<="&EOMONTH(TODAY(),-1))

  11. #11
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,625

    Re: Formula to pick up last 6 months data.

    PL see file. I have rearranged data in RAW sheet. Is it Ok.
    IN H7
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  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,617

    Re: Formula to pick up last 6 months data.

    Yet another option:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  13. #13
    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,432

    Re: Formula to pick up last 6 months data.

    Thanks for the rep.

  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,617

    Re: Formula to pick up last 6 months data.

    Ditto. Thanks for the rep.

+ 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. How to pick data using formula
    By Junaid Hussain in forum Excel General
    Replies: 1
    Last Post: 07-16-2019, 03:37 AM
  2. Formula to pick up data which almost match.
    By lababa in forum Excel General
    Replies: 7
    Last Post: 12-06-2018, 03:59 AM
  3. Using a certain formula to pick up data on different tabs
    By Andie5 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-24-2017, 12:52 PM
  4. Replies: 3
    Last Post: 12-08-2016, 10:37 AM
  5. Formula to Pick data
    By Sri.n in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-22-2014, 01:43 PM
  6. [SOLVED] Formula to pick data from a column then a row help :)
    By enagli in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-27-2014, 03:01 PM
  7. Formula to pick up second data instead of the first again
    By TIERNAN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-02-2013, 02:36 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