VLOOKUP is making mwe Crazy!

  • Thread starter Thread starter Jim
  • Start date Start date
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?
 
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.
 
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.
 
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.
 
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.
 
Back
Top