Vlookup, code help

Harrywatson

Board Regular
Joined
Jan 20, 2014
Messages
92
I explained this question badly intitially. I have now added my data in table form.

[HTMLExcel 2012
ABCDEFGHIJKLMN
17 months, 3 days
13 months, 30 days
15 months, 25 days
13 months, 24 days
14 months, 29 days
15 months, 23 days

<tbody>
[TD="align: center"]1298[/TD]
[TD="align: center"]2170[/TD]
[TD="align: center"]14/05/2014[/TD]
[TD="align: center"]UK12443760071508042013MSTX 01[/TD]
[TD="align: center"]UK124437[/TD]
[TD="align: center"]600715[/TD]
[TD="align: center"]08-04-2013[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]STX[/TD]
[TD="align: center"]£720[/TD]

[TD="align: center"][/TD]
[TD="align: center"]08/08/2014[/TD]
[TD="align: center"]BU[/TD]
[TD="align: center"]SKIPTON[/TD]

[TD="align: center"]1299[/TD]
[TD="align: center"]2171[/TD]
[TD="align: center"]14/05/2014[/TD]
[TD="align: center"]UK12459330121312072013MLIMX 01[/TD]
[TD="align: center"]UK124593[/TD]
[TD="align: center"]301213[/TD]
[TD="align: center"]12-07-2013[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]LIMX[/TD]
[TD="align: center"]£885[/TD]

[TD="align: center"][/TD]
[TD="align: center"]12/11/2014[/TD]
[TD="align: center"]BU[/TD]
[TD="align: center"]SKIPTON[/TD]

[TD="align: center"]1300[/TD]
[TD="align: center"]2172[/TD]
[TD="align: center"]14/05/2014[/TD]
[TD="align: center"]UK12486430057217052013MLIMX 01[/TD]
[TD="align: center"]UK124864[/TD]
[TD="align: center"]300572[/TD]
[TD="align: center"]17-05-2013[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]LIMX[/TD]
[TD="align: center"]£900[/TD]

[TD="align: center"][/TD]
[TD="align: center"]17/09/2014[/TD]
[TD="align: center"]BU[/TD]
[TD="align: center"]SKIPTON[/TD]

[TD="align: center"]1301[/TD]
[TD="align: center"]2173[/TD]
[TD="align: center"]14/05/2014[/TD]
[TD="align: center"]UK12486430059318072013MLIMX 01[/TD]
[TD="align: center"]UK124864[/TD]
[TD="align: center"]300593[/TD]
[TD="align: center"]18-07-2013[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]LIMX[/TD]
[TD="align: center"]£925[/TD]

[TD="align: center"][/TD]
[TD="align: center"]18/11/2014[/TD]
[TD="align: center"]BU[/TD]
[TD="align: center"]SKIPTON[/TD]

[TD="align: center"]1302[/TD]
[TD="align: center"]2174[/TD]
[TD="align: center"]14/05/2014[/TD]
[TD="align: center"]UK12495660038813062013MBAX 01[/TD]
[TD="align: center"]UK124956[/TD]
[TD="align: center"]600388[/TD]
[TD="align: center"]13-06-2013[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]BAX[/TD]
[TD="align: center"]£890[/TD]

[TD="align: center"][/TD]
[TD="align: center"]13/10/2014[/TD]
[TD="align: center"]BU[/TD]
[TD="align: center"]SKIPTON[/TD]

[TD="align: center"]1303[/TD]
[TD="align: center"]2175[/TD]
[TD="align: center"]14/05/2014[/TD]
[TD="align: center"]UK12510170077719052013MCHX 01[/TD]
[TD="align: center"]UK125101[/TD]
[TD="align: center"]700777[/TD]
[TD="align: center"]19-05-2013[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]CHX[/TD]
[TD="align: center"]£840[/TD]

[TD="align: center"][/TD]
[TD="align: center"]19/09/2014[/TD]
[TD="align: center"]BU[/TD]
[TD="align: center"]SKIPTON[/TD]

</tbody>
ON 13-14

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]A1298[/TH]
[TD="align: left"]=A1297+1[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]B1298[/TH]
[TD="align: left"]=B1297[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]A1299[/TH]
[TD="align: left"]=A1298+1[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]B1299[/TH]
[TD="align: left"]=B1298[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]A1300[/TH]
[TD="align: left"]=A1299+1[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]B1300[/TH]
[TD="align: left"]=B1299[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]A1301[/TH]
[TD="align: left"]=A1300+1[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]B1301[/TH]
[TD="align: left"]=B1300[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]A1302[/TH]
[TD="align: left"]=A1301+1[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]B1302[/TH]
[TD="align: left"]=B1301[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]A1303[/TH]
[TD="align: left"]=A1302+1[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]B1303[/TH]
[TD="align: left"]=B1302[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]D1298[/TH]
[TD="align: left"]=LEFT(C1298,8)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E1298[/TH]
[TD="align: left"]=MID(C1298,9,6)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]F1298[/TH]
[TD="align: left"]=TEXT(MID(C1298,15,8),"00-00-0000")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G1298[/TH]
[TD="align: left"]=MID(C1298,23,1)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]H1298[/TH]
[TD="align: left"]=MID(C1298,24,LEN(C1298)-26)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]D1299[/TH]
[TD="align: left"]=LEFT(C1299,8)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E1299[/TH]
[TD="align: left"]=MID(C1299,9,6)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]F1299[/TH]
[TD="align: left"]=TEXT(MID(C1299,15,8),"00-00-0000")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G1299[/TH]
[TD="align: left"]=MID(C1299,23,1)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]H1299[/TH]
[TD="align: left"]=MID(C1299,24,LEN(C1299)-26)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]D1300[/TH]
[TD="align: left"]=LEFT(C1300,8)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E1300[/TH]
[TD="align: left"]=MID(C1300,9,6)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]F1300[/TH]
[TD="align: left"]=TEXT(MID(C1300,15,8),"00-00-0000")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G1300[/TH]
[TD="align: left"]=MID(C1300,23,1)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]H1300[/TH]
[TD="align: left"]=MID(C1300,24,LEN(C1300)-26)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]D1301[/TH]
[TD="align: left"]=LEFT(C1301,8)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E1301[/TH]
[TD="align: left"]=MID(C1301,9,6)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]F1301[/TH]
[TD="align: left"]=TEXT(MID(C1301,15,8),"00-00-0000")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G1301[/TH]
[TD="align: left"]=MID(C1301,23,1)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]H1301[/TH]
[TD="align: left"]=MID(C1301,24,LEN(C1301)-26)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]D1302[/TH]
[TD="align: left"]=LEFT(C1302,8)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E1302[/TH]
[TD="align: left"]=MID(C1302,9,6)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]F1302[/TH]
[TD="align: left"]=TEXT(MID(C1302,15,8),"00-00-0000")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G1302[/TH]
[TD="align: left"]=MID(C1302,23,1)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]H1302[/TH]
[TD="align: left"]=MID(C1302,24,LEN(C1302)-26)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]D1303[/TH]
[TD="align: left"]=LEFT(C1303,8)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E1303[/TH]
[TD="align: left"]=MID(C1303,9,6)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]F1303[/TH]
[TD="align: left"]=TEXT(MID(C1303,15,8),"00-00-0000")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G1303[/TH]
[TD="align: left"]=MID(C1303,23,1)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]H1303[/TH]
[TD="align: left"]=MID(C1303,24,LEN(C1303)-26)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]J1298[/TH]
[TD="align: left"]=DATEDIF(F1298,NOW(),"m") &" months, " & DATEDIF(F1298,NOW(),"md") &" days "[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]K1298[/TH]
[TD="align: left"]=IF(IFERROR(VLOOKUP(A1298,'OFF 13-14'!A:A,1,0),0)='ON 13-14'!A1298,"✓","")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]L1298[/TH]
[TD="align: left"]=EDATE(F1298,16)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]J1299[/TH]
[TD="align: left"]=DATEDIF(F1299,NOW(),"m") &" months, " & DATEDIF(F1299,NOW(),"md") &" days "[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]K1299[/TH]
[TD="align: left"]=IF(IFERROR(VLOOKUP(A1299,'OFF 13-14'!A:A,1,0),0)='ON 13-14'!A1299,"✓","")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]L1299[/TH]
[TD="align: left"]=EDATE(F1299,16)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]J1300[/TH]
[TD="align: left"]=DATEDIF(F1300,NOW(),"m") &" months, " & DATEDIF(F1300,NOW(),"md") &" days "[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]K1300[/TH]
[TD="align: left"]=IF(IFERROR(VLOOKUP(A1300,'OFF 13-14'!A:A,1,0),0)='ON 13-14'!A1300,"✓","")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]L1300[/TH]
[TD="align: left"]=EDATE(F1300,16)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]J1301[/TH]
[TD="align: left"]=DATEDIF(F1301,NOW(),"m") &" months, " & DATEDIF(F1301,NOW(),"md") &" days "[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]K1301[/TH]
[TD="align: left"]=IF(IFERROR(VLOOKUP(A1301,'OFF 13-14'!A:A,1,0),0)='ON 13-14'!A1301,"✓","")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]L1301[/TH]
[TD="align: left"]=EDATE(F1301,16)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]J1302[/TH]
[TD="align: left"]=DATEDIF(F1302,NOW(),"m") &" months, " & DATEDIF(F1302,NOW(),"md") &" days "[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]K1302[/TH]
[TD="align: left"]=IF(IFERROR(VLOOKUP(A1302,'OFF 13-14'!A:A,1,0),0)='ON 13-14'!A1302,"✓","")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]L1302[/TH]
[TD="align: left"]=EDATE(F1302,16)[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]J1303[/TH]
[TD="align: left"]=DATEDIF(F1303,NOW(),"m") &" months, " & DATEDIF(F1303,NOW(),"md") &" days "[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]K1303[/TH]
[TD="align: left"]=IF(IFERROR(VLOOKUP(A1303,'OFF 13-14'!A:A,1,0),0)='ON 13-14'!A1303,"✓","")[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]L1303[/TH]
[TD="align: left"]=EDATE(F1303,16)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

][/HTML]

