Search code examples
excelindexingexcel-formulamatchlookup

Getting Value of Header with Min()/Max() in Excel


I would like to calculate the minimum of some values. Beside this I want to catch the value of the "Minimum" header. Example:

+------------+----------+--------+------+--------+
|     A      |    B     |   C    |  D   | result |
+------------+----------+--------+------+--------+
| item       | New York | Boston | Phil | ---    |
| Apple      | 3.4      | 4.2    | 2.3  | Phil   |
| Peach      | 2.2      | 2.5    | 1.7  | Phil   |
| Strawberry | 5.5      | 5.1    | 7.3  | Boston |
+------------+----------+--------+------+--------+

I can find the MIN() in the row 'Apple'. But how can i manage to receive the column header as a result like Phil in this example?


Solution

  • You can use INDEX + AGGREGATE:

    =INDEX($B$1:$D$1;AGGREGATE(14;6;(B2:D2=MIN(B2:D2))*COLUMN(B2:D2)-1;1))
    

    enter image description here