Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jthomas
 
Posts: n/a
Default VLOOKUP returning wrong row

I have a VLOOKUP function in Excel that is returning data from the row above
the target row. It must be finding the correct match data and column, but
always from the row above the one it should. Using the Exact match parameter
just returns an "#N/A" error. My table array is sorted.

Any ideas?

Thanks!
  #2   Report Post  
Adrian M
 
Posts: n/a
Default

Are there any hidden decimals in the lookup criteria? Also, if you have alpha
numeric lookup values make sure it is sorted by Excel and not by human
sorting as this can be a problem (see http://www.auditexcel.co.za/errors.html
). If none of these maybe you can give us some of the sample data?

"jthomas" wrote:

I have a VLOOKUP function in Excel that is returning data from the row above
the target row. It must be finding the correct match data and column, but
always from the row above the one it should. Using the Exact match parameter
just returns an "#N/A" error. My table array is sorted.

Any ideas?

Thanks!

  #3   Report Post  
jthomas
 
Posts: n/a
Default

How would I check for hidden decimals? I don't believe there are any. I did
have Excel sort the data.

Here is my formula:
=VLOOKUP(C5,'Argus Data'!A:F,6)

Where C5 refers to a ticker symbol. When C5 is ADP the formula result is
"0" (from blank row above). When C5 is ACN the result is 66 (from row above
for ACI).

Here is some sample data (sorry about formatting):

ticker security_name twelve_month_rating five_year_rating price_per_share target_price
AA ALCOA INC COM BUY BUY 27.91 37
AAI AIRTRAN HLDGS INC BUY BUY 11.81 14
AAP ADVANCE AUTO PARTS INC BUY BUY 69.05 78
AAPL APPLE COMPUTER INC BUY BUY 42.75 51
ABC AMERISOURCEBERGEN CORP HOLD HOLD 71.56
ABS ALBERTSONS INC HOLD HOLD 20.95
ABT ABBOTT LABS HOLD BUY 47.02
ABX BARRICK GOLD COM BUY HOLD 24.6 26
ACE ACE LTD HOLD HOLD 46.23
ACI ARCH COAL INC BUY BUY 58.72 66
ACN ACCENTURE LTD BUY BUY 25 32
ADBE ADOBE SYSTEMS INC BUY BUY 29.46 40
ADCT ADC TELECOMMUNICATION STK HOLD BUY 26.31
ADI ANALOG DEVICES INC HOLD BUY 39.06
ADP AUTOMATIC DATA PROCESS BUY BUY 44.36 53


Thanks for the help!
JT


"Adrian M" wrote:

Are there any hidden decimals in the lookup criteria? Also, if you have alpha
numeric lookup values make sure it is sorted by Excel and not by human
sorting as this can be a problem (see http://www.auditexcel.co.za/errors.html
). If none of these maybe you can give us some of the sample data?

"jthomas" wrote:

I have a VLOOKUP function in Excel that is returning data from the row above
the target row. It must be finding the correct match data and column, but
always from the row above the one it should. Using the Exact match parameter
just returns an "#N/A" error. My table array is sorted.

Any ideas?

Thanks!

  #4   Report Post  
Marc
 
Posts: n/a
Default

Looks to me like your "C5" value might have trailing spaces, like "ADP ". If
that's the case, and you don't specify 0 or FALSE as the last parameter in
the VLOOKUP, it will return the closest match, which would be the row above
it.

I run into this problem all the time when I get sheets from other people who
have the terrible habit of adding a space to everything they type into
Excel.

Also, with VLOOKUP and HLOOKUP (versus the plain LOOKUP), I don't believe
you have to sort your data--one of the advantages of using those two
functions...

"jthomas" wrote in message
...
How would I check for hidden decimals? I don't believe there are any. I

did
have Excel sort the data.

Here is my formula:
=VLOOKUP(C5,'Argus Data'!A:F,6)

Where C5 refers to a ticker symbol. When C5 is ADP the formula result is
"0" (from blank row above). When C5 is ACN the result is 66 (from row

above
for ACI).

Here is some sample data (sorry about formatting):

ticker security_name twelve_month_rating five_year_rating price_per_share

target_price
AA ALCOA INC COM BUY BUY 27.91 37
AAI AIRTRAN HLDGS INC BUY BUY 11.81 14
AAP ADVANCE AUTO PARTS INC BUY BUY 69.05 78
AAPL APPLE COMPUTER INC BUY BUY 42.75 51
ABC AMERISOURCEBERGEN CORP HOLD HOLD 71.56
ABS ALBERTSONS INC HOLD HOLD 20.95
ABT ABBOTT LABS HOLD BUY 47.02
ABX BARRICK GOLD COM BUY HOLD 24.6 26
ACE ACE LTD HOLD HOLD 46.23
ACI ARCH COAL INC BUY BUY 58.72 66
ACN ACCENTURE LTD BUY BUY 25 32
ADBE ADOBE SYSTEMS INC BUY BUY 29.46 40
ADCT ADC TELECOMMUNICATION STK HOLD BUY 26.31
ADI ANALOG DEVICES INC HOLD BUY 39.06
ADP AUTOMATIC DATA PROCESS BUY BUY 44.36 53


