Problem with LOOKUP function

J

J

A1 - "A"
B1 - "B"
C1 - "C"
A2 - 3
B2 - 2
C2 - 1

D2= is returning the MAX in the A2:C2 array and returning 3

E2 is my LOOKUP function. =LOOKUP(D2,A2:C2,A1:C1)
Which I thought was saying, look in the array a2:c2, find the value in
d2(3), and return the corresponding value in the a1:c1 array, which would be
"A".
I would be expecting it to return a value of "A" but it's returning "C"
instead.

I've tried VLOOKUP and HLOOKUP and haven't be able to get that to work with
this either. Any ideas what I'm doing wrong?
 
T

tim m

I get the same result as you when testing your data, must have something to
do with the highest value being in the left most column as if you make B the
higest value it gives the correct result. Has me stumped as well. May have
something to do in the sorting of the numerical data.
 
J

J

And I think that is the point of HLOOKUP and VLOOKUP but I haven't been able
to construct a formula with them that function correctly. Anyone a H or V
LOOKUP Expert that can help?
 
T

T. Valko

The LOOKUP function *requires* the array be sorted ascending.

Try this:

=INDEX(A1:C1,MATCH(D2,A2:C2,0))

Or, you could eliminate the separate MAX formula in D2 and incorporate that
directly into the "lookup" formula:

=INDEX(A1:C1,MATCH(MAX(A2:C2),A2:C2,0))

Biff
 
J

J

That works. Thank you!

T. Valko said:
The LOOKUP function *requires* the array be sorted ascending.

Try this:

=INDEX(A1:C1,MATCH(D2,A2:C2,0))

Or, you could eliminate the separate MAX formula in D2 and incorporate that
directly into the "lookup" formula:

=INDEX(A1:C1,MATCH(MAX(A2:C2),A2:C2,0))

Biff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top