IF Statement

P

phuser

=IF(SUM(G7-M7)>0,SUM(G7-M7)," ")

I love how this keeps the cells clean BUT because there is no value in the
cell, I cant calculate any further,
all I get in return is a #Value
Is it possible to use 2 or more cells like this in a calulation? and if so
what syntax would I use?
 
G

Guest

Can you explain why you can't calculate further (cecause of the ""?) and what
exactly you want to do?
 
M

MyVeryOwnSelf

=IF(SUM(G7-M7)>0,SUM(G7-M7)," ")
I love how this keeps the cells clean BUT because there is no value in
the cell, I cant calculate any further,
all I get in return is a #Value
Is it possible to use 2 or more cells like this in a calculation? and
if so what syntax would I use?


One way is to use
Tools > Options View
and uncheck "zero values." This means, "if a value is zero, display it as
empty." Then you can use the simple formula like
=MAX(G7-M7,0)
and do further arithmetic on the result, while keeping the cells looking
clean.



A different way is to use the "N" function.

Suppose A1 contains: =IF(G7>M7,G7-M7," ")
and A2 contains: =IF(H7>N7,H7-N7," ")
(your formula but a bit shorter).

Then a formula such as
=N(A1)+N(A2)
Treats A1 or A2 as zero in the troublesome cases.

Excel's built-in Help explains what "N" does.
 

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