ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   return last cell in a row not zero (https://www.excelbanter.com/excel-discussion-misc-queries/198457-return-last-cell-row-not-zero.html)

Maarkr

return last cell in a row not zero
 
hopefully simple but im an access type... and I would like a formula, not vb
code. a price is entered each week, starting from the left, default $0 if
not filled in. I want to return the first nonzero value from the right.
After 4 weeks i t looks like:

15 25 35 25 0 0 0 0 0

I want to return 25.

Jim Thomlinson

return last cell in a row not zero
 
Check out this link...

http://www.xldynamic.com/source/xld.LastValue.html
--
HTH...

Jim Thomlinson


"Maarkr" wrote:

hopefully simple but im an access type... and I would like a formula, not vb
code. a price is entered each week, starting from the left, default $0 if
not filled in. I want to return the first nonzero value from the right.
After 4 weeks i t looks like:

15 25 35 25 0 0 0 0 0

I want to return 25.


T. Valko

return last cell in a row not zero
 
a price is entered each week

I guess that means it's safe to assume there are no negative numbers?

Try this:

=IF(COUNTIF(A1:I1,"0"),LOOKUP(1E100,1/A1:I1,A1:I1),"no prices")

Will return the rightmost non-zero value.

--
Biff
Microsoft Excel MVP


"Maarkr" wrote in message
...
hopefully simple but im an access type... and I would like a formula, not
vb
code. a price is entered each week, starting from the left, default $0 if
not filled in. I want to return the first nonzero value from the right.
After 4 weeks i t looks like:

15 25 35 25 0 0 0 0 0

I want to return 25.




Teethless mama

return last cell in a row not zero
 
=LOOKUP(2,1/(1:1<0),1:1)


"Maarkr" wrote:

hopefully simple but im an access type... and I would like a formula, not vb
code. a price is entered each week, starting from the left, default $0 if
not filled in. I want to return the first nonzero value from the right.
After 4 weeks i t looks like:

15 25 35 25 0 0 0 0 0

I want to return 25.



All times are GMT +1. The time now is 03:53 PM.

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