*HELP* Need a cell to return a column heading

D

dan

Hello - I am in need of a formula to return the value from a column
heading.

A B C MAX REF
1 0 3 3
1 2 1 2
0 0 0 0
3 0 1 3
2 0 3 3
2 0 3 3
1 0 2 2
0 2 0 2
1 0 2 2

In the REF column, I would like to lookup the value from the MAX
column and return the correct column heading.

So for example, the first REF cell would find the number 3 and return
the answer C.
The second cell down would find the number 2 and return the value B.

Thanks for any assistance someone can provide!
Dan
 
P

Peo Sjoblom

Assuming that A, B and C are real headers that you put there and not the
built in column headers

=INDEX($A$1:$D$1,MATCH(D2,$A2:$C2,0))

copy down

this assumes you A is in A1 and the first data starts in A2

if there is more than one value that matches it will return the first
occurrence
 
P

PCLIVE

Maybe another way:

=IF(OR(D1={"",0}),"",MID(ADDRESS(1,MATCH(D1,A1:C1)),2,1))

HTH,
Paul
 
D

dan

Assuming that A, B and C are real headers that you put there and not the
built in column headers

=INDEX($A$1:$D$1,MATCH(D2,$A2:$C2,0))

copy down

this assumes you A is in A1 and the first data starts in A2

if there is more than one value that matches it will return the first
occurrence

--
Regards,

Peo Sjoblom










- Show quoted text -

Thank you so much!!
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top