Hi Guys, can you please show how to correct the formula below to show the header of the table (AAA, BBB, CCC), I have tried Index Match and XlookUp but kept getting errors;
XLOOKUP requires lookup_array and return_array to have matching dimensions (same number of rows for vertical lookups, or same number of columns for horizontal lookups), otherwise you'll get a #VALUE! error.
As Kimmy mentions below, INDEX MATCH may be your easiest option here....
Though you could accomplish it with a latest version of EXCEL365 using BYCOL and LAMBDA:
TOCOL function is used to convert both A7:C11 and A6:C6 into single columns of the same size - then you can use a regular XLOOKUP function to lookup all values in F7:F11 - if you want you can use the "if not found" option in XLOOKUP to convert #N/A error to something else.
I don’t use xlookup, I’m still old school and use index match, but try fixing A6:C11 to A7 I was about to write you an index match formula but it doesn’t work across columns I don’t believe
Oh, I see, I think you're saying you want to find the number in A5:C11, and return the value that is in row 5 of the column where that number is. Is that right?
Original response which probably isn't helpful:
Your request is a bit confusing. In the image, it looks like you are trying to get a formula to return the two values from columns B & C that relate to your list in column F. This should do that I think:
=xlookup(F7,A6:A11,B6:C11)
The words in your actual request suggest you want to return the headers themselves, which is a bit weird. The formula for that would just be:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution. [Thread #49758 for this sub, first seen 28th Nov 2026, 06:44][FAQ][Full list]^[Contact][Source code]
Edit: fixed screenshot. 1) Formula text in H25 included ISNUMBER from H16. 2) Color coded formula text. 3) Added an example of FILTER returning 2 headers.
Jumping in with a screenshot that shows my steps / strategies for a function or two that may be new to you.
Basically does the same as u/Chrome_CW though. Theirs is more elegant, mine just isn't case sensitive. Plus, if there's more than one column with a match, it will return multiple column headers.
•
u/AutoModerator 6d ago
/u/Radiant_Arrival_6179 - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
6
u/Chrome_CW 3 6d ago
XLOOKUP is GREAT for most purposes, but here:
XLOOKUP requires
lookup_arrayandreturn_arrayto have matching dimensions (same number of rows for vertical lookups, or same number of columns for horizontal lookups), otherwise you'll get a#VALUE!error.As Kimmy mentions below, INDEX MATCH may be your easiest option here....
Though you could accomplish it with a latest version of EXCEL365 using BYCOL and LAMBDA:
=XLOOKUP(TRUE, BYCOL($A$7:$C$11, LAMBDA(col, OR(col=F7))), $A$6:$C$6)
2
u/SolverMax 167 6d ago
Perhaps:
Or, if more than one heading may be returned:
3
u/CorndoggerYYC 162 6d ago
=INDEX($A$1:$C$1, XMATCH(TRUE, BYCOL($A$2:$C$6, LAMBDA(c, COUNTIF(c, E2)>0)), 0))
You need to search column by column for the value you're looking for.
3
u/real_barry_houdini 322 4d ago
To get all 5 results with a single "dynamic array formula" use this formula in G7 (with cells below left empty)
TOCOL function is used to convert both A7:C11 and A6:C6 into single columns of the same size - then you can use a regular XLOOKUP function to lookup all values in F7:F11 - if you want you can use the "if not found" option in XLOOKUP to convert #N/A error to something else.
2
u/kimmykim328 6d ago
I don’t use xlookup, I’m still old school and use index match, but try fixing A6:C11 to A7
I was about to write you an index match formula but it doesn’t work across columns I don’t believe
1
u/Intuin_Rhaabat 6d ago edited 6d ago
Oh, I see, I think you're saying you want to find the number in A5:C11, and return the value that is in row 5 of the column where that number is. Is that right?
Original response which probably isn't helpful:
Your request is a bit confusing. In the image, it looks like you are trying to get a formula to return the two values from columns B & C that relate to your list in column F. This should do that I think:
=xlookup(F7,A6:A11,B6:C11)
The words in your actual request suggest you want to return the headers themselves, which is a bit weird. The formula for that would just be:
=A6:C6
1
u/Decronym 6d ago edited 4d ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #49758 for this sub, first seen 28th Nov 2026, 06:44] [FAQ] [Full list] ^[Contact] [Source code]
1
u/DebitsCreditsnReddit 4 6d ago edited 6d ago
Edit: fixed screenshot. 1) Formula text in H25 included ISNUMBER from H16. 2) Color coded formula text. 3) Added an example of FILTER returning 2 headers.
Jumping in with a screenshot that shows my steps / strategies for a function or two that may be new to you.
Basically does the same as u/Chrome_CW though. Theirs is more elegant, mine just isn't case sensitive. Plus, if there's more than one column with a match, it will return multiple column headers.
0
u/Nervous-Toe5784 1 6d ago
If you're on 365, this returns the header(s) of whichever column contains your lookup value (G1 here):
If the value can only appear once, this works on older versions too: