计算指定列里的所有句子是否包含短语中的所有单词

例题描述和简单分析

有 Excel 文件 book1.xlsx,如下所示:


A

B

1

Systems Engineer

Systems   Product Engineer

2


Systems   Manager

3


Manager   Product

4


Engineer   Product

5


Engineer   Systems

6


Systems   Engineer

7


Engineer   Product Systems

现需要在 C 列计算 B 列每个格子中是否包含 A1 中的所有单词,包含返回 yes,否则返回 no,结果如下:


A

B

C

1

Systems Engineer

Systems   Product Engineer

yes

2


Systems   Manager

no

3


Manager   Product

no

4


Engineer   Product

no

5


Engineer   Systems

yes

6


Systems   Engineer

yes

7


Engineer   Product Systems

yes

解法及简要说明

Excel中加载插件 ExcelRaq.xll 后。

在 C1 格输入公式:=esproc("=if(?1.words()\?2.words()==[],""yes"",""no"")",$A$1,B1),再将 C1 下拉至 C7,即可得到结果。

问答搜集

https://stackoverflow.com/questions/63634662/check-if-words-in-a-cell-appear-in-a-list-but-the-words-can-be-out-of-sequenc