Xlookup and Match

Peter Davison

Active Member
Joined
Jun 4, 2020
Messages
433
Office Version
  1. 365
Platform
  1. Windows
I have tried to use Xlookup which is working okay when the column to search is not variable.
For example I want to look up the Rank number 1 but it could be in any one of 10 columns so I want to match which column to use.

This is my xlookup formula -
XLOOKUP($B187,'Pivot Vol'!$AE$9:$AE$5000,'Pivot Vol'!$B$9:$B$5000,"",0)
I want to be able to use match for the AE column because it could be any column AB to AG.
The return column will always be B.
B187 is a number it is looking for in the search column

So its like I normally use a VLookup with Match but want to use XLookup and match but can't work it out.

Could anyone help me. It would be really appreciated?

Thanks
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
What are you trying to match to find which column to use?
 
Upvote 0
I have 11 columns to search and each column has a store number at the top of the column so I want to match the column by this?
Hope that is clear
 
Upvote 0
Where is the store number held?

Basically you want:

XLOOKUP($B187,INDEX('Pivot Vol'!$AB$9:$AG$5000,0,MATCH(A2,'Pivot Vol'!$AB$8:$AG$8,0)),'Pivot Vol'!$B$9:$B$5000,"",0)

where A2 is the store number cell.
 
Upvote 0
Brilliant, that is most helpful.
Appreciate your time.

I have a separate question shortly trying to do a dynamic range for a chart using Offset and Counta by row. I will come back to you.
Thanks again
 
Upvote 0
I believe I've cracked the problem above.
I think it is because I needed the following
=OFFSET(Dashboard!$FA$6,0,1,COUNTA(Dashboard!$6:$6))
and I had blank columns between series's.

Thanks again for all your help.
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,465
Members
448,965
Latest member
grijken

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