+ Reply to Thread
Results 1 to 15 of 15

Advanced filter date problem

  1. #1
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Advanced filter date problem

    I am using the advanced filter but I am running into a problem when using a date in the criteria range. The data being filtered contains the hour and minute 1/17/2011 8:00:00 AM, the cell is formatted to display Mon-Jan-17-11. I would like to filter for anything on Monday January 17 2011 irregardless of the time. Is there a way to do this with the advance filter?? How should I be entering this in the criteria range.
    Last edited by pdmkh; 01-17-2011 at 04:02 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Advanced filter date problem

    Hi pdmkh,

    Look at http://www.contextures.com/xladvfilter01.html down the page in a section of:
    Excel Advanced Filter Criteria Examples

    hope that helps.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Advanced filter date problem

    Tried * wildcard before and after but it still does not pull everything from the Monday

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Advanced filter date problem

    I was thinking you would use two dates in the criteria and use the AND reasoning.
    If you wanted all dates and times in 1/6/2011 you would filter all >1/5/2011 and < 1/7/2011
    See http://www.ozgrid.com/Excel/advanced-filter.htm for the example with ages instead of dates.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Advanced filter date problem

    with dates in col a starting A2
    pick somwhere for critereria say d1:d2
    leave d1 blank
    in d2 put =trunc(A2)=$E$1
    put the date you want to filter on in E1
    now advance filter using d1:d2 as criteria
    Attached Files Attached Files
    Last edited by martindwilson; 01-10-2011 at 12:23 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Advanced filter date problem

    Adding another column and filtering based on greater than or less than seems to work the best and is the quickest fix. Thanks for your help

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Advanced filter date problem

    now im puzzled are you saying its easier to use 2 columns? than use that formula approach? i dont believe it! and given that
    if you filter > 21/2/2010 and < 23/2/2010 it would not only pass all 22/2/2010 but also would be 21/2/2010 08:00 as any time added would make it meet the criteria > than 21/2/2010
    Last edited by martindwilson; 01-11-2011 at 09:14 AM.

  8. #8
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Advanced filter date problem

    Please have a look at the attached workbooks. They demonstrate how I have used the advanced filter and it appears to work. Adding another date column (targeted start) in "ADVANCED FILTER TEST 1" is not an issue. Howerver I am concerned that, based on your last comments, I may have a problem with the information passing. I have tested the criteria listed in "ADVANCED FILTER TEST 2" several times with different crews and dates and it works.
    Attached Files Attached Files
    Last edited by pdmkh; 01-11-2011 at 01:14 PM.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Advanced filter date problem

    cant really see where your filters are
    but >1/23/2011 would probably omit 1/23/2011 00:00

  10. #10
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Advanced filter date problem

    Sorry, I didnot include the data being filtered in the previous post.
    Attached Files Attached Files

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Advanced filter date problem

    Hi pdmkh

    Find the attached with the correct advanced filter. Note that you need two of the field heads of "Start Target" in the Criteria header line but only one in your data. You are not supposed to ever have the same field names in the headers of the data. I think this was the problem. Also, formatting the dates correctly is important.

    Advanced Filters have huge power but aren't the most obvious beasts in Excel.
    Hope this helps.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Advanced filter date problem

    The filter still returns more than one day. I changed the second date in your criteria to
    <12/10/2011 with the first criteria being >12/8/2011. I was hoping to filter out only tasks scheduled for 12/9/2011, however, tasks for both 12/8/2011 and 12/9/2011 appeared??

  13. #13
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Advanced filter date problem

    back to what i said
    or change your first criteria to >=12/9/2010
    i said before any time added to a date will make it >than the actual date >12/08/2010 means anything greater than
    12/08/2010 00:00 so 12/08/2010 00:01 will make it through the filter
    Attached Files Attached Files
    Last edited by martindwilson; 01-16-2011 at 11:54 AM.

  14. #14
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Advanced filter date problem

    With the proper formatting I think the the issue has been taken care of. Formatted the cells to; > 1/6/2011 12:00 AM and < 1/7/2011 12:00 AM to pass all work scheduled on 1/6/2011. Checked this several times with several different crews and the filtered information is accurate. Any comments?

  15. #15
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Advanced filter date problem

    nothing to do with formatting , the cell value remains the same
    but >6 and <7 will work as its not the same as you were trying before >8 <10

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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