Find most recent value in data range that includes SUM formulas

R

RPage@SF

I have a series of cells that sum the columns above them (O12:X12) on
multiple worksheets. I would like to write a formula to report the cell that
has a value and is the furthest to the right. I used:

=LOOKUP(10^10,'Worksheet reference'!O12:X12)

This worked on a previous worksheet when the data range contained values,
but since O12 through X12 include SUM formulas, it's not working.

Any ideas?
 
G

Gary''s Student

We can force your LOOKUP() to work!!

In O12 you may have something like:
=SUM(O1:O11)
replace it with:
=IF(SUM(O1:O11)=0,"",SUM(O1:O11)) and copy across

This way if the SUM() reports a zero, we make it a blank and your LOOKUP()
will be happy again.
 
T

T. Valko

It should work. It doesn't make a difference whether the values are
constants or the results of formulas. As long as the values are *numeric
numbers* the formula should work.
 
R

RPage@SF

Now it reports "#NA" if the value is zero, but correctly if there are values
to be summed. How can I get it to report 0 if there isn't a value to report?
 
T

T. Valko

Try this:

=IF(COUNT('Worksheet reference'!O12:X12),LOOKUP(1E100,'Worksheet
reference'!O12:X12),"")
 

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