VLOOKUP is making mwe Crazy!

J

Jim

Hi i just started off with VLOOKUP function but it doesn't seem to work , i
want ot have the basic understanding of how it functions?

Example

A B C
1 ITEMS COST
2 Ham 2
3 Cheese 4
4 Eggs 6
5 Pork 5


Now if i want to lookup how much does ham costs?

the forumal wd be:
=VLOOKUP(Ham,A1:B5,2,FALSE)

I believ the formula is right , but i am confused in which cell do i need to
write it? If i write it in C2, it returns #NAME?.

Pls tell where do i need to write the formula?
 
J

JE McGimpsey

You need to put "Ham" in quotes:

=VLOOKUP("Ham",A1:B5,2,FALSE)

Otherwise XL assumes that you have an object named Ham (e.g., a cell),
but it can't find it.
 
J

Jim

THANKS A TONNE!

--

Jim
India




JE McGimpsey said:
You need to put "Ham" in quotes:

=VLOOKUP("Ham",A1:B5,2,FALSE)

Otherwise XL assumes that you have an object named Ham (e.g., a cell),
but it can't find it.
 
B

BenjieLop

First of all, the range (A1:B5) is not the correct range for the VLOOKU
formula that you have. Even if you have your item in quotes ("ham") i
will still give you the #N/A error.

You need to change the range in your formula as follows:

=vlookup("ham",*$B2:$C$5*,2,0)

You can also do it this way. In Cell D1, you can enter the item nam
that needs to be looked up and in Cell D2, enter the following formula

=Vlookup(D1,$B$2:$C$5,2,0)

Also, you do not need to put quotation marks when you enter the ite
name in Cell D1.
 
A

Alan Beban

For any who might be following this thread and be confused by
BenjieLop's response, it assumes (I think incorrectly, though
understandably) that ITEMS are in Column B and COST in Column C.

Alan Beban
First of all, the range (A1:B5) is not the correct range for the VLOOKUP
formula that you have. Even if you have your item in quotes ("ham") it
will still give you the #N/A error.

You need to change the range in your formula as follows:

=vlookup("ham",*$B2:$C$5*,2,0)

You can also do it this way. In Cell D1, you can enter the item name
that needs to be looked up and in Cell D2, enter the following formula

=Vlookup(D1,$B$2:$C$5,2,0)

Also, you do not need to put quotation marks when you enter the item
name in Cell D1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top