Search code examples
google-sheetsfilterformulaspreadsheetminimum

Find minimum numeric value and return cell in different row


I am looking to find the minimum (numeric value only) of a multi-column range that will have numbers and text values in it and then return a cell from the same column in Row 1.

For example:

A B C D
John Dave Ryan Nate
2 7 3 4
5 Apple 1 8
9 10 Orange 12
Banana 14 Kiwi 16

I want to first find the minimum numeric-only value in A2:D5 (which would be 1) and then return the value/cell that corresponds with that column in Row 1 (which would be Ryan).

I tried the follow formula but it wasn't working properly.

=INDEX(A1:D1,MIN(IF(ISNUMBER(A2:D5),A2:D5,0)))

Solution

  • for min value only:

    =INDEX(MIN(A2:D5))
    

    enter image description here

    and:

    =+INDEX(SORT(FLATTEN(IF(IFERROR(A2:D5*1)=MIN(A2:D5), A1:D1, ))))
    

    enter image description here

    or:

    =INDEX(QUERY({SPLIT(FLATTEN(A1:D1&"♦"&A2:D5), "♦")&""}, 
     "order by Col2 limit 1"))
    

    enter image description here