2017-02-22 131 views
1

我需要找出我創建的公式出了什麼問題(請參閱下文),一切工作正常,但是當我檢查單詞「complete」時,它正在吸收「不完整」,我不需要它做那。爲什麼只在「完成」時纔會與「不完整」匹配?

=SUMPRODUCT(--ISNUMBER(SEARCH({"correction","change","legal","property","terms","vesting","payment","date","interest","correction","amended","chg","address","exhibit","add","notary","complete","amnt"},V2)))>0 

回答

2

搜索將返回詞的部分。

要搜索完整的詞將其更改爲:

=SUMPRODUCT(--ISNUMBER(SEARCH({" correction "," change "," legal "," property "," terms "," vesting "," payment "," date "," interest "," correction "," amended "," chg "," address "," exhibit "," add "," notary "," complete "," amnt "}," " & V2 & " ")))>0 

通過之前和之後只會拿起完整的單詞,並沒有任何額外添加空格。

+1

如果'「complete」'是您正在搜索的單元格中的第一個(也可能是唯一的)單詞,會發生什麼? –

+1

我在V2'「」&V2&「」'的開始和結尾添加了空格,所以它沒關係。 @JohnColeman –

+1

我明白了 - 聰明。雖然標點符號仍然是個問題。一個更強大的解決方案可能需要VBA和正則表達式,儘管這可能是矯枉過正。 –

相關問題