2

I have two columns, the first column (A) has names and the second column (B) has values.

A B
apple 10
orange 12
orange 14
apple 8

Is there a way to get only rows with unique names from A AND max values from B? So the result should look like this:

A B
apple 10
orange 14

I tried using different combinations of FILTER, QUERY and UNIQUE, but so far no luck. Note that the actual dataset I'm using is much larger than this, but the idea is the same.

player0
  • 124,011
  • 12
  • 67
  • 124
R2vale
  • 75
  • 2
  • 7

2 Answers2

2

use:

=SORTN(SORT(A:B; 2; 0); 9^9; 2; 1; 1)
player0
  • 124,011
  • 12
  • 67
  • 124
0

Should be doable directly within a query as well:

=query(A:B,"select A,max(B) where A is not null group by A")
The God of Biscuits
  • 2,029
  • 2
  • 3
  • 10