Noob_Programmer
Noob_Programmer

Reputation: 147

LOOKUP function not giving expected results

I am having a problem with the LOOKUP function.

To test some things, I entered the following function

=LOOKUP(4.19, $B$2:$B$6, $C$2:$C$6) 

And on every line, it gives me a different answer. I don't know what is the problem with it because it just gives me the wrong answer. It should say "blue".

Example given

Upvotes: 2

Views: 2755

Answers (3)

HvG
HvG

Reputation: 43

With the third argument you tell the function what the output should be if the first argument( 4.19) is valid. since you enterd a range of cells, the output differs. Also if you are searching for an exact value you should add a further argument at the end of the function =VLOOKUP(4.19, $B$2:$B$6, D1, FALSE)

Upvotes: 0

Ralph
Ralph

Reputation: 9444

The lookup value must be (always) in the first column of the lookup table. So, if you are looking for 4.19 (which is in the right-most-column) in order to return a value from a column further to the left then you'll have to change to INDEX/MATCH like so:

=Index($C$2:$C$6,Match(4.19, $B$2:$B$6,0))

Upvotes: 1

ewcz
ewcz

Reputation: 13087

With LOOKUP the values you are searching in must be in descending order. If you want to keep the order as is, you might want to use INDEX/MATCH functions.

Upvotes: 1

Related Questions