Formula help with vlookup or index match

blaineschultz

New Member
Joined
Feb 5, 2013
Messages
3
I have a master data source sheet 'msf12' tht contains a column with the names of companies. i have a second sheet that contains a list of all the companies names, their region, zip code ect. sheet name 'companies'. I am trying to create a formula that will look at the companies name and then generate their respective region served in a new column on the same sheet using the reference sheet 'companies' however, my results have either been accurate up to around row 100 when the regions column starts giving row references that are off by 1-3 rows. I tried to combat this by using index match but in that case i only get a few regions and the rest of the cells display N/A. 'companies' is sorted in ascending order both fields are text values i feel like i have tried everything. here is a quick example.

My main source that has the companies name- I need to create a column that shows the corresponding region. Right now I have name/Service type

Martz Transport - Wikes - Sacramento
CTC
Martz Transport - Wikes - VegasCTC

MTR Western
CTC
Abbott Trails
CTC
Mlaker TransCTC

<tbody>
</tbody>


The reference sheet is like this.. Company name/zip/region(the cell i need) is in col E

Martz Transport - Wikes - Sacramento94445Southern Cal
Martz Transport - Wikes - Vegas74665Western
MTR Western37382Great Lakes
Abbott Trails83727NY Metro
Mlaker Trans88888Southeast

<tbody>
</tbody>


Right now i have this formula and it works for the companies up until Martz..
=LOOKUP([@operator],'Bus region Source1'!$A$2:$A$243,'Bus region Source1'!$E$2:$E$243)

Any way to make this work??
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I notice that sometimes VLookups will fail whenever the formats/data types aren't the same between the source and lookup columns. For example, say the value 12345 is stored as number on one sheet, but as text in the other, the VLookup will fail.

You might want to check formats and "equalize" them, i.e., make them all the same format/data type.

Not sure if that's the problem, but you may want to check, especially if some rows look up okay and others don't...
 
Upvote 0
Try VLOOKUP so that you can find exact matches.

e.g.

=VLOOKUP([@operator],'Bus region Source1'!$A$2:$E$243,5,FALSE)
 
Upvote 0
Try VLOOKUP so that you can find exact matches.

e.g.

=VLOOKUP([@operator],'Bus region Source1'!$A$2:$E$243,5,FALSE)


Thanks! that worked for most of the values. However I am getting #N/A for a good amount of the columns still. I checked and the cells are both formatted to text and the company name cells match perfectly. Any other ideas what is causing this?
 
Upvote 0
Could there be "phantom" characters in one of the values (either the source or lookup target)? Like trailing spaces, control characters (like tabs, carriage returns, etc.)?

ADD:
You can also try double-clicking in one of the cells which is returning an #N/A and then clicking off of it. If the lookup then works, there's a data type formatting problem.
 
Upvote 0

Forum statistics

Threads
1,215,264
Messages
6,123,960
Members
449,135
Latest member
jcschafer209

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