#1   Report Post  
Posted to microsoft.public.excel.misc
John Moore
 
Posts: n/a
Default VLOOKUP QUERY

Trying to get a simple Vlookup to work ,,, and it has me perplexed ,,,,
example below ,,,,,, column A contains the original data, column B contains a
LEFT function of colunm A ,,, i.e. =LEFT(A1,4,0), to return the first 4
characters of A1, column C is where I have a Vlookup, lookup is based on a
range, called data, so would look like this , =VLOOKUP(B1,data,2,0) ,,,,,
this returns an #NA error, even though the data in B1 exits in the range, how
do I solution this ,,,,,is there a way to do a vlookup on cell A1 ( first
four characters only ) without doing an =LEFT in coulmn B ?
  #2   Report Post  
Posted to microsoft.public.excel.misc
John Moore
 
Posts: n/a
Default VLOOKUP QUERY

Sorry ,,, would help if I posted the example ...

Col A Col B Col C
6223BD2 6223 #NA


"John Moore" wrote:

Trying to get a simple Vlookup to work ,,, and it has me perplexed ,,,,
example below ,,,,,, column A contains the original data, column B contains a
LEFT function of colunm A ,,, i.e. =LEFT(A1,4,0), to return the first 4
characters of A1, column C is where I have a Vlookup, lookup is based on a
range, called data, so would look like this , =VLOOKUP(B1,data,2,0) ,,,,,
this returns an #NA error, even though the data in B1 exits in the range, how
do I solution this ,,,,,is there a way to do a vlookup on cell A1 ( first
four characters only ) without doing an =LEFT in coulmn B ?

  #3   Report Post  
Posted to microsoft.public.excel.misc
RWS
 
Posts: n/a
Default VLOOKUP QUERY

Your lookup is fine, the prolem is that the left function returns a text value
Make it

=VALUE(LEFT(A1,4))
This will give you a numeric value rather than text and so it should work

--
RWS


"John Moore" wrote:

Sorry ,,, would help if I posted the example ...

Col A Col B Col C
6223BD2 6223 #NA


"John Moore" wrote:

Trying to get a simple Vlookup to work ,,, and it has me perplexed ,,,,
example below ,,,,,, column A contains the original data, column B contains a
LEFT function of colunm A ,,, i.e. =LEFT(A1,4,0), to return the first 4
characters of A1, column C is where I have a Vlookup, lookup is based on a
range, called data, so would look like this , =VLOOKUP(B1,data,2,0) ,,,,,
this returns an #NA error, even though the data in B1 exits in the range, how
do I solution this ,,,,,is there a way to do a vlookup on cell A1 ( first
four characters only ) without doing an =LEFT in coulmn B ?

  #4   Report Post  
Posted to microsoft.public.excel.misc
bpeltzer
 
Posts: n/a
Default VLOOKUP QUERY

I'll take a guess that the table in which you're looking for 6223 is numeric;
the result of the LEFT function is still a string (even though it's a string
of numbers). Convert it to a value and your lookup may work:
=vlookup(value(b1),data,2,0)

"John Moore" wrote:

Sorry ,,, would help if I posted the example ...

Col A Col B Col C
6223BD2 6223 #NA


"John Moore" wrote:

Trying to get a simple Vlookup to work ,,, and it has me perplexed ,,,,
example below ,,,,,, column A contains the original data, column B contains a
LEFT function of colunm A ,,, i.e. =LEFT(A1,4,0), to return the first 4
characters of A1, column C is where I have a Vlookup, lookup is based on a
range, called data, so would look like this , =VLOOKUP(B1,data,2,0) ,,,,,
this returns an #NA error, even though the data in B1 exits in the range, how
do I solution this ,,,,,is there a way to do a vlookup on cell A1 ( first
four characters only ) without doing an =LEFT in coulmn B ?

  #5   Report Post  
Posted to microsoft.public.excel.misc
SteveG
 
Posts: n/a
Default VLOOKUP QUERY


In C try,

=VLOOKUP(LEFT(A1,4),data,2,FALSE)

Copy down as needed. Make sure your named range "data" includes all
the columns in the table as well or the VLOOKUP will return a REF
error. Also make sure that your "data" has no spaces after the 4
characters you are looking up or it will not find it as a match. To
check, on one of your N/A errors, find that value in the data table and
click just to the right of the last letter and hit delete a bunch of
times. If your VLOOKUP now returns the value, you know that is the
issue.


HTH
Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=554757



  #6   Report Post  
Posted to microsoft.public.excel.misc
LACA
 
Posts: n/a
Default VLOOKUP QUERY


You can actually eliminate Column B to save space and just use

=VLOOKUP(VALUE(LEFT(A1,4)),DATA,2,FALSE)


--
LACA
------------------------------------------------------------------------
LACA's Profile: http://www.excelforum.com/member.php...o&userid=30381
View this thread: http://www.excelforum.com/showthread...hreadid=554757

  #7   Report Post  
Posted to microsoft.public.excel.misc
John Moore
 
Posts: n/a
Default VLOOKUP QUERY

Thanks guys ,,, works well ,,,, I had an idea it was because of the numeric
text ,,,, thanks again

"bpeltzer" wrote:

I'll take a guess that the table in which you're looking for 6223 is numeric;
the result of the LEFT function is still a string (even though it's a string
of numbers). Convert it to a value and your lookup may work:
=vlookup(value(b1),data,2,0)

"John Moore" wrote:

Sorry ,,, would help if I posted the example ...

Col A Col B Col C
6223BD2 6223 #NA


"John Moore" wrote:

Trying to get a simple Vlookup to work ,,, and it has me perplexed ,,,,
example below ,,,,,, column A contains the original data, column B contains a
LEFT function of colunm A ,,, i.e. =LEFT(A1,4,0), to return the first 4
characters of A1, column C is where I have a Vlookup, lookup is based on a
range, called data, so would look like this , =VLOOKUP(B1,data,2,0) ,,,,,
this returns an #NA error, even though the data in B1 exits in the range, how
do I solution this ,,,,,is there a way to do a vlookup on cell A1 ( first
four characters only ) without doing an =LEFT in coulmn B ?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP Query blain Excel Worksheet Functions 2 June 17th 06 03:09 PM
VLookup query mr_teacher Excel Discussion (Misc queries) 1 May 25th 06 08:19 AM
Vlookup query Tester Excel Worksheet Functions 2 December 2nd 05 11:39 PM
AHHHH-Get Data from Multiple Excel workbooks JAA149 Excel Discussion (Misc queries) 5 October 30th 05 05:19 PM
Non-sequential VLOOKUP function -OR- sequential sort of web query Eric S Excel Worksheet Functions 1 February 28th 05 07:50 PM


All times are GMT +1. The time now is 06:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"