Formula to Return Last Non-Zero Value in Row

G

Guest

Hi,
I'm looking for a formula that will reutrn the last non-zero value in a row.
TIA.
 
B

Biff

Based on your question I'm assuming only numbers will involved, no TEXT in
the range?

=LOOKUP(2,1/(1:1<>0),1:1)

Will return the last value that is not a zero from row 1, A1:IV1.

Biff
 
G

Guest

Here's a variation of Biff's formula that you can put in A1 (and copy down)
to check the rest of the row..........

=IF(MAX(B1:IV1)>0,LOOKUP(2,1/(B1:IV1<>0),B1:IV1),"")

Vaya con Dios,
Chuck, CABGx3
 
G

Guest

Biff,
Thanks for the solution. It works as advertised.
I am trying to undersand the logic.
Is the first "2" Boolean (i.e. "False")?
Is the first "1" Boolean (i.e. "True")?
The formula seems to work whether the "1" is a "1" or a "2."
If you have a moment, could you explain how this works?
(Always trying to improve my Excel logic skills.)
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top