Originally Posted by
XOR LX
Using the data you posted and taking the formula in cell W26, this part:
LOOKUP(1,0/V$2:V25,U$3:U26)
which, putting in the entries from V2:V25, is:
LOOKUP(1,0/{1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0},U$3:U26)
and, after reciprocation with zero:
LOOKUP(1,{0;0;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!;#DIV/0!},U$3:U26)
The point being that, any zeroes within that range have now been rendered as errors. As such, they will be ignored by LOOKUP (one of its useful properties), which was precisely the reason for the prior reciprocation.
And, providing the lookup_vector is sorted (which, since it contains nothing but zeroes (recall that we ignore the errors), can certainly be said for that array in this instance), then, if the lookup_value is greater than all values within the lookup_vector (the choice of 1 here is therefore always sufficient, though any other value >0 would also suffice), the entry corresponding to the last numerical value within the range is returned. Here that is equivalent to the last zero within that array, highlighted in the above.
Regards
Bookmarks