Index match where any lookup values are in lookup array

前端 未结 1 1407
无人共我
无人共我 2021-01-25 20:45

Is it possible to do an Index Match to find if any of the words that are in the lookup value are in the lookup array. The lookup value is a sentence so can contain several word

相关标签:
1条回答
  • 2021-01-25 21:25

    I like to use AGGREGATE to return the row number to an INDEX():

    =IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW($A$2:$A$4)/(ISNUMBER(SEARCH($A$2:$A$4,C1))),1)),"Not Found")
    

    AGGREGATE is an array type formula and therefore the references should be limited to only those with data and not use full column references.


    For a more dynamic formula we can use INDEX/MATCH to set the end of the data set dynamically. This will allow the search parameters to grow or shrink depending on the number of values in the data set, thus limiting the number of iterations to only those cells with data in them.

    =IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW($A$2:INDEX(A:A,MATCH("ZZZ",A:A)))/(ISNUMBER(SEARCH($A$2:INDEX(A:A,MATCH("ZZZ",A:A)),C1))),1)),"Not Found")
    
    0 讨论(0)
提交回复
热议问题