google-sheets - 在过滤器公式中使用 Unique

标签 google-sheets filter unique google-sheets-formula

我有一个标识符列表以及自动填充的每个标识符的值。
我想过滤列表,这样我只会获得唯一标识符及其各自的值。
例如“Dana”可以出现 3 次,但在过滤表中我只想看到名称(和值)一次。
理想情况下我想使用类似的东西 =filter(a:b,unique(a:a) 显然不起作用。

如前所述,列表会自动更新,因此需要拖动的公式无法解决问题。

注意:可以通过从A列中提取唯一值来解决

=unique(A:A)

然后是 Arrayformula + vLookup

=arrayformula(if(I1:I>0,vlookup(I1:I,A:B,2,0),""))

但我很好奇是否可以使用 Filter 来解决这个问题,以获得更优雅的效果。

这是一个示例(包括我提到的解决方案): https://docs.google.com/spreadsheets/d/1heKdV3U6mdGYkHCIWkeUyqo6AfhgV7ItSmolibH7ecU/edit?usp=sharing

最佳答案

请使用以下内容

=UNIQUE(A:B)

enter image description here


UPDATE

Following OP's comment/request:

Nice fix! Out of curiosity - is it possible to still use it with the filter function (for example, if I wanted to filter by Col B or add other restrictions) ?

Sure. Try these ones out

=UNIQUE(FILTER(A:B,B:B=333))

或者

=FILTER(UNIQUE(A:B),UNIQUE(B:B)=333)

引用:

关于google-sheets - 在过滤器公式中使用 Unique,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64925432/

相关文章:

google-apps-script - 将 Google Script 复制到剪贴板和 mailto [问题]

date - Google Sheets FILTER 公式大于 TODAY()

node.js - 在 Mongoose 模式中定义一个唯一的数字数组

excel - 在 Excel 中计算列中的唯一值

google-sheets - Google 电子表格中的数组公式求和

php - Google Sheets PHP API - 添加多个选项卡时出现问题

javascript - 无法使用脚本删除有效用户对 protected 范围的编辑权限 - 谷歌表格

ios - 使用 NSPredicates 过滤 NSMutableArray

javascript - AngularJS 过滤器最佳实践

mysql - 在 MySQL 查找表中删除重复的多对多关系