如果存在匹配项,将所有匹配项收集到一个单元格中的电子表格公式

Spreadsheet formula to gather all matches into one cell if matches exist

我在回答这个 post 时使用了公式: Spreadsheet formula to gather all matches into one cell

我的版本是:

=ArrayFormula(CONCATENATE(REPT(Occupation!B:D&", ",Occupation!A:A=A2)))

不过,我的一些职业!B:D 单元格是空的,所以我得到的结果是“Attorney, , ,”。

我的问题是我应该在哪里添加 IFERROR 或 ISBLANK 或 IF <> "" 以便在 Occupation!B:D 上的任何单元格为空时不返回任何内容。

尝试

=TEXTJOIN(", ", 1, FILTER(Occupation!B:D, Occupation!A:A=A2))

看看是否有帮助?

参考资料