Reputation: 1843
I have a column whose content is conditioned upon another column:
=IF(B8<>"";B8/($J$2 * $J$2);"")
This column is the line data for a chart. It works fine when the IF
condition is met. However, any ELSE
""
value is considered as 0
in the chart and the line crashes down to the bottom.
The alternative is to use
=IF(B8<>"";B8/($J$2 * $J$2);NA())
But then it looks ugly in the spreadsheet with loads of #N/A
in the column.
Any solution aside from putting a conditional formatting on top which makes the font color white when the value is #N/A
?
Upvotes: 0
Views: 1044
Reputation: 695
You can plot with a Named Range which will evaluate 0
to #NA
If the data you're plotting is in C3:C8
:
0
as #NA
(I've called the Range "PLOT", but you can give it any name you want): =IF(Sheet1!$C$3:$C$8=0,NA(),Sheet1!$C$3:$C$8)
=SERIES(,,Book1!PLOT,1)
This will allow you to keep the ELSE
-cells as ""
in your sheet, whilst still showing up as #NA
to the Chart and hence not collapsing the line to zero
NB: See here for notes on how to use Named Ranges in charts, particularly:
If your references are Names (Named Ranges), you need to qualify the Name with the scope of the Name, that is, either its parent worksheet or the parent workbook.
=SERIES(Sheet1!TheSeriesName,Sheet1!TheXValues,Sheet1!TheYValues,1)
You can enter the Name qualified by the worksheet, and if the Name is scoped to the workbook, Excel will fix it for you.
Upvotes: 1