简体   繁体   English

如何获取 Google 表格不同列中每个唯一值的最大值?

[英]How to get max values for each unique value in a different column in Google Sheets?

I have two columns, the first column (A) has names and the second column (B) has values.我有两列,第一列 (A) 有名称,第二列 (B) 有值。

A一种 B
apple苹果 10 10
orange橘子 12 12
orange橘子 14 14
apple苹果 8 8个

Is there a way to get only rows with unique names from A AND max values from B?有没有办法只从 A 中获取具有唯一名称的行,从 B 中获取最大值? So the result should look like this:所以结果应该是这样的:

A一种 B
apple苹果 10 10
orange橘子 14 14

I tried using different combinations of FILTER, QUERY and UNIQUE, but so far no luck.我尝试使用 FILTER、QUERY 和 UNIQUE 的不同组合,但到目前为止运气不好。 Note that the actual dataset I'm using is much larger than this, but the idea is the same.请注意,我使用的实际数据集比这大得多,但想法是一样的。

use:利用:

=SORTN(SORT(A:B; 2; 0); 9^9; 2; 1; 1)

Should be doable directly within a query as well:也应该可以直接在查询中使用:

=query(A:B,"select A,max(B) where A is not null group by A")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在谷歌表格查询函数中使用日期的 MAX() 来获取另一列的值 - Use MAX() of a date in the Google Sheets query function, to get the value of another column Google Sheets Script - 循环遍历所有工作表,并将某一列的所有值添加到数组中,然后计算唯一值 - Google Sheets Script - Looping through all sheets, and adding all values of a certain column into array to then count unique values 如何从二维数组+最大值索引中获取每一列的最大值 - how to get the max of each column from an 2d array + index of the max value 如何使用javascript从Google电子表格中的列的所有值中获取排序的唯一值 - How to get sorted unique values from all the values of a column in Google spreadsheet using javascript 根据Google表格中的条件提取唯一值 - Extract Unique Values Based On Criteria In Google Sheets 从二维数组的每一列获取最大值 - Get max value from each column of a 2-dimensional array 获取最大和最小值在多维数组php中的每一列 - get max and min value each column in multdimensional array php 查找范围内值的匹配项并获取每个匹配项的第一个单元格和第一列值谷歌应用脚本 - Find matches to a value in a range and get first cell and first column values for each match google app script 如何根据Google表格中的布尔值将行合并为一列? - How to combine rows into one column based on boolean values in Google Sheets? 如何通过具有多个唯一值的唯一列值拆分数据框或数组 - How to split dataframe or array by unique column value with multiple unique values
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM