![](/img/trans.png)
[英]Use MAX() of a date in the Google Sheets query function, to get the value of another column
[英]How to get max values for each unique value in a different column in Google Sheets?
我有兩列,第一列 (A) 有名稱,第二列 (B) 有值。
一種 | 乙 |
---|---|
蘋果 | 10 |
橘子 | 12 |
橘子 | 14 |
蘋果 | 8個 |
有沒有辦法只從 A 中獲取具有唯一名稱的行,從 B 中獲取最大值? 所以結果應該是這樣的:
一種 | 乙 |
---|---|
蘋果 | 10 |
橘子 | 14 |
我嘗試使用 FILTER、QUERY 和 UNIQUE 的不同組合,但到目前為止運氣不好。 請注意,我使用的實際數據集比這大得多,但想法是一樣的。
利用:
=SORTN(SORT(A:B; 2; 0); 9^9; 2; 1; 1)
也應該可以直接在查詢中使用:
=query(A:B,"select A,max(B) where A is not null group by A")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.