+ Reply to Thread
Results 1 to 7 of 7

Filtering data based on start and end date, ignoring the year.

  1. #1
    Registered User
    Join Date
    06-07-2016
    Location
    Pretoria, South Africa
    MS-Off Ver
    2007
    Posts
    4

    Question Filtering data based on start and end date, ignoring the year.

    Hi peeps,

    I've got a problem I need some help with . In my workbook I have a sheet with a large amount of daily data for the past 25 years. I want an end user to be able to insert a Start and End date (e.g. 2016/07/01 to 2016/09/30) in another sheet, after which by the press of a button, all data between 1 July and 30 Sep over the past 25 years is copied to that sheet. So it should filter based on day and month only, ignoring the year.

    I have attached the workbook. "Big data" is is where the data should be copied from and "Structure 1" is where it should be pasted to.

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Filtering data based on start and end date, ignoring the year.

    Hello welcome to the forum.
    The attached copy of your file amended for macros, contains and Advanced Filter Macros which brings back all the days and months selected in you Start and End dates ignoring years.

    Hope you can amend this for your actual data. The range selection in the filter uses Current Region, which allows you to add data to the bottom of the list without adjusting the macro code. However, you must keep a column and row clear around this otherwise it loses the Current Region.

    DBY
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-07-2016
    Location
    Pretoria, South Africa
    MS-Off Ver
    2007
    Posts
    4

    Re: Filtering data based on start and end date, ignoring the year.

    Thank you! There's a issue though when I enter say 01-Aug to 01-Sep. It only gives me the 1st of Aug and 1st of Sep, leaving out 2-31 Aug. Do mind looking at that please?

    untitled.JPG

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Filtering data based on start and end date, ignoring the year.

    So it should filter based on day and month only, ignoring the year.
    Yes I see. I misunderstood. I thought you wanted only the day(s) ie. the 1st and the month(s). So the 1/8 to 1/9 will bring back all of the 1st and 8th. dates in the given months. I'll make some adjustments so it's between those two dates and get back.

  5. #5
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Filtering data based on start and end date, ignoring the year.

    Try the following formula in the 'Criteria' cell:

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


    In my test it brings back all the dates between the Start and End dates for all years. The filter in effect changes the year in Date column (not actually) to whatever year is in the Start date (doesn't matter which year) and then brings back all the matching rows in the actual data.

    DBY
    Last edited by DBY; 06-10-2016 at 04:44 AM. Reason: New possible solution added.

  6. #6
    Registered User
    Join Date
    06-07-2016
    Location
    Pretoria, South Africa
    MS-Off Ver
    2007
    Posts
    4

    Re: Filtering data based on start and end date, ignoring the year.

    It works perfectly. Thank you!

  7. #7
    Registered User
    Join Date
    06-07-2016
    Location
    Pretoria, South Africa
    MS-Off Ver
    2007
    Posts
    4

    Re: Filtering data based on start and end date, ignoring the year.

    Hi DBY,

    Is there any way you can help so that I can select a start date in one year and an end date in the next? e.g. 15 December to 10 January, and filter accordingly?

    Currently it only gives me the data for the period that falls within the first year (15 Dec to 31 Dec).

    Thank you in advance.
    Attached Files Attached Files

+ 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. Replies: 5
    Last Post: 08-04-2014, 06:42 PM
  2. [SOLVED] Employee Utilization for the Year based on Start Date and End Date
    By nickydharia in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-08-2014, 05:55 AM
  3. Filtering data based on start and end date
    By gururajrao.1992 in forum Excel General
    Replies: 2
    Last Post: 11-28-2013, 02:44 AM
  4. Replies: 8
    Last Post: 05-10-2013, 05:37 AM
  5. Input a year to determine the start date for 4-4-5 Calendar Year.
    By mak1176 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-25-2013, 10:34 AM
  6. [SOLVED] Macro to Retrieve Data with Start Year and End Year
    By boldcode in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2013, 01:09 PM
  7. Replies: 3
    Last Post: 08-14-2012, 05:14 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