Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default Returning Column Header based on Row and Value

Hi All,

I've run into a problem trying to return a value from the header row
based on locating a row value and a subsequent value within that row
to define the column header needed.

For example in the confusing example below imagine that the top row "
A B C D" is the column headers and the column 1 "A B C D" is the row
labels i've assigned. Given values of "C" and "D" I'd like to write a
formula that searches down column 1 for "C" and then looks across the
row for value "D" and returns the value of the column header "B".
Sorry if this question is worded too obscurely. Thanks for any help.


A B C D
A A B C D
B B C D E
C C D E F
D D E F G
  #3   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Returning Column Header based on Row and Value

Assuming the table as posted is within A1:E5
and G1:H1 contains the variables: C, D
you could place this in I1:
=INDEX(B1:E1,MATCH(H1,OFFSET(B1:E1,MATCH(G1,A:A,0)-1,,,4),0))
to retrieve the required col header within B1:E1
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"Chad DiGregorio" wrote in message
...
Hi All,

I've run into a problem trying to return a value from the header row
based on locating a row value and a subsequent value within that row
to define the column header needed.

For example in the confusing example below imagine that the top row "
A B C D" is the column headers and the column 1 "A B C D" is the row
labels i've assigned. Given values of "C" and "D" I'd like to write a
formula that searches down column 1 for "C" and then looks across the
row for value "D" and returns the value of the column header "B".
Sorry if this question is worded too obscurely. Thanks for any help.


A B C D
A A B C D
B B C D E
C C D E F
D D E F G



  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Returning Column Header based on Row and Value

Here's a non-volatile approach:

Column headers in the range B1:E1
Row headers in the range A2:A5
Data in the range B2:E5

A10 = C
B10 = D

=INDEX(B1:E1,MATCH(B10,INDEX(B2:E5,MATCH(A10,A2:A5 ,0),0),0))

--
Biff
Microsoft Excel MVP


"Chad DiGregorio" wrote in message
...
Hi All,

I've run into a problem trying to return a value from the header row
based on locating a row value and a subsequent value within that row
to define the column header needed.

For example in the confusing example below imagine that the top row "
A B C D" is the column headers and the column 1 "A B C D" is the row
labels i've assigned. Given values of "C" and "D" I'd like to write a
formula that searches down column 1 for "C" and then looks across the
row for value "D" and returns the value of the column header "B".
Sorry if this question is worded too obscurely. Thanks for any help.


A B C D
A A B C D
B B C D E
C C D E F
D D E F G



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
column data retrieved based on value in header row Tomkat743 Excel Discussion (Misc queries) 2 March 4th 09 04:17 AM
pick from table based on row and column header PBcorn Excel Worksheet Functions 2 June 29th 08 07:00 PM
Copy data from other worksheet based on column header [email protected] Excel Discussion (Misc queries) 0 April 29th 08 08:18 PM
Returning Column Header [email protected] Excel Worksheet Functions 4 February 12th 08 04:00 AM
Returning column header as result Patricia Excel Worksheet Functions 4 July 6th 06 05:36 PM


All times are GMT +1. The time now is 05:07 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"