View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom Peo Sjoblom is offline
external usenet poster
 
Posts: 3,268
Default Vlookup displays wrong result

You should still use FALSE since you are looking for an exact match, that
way you will always know if there is not a match (N/A) thus you can find out
the reason like with your trailing spaces whereas a TRUE or nothing will
return the wrong result


--


Regards,


Peo Sjoblom


"Melbridge" wrote in message
...
Then it displays #N/A

Just found out what is wrong - there are a load of spaces after each
customer name!!
When I delete these it's ok

Thanks for your help.

Dean (Melbridge)

"John Bundy" wrote:

Change your true to false.
--
-John
Please rate when your question is answered to help us and others know
what
is helpful.


"Melbridge" wrote:

I have 2 workbooks open and want to lookup data from one and display it
in
the other.
The workbook with the data in [CUST NOS.xls] contains the customer name
in
column A (sorted) and the customer number in column B
I want to lookup the customer name (which is in column A of the active
workbook) and display the relevant customer number, I'm using the
following
formula:

=VLOOKUP(A2,'[CUST NOS.xls]Sheet1'!$A$1:$B$174,2,TRUE)

For some reason it displays the number from the previous row.
eg
A B
1 Alan 123
2 Bob 234
3 Dean 345
4 John 456

If the customer being looked up was Dean it displays 234 when it should
display 345.
I can bodge it by inserting a cell at the beginning of the customer
name
column to push all the names down 1 cell relative to the customer
number
column but this is an ugly solution to a problem that shouldn't exist!

Any help? Thanks, Dean. (Melbridge)