2 columns w/ text data that i want to do a wildcard comparison

D

dellsilv

iN eXCEL, I HAVE 2 COLUMNS AS SUCH:

A A EXACTMATCH
A B NOMATCH
A1 1 PARTIALMATCH
IS MISS PARTIALMATCH
X NOMATCH

I need to do a wildcard comparison between column A to column B and place in
Column C the resulting match type.
 
P

Patrick Molloy

you can create a User Defined Function (aka UDF) for this as follows.

In a standard code module paste this:

Option Explicit
Function MatchType(textA As String, textB As String) As String
If textA = textB Then
MatchType = "EXACTMATCH"
ElseIf InStr(textA, textB) > 0 Then
MatchType = "PARTIALMATCH"
ElseIf InStr(textB, textA) > 0 Then
MatchType = "PARTIALMATCH"
Else
MatchType = "NOMATCH"
End If
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top