Categorize Items in a table against matching text in another table with partial matches.

mvulc

New Member
Joined
Mar 22, 2015
Messages
3
First of all thank you for taking the time to read my question, and provide an answer if possible.
My apologies if this is already answered on the forum, I did search for it but could not find how to do this sort of match either with either a vlookup or index match, as in my case I'm searching for the existence of any one of a number of values.

Here's what I'm trying to accomplish.

In the table below, assume columns A,B,C are a table, and columns F,G are a separate table.
I want to fill in column C with the "ticket type" value as listed in column G, so long as there is a match for any of the values in column F in the text within column B.
So the results should be
C2 = "Backup Failure"
C3 = "Backup Failure"
C4 = "Restore Request"
C5 = "Ping Timeout"
C6 = "Hardware Failure"
C7 = "Hardware Failure"


TicketTitleTypeMatch TextTicket Type
1Backup Failure on Server ABackupBackup Failure
2Server B Failed BackupRestoreRestore Request
3Restore Directory on Server CPingPing Timeout
4Ping Timeout Server DHard DriveHardware Failure
5Server D Failed Hard DriveFailed MemoryHardware Failure
6Server E Failed Memory

<tbody>
</tbody>
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Here's a function that should do what you're after:

Code:
Public Function ticketType(matchText As Range, title As Range)
    Dim i As Integer
    i = 2
    For Each rng In matchText
        If InStr(UCase(title.Value), UCase(rng.Value)) Then
            ticketType = Range("G" & i)
        End If
        i = i + 1
    Next
End Function

Then use this formula in C2 and drag down:

Code:
=ticketType($F$2:$F$6,B2)
 
Upvote 0
...In the table below, assume columns A,B,C are a table, and columns F,G are a separate table.
I want to fill in column C with the "ticket type" value as listed in column G, so long as there is a match for any of the values in column F in the text within column B.
[...]

Define BigNum as referring to:

=9.99999999999999E+30

In C2 enter and copy down:

=LOOKUP(BigNum,SEARCH(" "&$F$2:$F$6&" "," "&B2&" "),$G$2:$G$6)
 
Upvote 0

Forum statistics

Threads
1,215,972
Messages
6,128,026
Members
449,414
Latest member
sameri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top