I have a range of values listed in individual cells, and I want check if another cell contains *any one or more* of those values. For example the text I want to search for (i.e. "find text") is A, B, C, D, E (each letter in its own cell) and the text I am searching (i.e. "within text") is something like NQD. So, in this example, NQD contains at least one letter from the "find text" range (A, B, C, D, E), and the result would be "TRUE" or the position number or some other indication of a positive result.
Another example of "within text" is NQDA, where it has 2 letters from the "find text" range, and the result would also be positive...i.e. at least one condition from find text is inside search text.
Any ideas?
I may also use this in a sumproduct or other type of array where I have to count or sum the records of "within text" that were positive when compared to "find text".
Hope this makes sense!
Excel 2007
Another example of "within text" is NQDA, where it has 2 letters from the "find text" range, and the result would also be positive...i.e. at least one condition from find text is inside search text.
Any ideas?
I may also use this in a sumproduct or other type of array where I have to count or sum the records of "within text" that were positive when compared to "find text".
Hope this makes sense!
Excel Workbook | |||||
---|---|---|---|---|---|
M | N | O | |||
1 | find text | within text | formula | ||
2 | A | BAH | 2 | ||
3 | B | FGA | #VALUE! | ||
4 | C | D | #VALUE! | ||
5 | D | @#% | #VALUE! | ||
6 | F | QE | #VALUE! | ||
7 | G | ||||
8 | H | ||||
9 | J | ||||
10 | K | ||||
11 | M | ||||
12 | N | ||||
13 | P | ||||
14 | Q | ||||
15 | R | ||||
16 | S | ||||
17 | T | ||||
18 | U | ||||
19 | V | ||||
20 | Y | ||||
21 | Z | ||||
22 | # | ||||
tc_codes |
Cell Formulas | ||
---|---|---|
Range | Formula | |
O2 | =SEARCH($M$2:$M$22,N2,1) | |
O3 | =SEARCH($M$2:$M$22,N3,1) | |
O4 | =SEARCH($M$2:$M$22,N4,1) | |
O5 | =SEARCH($M$2:$M$22,N5,1) | |
O6 | =SEARCH($M$2:$M$22,N6,1) |