Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default How to return a Column Header

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return column header within an array when a value is met ECDNewEngland Excel Worksheet Functions 9 October 20th 08 10:08 PM
Return header cell of last column with data Karen Excel Discussion (Misc queries) 12 September 4th 08 04:05 AM
Return column number from column header text Roger[_3_] Excel Discussion (Misc queries) 4 February 14th 08 09:40 PM
Rank and return column header Jshendel Excel Discussion (Misc queries) 5 November 3rd 06 10:12 PM
Return Column header, if row value is > X kvail Excel Discussion (Misc queries) 2 January 11th 05 01:31 PM


All times are GMT +1. The time now is 03:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"