The list of things to check for is in thenamed rangethings(E5:E9).
The result is returned as a comma separated text string.
The core search logic isexplained in detail here.
We can reduce the redundant code by assigning intermediate results to variables with the LET function.
Whensortis TRUE, the function will sort search results in the order they appear in text.
the order they are listed in “things”).
The logic for this is handled by theIF function.
The screen below shows the new version of the formula in action.
LET Function
The Excel LET function lets you define named variables in a formula.
SEARCH Function
The Excel SEARCH function returns the location of one text string inside another.
SEARCH returns the position offind_textinsidewithin_textas a number.
The range or array used to sort does not need to appear in results.