问题
If cell A1 contains "Brother Sister Father Mother Grandson" and cell A2 contains "Mother Father", return 2 in cell A3.
How can I achieve this?
回答1:
Try
=SUMPRODUCT(TRANSPOSE(SPLIT(A1," "))=SPLIT(A2," "))
回答2:
For the giving example, this formula entered in A3 should work
=sum(ArrayFormula(--regexmatch(split(A1, " "), substitute(A2, " ", "|"))))
All depends on how the "real data" is structured.
来源:https://stackoverflow.com/questions/50772870/google-sheets-compare-multiple-words-in-cell-with-another-cell-count-number