Using vlookup to extract data from closest date and matching criteria

ShadowLady17

New Member
Joined
May 19, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi, would appreciate any help on this please.

My data is like this:

Worksheet 1:
date from | date to | address

Worksheet 2:
address | date from | date to | occupancy (occupied or vacant)

I need to do a vlookup from the address on worksheet 1 to 2, finding the date when it was last occupied as close to the date from worksheet 1 as possible, for example:

Worksheet 1:
ST4 2LN
01/04/2022​
31/03/2023​

Worksheet 2:
ST4 2LN03/05/202231/12/9999Occupied
ST4 2LN12/04/202202/05/2022Vacant
ST4 2LN24/11/202111/04/2022Vacant
ST4 2LN19/11/202123/11/2021Vacant
ST4 2LN18/11/202118/11/2021Vacant
ST4 2LN09/11/199217/11/2021Occupied
ST4 2LN23/10/199208/11/1992Vacant

I would need the row that's highlighted - the 2 dates and the occupancy.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
on worksheet1 there are 2 dates, does it matter which date you are comparing to on sheet 2?
 
Upvote 0

Forum statistics

Threads
1,215,237
Messages
6,123,807
Members
449,127
Latest member
Cyko

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