More elegant method?

R

RoR

For each month a number is entered, until it is entered the value for each month is zero.
I am trying to pull the latest number greater than zero from the list.

Currently I use two nested IF arguments such as:
IF(jan>0, jan, if(feb>0, feb, (if mar>0, mar, etc. I'm using two to avoid the limit of
nesting logical arguments within logical arguments to 7.

Each result reports to a cell with its result, I then do a similar calculation to get the
number I really need.

Clumsy, but effective. I, however, need a method to get the latest number without using
the extra cells, and would like to get it in a more elegant manner. Any suggestions?

It's been a very long time since I've written spreadsheets (early 1-2-3, and visicalc,
yeah, that long) and I feel that there must be something I'm missing.

Thanks in advance.
 
B

Biff

Hi!

Maybe this:

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

10
22
44
0
0
0


The above formula will return 44.

10
22
44
0
17
0

The above formula will return 17.

Biff
 
R

RoR

Hi!

Maybe this:

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

10
22
44
0
0
0


The above formula will return 44.

10
22
44
0
17
0

The above formula will return 17.
Thanks, Biff, it gives the result I need, but for the life of me I can't figure out why. I
thought lookup had to be on ordered data in ascending order.

More research needed on my part regarding this spreadsheet.

Thanks again.
 

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