XLOOKUP and LOOKUP Combined

austinandreikurt

Board Regular
Joined
Aug 25, 2020
Messages
91
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I need help to combine both formula's into one. In simple term, this is a VLOOKUP with 2 criteria but I can't merge cells to simplify it because the second criteria is a date range, thus I need a LOOKUP.
For example, I have this in a table:
Employee IDDate of Change (CheckDate)RATE
1XXX001
01-Jan-20​
27.57
1XXX001
12-Mar-21​
28.26
1XXX002
01-Jan-20​
27.57
1XXX002
12-Mar-21​
28.26
1XXX005
01-Jan-20​
27.57
1XXX005
09-Apr-21​
28.26
1XXX005
20-Jun-21​
30.55
Say I have the Employee ID list in Column A then date range in Column B and I need to put the formula to get the rates in Column C.
Then if I am looking for the rate of Employee 1XXX001 (Cell A2) as of 20-Feb-21 (Cell B2), then the formula in Cell C2 should result to 27.57 because the 28.26 is only effective since 12-Mar-21 onwards.
Another sample is for Employee 1XXX005 (Cell A3) with date 30-Jun-21 (Cell B3), rate I need to get in Cell C3 is 30.55.
Employee IDDateRATE
1XXX001
20-Feb-21​
27.57
1XXX005
30-Jun-21​
30.55
1XXX002
02-Jan-20​
27.57
1XXX005
09-Apr-21​
28.26
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Don't need to combine both, just use lookup. You wouldn't have XLOOKUP in your 2016 version of excel anyway.
Book1
ABC
1Employee IDDate of Change (CheckDate)RATE
21XXX00101-Jan-2027.57
31XXX00112-Mar-2128.26
41XXX00201-Jan-2027.57
51XXX00212-Mar-2128.26
61XXX00501-Jan-2027.57
71XXX00509-Apr-2128.26
81XXX00520-Jun-2130.55
9
10Employee IDDateRATE
111XXX00120-Feb-2127.57
121XXX00530-Jun-2130.55
131XXX00202-Jan-2027.57
141XXX00509-Apr-2128.26
Sheet3
Cell Formulas
RangeFormula
C11:C14C11=LOOKUP(2,1/($A$2:$A$8=A11)/($B$2:$B$8<=B11),$C$2:$C$8)
 
Upvote 0
Solution

Forum statistics

Threads
1,215,603
Messages
6,125,776
Members
449,259
Latest member
rehanahmadawan

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