Excel - Tell me the column header that had the highest number for each row

RIK picture RIK · May 10, 2013 · Viewed 12.7k times · Source
| Name  | Blues | Greens | Yellows | Reds | Winner |
| Smith | 35    | 42     | 52      | 17   |        |

I want to know the column header that has the largest number for each row and insert its name in the 'Winner' column.

How would this be done

Answer

kb_sou picture kb_sou · May 10, 2013

You can do this by using a formula like (suposing the headers on A1:E1)

=OFFSET($A$1,0,MATCH(MAX($A2:$E2),$A2:$E2,0)-1)

The Match function will give the position of the maximum value of the range $A2:$E2. Then you can use theOffset function to get the header on that position