How to Create Self-Adjusting Excel Charts for Blank Formula Cells
Question details
The user needs a practical way to make Excel charts resize automatically to ignore rows where calculated series return empty strings instead of truly blank cells.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating a dynamic chart based on a dataset where calculated formula columns return empty strings ("") for missing values, which causes the chart to fail at resizing dynamically.
- Observed behavior
- The chart includes the formula-generated empty strings as valid data points, resulting in unwanted blank spaces, flat lines at zero, or incorrect axis scaling instead of adjusting to only the available data.
Ensure your dataset is organized into clear columns, and identify which column contains the raw user input versus the calculated formulas returning the empty strings.
Create a Dynamic Named Range Using OFFSET and COUNTA
This method calculates the actual number of populated cells in your raw input column and dynamically sizes the chart range to exclude formula-generated blanks.
A formula returning an empty string ("") is still considered a non-blank cell by spreadsheet software. Because of this, standard chart ranges will plot these empty cells.
By basing the COUNTA function on the original raw data column instead of the formula column, you can accurately determine the chart's true size and pass that dynamic range to your chart series.
Navigate to the Formulas tab on the ribbon and click 'Name Manager'. Click 'New' to define a new named range (for example, name it 'Dynamic_X').
In the 'Refers to' box, enter your dynamic formula: =OFFSET(Sheet1!$A$2, 0, 0, COUNTA(Sheet1!$B:$B)-1, 1). Adjust '$A$2' to your first X-axis value and '$B:$B' to your raw input Y-column.
Right-click your chart and choose 'Select Data'. Edit your series and replace the standard range reference with your new dynamic named range (e.g., =Sheet1!Dynamic_X).

Filter Out Blank Rows Using Helper Columns
Create a clean, secondary dataset that actively filters out any rows where the formula returns an empty string.
Easily Create Dynamic Charts with WPS Spreadsheet
WPS Spreadsheet offers powerful formula support, including dynamic arrays, OFFSET, and COUNTA functions, allowing you to seamlessly handle blank cells and create professional, self-adjusting charts in seconds.
- 1. Open Your Dataset: Launch WPS Spreadsheet and open your workbook containing the calculated data.
- 2. Define Dynamic Ranges: Navigate to Formulas > Name Manager and input your OFFSET and COUNTA formulas to define the chart's dynamic series based on raw inputs.
- 3. Insert and Configure the Chart: Go to the Insert tab, choose your preferred chart type, right-click the chart area to choose 'Select Data', and input your custom named ranges.
- 4. Test the Dynamic Chart: Add or remove raw data points in your worksheet to watch the chart automatically resize without showing blank gaps.

Frequently Asked Questions
Why does my chart show empty strings as zero or a blank gap?
Spreadsheet software treats a formula returning an empty string ("") as a text value, not a truly blank cell. As a result, the chart still plots the cell, which leads to gaps or a zero value dropping on the axis.
Can I use the NA() function instead of an empty string to fix the chart?
Yes. Changing your formula to return #N/A (using the NA() function) instead of "" will cause line and scatter charts to interpolate over the missing data rather than plotting them as zeros. However, this alone will not resize the axis dynamically; you still need dynamic named ranges for auto-resizing.
Does the FILTER function approach work in older software versions?
The FILTER function relies on dynamic arrays, which are available in modern spreadsheet tools like newer versions of WPS Office and Microsoft 365. For older versions, you must rely on the OFFSET and COUNTA dynamic range method.




