Is there any Excel function that can copy culumn's (first row's) name if the value matches? - TagMerge
2Is there any Excel function that can copy culumn's (first row's) name if the value matches?Is there any Excel function that can copy culumn's (first row's) name if the value matches?

Is there any Excel function that can copy culumn's (first row's) name if the value matches?

Asked 1 years ago
1
2 answers

You can do it with

=INDIRECT(ADDRESS(1; MATCH(1;E2:ZZ2)+4))

The inner MATCH searched for "1" in the given array (from E2 to ZZ2). The "+4" is there, because you are beginning to search in column E (=5) and MATCH returns the column within your array.

The ADDRESS takes the first row and the column found by MATCH.

The INDIRECT returns the value of the given ADDRESS.

If you copy this formula down the rows, the search array (E2:ZZ2) is automatically adjusted to search the corresponding row.

Source: link

1

=INDEX($E$1:$O$1;1;MATCH(1;E2:O2;0))

Replace semicolon with comma if your Excel version needs it.

enter image description here

If you have, you can also use Xlookup, it's a bit easier.

=XLOOKUP(1;E2:O2;$E$1:$O$1;"not found")

Source: link

Recent Questions on excel

    Programming Languages