Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Extracting Date Range

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a database with hourly temperature values that I'm trying to extract a range of data "between" to dates. The data file looks like:
    Date Time Temp
    01-Jan-02 0:00 29.9
    01-Jan-02 1:00 30.3
    01-Jan-02 2:00 29.9
    01-Jan-02 3:00 29.9

    I'm trying to use the Advanced Filter with the following Criteria range:

    Date Time Temp
    >=37319 (= 3/4/02)
    <=37325 (= 3/10/02)

    I works if I reverse this and "exclude" data between the two dates or only search in one direction.

    What am I doing wrong? I'd like to eventually create a VBA so the user simply enters two date to extract all the data "between" the two timepoints.

    Thanks in advance.


  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Calgary, Alberta Canada
    Posts
    3,420
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    Date Time Temp Date Date Time Temp
    01-Jan-02 5:00 29-Jan-00 >=37316 <=37325
    05-Mar-02 6:00 30-Jan-00
    06-Mar-02 7:00 29-Jan-00 Date Time Temp
    15-Mar-02 8:00 29-Jan-00 05-Mar-02 6:00 30-Jan-00
    06-Mar-02 7:00 29-Jan-00


    The Data Filter works OK.
    In the criteria use the Heading Date 2 times
    1. start =">="&37316
    2. end ="<="&37325

    I am not sure what date system you are using;
    I revised the sample and the criteria dates.

    [ This Message was edited by: Dave Patton on 2002-04-04 11:27 ]

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    It works!! Thanks, I owe you a beer.

    I was thinking about duplicating the Date column, but just didn't try it.

    Cheers,
    Brewski

  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You could have used a vertically-oriented, 2-cell computed criteria with the 1st cell left intentially blank and the 2nd cell containing the formula...

    =AND(Date>="3/4/02"+0,Date<="3/10/02"+0)

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •