Forum Discussion
lookup
sure. As with all formulas you start in the middle most () so:
FILTER($A$17:$B$19,IFERROR(SEARCH($A$17:$A$19,A26),0)=1,"na")
this FILTER will filter the rows in A17:B19 if the condition is true and that condition is:
IFERROR(SEARCH($A$17:$A$19,A26),0)=1
which is checking if it can find (i.e. search) the code from column A (A17:A19) inside this row's code value (A26) and it must be found starting at position 1 because a code like 123 we don't want to "match" inside a code 45123. the IFERROR is to catch when the code is NOT found and returns a 0 and hence a false.
So that filter will return all the rows from the code table that have codes that "match" and then that list is SORT from biggest to smallest
and finally it takes the 1st row (i.e. INDEX(..., 1, ) ). note we could also have used TAKE(... , 1) instead