• Max returns a Column Name

    Author
    Topic
    #464567

    I have date in columns with the variable names in the first row. I would like to return the variable name for the column where the maximum value occurs.

    For example
    Q R S value
    2 5 3 R
    3 5 6 S
    9 5 4 Q

    I would like a formula to return R for the 1st row, S for the 2nd row and Q for the third row.

    Thanks for your help!

    Viewing 0 reply threads
    Author
    Replies
    • #1189558

      Let’s say that your data are in columns A:C, with field names (column headings) in A1:C1.
      In D2, enter the following formula:

      =INDEX($A$1:$C$1,MATCH(MAX(A2:C2),A2:C2,0))

      and fill down as far as needed. If the data span other columns, adjust the formula accordingly.

      Note: if the maximum value occurs in more than one field, the formula will return the first field (from left to right) in which it occurs.

    Viewing 0 reply threads
    Reply To: Max returns a Column Name

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: