Date based vlookup in excel

Deepakkandpal

New Member
Joined
Oct 9, 2017
Messages
1
Hi,

I'm stucked in a logic to be built while transactin with excel table, need your expert advice for the same.

I've two tables (Table 1 & Table2) pasted below for the reference.
here I'm mapping the closure date in Table1 from Table2 basis ID field. now what I need is to map the ID basis it's transaction date (for multiple IDs)
i.e the closure date should be picked if it's greater than the transaction date

have updated the desired output as well for the reference, by every mean it's picking the first value only for ID AAAA999143

[TABLE="width: 476"]
<colgroup><col width="71" style="width: 53pt; mso-width-source: userset; mso-width-alt: 2272;"> <col width="111" style="width: 83pt; mso-width-source: userset; mso-width-alt: 3552;"> <col width="132" style="width: 99pt; mso-width-source: userset; mso-width-alt: 4224;"> <col width="72" style="width: 54pt;"> <col width="133" style="width: 100pt; mso-width-source: userset; mso-width-alt: 4256;"> <col width="116" style="width: 87pt; mso-width-source: userset; mso-width-alt: 3712;"> <tbody>[TR]
[TD="class: xl67, width: 314, bgcolor: transparent, colspan: 3"]Table 1[/TD]
[TD="class: xl66, width: 72, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 249, bgcolor: transparent, colspan: 2"]Table 2[/TD]
[/TR]
[TR]
[TD="class: xl68, bgcolor: #D9D9D9"]ID[/TD]
[TD="class: xl68, bgcolor: #D9D9D9"]Transaction Date[/TD]
[TD="class: xl69, bgcolor: #FFC000"]Desired Output[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl68, bgcolor: #D9D9D9"]ID[/TD]
[TD="class: xl68, bgcolor: #D9D9D9"]Closure Date[/TD]
[/TR]
[TR]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]22-09-2017 12:33:00[/TD]
[TD="class: xl71, bgcolor: yellow"]23-09-2017 12:33:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl69, bgcolor: #FFC000"]AAAA999143[/TD]
[TD="class: xl74, bgcolor: #FFC000"]23-09-2017 12:33:00[/TD]
[/TR]
[TR]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]23-09-2017 13:31:00[/TD]
[TD="class: xl71, bgcolor: yellow"]24-09-2017 13:31:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]24-09-2017 13:31:00[/TD]
[/TR]
[TR]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]25-09-2017 18:02:00[/TD]
[TD="class: xl71, bgcolor: yellow"]26-09-2017 18:02:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]26-09-2017 18:02:00[/TD]
[/TR]
[TR]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]26-09-2017 07:50:00[/TD]
[TD="class: xl71, bgcolor: yellow"]27-09-2017 07:50:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]27-09-2017 07:50:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA994328[/TD]
[TD="class: xl73, bgcolor: transparent"]26-09-2017 14:42:00[/TD]
[TD="class: xl73, bgcolor: transparent"]27-09-2017 14:42:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA994328[/TD]
[TD="class: xl73, bgcolor: transparent"]27-09-2017 14:42:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA994328[/TD]
[TD="class: xl73, bgcolor: transparent"]28-09-2017 08:06:00[/TD]
[TD="class: xl73, bgcolor: transparent"]29-09-2017 08:06:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA994328[/TD]
[TD="class: xl73, bgcolor: transparent"]29-09-2017 08:06:00[/TD]
[/TR]
[TR]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]28-09-2017 13:49:00[/TD]
[TD="class: xl71, bgcolor: yellow"]29-09-2017 13:49:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]29-09-2017 13:49:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA997488[/TD]
[TD="class: xl73, bgcolor: transparent"]28-09-2017 20:59:00[/TD]
[TD="class: xl73, bgcolor: transparent"]29-09-2017 20:59:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA997488[/TD]
[TD="class: xl73, bgcolor: transparent"]29-09-2017 20:59:00[/TD]
[/TR]
[TR]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]29-09-2017 16:57:00[/TD]
[TD="class: xl71, bgcolor: yellow"]30-09-2017 16:57:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]30-09-2017 16:57:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA996035[/TD]
[TD="class: xl73, bgcolor: transparent"]29-09-2017 19:03:00[/TD]
[TD="class: xl73, bgcolor: transparent"]30-09-2017 19:03:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA996035[/TD]
[TD="class: xl73, bgcolor: transparent"]30-09-2017 19:03:00[/TD]
[/TR]
[TR]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]30-09-2017 13:56:00[/TD]
[TD="class: xl71, bgcolor: yellow"]01-10-2017 13:56:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]01-10-2017 13:56:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA995196[/TD]
[TD="class: xl73, bgcolor: transparent"]02-10-2017 13:03:00[/TD]
[TD="class: xl73, bgcolor: transparent"]03-10-2017 13:03:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA995196[/TD]
[TD="class: xl73, bgcolor: transparent"]03-10-2017 13:03:00[/TD]
[/TR]
[TR]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]03-10-2017 17:16:00[/TD]
[TD="class: xl71, bgcolor: yellow"]04-10-2017 17:16:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]04-10-2017 17:16:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA994094[/TD]
[TD="class: xl73, bgcolor: transparent"]04-10-2017 10:59:00[/TD]
[TD="class: xl73, bgcolor: transparent"]05-10-2017 10:59:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA994094[/TD]
[TD="class: xl73, bgcolor: transparent"]05-10-2017 10:59:00[/TD]
[/TR]
[TR]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]04-10-2017 14:46:00[/TD]
[TD="class: xl71, bgcolor: yellow"]05-10-2017 14:46:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl70, bgcolor: yellow"]AAAA999143[/TD]
[TD="class: xl71, bgcolor: yellow"]05-10-2017 14:46:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA995614[/TD]
[TD="class: xl73, bgcolor: transparent"]04-10-2017 16:41:00[/TD]
[TD="class: xl73, bgcolor: transparent"]05-10-2017 16:41:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA995614[/TD]
[TD="class: xl73, bgcolor: transparent"]05-10-2017 16:41:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA997790[/TD]
[TD="class: xl73, bgcolor: transparent"]05-10-2017 13:05:00[/TD]
[TD="class: xl73, bgcolor: transparent"]06-10-2017 13:05:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA997790[/TD]
[TD="class: xl73, bgcolor: transparent"]06-10-2017 13:05:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA995701[/TD]
[TD="class: xl73, bgcolor: transparent"]06-10-2017 15:09:00[/TD]
[TD="class: xl73, bgcolor: transparent"]07-10-2017 15:09:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA995701[/TD]
[TD="class: xl73, bgcolor: transparent"]07-10-2017 15:09:00[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]AAAA997145[/TD]
[TD="class: xl73, bgcolor: transparent"]08-10-2017 10:07:00[/TD]
[TD="class: xl73, bgcolor: transparent"]09-10-2017 10:07:00[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl72, bgcolor: transparent"]AAAA997145[/TD]
[TD="class: xl73, bgcolor: transparent"]09-10-2017 10:07:00[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
so you want to look up ID in table 1 across in table 2 to get the closure date and put it in third column of table 1 ONLY IF it is greater than transaction date ?

What if it is equal or less than, blank, or there is no matching ID in table 2
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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