VLOOKUP - Wrong Value Return

M

MysticalNomad

I have a spreadsheet that will lookup an Object name based on the Objec
code. The Object codes are Q,R,F,M,W and Msg and the Object names ar
Query, Report, Form, Macro, Warnings and Messages.

When I type the code into (for example) A1, the Object name shoul
appear in B1. I have named the lookup chart "Objects" and the formul
for B1 is:

=IF(A1="","",VLOOKUP(A1, Objects, 2))

The wrong value is returned, i.e Q is typed in and Macro is returned
What's going on?
I have attached the spreadsheet for you to look at.

Please help..

Attachment filename: lookup.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=66455
 
R

Richard

Hi this is a simple problem, you are missing the last part of the formula
you need to change it to IF(A1="","",VLOOKUP(A1, Objects, 2,false)) this
is
because you list in not in alpha order.


I have a spreadsheet that will lookup an Object name based on the Object
code. The Object codes are Q,R,F,M,W and Msg and the Object names are
Query, Report, Form, Macro, Warnings and Messages.

When I type the code into (for example) A1, the Object name should
appear in B1. I have named the lookup chart "Objects" and the formula
for B1 is:

=IF(A1="","",VLOOKUP(A1, Objects, 2))

The wrong value is returned, i.e Q is typed in and Macro is returned.
What's going on?
I have attached the spreadsheet for you to look at.

Please help...

Attachment filename: lookup.xls
Download attachment:
http://www.excelforum.com/attachment.php?postid=664551
 
H

Haldun Alay

hi,

to get correct value from lookup table with your existing formula, your lookup table has to be sorted.

or if you change your formula with following one it will get correct value.

=IF(A1="","",VLOOKUP(A1, Objects, 2,FALSE))

Kind regards.

--
Haldun Alay



"MysticalNomad >" <<[email protected]>, iletide þunu yazdý I have a spreadsheet that will lookup an Object name based on the Object
code. The Object codes are Q,R,F,M,W and Msg and the Object names are
Query, Report, Form, Macro, Warnings and Messages.

When I type the code into (for example) A1, the Object name should
appear in B1. I have named the lookup chart "Objects" and the formula
for B1 is:

=IF(A1="","",VLOOKUP(A1, Objects, 2))

The wrong value is returned, i.e Q is typed in and Macro is returned.
What's going on?
I have attached the spreadsheet for you to look at.

Please help...

Attachment filename: lookup.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=664551
 
R

RagDyeR

Just add the fourth argument for an exact match:

=IF(A1="","",VLOOKUP(A1, Objects, 2,0))
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


message I have a spreadsheet that will lookup an Object name based on the Object
code. The Object codes are Q,R,F,M,W and Msg and the Object names are
Query, Report, Form, Macro, Warnings and Messages.

When I type the code into (for example) A1, the Object name should
appear in B1. I have named the lookup chart "Objects" and the formula
for B1 is:

=IF(A1="","",VLOOKUP(A1, Objects, 2))

The wrong value is returned, i.e Q is typed in and Macro is returned.
What's going on?
I have attached the spreadsheet for you to look at.

Please help...

Attachment filename: lookup.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=664551
 
A

Arvi Laanemets

Hi


...Patrick said:
sort the table on the right bye the object (col E)

And when an nonexisting code, p.e. 'S', is entered, an object name is
returned! Here is exact match needed, so 4th parameter must be set to
False - which makes sorting abundant.


--
Arvi Laanemets
(When sending e-mail, use address arvil<At>tarkon.ee)


--
...Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel


"MysticalNomad >" <<[email protected]> a écrit dans
le message de news:[email protected]...
 

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

Similar Threads

Scrabble Value calculation for Welsh words 0
Use Vlookup to store formulas? 6
Vlookup and return sheet name also 2
vlookup 1
Lookup function help 4
return value other than #N/A 2
VLOOKUP help 5
VLOOKUP problem 2

Top