vlookup specific data

Jas5on

New Member
Joined
Mar 1, 2019
Messages
4
Hi all, i’m ok with excel and simple vlookup but i’m not getting anywhere after looking all over the internet for hopefully a simple formula.
i’m doing a vlookup which will return specific data related to UK0006 against sheet 2 column B for station- CCTV for example. As there are multiple UK0006 choices in column b but i know i need CCTV then how do I get the return, specific text CCTV and not the others.

As i will be doing the return for 1000 plus lines with same issue, can someone help? It will be much appreciated.I've looked on the internet and various forums but can't seem to find the answer.

Column A sheet 1 contains
UK0006
UK0007
UK0008

Sheet 2
column A Column B
UK0006 Station - shop
UK0006 Station - CCTV
UK0006 Station - Car Care
UK0006 Station - Fuel
UK0007 Station - Fuel
UK0007 Station - Non Fuel
UK0007 Station - CCTV
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Do you know that UK0006 or any other values with multiple answers will always need to be CCTV?

Hi all, i’m ok with excel and simple vlookup but i’m not getting anywhere after looking all over the internet for hopefully a simple formula.
i’m doing a vlookup which will return specific data related to UK0006 against sheet 2 column B for station- CCTV for example. As there are multiple UK0006 choices in column b but i know i need CCTV then how do I get the return, specific text CCTV and not the others.

As i will be doing the return for 1000 plus lines with same issue, can someone help? It will be much appreciated.I've looked on the internet and various forums but can't seem to find the answer.

Column A sheet 1 contains
UK0006
UK0007
UK0008

Sheet 2
column A Column B
UK0006 Station - shop
UK0006 Station - CCTV
UK0006 Station - Car Care
UK0006 Station - Fuel
UK0007 Station - Fuel
UK0007 Station - Non Fuel
UK0007 Station - CCTV
 
Upvote 0
Hi,

So, are you saying, in Sheet 2, if there's "UK0006" in Column A and there's "Station - CCTV" in corresponding Column B, then return "Station - CCTV", otherwise return Nothing ?

In other words, you Only want "Station - CCTV" if it's there.
 
Upvote 0
Yes correct. I can't seem to get a good formula as sheet 2 column A carries UK0006 but then lookup needs to choose from column B with the 4 or 5 options linked to UK0006 column A.
Most of the data for column B carries station but various options after like CCTV, Fuel etc.
 
Upvote 0
you could always swap the 2 columns in the range and search for "Station - CCTV" and return the "UK0006" instead.
 
Upvote 0
Then you don't want to use VLOOKUP, use COUNTIFS:

Change/adjust cell references/range, add sheet name, as needed:


Book1
AB
1UK0006Station - CCTV
2UK0007Station - CCTV
3UK0008No Match
4
5
6
7
8UK0006Station - shop
9UK0006Station - CCTV
10UK0006Station - Car Care
11UK0006Station - Fuel
12UK0007Station - Fuel
13UK0007Station - Non Fuel
14UK0007Station - CCTV
Sheet623
Cell Formulas
RangeFormula
B1=IF(COUNTIFS(A$8:A$14,A1,B$8:B$14,"Station - CCTV"),"Station - CCTV","No Match")
 
Upvote 0
Regarding Post # 5, that won't work neither, as it'll Always return the First match of "Station - CCTV" (i.e. UK0006), regardless of the criteria for Sheet 1, Column A.
 
Upvote 0
Call me daft please but why am I using countif. I'm literally pulling info from sheet 2column B which is linked to sheet 1A by the means of the unique number UK0006 and working on a vertical list which contains up to 6 variations of Station(always the same) but contains either, CCTV, Bakery,Shop,Car Care so if i'm looking for the data to choose which i know which is specific so could i not use lookup with "contains ("CCTV") for example as its word specific linked to UK0006 or UK0007 etc.Thanks I'm not doing any counting. Many Thanks For your help here
 
Upvote 0
Then call Me daft please, unless I'm really confused about what you're asking...

Did you even try to implement my suggestion ?

If I'm really daft and not understanding what you want, then Please show some more samples with expected results, again, have you tried my formula ?
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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