Hi,
You should not use LOOKUP unless your values are sorted in ascending orderas
indicated in Help article you have mentioned (an exception to that is when
you want to return the last value in the array)
Instead you could use VLOOKUP if the value to return is in a column
following the one with the booleans, e.g.:
=VLOOKUP(TRUE,A1:B6,2,0)
this formula assumes that the booleans are in column [A] and the values to
return in [B]
the 0 argument in the VLOOKUP function corresponds to FALSE and means that
the array is not sorted
Or in any situation you can use:
=INDEX(A1:A6,MATCH(TRUE,B1:B6,0))
this formula assumes that the booleans are in column [B] and the values to
return in [A]
the 0 argument in the MATCH function means that the array is not sorted
Regards,
KL
> Hi everyone,
> I'm trying to figure out some wierd LOOKUP behavior with booleans. I
[quoted text clipped - 28 lines]
> Andy Landen
> SLC, UT
landen99@gmail.com - 14 Sep 2005 22:24 GMT
Thank you very much for your help. I had to group my values together
to form a table for the "A1:B6" part. Couldn't have the columns
separated for some reason. Anyhow, the VLOOKUP works perfectly, thanks
again.
Andy
> Hi,
>
[quoted text clipped - 53 lines]
> > Andy Landen
> > SLC, UT
KL - 15 Sep 2005 07:14 GMT
Hi,
You don't need to group the columns - they can be at any distance from each
other.
for VLOOKUP the additional requirement is that the column with the results
is located to the right frome the evaluated column
=VLOOKUP(SearchedValue,LookupTable,ResultColumnNumber,Sorted)
the second formula does not have this requirement.
=INDEX(ResultColumnReference,MATCH(SearchedValue,LookupColumnReference,Sorted))
Regards,
KL
> Thank you very much for your help. I had to group my values together
> to form a table for the "A1:B6" part. Couldn't have the columns
[quoted text clipped - 65 lines]
>> > Andy Landen
>> > SLC, UT