Thanks for the help!
JT


"Adrian M" wrote:

Are there any hidden decimals in the lookup criteria? Also, if you have

alpha
numeric lookup values make sure it is sorted by Excel and not by human
sorting as this can be a problem (see

http://www.auditexcel.co.za/errors.html
). If none of these maybe you can give us some of the sample data?

"jthomas" wrote:

I have a VLOOKUP function in Excel that is returning data from the row

above
the target row. It must be finding the correct match data and column,

but
always from the row above the one it should. Using the Exact match

parameter
just returns an "#N/A" error. My table array is sorted.

Any ideas?

Thanks!



  #5   Report Post  
Marc
 
Posts: n/a
Default

As a followup, if you specify "FALSE" as the last parameter in the lookup,
then your list does not need to be sorted. If you specify "TRUE", then it
must be sorted...


"jthomas" wrote in message
...
How would I check for hidden decimals? I don't believe there are any. I

did
have Excel sort the data.

Here is my formula:
=VLOOKUP(C5,'Argus Data'!A:F,6)

Where C5 refers to a ticker symbol. When C5 is ADP the formula result is
"0" (from blank row above). When C5 is ACN the result is 66 (from row

above
for ACI).

Here is some sample data (sorry about formatting):

ticker security_name twelve_month_rating five_year_rating price_per_share

target_price
AA ALCOA INC COM BUY BUY 27.91 37
AAI AIRTRAN HLDGS INC BUY BUY 11.81 14
AAP ADVANCE AUTO PARTS INC BUY BUY 69.05 78
AAPL APPLE COMPUTER INC BUY BUY 42.75 51
ABC AMERISOURCEBERGEN CORP HOLD HOLD 71.56
ABS ALBERTSONS INC HOLD HOLD 20.95
ABT ABBOTT LABS HOLD BUY 47.02
ABX BARRICK GOLD COM BUY HOLD 24.6 26
ACE ACE LTD HOLD HOLD 46.23
ACI ARCH COAL INC BUY BUY 58.72 66
ACN ACCENTURE LTD BUY BUY 25 32
ADBE ADOBE SYSTEMS INC BUY BUY 29.46 40
ADCT ADC TELECOMMUNICATION STK HOLD BUY 26.31
ADI ANALOG DEVICES INC HOLD BUY 39.06
ADP AUTOMATIC DATA PROCESS BUY BUY 44.36 53


Thanks for the help!
JT


"Adrian M" wrote:

Are there any hidden decimals in the lookup criteria? Also, if you have

alpha
numeric lookup values make sure it is sorted by Excel and not by human
sorting as this can be a problem (see

http://www.auditexcel.co.za/errors.html
). If none of these maybe you can give us some of the sample data?

"jthomas" wrote:

I have a VLOOKUP function in Excel that is returning data from the row

above
the target row. It must be finding the correct match data and column,

but
always from the row above the one it should. Using the Exact match

parameter
just returns an "#N/A" error. My table array is sorted.

Any ideas?

Thanks!





  #6   Report Post  
Marc
 
Posts: n/a
Default

Ok, one last followup...........

It may be that either your C5 value has a trailing space, OR your data array
(Argus Data) has trailing spaces after the entries in the first column.

You could select the entire first column in Argus Data, and do a
search/replace function replacing all spaces with nothing... thus making
sure you don't have trailing spaces...

"Marc" wrote in message
...
As a followup, if you specify "FALSE" as the last parameter in the lookup,
then your list does not need to be sorted. If you specify "TRUE", then it
must be sorted...


"jthomas" wrote in message
...
How would I check for hidden decimals? I don't believe there are any.

I
did
have Excel sort the data.

Here is my formula:
=VLOOKUP(C5,'Argus Data'!A:F,6)

Where C5 refers to a ticker symbol. When C5 is ADP the formula result

is
"0" (from blank row above). When C5 is ACN the result is 66 (from row

above
for ACI).

Here is some sample data (sorry about formatting):

ticker security_name twelve_month_rating five_year_rating

