Excel: Search for a list of strings within a particular string using array formulas?

后端 未结 4 1103
余生分开走
余生分开走 2020-11-29 05:20

I want to search a cell for a list of words. I thought this would work as an array formula:

{=FIND(,

        
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 05:54

    1. Arange your word list with delimiter which never occures in the words, f.e. |
    2. swap arguments in find call - we want search if cell value is matching one of the words in pattern string {=FIND("cell I want to search","list of words I want to search for")}
    3. if the patterns are similar, there is a risk of getting more results than wanted, we restrict just correct results via adding &"|" to the cell value tested (works well with array formulas) cell G3 could contain: {=SUM(FIND($A$1:$A$100&"|";A3))} this ensures spreadsheet will compare strings like "cellvlaue|" againts "pattern1|", "pattern2|" etc. which sorts out conflicts like pattern1="newly added", pattern2="added" (sum of all cells matching "added" would be too high, including the target values for cells matching "newly added", which would be a logical error)

提交回复
热议问题