selecting last entry

D

dihirod

I have several cells reading data from a single cell - the last one in a
column - the value of which keeps changing as data is added. How do I ensure
that the several cells read only from the last entry in the column, and not
from older obsolete entries?
 
B

Bob Phillips

This will get you the last value in a column

=INDEX(A:A,MAX(MATCH({"ZZZZZZZZZZZZZZZZZZZZ",9.99999999999999E+307},A:A)))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
D

dihirod

Many thanks. I stupidly omiteed to add that the list of entries does not
comprise the entire column - only part of it (let's say C5 to c10) after
that, there's oodles of other things in the same column. I'd like to know how
to restrict the lookup to that small section.
 
B

Bob Phillips

=INDEX(C5:C10,MAX(MATCH({"ZZZZZZZZZZZZZZZZZZZZ",9.99999999999999E+307},C5:C1
0)))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
D

dihirod

Many thanks. I tried this myself, but I got, and still get #N/A which I
understand is a MATCH error value. (The first one worked fine as described,
it returned the value from the bottom of the worksheet.) What am I doing
wrong with this one?
 
B

Bob Phillips

That sounds like you have all numbers or all text.

If all numbers, and always all numbers, use

=INDEX(C5:C10,MAX(MATCH(9.99999999999999E+307,C5:C10)))

If all text, and always all text, use

=INDEX(C5:C10,MAX(MATCH("ZZZZZZZZZZZZZZZZZZZZ",C5:C10)))

If it could be both, but coul;d be all numbers or all text, use

=INDEX(C5:C10,MAX(IF(ISERROR(MATCH({"ZZZZZZZZZZZZZZZZZZZZ"},C5:C10)),MATCH(9
..99999999999999E+307,C5:C10),IF(ISERROR(LOOKUP(9.99999999999999E+307,C5:C10)
),MATCH("ZZZZZZZZZZZZZZZZZZZZ",C5:C10),MATCH({"ZZZZZZZZZZZZZZZZZZZZ",9.99999
999999999E+307},C5:C10)))))



--

HTH

RP
(remove nothere from the email address if mailing direct)
 
D

dihirod

Perfect! many many thanks.

Bob Phillips said:
That sounds like you have all numbers or all text.

If all numbers, and always all numbers, use

=INDEX(C5:C10,MAX(MATCH(9.99999999999999E+307,C5:C10)))

If all text, and always all text, use

=INDEX(C5:C10,MAX(MATCH("ZZZZZZZZZZZZZZZZZZZZ",C5:C10)))

If it could be both, but coul;d be all numbers or all text, use

=INDEX(C5:C10,MAX(IF(ISERROR(MATCH({"ZZZZZZZZZZZZZZZZZZZZ"},C5:C10)),MATCH(9
..99999999999999E+307,C5:C10),IF(ISERROR(LOOKUP(9.99999999999999E+307,C5:C10)
),MATCH("ZZZZZZZZZZZZZZZZZZZZ",C5:C10),MATCH({"ZZZZZZZZZZZZZZZZZZZZ",9.99999
999999999E+307},C5:C10)))))



--

HTH

RP
(remove nothere from the email address if mailing direct)
 
A

Aladin Akyurek

If you want to retieve the last numeric value from C5:C10, invoke:

=LOOKUP(9.99999999999999E+307,$C$5:$C$10)

If you want to retieve the last text value from C5:C10, invoke:

=LOOKUP(REPT("z",255),$C$5:$C$10)

The latter will fetch a formula-blank (created by, say, someting like
="") if this text value is the last entry.
Many thanks. I stupidly omiteed to add that the list of entries does not
comprise the entire column - only part of it (let's say C5 to c10) after
that, there's oodles of other things in the same column. I'd like to know how
to restrict the lookup to that small section.

:

--

[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.
 
R

Ragdyer

You could try this for *either* text or numbers:

=LOOKUP(2,1/(1-ISBLANK(C5:C10)),C5:C10)
 
R

Ragdyer

Exactly !
Isn't that what was asked for ... in the OP ... and in the subject line?<g>

Isn't an error return from a formula just as valid a response as a "1" or an
"A"?
As long as the error is *not* caused by the "checking" formula *itself*!

And of course, the magic word in my suggestion was "try", since the OP is
the final judge as to the functionality and validity of any submitted
suggestion.

BUT, I must admit that you do perhaps have a point, in that it would have
been better practice on my part to "advise" that *all* formula returns,
values as well as errors, will be displayed by my suggestion, as well as
*all* keyed in entries.
--
Regards,

RD
 
Top