如何拆分逗号分隔的字符串并去除重复项

huangapple go评论76阅读模式
英文:

How to split comma separated strings and remove duplicates

问题

我尝试从另一个标签页中获取一些调查答案。答案默认使用逗号分隔,我需要一个可以拆分范围并生成无重复项列表的公式。

这是我尝试做的事情的示例。

英文:

I'm trying to grab some survey answers from another tab.
The answers were provided with a comma by default separation between options, and I need a formula that splits ranges and results in a list with no duplicates.

Here is an example of what I'm trying to do.

如何拆分逗号分隔的字符串并去除重复项

答案1

得分: 0

使用以下公式:

=INDEX(UNIQUE(TRIM(FLATTEN(SPLIT(FILTER(B3:B9, B3:B9<>" "), ",")))))

如果你的另一个标签是 Sheet1,那么使用 Sheet1!B3:B9

(根据你的范围和地区调整公式)

英文:

Use the following

=INDEX(UNIQUE(TRIM(FLATTEN(SPLIT(FILTER(B3:B9, B3:B9&lt;&gt;&quot;&quot;),&quot;,&quot;)))))

If your other tab is Sheet1 then use Sheet1!B3:B9

(Do adjust the formula according to your ranges and locale)

如何拆分逗号分隔的字符串并去除重复项

huangapple
  • 本文由 发表于 2023年3月7日 03:07:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75654862.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定