XLOOKUP/INDEX MATCH spills down but not right

narnian_uk

New Member
Joined
Jul 28, 2021
Messages
21
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have data in cells D6:D819. In cell A6, I have this formula:

Excel Formula:
=XLOOKUP(D6:D819, tbl[ID], tbl[[Forename]:[Preferred name]])

"tbl" comprises of three columns: "Forename", "Surname", and "Preferred name". The formula will produce a column of forenames only (whereas I want it to produce all three columns). If, on the other hand, I place one formula in A6, like this:

Excel Formula:
=XLOOKUP(D6, tbl[ID], tbl[[Forename]:[Preferred name]],{"","",""})

and then drag down to A819, the forename, surname, and preferred name will be produced in each case (which is what I was trying to achieve with the first formula, without the need for a separate formula in each cell). I tried doing much the same thing with INDEX MATCH and had the same problem. Any help gratefully received!
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
How about
Excel Formula:
=index(tbl[[Forename]:[Preferred name]],xmatch(d6:d819,tbl[Student Number]),{1,2,3})
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Another option:
Excel Formula:
=FILTER(tbl[[Forename]:[preferred name]],ISNUMBER(MATCH(tbl[ID],D6:D819,0)),"")
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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