ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Display the last non-zero value in a list of numbers (https://www.excelbanter.com/excel-discussion-misc-queries/114413-display-last-non-zero-value-list-numbers.html)

IvanM

Display the last non-zero value in a list of numbers
 
I am trying to find the last entered value in a list of basic weight data. I
enter new numeric values to the list on a daily basis, but would like to
always show the last entered value in another cell also. The list also
contains zero values, that I want to exclude or ignore from my result, e.g.

0
300
250
350
375
0
0

would always return 375, as the last value in the list (which will also
always be positive) it's also the VALUE I need, not the position in the list.

Regards,

IvanM

Ron Rosenfeld

Display the last non-zero value in a list of numbers
 
On Sat, 14 Oct 2006 04:19:01 -0700, IvanM
wrote:

I am trying to find the last entered value in a list of basic weight data. I
enter new numeric values to the list on a daily basis, but would like to
always show the last entered value in another cell also. The list also
contains zero values, that I want to exclude or ignore from my result, e.g.

0
300
250
350
375
0
0

would always return 375, as the last value in the list (which will also
always be positive) it's also the VALUE I need, not the position in the list.

Regards,

IvanM


Something like:

=LOOKUP(2,1/(-A1:A1000<0),A1:A1000)

should work.


--ron

Bob Phillips

Display the last non-zero value in a list of numbers
 
=LOOKUP(2,1/(A1:A1000<0),A1:A1000)

works for me

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ron Rosenfeld" wrote in message
...
On Sat, 14 Oct 2006 04:19:01 -0700, IvanM


wrote:

I am trying to find the last entered value in a list of basic weight

data. I
enter new numeric values to the list on a daily basis, but would like to
always show the last entered value in another cell also. The list also
contains zero values, that I want to exclude or ignore from my result,

e.g.

0
300
250
350
375
0
0

would always return 375, as the last value in the list (which will also
always be positive) it's also the VALUE I need, not the position in the

list.

Regards,

IvanM


Something like:

=LOOKUP(2,1/(-A1:A1000<0),A1:A1000)

should work.


--ron




Ron Rosenfeld

Display the last non-zero value in a list of numbers
 
On Sat, 14 Oct 2006 12:52:21 +0100, "Bob Phillips"
wrote:

=LOOKUP(2,1/(A1:A1000<0),A1:A1000)

works for me


Yes, of course. <sound of slap to forehead

Actually,

=LOOKUP(2,1/(A1:A1000),A1:A1000)

should work also, for non-zero numeric values.


--ron

Bob Phillips

Display the last non-zero value in a list of numbers
 
Actually, that is what I meant, I don't know why I copied the <0 (slap for
me too <g)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ron Rosenfeld" wrote in message
...
On Sat, 14 Oct 2006 12:52:21 +0100, "Bob Phillips"
wrote:

=LOOKUP(2,1/(A1:A1000<0),A1:A1000)

works for me


Yes, of course. <sound of slap to forehead

Actually,

=LOOKUP(2,1/(A1:A1000),A1:A1000)

should work also, for non-zero numeric values.


--ron





All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com