Forum Discussion

Richard Cooke's avatar
Richard Cooke
Copper Contributor
Oct 24, 2017

Charts acting like blank cells are zeros - NB the cells use a formula which returns the blank value

Hi,

 

I have a column, C, of the form: C6=IF(OR(A6="",B6=""),"",A6-B6) where A and B are columns with mostly numerical values but occasionally blanks. The formula, rather than a simple C=A-B, ensures C is also blank if either of A or B are blank. So my column C now has mostly numerical values but also some blanks. So when i look at Averages in the column the returned value is correct. 

 

HOWEVER, when i chart the row, all the blank cells appear as zero values in the chart. If I 'delete' the formula that gives the blank return, and therefore replace it with an empty (ie blank) cell then the chart treats it correctly as a gap. 

 

How do i get the chart to treat the blank (resulting from the formula) as a true blank (ie a gap in the chart)? Or do I need to change the formula? 

  • Hi Richard,

     

    Right click on your chart, Select Data in the menu, Hidden and Empty Cells button at bottom left, select Gaps

     

    • Richard Cooke's avatar
      Richard Cooke
      Copper Contributor

      Thank you Sergei - I tried that. However it does not work, as it somehow interprets a blank cell caused by a formula as different to a truly blank cell. It treats the blank-cell-caused-by-a-formula as a zero ...it's most irritating!

      • SergeiBaklan's avatar
        SergeiBaklan
        MVP

        Hi Richard,

         

        In your formula you may use NA() instead of empty string

        =IF(OR(A3="",B3=""),NA(),A3-B3)

        when

        To hide #N/A you may apply conditional formatting with rule like

        =IFNA(C3,"na")="na"

        to format the cell as white on white

        And in latest Excel you may select to show #N/A as empty cell, when

         

Resources