Excel Ninja In Training
New Member
- Joined
- May 6, 2011
- Messages
- 25
I've got a nested function that works just fine, but it's long, ugly, and hard to expand:
=IF(OR(ISNUMBER(SEARCH(E$3,$A2)),ISNUMBER(SEARCH(E$4,$A2)),ISNUMBER(SEARCH(E$5,$A2)),ISNUMBER(SEARCH(E$6,$A2))),E$2,"")
In other words, if any of the strings I've entered in cells E3 through E6 are found in cell A2, then the contents of E2 are returned in the active cell.
Like I said, this works fine, but it gets ever longer and more unwieldy the more search terms I add.
I know that the answer is an array. How would I go about transforming this into one?
=IF(OR(ISNUMBER(SEARCH(E$3,$A2)),ISNUMBER(SEARCH(E$4,$A2)),ISNUMBER(SEARCH(E$5,$A2)),ISNUMBER(SEARCH(E$6,$A2))),E$2,"")
In other words, if any of the strings I've entered in cells E3 through E6 are found in cell A2, then the contents of E2 are returned in the active cell.
Like I said, this works fine, but it gets ever longer and more unwieldy the more search terms I add.
I know that the answer is an array. How would I go about transforming this into one?