VLOOKUP on Dates

MikeyZ

Well-known Member
Joined
Mar 14, 2002
Messages
553
I know when you do a Vlookup on a date , say 4/16/1, it's going to pull the first one it finds and nothing else.
Suppose I have any number of lines showing a specific date, is there a way I can pull the sequential info from the cells in that column?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
The common solution looks like this:


Book1
ABCDE
1DateValueLookup Date:01/01/2018
201/01/2018aValues:a
302/01/2018bd
403/01/2018cg
501/01/2018d
602/01/2018e
703/01/2018f
801/01/2018g
Sheet1
Cell Formulas
RangeFormula
E2{=IFERROR(INDEX($B$1:$B$8,SMALL(IF($A$1:$A$8=$E$1,ROW($A$1:$A$8)-ROW($A$1)+1),ROWS($E$2:$E2))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.


Copy formula in E2 down as necessary. Adjust cell references to suit your data.

WBD
 
Upvote 0
Need to be a bit more specific.
VLOOKUP returns one value, no more.

Are you saying you have multiple rows showing the same date and wish to return all of them?

Usual answer is something like this

=IFERROR(INDEX(range1,SMALL(IF((range1=specificdate),ROW(range1)),ROW(A1))-(ROW(firstrowofrange)-1),column number),"")
Array formula, use Ctrl-Shift-Enter

Post best post some example data.
You cant attach files on this forum. There are tools on this forum for adding small spreadsheet images

https://www.mrexcel.com/forum/about-board/508133-attachments.html

Or upload the file to an online storage site and post a link to it, though some people may not download the file for fear of viruses.
 
Upvote 0
True. I should be a bit more explicit.
I run the VLOOKUP fx down the column.
I will then only pick up the first hit it comes across and go no further.

I have several PO's due on 4/16/18.
I want to show in my daily returns those PO's that are due 4/16/18.
 
Upvote 0
True. I should be a bit more explicit.
I run the VLOOKUP fx down the column.
I will then only pick up the first hit it comes across and go no further.

I have several PO's due on 4/16/18.
I want to show in my daily returns those PO's that are due 4/16/18.

Hi!

Another way (with WBD's layout):

In E2 and copy down

=IFERROR(INDEX(B$2:B$8,MATCH(0,INDEX(COUNTIF(E$1:E1,B$2:B$8)+(A$2:A$8<>E$1),),0)),"")

Markmzz
 
Upvote 0
trying to figure out how to use this fx.
I don't understand the CountIF criteria..

I have my static date in $C$6.

My data is in another sheet named POLINES.
AJ is where I am going to pull the PO# from.
AL is where the due date is located that will match up with $C$6.

S
 
Upvote 0
trying to figure out how to use this fx.
I don't understand the CountIF criteria..

I have my static date in $C$6.

My data is in another sheet named POLINES.
AJ is where I am going to pull the PO# from.
AL is where the due date is located that will match up with $C$6.

S

Hi!

Try this in D6 of the Main sheet (the sheet where you have the static date - $C$6) and copy down

=IFERROR(INDEX(POLINES!$AJ$2:$AJ$8,
MATCH(0,INDEX(COUNTIF($D$5:$D5,POLINES!$AJ$2:$AJ$8)+(POLINES!$AL$2:$AL$8<>$C$6),),0)),"")


[TABLE="class: grid, width: 619"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD][/TD]
[TD][/TD]
[TD]AI[/TD]
[TD]AJ[/TD]
[TD]AK[/TD]
[TD]AL[/TD]
[TD]AM[/TD]
[TD]AN[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Sheet[/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD]PO's[/TD]
[TD][/TD]
[TD]Date[/TD]
[TD][/TD]
[TD]Sheet[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Main[/TD]
[TD][/TD]
[TD]2[/TD]
[TD][/TD]
[TD]PO01[/TD]
[TD][/TD]
[TD="align: right"]01/04/2018[/TD]
[TD][/TD]
[TD]POLINES[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3[/TD]
[TD][/TD]
[TD]PO02[/TD]
[TD][/TD]
[TD="align: right"]02/04/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4[/TD]
[TD][/TD]
[TD]PO03[/TD]
[TD][/TD]
[TD="align: right"]03/04/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD]Date[/TD]
[TD]PO's[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5[/TD]
[TD][/TD]
[TD]PO04[/TD]
[TD][/TD]
[TD="align: right"]04/04/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]01/04/2018[/TD]
[TD]PO01[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]6[/TD]
[TD][/TD]
[TD]PO05[/TD]
[TD][/TD]
[TD="align: right"]01/04/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]PO05[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]7[/TD]
[TD][/TD]
[TD]PO06[/TD]
[TD][/TD]
[TD="align: right"]02/04/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]8[/TD]
[TD][/TD]
[TD]PO07[/TD]
[TD][/TD]
[TD="align: right"]03/04/2018[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]***[/TD]
[TD]**[/TD]
[TD]**[/TD]
[TD]**********[/TD]
[TD]*******[/TD]
[TD]**[/TD]
[TD]********[/TD]
[TD]**[/TD]
[TD]***[/TD]
[TD]**[/TD]
[TD]*******[/TD]
[TD]****[/TD]
[TD]**********[/TD]
[TD]****[/TD]
[TD]********[/TD]
[/TR]
</tbody>[/TABLE]


By the way, how many rows your data have?

Markmzz
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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