![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 2
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
|
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 |
|
New Member
Join Date: Apr 2002
Posts: 2
|
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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
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) |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|