How to Prevent Excel Charts from Plotting Empty Formula Cells as Zero
Question details
The user needs to stop a dynamic line chart from plotting blank string outputs from formulas as zero values.

- Product
- Excel Online
- Device & OS
- not provided
- Scenario
- Creating a dynamic line chart based on formula results where future or missing data is designed to return a blank string.
- Observed behavior
- The chart interprets blank string outputs from formulas as zero, causing the line to drop abruptly to the zero axis instead of breaking or stopping.
Identify the exact formulas being used to generate your plotted chart values. Ensure you have editing access to the source data range to modify the formula conditions.
Replace Blank Strings with the NA() Function
Modify your IF formulas to output #N/A errors instead of blank strings, allowing the chart to natively ignore missing data.
Spreadsheet software interprets blank strings ("") returned by formulas as text. When plotting numerical charts, these text values are evaluated as zero, causing the line to plummet. By returning an actual #N/A error instead, the chart knows to ignore the cell.
You will need to update the formula and adjust the chart's hidden and empty cell settings to handle the new #N/A outputs properly.
Select the first cell in your chart's data range that contains the formula returning a blank string.
Edit the formula in the Formula Bar. Replace the blank string output ("") with the NA() function. For example, change =IF(A1="", "", A1*2) to =IF(A1="", NA(), A1*2).
Press Enter to apply the formula, then drag the fill handle to apply this updated formula across your entire data range.
Right-click your line chart and choose 'Select Data'. Click the 'Hidden and Empty Cells' button at the bottom left of the dialog.
Ensure 'Show empty cells as: Gaps' is selected. Click 'OK' to save the settings. The chart will now stop at the last valid data point instead of dropping to zero.

Create Flawless Dynamic Charts with WPS Spreadsheet
WPS Spreadsheet offers robust chart customization tools and perfectly handles #N/A values in dynamic data ranges. It ensures your line charts always look professional and accurate without unexpectedly dropping to zero.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your dynamic chart data.
- 2. Update formulas to use NA(): Adjust your conditional formulas to output NA() instead of empty quotes for missing data points.
- 3. Insert or update your chart: Navigate to the Insert tab, select Line Chart, and verify that the #N/A values are correctly treated as gaps in your visualization.

Frequently Asked Questions
Can I hide the #N/A errors in my worksheet while keeping the chart functional?
Yes. You can use Conditional Formatting to hide the visible #N/A errors in your data range. Select your data, create a new rule using 'Format only cells that contain', select 'Errors', and set the font color to match the cell background (e.g., white).
Why does returning a blank string cause a zero on the chart?
Spreadsheet software treats empty strings ("") returned by formulas as text characters. In line and scatter charts, text values are often evaluated as zero on the numerical axis, which forces the plotted line to drop to the bottom.
Does this NA() trick work for bar or column charts?
Yes, using the NA() function works identically for bar and column charts. It prevents a zero-value bar or column from being drawn on the axis, keeping the category space completely empty for a cleaner look.




