Return blank cell if cell to be tested is blank

  • Thread starter Thread starter John Richards
  • Start date Start date
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
 
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
 
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
 
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)
 
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.
 
Back
Top