Return blank cell if cell to be tested is blank

J

John Richards

Can someone tell me how I can test for a blank cell and return a blank
rather than a zero? I am currently using a formula of the form "=IF(
A1<>0,A1+A2,0)" to test for a non-zero value (a zero value in A1 would
normally be an empty cell) but if the value of A1 is blank, the test returns
a zero. The problem is that I am inputing values into A1,A2,A3,... daily
and charting the results. My chart is built using daily values to the end
of the year so when it sees a date corresponding to a future date, An =
blank, the cell of interest holds a zero and my chart goes to zero through
the end of the year instead of stopping when there are no more values in An.
Hope this is clear enough.

Thanks
John
 
J

John Richards

Aladin Akyurek said:
What do you want to happen if A2 is (also) blank?

OOPS! Should have used "IF(A1<>0, A1+B1,0). I am looking into using
"IF(ISBLANK(A1),"",A1+B1)", I'm making progress but I still have a few
details to work out.

John
 
J

John Richards

Arvi Laanemets said:
Hi

=IF(A1="","",A1+A2)

Cool! I discovered the ISBLANK function which works the same as your
suggestion but is not as efficient as your suggestion.

Thanks
John
 
A

Aladin Akyurek

John,

You didn't answer the question I posed. Ok: A2 --> B1, but what happens if
B1 is blank or not blank? Considering that you are charting the results
(producing a graph), maybe one of:

=IF(COUNTBLANK(A1:B1),#N/A,A1+B1)

=IF(N(A1)*N(B1),A1+B1,#N/A)

=IF(A1,A1+B1,#N/A)

=IF(N(A1),A1+B1,#N/A)
 
A

Arvi Laanemets

Hi


John Richards said:
Cool! I discovered the ISBLANK function which works the same as your
suggestion but is not as efficient as your suggestion.

With ISBLANK there is an additional step - calculating the function value -
which is abundant for this particular case.
 

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