Formulas in a range of cells

L

lmc

I am trying to select a range of cells exp. (C15 - C25) and I will for sure
be entering data in C15. It varies if I will use all the cells up to C25. Now
is C26 I want a formula that take the last entered cell in that data range
and subtracts it from cell C15. Is that possible to do?
 
T

T. Valko

What if C15 is the only entry? I'm assuming that you don't want anything to
happen if C15 is the only entry.

=IF(COUNT(C15:C25)<2,"",C15-LOOKUP(10^10,C16:C25))

Biff
 
J

Jason Lepack

Let me get this straight.

You enter numbers in columns C from cell C15 up to some random spot
that will never be past C25.

Example:
C
15. 12
16. 10
17.
18.
19. 5
20.
21. 2
22. 3
23.
24.
25.

In this case you would want C26 to be 12 - 3 = 9.

But if data was only entered in C15 = 12, C16 = 2 then C26 = 12-2 = 10.

What about if only C15 = 5 is entered? Does C26 = 5?

IF you're logic is the same as mine, the this should work. Put this in
C26.

=IF(COUNT(C16:C25)>0,C15 - LOOKUP(2,1/(C16:C25<>""),C16:C25),C15)

Cheers,
Jason Lepack
 
G

Gord Dibben

Biff

Very good.

Gord

What if C15 is the only entry? I'm assuming that you don't want anything to
happen if C15 is the only entry.

=IF(COUNT(C15:C25)<2,"",C15-LOOKUP(10^10,C16:C25))

Biff
 

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