Two way vertical and horizontal lookup including a date match

Mitchell_butler

New Member
Joined
Jan 19, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I want a formula to lookup a date, establish whats it falls onto using the week ending date, match that against the employee name and return the intersecting value.

For example, I want to see James' potential hours for 8/1/21, which should return 32 (B16). If the date was 04/04/21 then it should return 25.6 for James

The dates in my dataset are by week ending e.g. Sunday 10/1/21 so a date lookup would need to know that 8/1/21 falls under that week and returns the intersecting value against the employee name

I have tried the following xlookup to no avail

=XLOOKUP(B3,A13:A16,XLOOKUP(B4,B12:AW12,B16:AW16,"not found",1,1))

Sample data XLOOKUP problem.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAX
1
2
3NameJames
4Date10/01/2021
5#VALUE!
6
7Grand Total
8
9Q1Q2Q3Q4
10JanuaryFebruaryAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember
11Name10/01/202117/01/202124/01/202131/01/202107/02/202114/02/202121/02/202128/02/202107/03/202114/03/202121/03/202128/03/202104/04/202111/04/202118/04/202125/04/202102/05/202109/05/202116/05/202123/05/202130/05/202106/06/202113/06/202120/06/202127/06/202104/07/202111/07/202118/07/202125/07/202101/08/202108/08/202115/08/202122/08/202129/08/202105/09/202112/09/202119/09/202126/09/202103/10/202110/10/202117/10/202124/10/202131/10/202107/11/202114/11/202121/11/202128/11/202105/12/2021
12Week ending10/01/202117/01/202124/01/202131/01/202107/02/202114/02/202121/02/202128/02/202107/03/202114/03/202121/03/202128/03/202104/04/202111/04/202118/04/202125/04/202102/05/202109/05/202116/05/202123/05/202130/05/202106/06/202113/06/202120/06/202127/06/202104/07/202111/07/202118/07/202125/07/202101/08/202108/08/202115/08/202122/08/202129/08/202105/09/202112/09/202119/09/202126/09/202103/10/202110/10/202117/10/202124/10/202131/10/202107/11/202114/11/202121/11/202128/11/202105/12/2021
13Gary32323232323232323232323225.625.632323225.632323225.632323232323232323232323225.6323232323232323232323232321504
14Bob32323232323232323232323225.625.632323225.632323225.632323232323232323232323225.6323232323232323232323232321504
15Liz32323232323232323232323225.625.632323225.632323225.632323232323232323232323225.6323232323232323232323232321504
16James32323232323232323232323225.625.632323225.632323225.632323232323232323232323225.6323232323232323232323232321504
Potential hours
Cell Formulas
RangeFormula
B5B5=XLOOKUP(B3,A13:A16,XLOOKUP(B4,B12:AW12,B16:AW16,"not found",1,1))
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Welcome to the MrExcel forum!

Try in B5:

Excel Formula:
=INDEX($B$13:$AW$16,MATCH(B3,$A$13:$A$16,0),MATCH(B4+CHOOSE(WEEKDAY(B4),0,6,5,4,3,2,1),$B$12:$AW$12,0))
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,127
Members
452,381
Latest member
Nova88

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