Finding cell data when condition is true

BLuse

New Member
Joined
Apr 15, 2016
Messages
13
I have two different spread sheets with categories and I want to pull the category ID of sheet B into sheet A. While they have similar names they are not identical so I cannot do a simple VLOOKUP or other similar method. What I want to do is search if any part of the category name in sheet A is found in sheet B then pull in the corresponding category ID

Example:

Sheet A
CategoryCategoryID
Skin Care
First Aid and Healing
Moisturizers

<tbody>
</tbody>

Sheet B
CategoryCategoryID
Hair & Skin Care13908
Other First Aid11779
Body Lotions & Moisturizers11841

<tbody>
</tbody>
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hello,

In Sheet1 cell C2 you can test following array formula

=INDEX(Sheet2!$B$2:$B$4,MATCH(TRUE,ISNUMBER(SEARCH(LEFT(A2,9),Sheet2!$A$2:$A$4)),0))

Hope this will help
 
Upvote 0
@BLuse: James006 solution will only work if the first 9 characters of Sheet A Category are in Sheet B, though the solution works on all your example data.
 
Upvote 0
Hello,

In Sheet1 cell C2 you can test following array formula

=INDEX(Sheet2!$B$2:$B$4,MATCH(TRUE,ISNUMBER(SEARCH(LEFT(A2,9),Sheet2!$A$2:$A$4)),0))

Hope this will help
Thank for trying to help but I somehow can't get it to work I get #N/A instead of the ID.
 
Upvote 0
For an Array Formula ...

Instead of the Enter key ...

You need to use simultaneously the three keys : Control Shift Enter

Hope this will help
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,824
Members
449,050
Latest member
Bradel

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