Match lookup based on value within long text field and return category - all help appreciated!

step_hen711

New Member
Joined
Feb 9, 2015
Messages
11
Hey all,

I have a formula query which has been wrecking my brain for the last few days - I've searched high and low for a solution, but with no luck.

I have an excel file with 2 sheets - one contains the data and all the metrics I analyse. I'm looking to create a new metric field, so that I can split analysis into defined groups. I want to use the unique product key as the reference - within a typical cell, it contains the name of the category I'd like to define. For example, an entry in the product key is displayed as so:
"BV_Social_CommentApproved" - in this example, "Social" is one of the groups I wish to define.

In sheet 2 of the file, I have a list of values (2 columns - one column contains part of the lookup value and the second column contains the category I'd like to call it.) The table had one heading of "key word2 - in this example it's "social_" and the category I wish to generate is in the second column "Social"


<tbody>
</tbody>
I require a formula solution which is able to pick out this key word within the unique product key and match it with the table in the second sheet - it must return the matched value within a new metric column.

I hope this makes sense - I'll keep an eye on this thread for any help - all help/suggestions are much appreciated! :)
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Can you post an example of sheet 1 & 2, with the results you expect, it will help to understand what you want to achieve.
 
Upvote 0
Can you post an example of sheet 1 & 2, with the results you expect, it will help to understand what you want to achieve.

Thanks Garry - here is a quick view of each sheet and example what i want to achieve:

Sheet 1:

Unique product IDSegment
BV_Social_CommentApprovedSocial
Gift_List_2014ABCGift List
Shops_Abandon_Basket_1Abandon Basket
Sheet 2:

Unique product IDNew Segment
Social_Social
Gift_ListGift List
Abandon_BasketAbandon Basket

<colgroup><col><col></colgroup><tbody>
</tbody>

<colgroup><col><col></colgroup><tbody>
</tbody>

Basically, I need the formula to see if part of the text in sheet 2, column 1, exists within the text of sheet 1 column 1 - if it generates a successful match, then return the value from sheet 2, column 2 within the Segment column. This would allow me to assign a Segment to each email type.

Thank you for your help!

<colgroup><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
Thanks Garry - here is a quick view of each sheet and example what i want to achieve:

Sheet 1:

Unique product IDSegment
BV_Social_CommentApprovedSocial
Gift_List_2014ABCGift List
Shops_Abandon_Basket_1Abandon Basket
Sheet 2:

Unique product IDNew Segment
Social_Social
Gift_ListGift List
Abandon_BasketAbandon Basket

<tbody>
</tbody>

<tbody>
</tbody>

Basically, I need the formula to see if part of the text in sheet 2, column 1, exists within the text of sheet 1 column 1 - if it generates a successful match, then return the value from sheet 2, column 2 within the Segment column. This would allow me to assign a Segment to each email type.

Thank you for your help!

<tbody>
</tbody>

Is anyone able to help?
 
Upvote 0
Good guess with the name!

Try
=INDEX(Sheet1!$B$2:$B$4,MATCH("*"&A2&"*",Sheet1!$A$2:$A$5,0))
 
Upvote 0
Good guess with the name!

Try
=INDEX(Sheet1!$B$2:$B$4,MATCH("*"&A2&"*",Sheet1!$A$2:$A$5,0))


Thanks Gaz - I've been messing around with this formula for an hour this morning but with no luck - this has really tested me! Are there any alternatives I could try?

Very grateful for all your help!
 
Upvote 0
What do you mean, no luck? With the data above it returns the same results that you have.
 
Upvote 0
try this

Code:
=INDEX(Sheet2!$B$2:$B$4,MATCH(1,1/ISNUMBER(SEARCH(Sheet2!$A$2:$A$4,A2)),0))

confirm the formula with Ctrl+Shift+Enter
 
Upvote 0
Assuming the data is in Sheet1 A2, enter the formula in B2
 
Upvote 0

Forum statistics

Threads
1,216,488
Messages
6,130,952
Members
449,608
Latest member
jacobmudombe

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