price_per_share
target_price
AA ALCOA INC COM BUY BUY 27.91 37
AAI AIRTRAN HLDGS INC BUY BUY 11.81 14
AAP ADVANCE AUTO PARTS INC BUY BUY 69.05 78
AAPL APPLE COMPUTER INC BUY BUY 42.75 51
ABC AMERISOURCEBERGEN CORP HOLD HOLD 71.56
ABS ALBERTSONS INC HOLD HOLD 20.95
ABT ABBOTT LABS HOLD BUY 47.02
ABX BARRICK GOLD COM BUY HOLD 24.6 26
ACE ACE LTD HOLD HOLD 46.23
ACI ARCH COAL INC BUY BUY 58.72 66
ACN ACCENTURE LTD BUY BUY 25 32
ADBE ADOBE SYSTEMS INC BUY BUY 29.46 40
ADCT ADC TELECOMMUNICATION STK HOLD BUY 26.31
ADI ANALOG DEVICES INC HOLD BUY 39.06
ADP AUTOMATIC DATA PROCESS BUY BUY 44.36 53


Thanks for the help!
JT


"Adrian M" wrote:

Are there any hidden decimals in the lookup criteria? Also, if you

have
alpha
numeric lookup values make sure it is sorted by Excel and not by human
sorting as this can be a problem (see

http://www.auditexcel.co.za/errors.html
). If none of these maybe you can give us some of the sample data?

"jthomas" wrote:

I have a VLOOKUP function in Excel that is returning data from the

row
above
the target row. It must be finding the correct match data and

column,
but
always from the row above the one it should. Using the Exact match

parameter
just returns an "#N/A" error. My table array is sorted.

Any ideas?

Thanks!





  #7   Report Post  
jthomas
 
Posts: n/a
Default

Bingo!

Now I remember running into something like this before. I am downloading
the table I am querying, what a pain to have to eliminate spaces.

Thanks!
JT


"Marc" wrote:

Ok, one last followup...........

It may be that either your C5 value has a trailing space, OR your data array
(Argus Data) has trailing spaces after the entries in the first column.

You could select the entire first column in Argus Data, and do a
search/replace function replacing all spaces with nothing... thus making
sure you don't have trailing spaces...

"Marc" wrote in message
...
As a followup, if you specify "FALSE" as the last parameter in the lookup,
then your list does not need to be sorted. If you specify "TRUE", then it
must be sorted...


"jthomas" wrote in message
...
How would I check for hidden decimals? I don't believe there are any.

I
did
have Excel sort the data.

Here is my formula:
=VLOOKUP(C5,'Argus Data'!A:F,6)

Where C5 refers to a ticker symbol. When C5 is ADP the formula result

is
"0" (from blank row above). When C5 is ACN the result is 66 (from row

above
for ACI).

Here is some sample data (sorry about formatting):

ticker security_name twelve_month_rating five_year_rating

price_per_share
target_price
AA ALCOA INC COM BUY BUY 27.91 37
AAI AIRTRAN HLDGS INC BUY BUY 11.81 14
AAP ADVANCE AUTO PARTS INC BUY BUY 69.05 78
AAPL APPLE COMPUTER INC BUY BUY 42.75 51
ABC AMERISOURCEBERGEN CORP HOLD HOLD 71.56
ABS ALBERTSONS INC HOLD HOLD 20.95
ABT ABBOTT LABS HOLD BUY 47.02
ABX BARRICK GOLD COM BUY HOLD 24.6 26
ACE ACE LTD HOLD HOLD 46.23
ACI ARCH COAL INC BUY BUY 58.72 66
ACN ACCENTURE LTD BUY BUY 25 32
ADBE ADOBE SYSTEMS INC BUY BUY 29.46 40
ADCT ADC TELECOMMUNICATION STK HOLD BUY 26.31
ADI ANALOG DEVICES INC HOLD BUY 39.06
ADP AUTOMATIC DATA PROCESS BUY BUY 44.36 53


Thanks for the help!
JT


"Adrian M" wrote:

Are there any hidden decimals in the lookup criteria? Also, if you

have
alpha
numeric lookup values make sure it is sorted by Excel and not by human
sorting as this can be a problem (see

http://www.auditexcel.co.za/errors.html
). If none of these maybe you can give us some of the sample data?

"jthomas" wrote:

I have a VLOOKUP function in Excel that is returning data from the

row
above
the target row. It must be finding the correct match data and

column,
but
always from the row above the one it should. Using the Exact match

parameter
just returns an "#N/A" error. My table array is sorted.

Any ideas?

Thanks!






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 not returning results Chris Kellock Excel Worksheet Functions 14 March 19th 08 08:30 AM
vlookup returning a n/a result jeanette.rimmer Excel Worksheet Functions 4 July 14th 05 01:00 AM
Vlookup returning #N/A ww Excel Worksheet Functions 2 March 23rd 05 12:24 AM
MY VLOOKUP IS RETURNING N/A AND THEREFORE MY TOTAL SUM AT THE BOT. Martin Excel Discussion (Misc queries) 2 December 13th 04 11:21 AM
troubleshoot vlookup returning #N/A dillon Excel Worksheet Functions 1 December 2nd 04 03:32 PM


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

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

About Us

"It's about Microsoft Excel"