In Excel, I have two columns of property names. I need to determine if a name in Column A has a complete match, a partial match or no match in Column B.
Something
Exact match
Finding out if an exact match is available is easy - you can use the MATCH
function for this:
=MATCH(B1,A:A,0)
will return you the row number in which B1 is found. Combine it with IFERROR to handle elements that do not have any match:
=IFERROR(MATCH(B1,A:A,0),"No exact match")
Alternatively, if you're only interested if there is a match, but not where, use the ISERROR
function:
=NOT(ISERROR(MATCH(B1,A:A,0)))
Partial match
From your comment I understand that a "partial match" means the occurrence of the full string in column B as a substring in column A. You can use the SEARCH
function for that. However, as search will only check the appearing in one cell, you need to combine it as an array formula:
=MATCH(FALSE,ISERROR(SEARCH(B1,A1:A100)),0)
Enter it with Ctrl-Shift-Enter.
Also note that for performance reasons it is better to limit the range to search, i.e. instead of A:A
, use A1:A100
- or whatever your number of rows is.