babycody said:
I will always bow to your expertise Aladin. You are far better at this than me. I did test this idea before I posted it however. A1 on sheet1 returned the value of the last cell in the range MyRange when I tested it. As I added more information down the rows the value shown in Sheet1 A1 changed to match the last value. You are correct (as always) in pointing out that a blank space disrupts everything. This was something I had not considered. I wasn't trying to say not to use the 9s. I was trying to use my own immagination to help solve the problem. I have received so much help here that I try on occasion to do the same for others. I had conceived this idea, and thought it was something new to consider. I didn't see the flaws in my approach that you as a more experienced Excel user could more readily see. Next time I post an original technique I will ask the other members their opinions about the approach I used to achieve the solution. I will also state that the method is untested. I know that you put a lot of thought into this formula =LOOKUP(9.99999999999999E+307,Sheet2!A:A) .
There is no need to be apologetic...
Setting up a dynamic named range with:
[1]
=OFFSET(Sheet2!$A$1,0,0,COUNTA(Sheet2!$A:$A),1)
requires an additional formula to retrieve the last value the OP wants. And you provided:
[2]
=OFFSET(Sheet2!A1,COUNTA(MyRange)-1,0)
Even if you created these two formulas yourself (that's simply great), they are not new (i.e., they are standard, well-known idioms).
You could also have forwarded just the last one (something that is quite similar anyway and something that you already know)...
[3]
=OFFSET(Sheet2!A1,COUNTA(Sheet2!$A:$A)-1,0)
Here a review:
A)
[1] and [2] together are too expensive to invoke for just retrieving the last value.
B)
[3] alone is also expensive compared with other idioms which are available.
C)
COUNTA is impervious to empty cells: The OFFSET formulas invoking this function might potentially calculate wrong results.
D)
[1] and [2] together or [3] alone would return any last value, if not thwarted by empty cells. Alternative idioms, although very fast, are specific to the data type of the last value one needs.