Extract to 2nd sheet only flights valid during a 7 day period?

ctfloydscry

New Member
Joined
Jan 11, 2018
Messages
2
Excel novice(at best)

Timetable data.csv file

Example/excerpt:

Wish to extract to 2nd sheet only flights valid for 7 day period beginning Jan/14 ending Jan/20 from following....

Jan/1-Jan/13,ABR,5:00AM,MSP,6:20AM,123456,7365,CRJ
Jan/16-Feb/28,ABR,5:00AM,MSP,6:20AM,123456,7365,CRJ
Jan/7-Jan/14,ABR,6:50AM,MSP,8:12AM,7,7365,CRJ
Jan/15-Jan/21,ABR,6:50AM,MSP,8:12AM,17,7365,CRJ
Jan/28-Feb/28,ABR,6:50AM,MSP,8:12AM,7,7365,CRJ
Jan/1-Jan/2,ABR,1:08PM,MSP,2:30PM,12,7363,CRJ
Jan/3-Feb/28,ABR,1:09PM,MSP,2:30PM,1234567,7363,CRJ
Feb/2-Feb/28,ACC,10:00AM,JFK,4:44PM,156,0220,76W
Jan/1-Jan/30,ACC,10:00AM,JFK,4:50PM,1256,0220,76W

Output to second sheet...

Jan/16-Feb/28,ABR,5:00AM,MSP,6:20AM,123456,7365,CRJ
Jan/7-Jan/14,ABR,6:50AM,MSP,8:12AM,7,7365,CRJ
Jan/15-Jan/21,ABR,6:50AM,MSP,8:12AM,17,7365,CRJ
Jan/3-Feb/28,ABR,1:09PM,MSP,2:30PM,1234567,7363,CRJ
Jan/1-Jan/30,ACC,10:00AM,JFK,4:50PM,1256,0220,76W

Possible?

Thank you...
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi,

To make it easier I added 2 helper columns :

C2 =DATE(2018,MONTH(LEFT(A2,FIND("-",A2)-1)),DAY(MID(A2,FIND("/",A2)+1,(FIND("-",A2)-1)-(FIND("/",A2)))))
D2 =DATE(2018,MONTH(MID(A2,FIND("-",A2)+1,(FIND(",",A2)-1)-(FIND("-",A2)))),DAY(MID(MID(A2,FIND("-",A2)+1,(FIND(",",A2)-1)-(FIND("-",A2))),5,2)))

G2 & H2 your date criteria

Ctrl+Shift+Enter NOT just Enter
A17 =IFERROR(INDEX($A$2:$A$10,SMALL(IF($H$2>=$C$2:$C$10,IF($G$2<=$D$2:$D$10,ROW($A$1:$A$9))),ROW(A1))),"")


ABCDEFGH
1FlightsExtract StartExtract EndCriteriaStartEnd
2Jan/1-Jan/13,ABR,5:00AM,MSP,6:20AM,123456,7365,CRJ01/01/1813/01/1814/01/1820/01/18
3Jan/16-Feb/28,ABR,5:00AM,MSP,6:20AM,123456,7365,CRJ16/01/1828/02/18
4Jan/7-Jan/14,ABR,6:50AM,MSP,8:12AM,7,7365,CRJ07/01/1814/01/18
5Jan/15-Jan/21,ABR,6:50AM,MSP,8:12AM,17,7365,CRJ15/01/1821/01/18
6Jan/28-Feb/28,ABR,6:50AM,MSP,8:12AM,7,7365,CRJ28/01/1828/02/18
7Jan/1-Jan/2,ABR,1:08PM,MSP,2:30PM,12,7363,CRJ01/01/1802/01/18
8Jan/3-Feb/28,ABR,1:09PM,MSP,2:30PM,1234567,7363,CRJ03/01/1828/02/18
9Feb/2-Feb/28,ACC,10:00AM,JFK,4:44PM,156,0220,76W02/02/1828/02/18
10Jan/1-Jan/30,ACC,10:00AM,JFK,4:50PM,1256,0220,76W01/01/1830/01/18
11
12
13
14
15
16
17Jan/16-Feb/28,ABR,5:00AM,MSP,6:20AM,123456,7365,CRJ
18Jan/7-Jan/14,ABR,6:50AM,MSP,8:12AM,7,7365,CRJ
19Jan/15-Jan/21,ABR,6:50AM,MSP,8:12AM,17,7365,CRJ
20Jan/3-Feb/28,ABR,1:09PM,MSP,2:30PM,1234567,7363,CRJ
21Jan/1-Jan/30,ACC,10:00AM,JFK,4:50PM,1256,0220,76W

<colgroup><col><col><col><col><col><col><col><col span="2"></colgroup><tbody>
</tbody>
 
Upvote 0
Thank you for the reply.

The only version of Excel I have is from Office 2000 on an older laptop, one that I haven't used in quite some time. Even then I only used Excel for just very basic editing on above type data, and as such, I'm not too familiar on the use of formulas and other functions, so you'll have to pardon my ignorance here, but, (a) will these work with Excel 2000? If so, is there an idiots guide as to how these are applied? I've been watching tutorials and reading other information for beginners...but at my age there's definitely a bit of a learning curve. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,942
Members
449,275
Latest member
jacob_mcbride

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top