+ Reply to Thread
Results 1 to 6 of 6

Cutting Data to the Latest 365 days for multiple sets of data

  1. #1
    Registered User
    Join Date
    09-05-2018
    Location
    Oxford
    MS-Off Ver
    2016
    Posts
    7

    Cutting Data to the Latest 365 days for multiple sets of data

    Good Evening,


    I am looking for some help if possible. I have attached some example data that shows what I am using - data ranges from 100 days sometimes to 1000 days, very unpredictable per customer number and there will always be 48 columns then across the top.

    I am looking to see if there is a function, VBA, macro or filtering tool that can extract out/cut around the latest 365 days of data without having to look at them all manually. The data attached shows two customer examples but this can go up to 1000 different customers so I am very keen to see if I can improve the process I am using currently.


    Any help would be greatly appreciated.


    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Cutting Data to the Latest 365 days for multiple sets of data

    Hi improvemyknowledge. Welcome to the forum.

    For a formula solution with that much data I would use helper columns. The formula alternative would be many, many array formulas. They are resource hungry and I would be concerned they would slow the workbook.

    The ouput section is in columns BD:DA of the attached. The headers are identical to the source data.

    This has a system of 4 helper columns.
    1. in column A are Indexing Reference numbers. These are done with the fill series feature under Home > Editing group. Since there is no calculation overhead I "future proofed" the range to handle additional data.
    2. In column BB is another filled by series helper. It serves as the K value for the small function that comes later.
    3. In column AZ is a helper that assigns Indexing numbers to the qualifying rows by way of the first helper in column A. The formula is
      Formula: copy to clipboard
      Please Login or Register  to view this content.
      and returns mostly blanks except for the last 365 rows.
    4. In column is a helper that "gathers" all of those assigned index numbers once referencing the helper in column BB for the K values. Those index numbers will used by reference in the final formula rather than calculation. The formula
      Formula: copy to clipboard
      Please Login or Register  to view this content.


    The final formula in BD2 filled across and down until you get blanks
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,721

    Re: Cutting Data to the Latest 365 days for multiple sets of data

    Dave,

    I think you've missed the fact that there are TWO sets of customer data in the file, one for Cust Num 12345 (covering the period 01/08/2016 up to 17/10/2017) and the other for 54321 (covering the period 01/10/2016 up to 20/02/2018). The OP says there may be up to 1000 customers, and when I read that I thought that 365 days worth of data for each customer does not lend itself to a formula solution.

    Pete

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Cutting Data to the Latest 365 days for multiple sets of data



    Thank you, Pete. Yes I did miss that.

    And of course you are correct. Formulas out.

  5. #5
    Registered User
    Join Date
    09-05-2018
    Location
    Oxford
    MS-Off Ver
    2016
    Posts
    7

    Re: Cutting Data to the Latest 365 days for multiple sets of data

    Thank you so much for trying with the formulas- it's very useful, I will give it a go with any single customer sets of data that I have to improve the process

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: Cutting Data to the Latest 365 days for multiple sets of data

    I respectfully submit that there may be a formula solution.
    Borrowing from Dave's idea about a helper column, sheet1 A2 and down is populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Sheet2 (2nd row and down) is populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that I only included the first five columns on Sheet 2 however dragging the formula to the right and then double clicking the fill handle while the additional columns are selected should populate the entire range.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Finding the latest data multiple criteria are met
    By alex_a in forum Excel General
    Replies: 1
    Last Post: 01-04-2016, 05:31 PM
  2. Split one row with data sets into multiple rows with one data set
    By coopbeer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-26-2014, 11:05 AM
  3. Replies: 3
    Last Post: 05-09-2014, 06:03 AM
  4. VBA to fill down for multiple data sets, then consolidate data
    By franklin225 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-07-2012, 02:37 PM
  5. [SOLVED] Ploting multiple data sets with non-aligning x-data
    By motivef in forum Excel General
    Replies: 3
    Last Post: 07-19-2012, 07:49 PM
  6. Dependable Data Validation; Multiple data sets
    By Expod in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-06-2012, 06:04 PM
  7. Replies: 1
    Last Post: 06-29-2006, 04:25 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