0

With this formula, I can get a list of the rows with the highest total

=QUERY(A2:D5, "Select A,D Order by D Desc Limit 4")

enter image description here

But I can't figure out how to do the opposite, find the columns with the highest total, and return a list of that.

It should list

betty 12
aaron 6
2
  • Please edit this question for clarity. It doesn't make sense as it's written. You already have those totals. Why do you want the totals row?
    – Blindspots
    Commented Sep 14, 2023 at 0:19
  • 1
    I wanted the totals row to be sorted, to see which columns have the highest totals
    – stackers
    Commented Sep 14, 2023 at 17:45

1 Answer 1

1

One option is to use TRANSPOSE. This function change columns to rows.

NOTE: When feeding QUERY with an array of values, like the result of transpose, instead of using the column letters as field names, use Col1, Col2, according to the column position of the feed array of values.

=QUERY(TRANSPOSE(A1:C5),"SELECT Col1,Col5 Order By Col5 Desc")
   
total
betty 12
aaron 6
1
  • 1
    Ah that's the key! I actually did see transpose, but when I tried it by selecting A (I assumed they would get remapped to the column letters), it said A didn't exist. ColX is the secret!
    – stackers
    Commented Sep 14, 2023 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.