XLOOKUP Formula working in certain sequence but not in others

thewiseguy

Well-known Member
Joined
May 23, 2005
Messages
956
Office Version
  1. 365
Platform
  1. Windows
Hi all,

When the formula in column C was written like this:

=IFERROR(XLOOKUP(A2,Table_Fixture[MaskedPartNumber],Table_Fixture[ApplicationType],XLOOKUP(A2,Table_Lamp[MaskedPartNumber],Table_Lamp[ApplicationType],XLOOKUP(A2,Table_Materials[MaskedPartNumber],Table_Materials[ApplicationType],A2,Table_Accessory[MaskedPartNumber],Table_Accessory[ApplicationType],XLOOKUP(A2,Table_Control[MaskedPartNumber],Table_Control[ApplicationType],XLOOKUP(A2,Table_Rental[MaskedPartNumber],Table_Rental[ApplicationType],"",0)))))),"")

it did not work.

written as it is here; it does work.

v2023.4 - Copy.xlsm
ABCD
1Mfg/ItemItemItem TypeManufacturer
2MAXLITE 11W LED PL Lamp [GX24q-MCCT]11W LED PL Lamp [GX24q-MCCT]CFL LampMAXLITE
3MAXLITE 2X4 LED Flat Panel [WS-MCCT]2X4 LED Flat Panel [WS-MCCT]  
4MAXLITE 4ft LED Wrap [23W-MCCT]4ft LED Wrap [23W-MCCT]  
5MAXLITE 8ft LED Linear Highbay [65W-MCCT]8ft LED Linear Highbay [65W-MCCT]  
6PHILIPS 5.5W LED Par20 Lamp [3K-90CRI]5.5W LED Par20 Lamp [3K-90CRI]PAR LampPHILIPS
7TBD Stranded Copper THHN Cable 12-AWG BLK/WHT/GRNStranded Copper THHN Cable 12-AWG BLK/WHT/GRNMaterialsTBD
8ROSELLE Roll Off Dumpsters – 15 YardRoll Off Dumpsters – 15 YardRentalRoselle
9UNITEDRENTALS Boom, Articulated, 30-39' Diesel DayBoom, Articulated, 30-39' Diesel DayRentalUnited Rentals
Sheet1
Cell Formulas
RangeFormula
A2:A9A2=VSTACK('Product (BOM)'!A2#,'Material (BOM)'!A2#,'Rental (BOM)'!A2#)
B2:B9B2=IFERROR(RIGHT(A2,LEN(A2)-FIND(" ",A2)),"")
C2:C9C2=IFERROR(XLOOKUP(A2,Table_Rental[MaskedPartNumber],Table_Rental[ApplicationType],XLOOKUP(A2,Table_Lamp[MaskedPartNumber],Table_Lamp[ApplicationType],XLOOKUP(A2,Table_Materials[MaskedPartNumber],Table_Materials[ApplicationType],(A2,Table_Accessory[MaskedPartNumber],Table_Accessory[ApplicationType],XLOOKUP(A2,Table_Control[MaskedPartNumber],Table_Control[ApplicationType],XLOOKUP(A2,Table_Fixture[MaskedPartNumber],Table_Fixture[ApplicationType],"",0)))))),"")
D2:D9D2=IFERROR(XLOOKUP(A2,Table_Rental[MaskedPartNumber],Table_Rental[Brand],XLOOKUP(A2,Table_Lamp[MaskedPartNumber],Table_Lamp[Brand],XLOOKUP(A2,Table_Materials[MaskedPartNumber],Table_Materials[Brand],(A2,Table_Accessory[MaskedPartNumber],Table_Accessory[Brand],XLOOKUP(A2,Table_Control[MaskedPartNumber],Table_Control[Brand],XLOOKUP(A2,Table_Fixture[MaskedPartNumber],Table_Fixture[Brand],"",0)))))),"")
Dynamic array formulas.


It seems like which ever string is last in the command, does not work properly. C3, C4 and C5 should populate the words, "Fixture."

Any ideas? I am stumped!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You're missing the XLOOKUP function for the table accessories table?
 
Upvote 0
no, there just happen not to be any accessories in this project.

the word "flat panel" is not populating
 
Upvote 0
The formula is the same here but i switched the first and last commands. It works - cell C3

v2023.4 - Copy.xlsm
ABCD
1Mfg/ItemItemItem TypeManufacturer
2MAXLITE 11W LED PL Lamp [GX24q-MCCT]11W LED PL Lamp [GX24q-MCCT]CFL LampMAXLITE
3MAXLITE 2X4 LED Flat Panel [WS-MCCT]2X4 LED Flat Panel [WS-MCCT]Flat PanelMAXLITE
Product (BOM)
Cell Formulas
RangeFormula
A2:A6A2=SORT(UNIQUE(FILTER('Line Item (input)'!W3:W2002,('Line Item (input)'!W3:W2002 <>"")*('Line Item (input)'!W3:W2002<>0),FALSE)))
B2:B3B2=IFERROR(RIGHT(A2,LEN(A2)-FIND(" ",A2)),"")
C2:C3C2=XLOOKUP(A2,Table_Fixture[MaskedPartNumber],Table_Fixture[ApplicationType],XLOOKUP(A2,Table_Lamp[MaskedPartNumber],Table_Lamp[ApplicationType],XLOOKUP(A2,Table_Materials[MaskedPartNumber],Table_Materials[ApplicationType],(A2,Table_Accessory[MaskedPartNumber],Table_Accessory[ApplicationType],XLOOKUP(A2,Table_Control[MaskedPartNumber],Table_Control[ApplicationType],XLOOKUP(A2,Table_Rental[MaskedPartNumber],Table_Rental[ApplicationType],"",0))))))
D2:D3D2=XLOOKUP(A2,Table_Fixture[MaskedPartNumber],Table_Fixture[Brand],XLOOKUP(A2,Table_Lamp[MaskedPartNumber],Table_Lamp[Brand],XLOOKUP(A2,Table_Materials[MaskedPartNumber],Table_Materials[Brand],(A2,Table_Accessory[MaskedPartNumber],Table_Accessory[Brand],XLOOKUP(A2,Table_Control[MaskedPartNumber],Table_Control[Brand],XLOOKUP(A2,Table_Rental[MaskedPartNumber],Table_Rental[Brand],"",0))))))
Dynamic array formulas.
 
Upvote 0
If you don't have an XLOOKUP in place for table accessories, how do you expect the formula to check if there are no matches and proceed with the xlookup for the tables after the table accessories table?
 
Upvote 0
i do have one in there….table_accessory

the issue only affects whichever command is last. the last command is not working.
 
Upvote 0
Just humour me and tell me what happens when you add an XLOOKUP to where the blank yellow box is?
1690253717942.png
 
Upvote 0
Solution
AHHHHH!

now i se what you were saying. I've been looking at this for an hour and totally missed it. Thank you! HUge help!
 
Upvote 0

Forum statistics

Threads
1,215,178
Messages
6,123,484
Members
449,100
Latest member
sktz

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