ryancgarrett
Board Regular
- Joined
- Jun 18, 2011
- Messages
- 122
I'm trying to create a function that will function similar to vlookup, but will replace the value instead of return it. The other caveat is there are multiple strings to be searched and replaced within a single cell:
<tbody>
</tbody>
I'm thinking something along the lines of =LookReplace(StringCell,LookupTable,LookupResultColumn), i.e. in the table above Cell F2 would contain =LookupReplace(D2,A1:B4,2)
I know I need to use the split function to split the strings and work with the individual strings, but I'm lost as to the lookup portion.
A | B | C | D | E | F | |
1 | Lookup Table | String | Result | |||
2 | Chevy | A | Chevy,Dodge | A,B | ||
3 | Dodge | B | Chevy,Toyota,Dodge | A,R,B | ||
4 | Toyota | R | Toyota,Dodge | R,B |
<tbody>
</tbody>
I'm thinking something along the lines of =LookReplace(StringCell,LookupTable,LookupResultColumn), i.e. in the table above Cell F2 would contain =LookupReplace(D2,A1:B4,2)
I know I need to use the split function to split the strings and work with the individual strings, but I'm lost as to the lookup portion.