Please help - XLOOKUP formula works on 1 value only

turner369

New Member
Joined
Aug 16, 2021
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I'm doing a spreadsheet where I'm using XLOOKUP to retrieve certain data with multiple criteria. By inputting the name in cell A5, cells B5 to E5 will retrieve the data from the spreadsheet below.

My formula is this

For Cell B5 =XLOOKUP(B4,G10:G37,XLOOKUP(A5,A10:A37,H10:H37))
For Cell C5 =XLOOKUP(C4,G10:G37,XLOOKUP(A5,A10:A37,H10:H37))
For Cell D5 =XLOOKUP(D4,G10:G37,XLOOKUP(A5,A10:A37,I10:I37))
For Cell E5 =XLOOKUP(E4,G10:G37,XLOOKUP(A5,A10:A37,I10:I37))

Now this is the most perplexing issue, the formula only works for T-shirts as seen below

1629129405216.png


However, when i sort by Category (Column G), the T-shirt formulas stop working and the Pants formula starts working

1629129553032.png


Tried sorting the other columns and there were no issues. Cell formats are also all the same

I have absolutely no clue why this is happening. Why does XLOOKUP work/not work when it is the exact same formula with only the lookup_value changed?

Please help!!

FYI i am using Microsoft Office Professional Plus 2019 with the ExcelDna.XFunctions Add-in for XLOOKUP function
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

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