Multiple vlook up

JOHN007

New Member
Joined
Aug 7, 2014
Messages
38
I need to lookup for nearest max data and nearest min date and return apprioprate code (code on nearest min date and code nearest max date date) based on two parameters
can anyone help me out?

based on Sheet 2 I need to return CODE in Sheet 1
[TABLE="width: 954"]
<tbody>[TR]
[TD]Sheet 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD="colspan: 2"]EXAMPLE DATE
[/TD]
[TD="colspan: 2"]EXAMPLE CODE
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Name
[/TD]
[TD]DATE
[/TD]
[TD]Code on nearest Min date
[/TD]
[TD]Code on nearest Max date
[/TD]
[TD]expected code on min date to be returned
[/TD]
[TD]expected code max date to be returned
[/TD]
[TD]expected code on min date to be returned
[/TD]
[TD]expected code max date to be returned
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Apple
[/TD]
[TD]01-01-2018
[/TD]
[TD]?
[/TD]
[TD]?
[/TD]
[TD]02-01-2018
[/TD]
[TD]NA
[/TD]
[TD]123
[/TD]
[TD]NA
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Apple
[/TD]
[TD]03-01-2018
[/TD]
[TD]?
[/TD]
[TD]?
[/TD]
[TD]03-01-2018
[/TD]
[TD]03-01-2018
[/TD]
[TD]56
[/TD]
[TD]56
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]Orange
[/TD]
[TD]08-01-2018
[/TD]
[TD]?
[/TD]
[TD]?
[/TD]
[TD]NA
[/TD]
[TD]09-01-2018
[/TD]
[TD]NA
[/TD]
[TD]2365
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]banana
[/TD]
[TD]11-01-2018
[/TD]
[TD]?
[/TD]
[TD]?
[/TD]
[TD]10-01-2018
[/TD]
[TD]12-01-2018
[/TD]
[TD]3241
[/TD]
[TD]236
[/TD]
[/TR]
</tbody>[/TABLE]



[TABLE="width: 399"]
<tbody>[TR]
[TD]Sheet 2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]c
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Name
[/TD]
[TD]Date
[/TD]
[TD]CODE
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Apple
[/TD]
[TD]02-01-2018
[/TD]
[TD]123
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Apple
[/TD]
[TD]03-01-2018
[/TD]
[TD]56
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Orange
[/TD]
[TD]07-01-2018
[/TD]
[TD]987
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]Orange
[/TD]
[TD]09-01-2018
[/TD]
[TD]2365
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]Orange
[/TD]
[TD]10-01-2018
[/TD]
[TD]698
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]Banana
[/TD]
[TD]10-01-2018
[/TD]
[TD]1478
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]Banana
[/TD]
[TD]12-01-2018
[/TD]
[TD]3241
[/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]Banana
[/TD]
[TD]13-01-2018
[/TD]
[TD]236
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

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