+ Reply to Thread
Results 1 to 15 of 15

Use filter to filter last 7 days in a date column

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Use filter to filter last 7 days in a date column

    Is there a custom filter to use to only get the last 7 days? When I use the last week, it gives me this week and last week. I only need the last 7 days. TIA.

  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: Use filter to filter last 7 days in a date column

    Have you tried the option for Top 10? It can be changed to Top 7. As long as dates are sorted ascending this should work.
    Dave

  3. #3
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Use filter to filter last 7 days in a date column

    No I haven't tried that at all. Not sure how to do that. I would sort ascending, but then how would I only get the last 7 days?

  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: Use filter to filter last 7 days in a date column

    Select a column header. Apply filters ... Data > Filter. Click the drop down arrow over the dates. Since dates are numbers (unless they have been entered as text) there will be an option "Number filters". Click on that. Then click Top 10. You will have the option to change that to Top 7.

    Edit My mistake. They don't have to be sorted ascending. It will return the latest 7 dates without that.
    Last edited by FlameRetired; 09-21-2017 at 11:10 AM.

  5. #5
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Use filter to filter last 7 days in a date column

    I do not see the top 10 listed. It has a bunch of things listed, but not Top 10. Is there another way to do it?

  6. #6
    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: Use filter to filter last 7 days in a date column

    Triscia, does it have Text filters listed? If so it sounds like your "dates" are text that look like dates. If you are not aware of it dates are numbers starting with day one in 1/1/1900. 9/21/2017 is day 42999 from 1/1/1900.

    In a temporary helper column use the following formula =ISNUMBER(A2) or whatever the first date containing cell is and copy down. If they show FALSE then they are text.

    Use Text to columns in the Data ribbon. Follow the prompts. When you get done the Number filter should show up.

  7. #7
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Use filter to filter last 7 days in a date column

    No the column is formatted as a date. The selections are equals, before, after, between, tomorrow, today, yesterday, this week, last week, next week, this month, last month, next month, this quarter, last quarter, next quarter, etc. When I select last week, it gives me too much, it goes clear back to 9/11/17.

  8. #8
    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: Use filter to filter last 7 days in a date column

    Aha. I forgot about the date filter.

    If you can temporarily format those dates as General (Ctrl + Shift + ~) they will be numbers and the filter Numbers > Top 10 will be available.

    Once filtered for the last 7 you can format those back to date. I usually keep a date somewhere handy so I can restore the dates with format painter.

    Sorry about the oversight.

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Use filter to filter last 7 days in a date column

    you can try create PivotTable then : TopTen together with post£8

  10. #10
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Use filter to filter last 7 days in a date column

    but it only gives me 7 items. There are more than 7 rows that are within the last 7 days.

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Use filter to filter last 7 days in a date column

    Attach a sample workbook (not a picture). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Add description what you want to achieve

  12. #12
    Registered User
    Join Date
    02-17-2022
    Location
    Cambridge, UK
    MS-Off Ver
    2010
    Posts
    2

    Smile Re: Use filter to filter last 7 days in a date column

    I feel it was quite clear what the OP wished to achieve, and why they were having difficulty.

    I think the easiest way will be to add a helper column to your table - perhaps at the left-most side.
    Title it "Show?" or something similar.
    In it you can then place any formula evaluating any citerion (or indeed criteria) you wish to filter on.

    So in this case, something like this is required, to get everything from the most recent 7 days.

    =IF((NOW()-[Date])<8,"Y","N")

    Note that I've suggested using 8 rather than 7, so that if it's late on Tuesday, say, you still get all the records even from early on the previous Tuesday.

    Also note that the column name [Date] above, should be preceeded byt the AT symbol to get relative addresses correct for each row, but I can't type that as I've only just registered and the site things I'm trying to post a (dodgy) link!!!

    ;-)
    Last edited by Cantabrigian; 02-17-2022 at 08:48 AM. Reason: Corrected typo

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Use filter to filter last 7 days in a date column

    Thanks for this. I presume you realise that the thread is four and a half years old, though?
    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.

  14. #14
    Registered User
    Join Date
    02-17-2022
    Location
    Cambridge, UK
    MS-Off Ver
    2010
    Posts
    2

    Re: Use filter to filter last 7 days in a date column

    I do indeed!

    But I'd stumbled across this thread just now, having just had the same problem, and it helped me get my thoughts in order, and suggest another solution which, having tried it, I find marginally less elegant than my own.

    So this thread may still help someone else!

  15. #15
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Use filter to filter last 7 days in a date column

    Yes, it may well do so. Just wanted you to be aware that you are unlikely to be thanked by the OP given the time that's passed since they posted the 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. macro to filter to a date 2 or 3 days ago
    By Newsome79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2016, 10:42 AM
  2. VBA to filter from today's date + 4 business days
    By kop1ko in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-19-2016, 07:20 AM
  3. vba to filter table by today's date up to 10 days. and save as new version
    By The Fly in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2014, 02:15 PM
  4. [SOLVED] How to set a 'Date Filter' on a field in the 'Report Filter' section of a Pivot Table?
    By Rhino_dance in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 03-28-2013, 11:01 AM
  5. Replies: 9
    Last Post: 01-04-2013, 09:56 AM
  6. Filter several pivot tables by one programmed date range filter in Excel 2003
    By olewka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2011, 11:49 AM
  7. Great Combo Filter/Search form, cant get DATE filter to integrate. HELP
    By fau5tu5 in forum Access Programming / VBA / Macros
    Replies: 4
    Last Post: 05-18-2009, 05:05 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