Trying to Make XLOOKUP Work with Single Cell Array

jase71ds

Board Regular
Joined
Oct 23, 2006
Messages
137
Office Version
  1. 365
Platform
  1. Windows
I'm trying to use XLOOKUP to reference a single cell (array) and return a value.

Example
A1 = .6
B1 = {0, .1, .6, .9, 1}
XLOOKUP( A1, B1, B1, , , -1 )

So if A1 were .6, then .6 would be returned
But if A1 were .5, then .1 would be returned

I understand that I could take cell B1 and stretch it out from B1 to B5, but I'm wondering if XLOOKUP can work with a single cell array.

Anyway, I've had no luck getting XLOOKUP to work with a single cell array. Am I doing something wrong, or is this just not possible?
Thanks.
 
If you have the let function, you can shorten the formula like
Excel Formula:
=LET(ary,FILTERXML("<t><s>"&SUBSTITUTE(B1,",","</s><s>")&"</s></t>","//s"),XLOOKUP(A1,ary,ary,"",-1))
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I've not used FILTERXML before. I'll have to check it out.
 
Upvote 0
Whilst it can be very useful in some circumstances, there can be quite a few pitfalls depending on the data.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,208
Members
448,554
Latest member
Gleisner2

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