finding last number in row excluding 0's

J

Joe

hello all, i have a row of 18 numbers that update autmatically and give me a
number increasing by 1 if the statement is true, if false, i get a 0. i would
like to know of a formula that will give me the last number in the string
excluding the 0's.
example is columns BA3:BR3 and in column BS3 i would like to see last number
over 0.
the below example would be after 3 different days of inputs, as you can see
it does not take the 0 but the last whole digit in the string.

your help would be greatly appreciated
thank you

ba bb bc bd be bf bg bg bi bj bk bl bm bn bo bp bq br
bs
0 1 2 3 4 5 6 7 8 0 1 2 3 0 1 2
0 0 =2

ba bb bc bd be bf bg bg bi bj bk bl bm bn bo bp bq br
bs
0 1 2 3 4 5 6 7 8 0 1 2 3 0 1 2
3 0 =3

ba bb bc bd be bf bg bg bi bj bk bl bm bn bo bp bq br
bs
0 1 2 3 4 5 6 7 8 0 1 2 3 0 1 2
3 4 =4
 
P

Peo Sjoblom

Adapt this

=LOOKUP(2,1/((BA3:BR3<>"")*(BA3:BR3<>0)),BA3:BR3)


if there can be no empty cells within you can use


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


--


Regards,


Peo Sjoblom
 
T

Tom Hutchins

Try this array formula (assuming row 1. Change as needed):

=INDEX(A1:R1,1,MAX(--(A1:R1<>0)*COLUMN(A1:R1)))

For an array formula, instead of Enter, you have to press Ctrl + Shift +
Enter. If you do it right, Excel will add curly braces around the formula.

Hope this helps,

Hutch
 
B

Bob Phillips

Doesn't work if the last value is < 1 but > 0

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
J

Joe

thank you all for your help, the first one i tried and its good. i have been
trying to figure that out for a few months now and was getting nowhere. keep
up the good work.

Joe
 

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