How to return a Column Header

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

I have several columns with rows of data in them. For example

_____Header1_____Header2_____Header3_____
_____Data1_______Data2_______Data3_______


What I want to do is search for "Data2" text, and return that Column's
header, for instance, in this example, searching for "Data2" would yield
"Header2".

What formula should best be used?

Thanks.
 
I have several columns with rows of data in them.

Headers in the range A1:C1
Data in the range A2:C6
E1 = lookup value

Try this array formula** :

=INDEX(A1:C1,MAX(IF(A2:C6=E1,COLUMN(A1:C1)))-COLUMN(A1)+1)

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.
 
Back
Top