ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   lookup problem in excel (https://www.excelbanter.com/excel-programming/306162-lookup-problem-excel.html)

gameboxinc

lookup problem in excel
 
Hi, the problem I have with lookup is that it doesn't do an exact match. It matches any part of Lookup_value with any part of Lookup_vector and returns the value.

I need it to bring the result_vector only if the Lookup_value is exactly the same as Lookup_vector. if its not exactly the same then put na or what ever it is it puts.

The code I am using is
=LOOKUP(A2,Sheet2!A2:A53,Sheet2!B2:B53)
and what happens is that it doesn't do an exact match, as long as a part of the Lookup_Value matches Lookup_vector it returns the Result_vector.

I tried using vlookup and hlookup but they where acting funny and I couldn't get them to work

Can some one please help me. Thank you.


sebastienm

lookup problem in excel
 
Hi,
Use
=VLOOKUP(A2,Sheet2!$A$2:$B$53,2,FALSE)
instead.

Issues with the vector-LOOKUP... from Online-help:
"Important : The values in lookup_vector must be placed in ascending order:
....,-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP may not give
the correct value. Uppercase and lowercase text are equivalent.
Result_vector : is a range that contains only one row or column. It must be
the same size as lookup_vector.
If LOOKUP can't find the lookup_value, it matches the largest value in
lookup_vector that is less than or equal to lookup_value.
If lookup_value is smaller than the smallest value in lookup_vector, LOOKUP
gives the #N/A error value. "

Regards,
Sebastien

"gameboxinc" wrote:

Hi, the problem I have with lookup is that it doesn't do an exact match. It matches any part of Lookup_value with any part of Lookup_vector and returns the value.

I need it to bring the result_vector only if the Lookup_value is exactly the same as Lookup_vector. if its not exactly the same then put na or what ever it is it puts.

The code I am using is
=LOOKUP(A2,Sheet2!A2:A53,Sheet2!B2:B53)
and what happens is that it doesn't do an exact match, as long as a part of the Lookup_Value matches Lookup_vector it returns the Result_vector.

I tried using vlookup and hlookup but they where acting funny and I couldn't get them to work

Can some one please help me. Thank you.


gameboxinc

lookup problem in excel
 
Thank you so much it helped you were great. awsome

"sebastienm" wrote:

Hi,
Use
=VLOOKUP(A2,Sheet2!$A$2:$B$53,2,FALSE)
instead.

Issues with the vector-LOOKUP... from Online-help:
"Important : The values in lookup_vector must be placed in ascending order:
...,-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP may not give
the correct value. Uppercase and lowercase text are equivalent.
Result_vector : is a range that contains only one row or column. It must be
the same size as lookup_vector.
If LOOKUP can't find the lookup_value, it matches the largest value in
lookup_vector that is less than or equal to lookup_value.
If lookup_value is smaller than the smallest value in lookup_vector, LOOKUP
gives the #N/A error value. "

Regards,
Sebastien

"gameboxinc" wrote:

Hi, the problem I have with lookup is that it doesn't do an exact match. It matches any part of Lookup_value with any part of Lookup_vector and returns the value.

I need it to bring the result_vector only if the Lookup_value is exactly the same as Lookup_vector. if its not exactly the same then put na or what ever it is it puts.

The code I am using is
=LOOKUP(A2,Sheet2!A2:A53,Sheet2!B2:B53)
and what happens is that it doesn't do an exact match, as long as a part of the Lookup_Value matches Lookup_vector it returns the Result_vector.

I tried using vlookup and hlookup but they where acting funny and I couldn't get them to work

Can some one please help me. Thank you.


Daniel[_7_]

lookup problem in excel
 

-----Original Message-----
Hi, the problem I have with lookup is that it doesn't do

an exact match. It matches any part of Lookup_value with
any part of Lookup_vector and returns the value.

I need it to bring the result_vector only if the

Lookup_value is exactly the same as Lookup_vector. if its
not exactly the same then put na or what ever it is it
puts.

The code I am using is
=LOOKUP(A2,Sheet2!A2:A53,Sheet2!B2:B53)
and what happens is that it doesn't do an exact match, as

long as a part of the Lookup_Value matches Lookup_vector
it returns the Result_vector.

I tried using vlookup and hlookup but they where acting

funny and I couldn't get them to work

Can some one please help me. Thank you.

.

Change the formula to
=LOOKUP(A2,Sheet2!A2:A53,Sheet2!B2:B53,false)


to get an exact match


All times are GMT +1. The time now is 06:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com