If cell is empty?

  • Thread starter Thread starter WH99
  • Start date Start date
W

WH99

I have the following formula:
=IF((B31)=0,SUM(C30+B31),(SUM(C30+B31)))
How do I add the following to the formula:
If A31="",NA()
In other words, I want the formula to also look at cell A31 and if it is
empty then cell C31 to show NA or even show nothing.
 
Maybe...

=if(a31="",na(),if(b31=0,c30+b31,c30+b31))

Did you mean to do the same expression in your formula?

=if(a31="",na(),c30+b31)
seems to the same.
 
I'm not sure what your first formula is doing - you seem to be adding
C30 to B31 irrespective of the value of B31 (and if it were zero, then
it would not matter anyway) !! Should one of the terms be C30+B30 ?

Try this:

=IF(A31="","n/a",C30+B31)

if your first formula is correct, or this:

=IF(A31="","n/a",IF(B31=0,C30+B30,C30+B31))

if my suggestion is correct.

Hope this helps.

Pete
 
Sorry I got carried away its not working quit right now!

This is mid table, it goes from the start of the month to the end.

A B C
07-Apr-08 03:30 11:30
08-Apr-08 01:50 13:20
09-Apr-08 02:45 16:05
10-Apr-08 00:00 16:05
11-Apr-08 02:00 18:05
12-Apr-08 03:15 21:20
13-Apr-08
14-Apr-08

Column "C" formula to add the previous days total to the next day total. But
If column "B" is zero then just to carry the days total (column "C") forward.
Also if there is no entry in column "B" then column "C" to show blank. as
per the table above.
 
I would basically make your A31 condition the primary condition and then put
your original formula as the secondary condition.

=IF(A31="",NA(),IF(B31=0,SUM(C30+B31),SUM(C30+B31)))

However I'd like you to look at your original formula again as it seems to
do the C30+B31 sum calculation regardless of the value of B31. So that part
is redundant. In other words, I'll simplify the new formula to the following
and still get the same result above:

=IF(A31="",NA(),SUM(C30+B31))
 
Thanks Rickster,
That works now.
--
WH99


Rickster said:
I would basically make your A31 condition the primary condition and then put
your original formula as the secondary condition.

=IF(A31="",NA(),IF(B31=0,SUM(C30+B31),SUM(C30+B31)))

However I'd like you to look at your original formula again as it seems to
do the C30+B31 sum calculation regardless of the value of B31. So that part
is redundant. In other words, I'll simplify the new formula to the following
and still get the same result above:

=IF(A31="",NA(),SUM(C30+B31))
 

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

Back
Top