Find a non-case-sensitive text string within a range of cells
Posted
by
Iszi
on Super User
See other posts from Super User
or by Iszi
Published on 2012-04-11T03:36:49Z
Indexed on
2012/04/11
5:32 UTC
Read the original article
Hit count: 664
excel-2010
|worksheet-function
I've got a bit of a problem to solve in Excel, and I'm not quite sure how to go about doing it. I've done a few searches online, and haven't really found any formulas that seem to be useful. Here's the situation (simplified just a bit, for the purpose of this question):
I have data in columns A-E. I need to match data in the cells in A and B, with data in C-E, and return TRUE or FALSE to column F.
Return TRUE if:
- The string in A is found within any string in C-E.
OR
- The string in B is found within any string in C-E.
Otherwise, return FALSE.
The strings must be exact matches for whole or partial strings within the range, but the matching function must be case-insensitive. I've taken a screenshot of an example sheet for reference.
I'm fairly sure I'll need to use IF or on the outermost layer of the formula, probably followed by OR. Then, for the arguments to OR, I'm expecting there will be some use of IFERROR involved. But what I'm at a loss for is the function I could most efficiently use to handle the text string searches.
VLOOKUP is very limited in this regard, I think. It may be workable to do whole-string against whole-string comparisons, but I'm fairly certain it won't return accurate results for partial string matches. FIND and SEARCH appear limited to only single-target searches, and are also case-sensitive. I suppose I could use UPPER or LOWER to force case-insensitivity in the search, but I still need something that can do accurate partial matching and search a specified range of cells.
Is there any function, or combination of functions, that could work here?
Ideally, I want to do this with a straight Excel formula. I'm not at all familiar with VBScript or similar tools, nor do I have time to learn it for this project.
© Super User or respective owner