XLOOKUP with multiple criteria and with month and year

fayez_MrExcel

Active Member
Joined
Oct 29, 2005
Messages
439
Office Version
  1. 365
Platform
  1. Windows
How to "XLookup" the cost center of Emp 123 from the source data with the same month and year.

Destination
DateEmp No.Cost Center
Jan 02, 2020123Expected Result. --> cc55
Apr 25, 2020123Expected Result --> cc90
March 5, 2021718


Source Data:
DateEmp No.Cost Center
Jan 31, 2020123cc55
Apr 4, 2020123cc90
Aug 2, 2020718cc35
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
How to "XLookup" the cost center of Emp 123 from the source data with the same month and year.

Destination
DateEmp No.Cost Center
Jan 02, 2020123Expected Result. --> cc55
Apr 25, 2020123Expected Result --> cc90
March 5, 2021718


Source Data:
DateEmp No.Cost Center
Jan 31, 2020123cc55
Apr 4, 2020123cc90
Aug 2, 2020718cc35

Index match or Vlookup will do. thanks
 
Upvote 0
You could use something like:

Excel Formula:
=LOOKUP(2,1/(TEXT('Source data'!$A$2:$A$100,"mmyyyy")=TEXT(A2,"mmyyyy"))/('Source data'!$B$2:$B$100=B2),'Source data'!$C$2:$C$100)
 
Upvote 0
You could use something like:

Excel Formula:
=LOOKUP(2,1/(TEXT('Source data'!$A$2:$A$100,"mmyyyy")=TEXT(A2,"mmyyyy"))/('Source data'!$B$2:$B$100=B2),'Source data'!$C$2:$C$100)
That works perfect. Thanks
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

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