Three Way lookup

Mark F

Well-known Member
Joined
Jun 7, 2002
Messages
515
Office Version
  1. 365
Platform
  1. Windows
Hi,

In Cell D1 in my "Shipping" sheet I have a Purchase Order Number
In Cell D2 I have the Last four digits of a UPS tracking number
UPS Tracking Numbers are 15 Characters long
In D3 I want to record the date a shipment with PO Number from D1 and Last 4 UPS digits in D2 was received.

In my "Back Order" Workbook:
All PO Numbers are recorded in Column A
Full 15 digit UPS Tracking Numbers are recorded in Column V
Date received is on Column U
=IF(D1<>"",XLOOKUP("*"&D1&"*",'[Back orders.xlsx]MAIN'!$a:$a,'[Back orders.xlsx]MAIN'!$U:$U,"no match",2),"")
The version above does partially work, in that it does find a date in Column U for a PO, but it's no good if the order wasn't received on the specified UPS shipment (in D2)
I've tried various options using MID formula to find the last 4 digits of the UPS reference in Column V, but I just cannot get there.

Any help appreciated
Shipping Cost.jpg
Back Order.jpg


Thanks Mark
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try this:
( I'm not going to build a testing workbook, but I think you can adjust as needed).
But, have you considered using power query to query your data? You may not have to have the external workbook open to do the lookup. In this scenario I think you need to have the workbook open.
This also uses exactly 11 placeholder characters, You could also have an asterix in the front instead of 11 question marks.

Book1
ABCDEFGHIJ
1105657
22815ZZZZZZZZZZZ28141056572024-03-11
3ZZZZZZZZZZZ43171056582024-03-10
42024-03-11ZZZZZZZZZZZ39191056592024-03-13
5ZZZZZZZZZZZ32371056602024-03-14
6ZZZZZZZZZZZ28151056572024-03-11
7ZZZZZZZZZZZ46731056612024-03-15
8ZZZZZZZZZZZ42851056622024-03-16
9ZZZZZZZZZZZ38851056632024-03-17
10ZZZZZZZZZZZ45161056642024-03-18
11ZZZZZZZZZZZ30581056652024-03-19
12ZZZZZZZZZZZ47401056662024-03-20
13ZZZZZZZZZZZ41901056672024-03-21
Sheet1
Cell Formulas
RangeFormula
C4C4=XLOOKUP("???????????"&D2&D1,$G$2:$G$13&$H$2:$H$13,$I$2:$I$13,"Not Found",2,1)
 
Upvote 0
Thank you.

I should have mentioned that that the UPS tracking number in column V is usually followed by other information in the same cell. I tried this code. It does look up the date, based on the PO number, seems to ignore the tracking number. As always any help appreciated.
=XLOOKUP("*"&D2&"*"&D1,MID('[Back orders.xlsx]MAIN'!$V5:$V5000,15,4)&'[Back orders.xlsx]MAIN'!$A5:$A5000,'[Back orders.xlsx]MAIN'!$U5:$U5000,,2,1)
 
Upvote 0
Give this a try:
Excel Formula:
=XLOOKUP(1,('[Back Orders.xlsx]MAIN'!$A:$A=D1)*(MID('[Back Orders.xlsx]MAIN'!$V:$V,11,5)=TRIM(D2)),'[Back Orders.xlsx]MAIN'!$U:$U,"")
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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