Excel Formula: What is the equivalent of =MATCH(), but for multiple columns

microsoft excelworksheet-function

Problem

This formula will return the row number where the value "Bob" appears. Say the value happens to be in $A$10, the formula would return: 10

=MATCH("Bob",A:A,0)

I would like a formula to do a similar thing, except give me the column.
For example, if I search for "Bob" in A:F, I would like to know what column it is in. I thought of something like this:

=INDEX(1:1,MATCH("Bob",A:F,0))

or

=CELL("col",B14)

Where the address, B14, is found with a lookup, index/match, etc.

Best Answer

MATCH only works with a single column or row, so you can use a row like 1:1 rather than A:A

=MATCH("Bob",1:1,0)

That will give you a number, so if "Bob" is first found in Z1 you'd get 26.....or do you need something different?

Do you have a larger problem of which this is a part?

Edited in response to comments:

This "array formula" will search for A2 anywhere in Summary!A2:Z1000 and return the column header from the first column where that value is found

=INDEX(Summary!A1:Z1,SMALL(IF(Summary!A2:Z1000=A2,COLUMN(Summary!A2:Z1000)-COLUMN(Summary!A2)+1),1))

formula needs to be confirmed with CTRL+SHIFT+ENTER so that curly braces like { and } appear around the formula in the formula bar

Related Question