简体   繁体   English

Google表格 - 将单元格中的多个单词与另一个单元格进行比较并计算匹配数

[英]Google Sheets - Compare multiple words in cell with another cell & count number of matches

If cell A1 contains "Brother Sister Father Mother Grandson" and cell A2 contains "Mother Father", return 2 in cell A3.如果 A1 单元格包含“兄弟姐妹父亲母亲孙子”,并且单元格 A2 包含“父亲母亲”,则在单元格 A3 中返回 2。

How can I achieve this?我怎样才能做到这一点?

For the giving example, this formula entered in A3 should work 对于给出的示例,在A3中输入的公式应适用

=sum(ArrayFormula(--regexmatch(split(A1, " "), substitute(A2, " ", "|"))))

All depends on how the "real data" is structured. 一切都取决于“真实数据”的结构。

尝试

=SUMPRODUCT(TRANSPOSE(SPLIT(A1," "))=SPLIT(A2," "))

The following worked for me:以下对我有用:

=SUMPRODUCT(TRANSPOSE(SPLIT(A1;" "))=SPLIT(A2;" "))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何计算Google表格中特定单元格中的单词数? - How do I count the number of words in a specific cell in Google Sheets? 计算 Google 表格单元格中的换行符数 - Count number of line breaks in Google Sheets cell 如果单元格与另一个工作表中的另一个单元格匹配,则Google表格会更改单元格背景 - Google Sheets change cell background if cell matches another cell from another sheet Google表格的单元格值与另一个工作表中的多个列匹配的列总和 - Google Sheets sum of columns where cell value matches multiple columns in another sheet 如何计算单元格是否在Google表格中的单词末尾包含* - How to count if cell contains * in end of words in Google Sheets Google表格-如果一个单元格中的颜色与另一单元格中的颜色匹配,则在另一单元格中打印该东西 - Google Sheets - If the colour in one cell, matches the colour in another cell, print the thing in the other cell Google表格,使用Countifs计数范围内的值数,并匹配另一个单元格的值 - Google Sheets, using Countifs to count number of values in a range, and match another cell's value Google Sheets - 基于另一个单元格的比较行数 - Google Sheets - Count of compared rows based on another cell 提取Google表格中单元格中的数字 - Extract the number in cell in Google sheets 谷歌表格 - 基于另一个单元格突出显示单元格 - Google Sheets - Highlight cell based on another cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM