A栏和B栏都有句子,我试图找出哪些句子的词最匹配,然后从B栏中返回这句话。
+-----------------------+-----------------------+----------------------+
|Column A |Column B |Return most matched |
+-----------------------+-----------------------+----------------------+
|this is a black car |Twinkle little star |that is a black couch |
+-----------------------+-----------------------+----------------------+
|there is a red cat |London Bridge is Fallin|red cat is in the hat |
+-----------------------+-----------------------+----------------------+
|I see a twinkle star |red cat is in the hat |Twinkle little star |
+-----------------------+-----------------------+----------------------+
|London tower is standin|that is a black couch |London Bridge is Fallin
+-----------------------+-----------------------+----------------------+
这里是初学者电子表格程序员。不确定这是否可能?谁能帮我指出正确的方向吗?
我在谷歌上搜索了许多匹配单个单词的词,但在句子中却没有匹配大多数匹配的单词。
发布于 2019-10-15 09:43:51
粘贴在C2中并向下拖动:
=ARRAYFORMULA(QUERY({B$2:B, MMULT(IFERROR(--REGEXMATCH(SPLIT(LOWER(B$2:B), " "),
"^"&SUBSTITUTE(LOWER(A2), " ", "$|^")&"$"), 0),
ROW(INDIRECT("A1:A"&COLUMNS(SPLIT(B$2:B, " "))))^0)},
"select Col1 order by Col2 desc limit 1", 0))
https://stackoverflow.com/questions/58390675
复制相似问题