1

我有一个 Excel 电子表格,其中包含 7 个单元格(在一列中),其中包含数据,这些是 C13 到 C19 我有一个公式将这些单元格中的所有数据组合在一起并将其放入一个单元格中,这个公式是=C13&", " &C14&"、"&C15&"、"&C16&"、"&C17&"、"&C18&"、"&C19并且工作正常。但是,我可以更改此公式以遗漏包含文本“Nothing else carby”的任何单元格吗?

4

2 回答 2

1

您可以在 Excel 2019 中使用:

=TEXTJOIN(", ",,IF(C13:C19<>"Nothing else carby",C13:C19,""))

如果“Nothing else carby”可以是单元格值中的子字符串,请尝试:

=TEXTJOIN(", ",,IF(ISNUMBER(FIND("Nothing else carby",C13:C19)),"",C13:C19))

确认通过CtrlShiftEnter

于 2021-05-28T08:25:49.480 回答
0

如您所见,公式不应该那么长:

=TEXTJOIN(",",TRUE,IF(C13:C19="Nothing","", C13:C19))

(出于可读性原因,我只是使用“Nothing”而不是整个词。)

参数说明:

"," : delimiter: between every cell content, a comma is added.
TRUE : treatment of blank cells (don't put them).
IF (...) : In case cell content is "Nothing", put an empty string. 
           In combination with the previous parameter,
           just one comma will be put in the result:
           "a,b,c,e,f,g" and not "a,b,c,,e,f,g" (see result).

使用数据:

a
b
c
Nothing
e
f
g

结果:

a,b,c,e,f,g
于 2021-05-28T08:32:16.953 回答