Cell contains text in data set

GMan777

New Member
Joined
Dec 1, 2020
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I have a data set with AD accounts and their AD path that inculudes city & country (ex: OU=New York,OU=USA,OU=Corporate... another one OU=Boston,OU=USA,OU=Corporate, etc..)
I have a separate data set with only the higher level OU's, ie per country, (ex: OU=USA,OU=Corporate.. another one OU=Mexico,OU=Corporate, etc.) with other data.

I needed to do a Vlookup in the 1st data set with the city/country combo... if it contains the "OU=Country,OU=Corporate" in the 2nd data set... bring back a column in the 2nd data set.

I've seen ways to look for partial vlookup matches with "*", but in the other direction, which would work if my 1st list had only Country, and the 2nd data set had City/Country.

Maybe Vlookup is not the way.. but am stumped so far.

Any ideas?
Thanks in advance.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to MrExcel Message Board.
Please upload example of Data at what you want. if you can use XL2BB it would be better. or upload images if you cann't.
 
Upvote 0
I have data set 1... and data set 2.
I'm looking for the right formula in column B highlighted...
- that if A:A ends with apple, looks up data set 2 bring back Red
- that if A:A ends with Banana, looks up data set 2 bring back Yellow
- that if A:A ends with Grape, looks up data set 2 bring back Green

So like a basic vlookup, but only looking to match the end of the string in data set 1 finds it's match in data set 2.
The number of characters vary, there is no standard special character like "right of" space or comma.. as the simplistic example I wrote below, but the "end" (ie. cell starting from the right) in A:A has a match in data set 2.


Example 123.png


Appreciate any help/input you may have.

Thanks,
 
Upvote 0
Hi & welcome to MrExcel.
How about
+Fluff v2.xlsm
ABCDE
1County
2West YorkshireRedYorkshireRed
3Greater ManchesterBlueManchesterBlue
4County DurhamGreenDurhamGreen
5North YorkshireRedMidlandsPurple
6West MidlandsPurple
7West YorkshireRed
8North YorkshireRed
9Greater ManchesterBlue
10West MidlandsPurple
11
Main
Cell Formulas
RangeFormula
B2:B10B2=FILTER($E$2:$E$5,COUNTIF(A2,"*"&$D$2:$D$5))
 
Upvote 0
Solution
Thank you so much, it works like a charm. I had never used the filter function and was not familiar with it, thanks for the education !
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

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