首页 > 解决方案 > Use Unique in a Filter formula

问题描述

I have a list of identifiers and a value for each identifier which is filled automatically.
I want to filter the list so I will only get unique identifiers and their respective value.
e.g. "Dana" can appears 3 times but in the filtered table I only want to see the name (and the value) once.
Ideally I'd like to use something like =filter(a:b,unique(a:a) which obviously doesn't work.

As mentioned, the list updates automatically so a formula that needs to be dragged won't do the trick.

Note: It can be solved by extracting uniques from col A

=unique(A:A)

and then an Arrayformula + vLookup

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

but I'm curious to see if it can be solved using Filter for more elegance.

Here's an example (including the solution I mentioned): https://docs.google.com/spreadsheets/d/1heKdV3U6mdGYkHCIWkeUyqo6AfhgV7ItSmolibH7ecU/edit?usp=sharing

标签: google-sheetsfilteruniquegoogle-sheets-formula

解决方案


请使用以下

=UNIQUE(A:B)

在此处输入图像描述


更新

遵循 OP 的评论/请求

很好的修复!出于好奇 - 是否仍然可以将它与过滤器功能一起使用(例如,如果我想按 Col B 过滤或添加其他限制)?

当然。试试这些

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

或者

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

参考:


推荐阅读