View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
j j is offline
external usenet poster
 
Posts: 128
Default Problem with LOOKUP function

That works. Thank you!

"T. Valko" wrote:

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" wrote in message
...
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?