Header of column which has minimum in row?

P

PGPS

Hi,
I have a problem. I have a matrix. In column #8(MIN_VAL), I calculate
the minimum of that particular row. I want to find the header of the
column, which has the minimum value. For example, in the matrix given
below, the answers under column MIN_HEADER should be
COL1,COL2,COL2,COL3,COL4 , for the corresponding rows. What functions
do I use in excel to do this.


COL1 COL2 COL3 COL4 COL5 COL6 COL7 MIN_VAL MIN_HEADER
12 18 23 22 25 27 26 12 ?
16 15 31 22 21 23 26 15 ?
19 14 23 22 20 32 25 14 ?
15 21 20 11 31 22 25 11 ?
15 19 19 21 10 22 15 10 ?


Thanks.
 
S

Scott

Try:
=INDEX($A$1:$G$1,1,MATCH(H2,A2:G2,0))

Where A1:G1 is your header, A2:G2 is the row, H2 is the minimum value
in that row. If you don't want to have to calculate the minimum, you
can put MIN(A2:G2) in place of the H2 and calculate it directly. ie:
=INDEX($A$1:$G$1,1,MATCH(MIN(A2:G2),A2:G2,0))

Note that your answer for rows 4 and 5 doesn't seem correct in your
example, and should probably be COL4, COL5, respectively.

Scott
 

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