VLOOKUP in Excel

Associate
Joined
2 Nov 2008
Posts
790
I have an Excel worksheet, and I'm trying to lookup a 2 digit number (01, 53, 14) and then bring up a date from the second column.
It works fine when I search text. I entered abc into the table and when I searched it it came up with the correct date. It just won't work with numbers.

This is what I have so far

=VLOOKUP(B7,Sheet3!A4:B30,2,FALSE)

B7 is the number I am looking for.

A4:B30 The table that I am searching in. 2 is the column with the date. For Example

A B
01 February 2012
03 March 2003
04 June 2004

Any suggestions on what I could do to make it all work?

THanks
 
Put B7 in quotes, I think. Or an apostrophe before. I forget which.


edit: scratch that. I thought you were looking for B7. I didn't read carefully. Never mind. Hold on.
 
Put B7 in quotes, I think. Or an apostrophe before. I forget which.


edit: scratch that. I thought you were looking for B7. I didn't read carefully. Never mind. Hold on.

Yeah, B7 is a cell with data that is input to it using a formula. I want to look up the result that was then put into B7.
The problem is caused because the result is a number, and for some reason it won't look up the numbers.
 
You'll need to ensure that the format of cell B7 is the same as the data in Column A of your lookup table.

If one is set to text and one number, then it won't work.
 
OK I know what the problem I am having is now.
I am using =MID(a1,2,2) to get the number that I am looking up.
It wont look up the number that is then given out.

How can I make it do that?
 
Last edited:
OK I know what the problem I am having is now.
I am using =MID(a1,2,2) to get the number that I am looking up.
It wont look up the number that is then given out.

How can I make it do that?

If I'm understanding you correctly, you'll need to put that mid function inside the vlookup function for the lookup cell...if that makes sense.
 
You probably know this already - but VLOOKUP gets borked if the values are in alphabetical/numeric order. Even one entry out of place will give bugged results.
 
use INDEX MATCH its much better and the data doesnt have to be sorted numerically for it to work...

formula is:-

=index(the answer, first column to lookup, second column to lookup, 0),1) hit enter

its so easy when you get the hang of it like anything really
 
Back
Top Bottom