Regarding your questions about the LOOKUP function:
Per Exce help:
"If LOOKUP can't find the lookup_value, it matches the largest value in
lookup_vector that is less than or equal to lookup_value."
Using that information:
=LOOKUP(2,1/(A1:A100<>""),A1:A100)
In that formula, the second argument divides the number 1 by 1 or 0, the
numeric result of whether each cell is non-blank (1) or blank (0). 1/1
returns 1. 1/0 returns #DIV/0!. Consequently, when LOOKUP cannnot locate 2 in
the second array, it will return the last numeric item in the list that is
less than 2, which is the last 1. That item will refer to the last non-blank
cell in the third argument.
=LOOKUP(10^99,A:A)
The same rules apply in that formula. 10^99 is a much larger number than I
would ever expect in a worksheet. When the LOOKUP function cannot find it in
a list of numbers, it will return the last number in the list that is less
than 10^99.
Note: If you happen to be an astronomer or scientist, you may want to lookup
the largest number Excel can handle: 9.99999999999999E-307 instead of 10^99
Does that help?
***********
Regards,
Ron
XL2002, WinXP