Vlookup Problem

wishes_h

New Member
Joined
Jul 2, 2008
Messages
2
Hello,

I have a problem with the Vlookup function, i have a defined table with two columns to define fuel sources, the first column refers to fuel source name and the second to the ID/number associated with each source. the table name is 'source'

in another sheet named 'ID', i have a list of ID's defined in column A

and in a third sheet named 'b', i have a list that should read the source names based on the corresponding id in sheet ID, I used the following formula in cell b!A2:

=VLOOKUP(ID!A2,source,1,FALSE)
but it returns #N/A :(

I read in one of the threads, that this might be related to the cell format, actually, i didn't play with the formats, all of the fields have the general format.

I gave up.....Any Ideas !!!!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,124
VLOOKUP looks from left to right -- it seems your source table has ID in the 2nd column and the value you want to retrieve is in the first column so a vlookup in this instance won't work (as you're essentially looking from right to left) -- you will need to use INDEX with MATCH

=INDEX(source1,MATCH(ID!A2,source2,0),1)

where source1 is column 1 in source range
where source2 is column 2 in source range
 
Upvote 0

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
59,294
Office Version
  1. 365
Platform
  1. Windows
wishes_h

Welcome to the MrExcel board!

I think this also does what you want:
=INDEX(Source,MATCH(ID!A2,INDEX(Source,0,2),0),1)

However, as indicated by lasw10, it would probably be simpler to refer directly to the source sheet and table with something like:
=INDEX(Sourcesheetname!A:A,MATCH(ID!A2,Sourcesheetname!B:B,0))
 
Upvote 0

wishes_h

New Member
Joined
Jul 2, 2008
Messages
2
Thanks a lot,

both worked and made me understand more things about this function, I also switched the two columns and this works well too....:)

wishes
 
Upvote 0

Forum statistics

Threads
1,191,005
Messages
5,984,120
Members
439,872
Latest member
noaman79

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
Top