ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   2 columns w/ text data that i want to do a wildcard comparison (https://www.excelbanter.com/excel-programming/429030-2-columns-w-text-data-i-want-do-wildcard-comparison.html)

dellsilv

2 columns w/ text data that i want to do a wildcard comparison
 
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.


Patrick Molloy

2 columns w/ text data that i want to do a wildcard comparison
 
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



"dellsilv" wrote in message
...
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.



All times are GMT +1. The time now is 03:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com