This is on the first sheet which is called "ON 13-14" this information is similiar all the way down this sheet for about 1500 rows.

My second sheet is blank.

What I would like on my second sheet is any rows of data on the first sheet (ON 13-14), where the date in column L is between two dates of my own choice.
Lets say i would like all rows (A-N) that have a date that is between 11/11/14 and 19/11/14 in column L to appear in the blank sheet.

So from the example i have given the rows that would then appear under the specification that i have given (The date in Column L is between 11/11/14 and 19/11/14) are as follows

HTML:
Excel 2012ABCDEFGHIJKLMN1299217114/05/2014UK12459330121312072013MLIMX 01UK12459330121312-07-2013MLIMX£88513 months, 30 days 12/11/2014BUSKIPTON[CENTER][COLOR=#161120][B]ON 13-14[/B][/COLOR][/CENTER]

and

HTML:
Excel 2012ABCDEFGHIJKLMN1301217314/05/2014UK12486430059318072013MLIMX 01UK12486430059318-07-2013MLIMX£92513 months, 24 days 18/11/2014BUSKIPTON[CENTER][COLOR=#161120][B]ON 13-14[/B][/COLOR][/CENTER]


I would like it so i can choose the two dates that i would like it to be between and then out of the thousand or so rows of data, say 40-50 appear on the second sheet where their contents in column L lies between the two dates I wish.

Help would be greatly appreciated.

Please feel free to ask questions.

:) Thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,222,561
Messages
6,166,802
Members
452,073
Latest member
akinch

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