View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default How to return a Column Header

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.

--
Biff
Microsoft Excel MVP


"Scott" wrote in message
...
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.