Last value

R

RedViking

Hi,
I am looking for a function that will give me the last value >0 in
column of data where the number of rows differs and the first entrie
may or may not be 0. Two examples:

A1: 0
A2: 3
A3: 5
A4: 7
A5: 0

In this case I want 7 (cell A4) to be given by the function.

A1: 1
A2: 3
A3: 5
A4: 6
A5: 8
A6: 10
A7: 0

In this case I want 10 (cell A6) to be given by the function.

I've tried =INDEX(A1:A7;COUNT(A1:A7)), but this will not work if th
first rows contain 0.

RedVikin
 
J

Jason Morin

=INDEX(A1:A7,MAX(IF(A1:A7>0,ROW(A1:A7))))

Array-entered, meaning press <ctrl><shift><enter>.

HTH
Jason
Atlanta, GA
 
D

Domenic

Hi,

Another way...

=LOOKUP(9.999999999E+307,IF(A1:A10>0,A1:A10))

entered using CTRL+SHIFT+ENTER
 

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