VLOOKUP

Alexander

New Member
Joined
Apr 15, 2002
Messages
45
If I have a value in one file (A1) that needs to match to a value in another file which is in two columns (A1:B1), how do I get a return in column C. Example:
File 1
A
Cat
Dog
Pig
Horse

File 2
A B
Cat Meow
Frog Croak
Dog Woof
Chick Peep
Horse Neigh
Duck Quack
Pig Oink

File 1 should now be:
A B
Cat Meow
Dog Woof
Horse Neigh
Pig Oink
This message was edited by Alexander on 2002-04-16 10:15
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
What problem are you having with Vlookup?
What result do you get?

Could you show your formula?

If the information is not sorted and you want an exact match, add the 4th parameter
- False.



See Help for Syntax.
 
Upvote 0
On 2002-04-16 10:05, Alexander wrote:
If I have a value in one file (A1) that needs to match to a value in another file which is in two columns (A1:B1), how do I get a return in column C. Example:
File 1
A
Cat
Dog
Pig
Horse

File 2
A B
Cat Meow
Frog Croak
Dog Woof
Chick Peep
Horse Neigh
Duck Quack
Pig Oink

File 1 should now be:
A B
Cat Meow
Dog Woof
Horse Neigh
Pig Oink
This message was edited by Alexander on 2002-04-16 10:15

Assuming file 1 and 2 are worksheets

In B1 of file 1 enter
=VLOOKUP(A1,file2!$A$1:$B$7,2,1)
 
Upvote 0
or try Brian's formula
revised slightly

In B1 of file 1 enter
=VLOOKUP(A1,file2!$A$1:$B$7,2,0)
 
Upvote 0
This works fine, except file 1 has 2000 lines and file 2 will vary, from 100 to 1000. It is not matching correctly.
 
Upvote 0
On 2002-04-16 11:00, Alexander wrote:
This works fine, except file 1 has 2000 lines and file 2 will vary, from 100 to 1000. It is not matching correctly.

If column A in file 2 has data that is repeated, it will match the first data that is repeated. Not sure what you mean by file 2 will vary, but you can name the range in file 2 i.e =vlookup(a1,range name,2,0)
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

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