ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Data tools
  3. Make an Excel Chart Ignore Blank Cells and Zeros

Make an Excel Chart Ignore Blank Cells and Zeros

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To make an Excel chart ignore blank cells, right-click the chart, choose Select Data, click Hidden and Empty Cells and pick Gaps or Connect data points with line. Formulas that return "" are not blank and plot as zero, so return NA() instead, for example =IF(B2="",NA(),B2). Zeros need the same NA() trick to disappear.

Key takeaways

  • Truly empty cells follow the Hidden and Empty Cells setting: Gaps, Zero or Connect data points with line.
  • A formula that returns "" is text, not blank, and line and column charts plot it as zero.
  • Return NA() instead of "" so the chart skips the point: =IF(B2="",NA(),B2).
  • Use =IF(B2=0,NA(),B2) in a helper column to hide real zeros from a chart.
  • Filtered or hidden rows are left out of a chart by default.
On this page+
  1. Why does an Excel chart show blank cells as zero?
  2. How to make a chart ignore truly blank cells
  3. How to make formulas return a gap instead of zero
  4. How to hide zero values in a chart
  5. How to stop #N/A spoiling the table
  6. How to keep averages from counting blanks and zeros
  7. Common mistakes with blanks in charts
  8. Practise it

If your line suddenly drops to the bottom of the chart for a month with no data, Excel is treating a blank or empty-looking cell as zero. You can make an Excel chart ignore blank cells with one setting, Hidden and Empty Cells, as long as the cells are truly empty. Cells with formulas that return "" need a different fix: return NA() instead. This guide covers both, plus how to hide real zeros, for anyone building monthly reports or dashboards.

Why does an Excel chart show blank cells as zero?#

There are two different causes, and each needs its own fix:

  1. The cell is truly empty, and the chart's empty cells setting is Zero. Change the setting.
  2. The cell holds a formula that returns "". It looks empty, but Excel sees text, and line and column charts plot text as zero. The setting doesn't help here, because the cell isn't empty.

To find out which one you have, click the cell. If the formula bar shows nothing, it is empty. If it shows a formula, it is cause 2. The guide to IFERROR returning a blank explains why "" is not a real blank.

Here is the data used in this guide. March has no figure yet, and May is a real zero because the shop was closed:

AB
1MonthSales
2Jan1,200
3Feb1,350
4Mar
5Apr1,500
6May0
7Jun1,400

How to make a chart ignore truly blank cells#

The Hidden and Empty Cells setting controls how a chart draws empty cells. To change it:

  1. Click the chart.
  2. Right-click it and choose Select Data (or go to Chart Design > Select Data).
  3. Click Hidden and Empty Cells in the bottom-left corner.
  4. Under Show empty cells as, choose an option and click OK twice.
OptionWhat the chart shows for March
GapsA break in the line between Feb and Apr
ZeroThe line drops to 0 for March
Connect data points with lineA straight line from Feb to Apr

Gaps is the honest choice when data is missing. Connect data points with line gives a smoother look, but readers may think March had a real value. That option is available for line and scatter charts. These steps are for Excel for Windows and Microsoft 365. On a Mac, look for the same options in the Select Data dialog. For chart basics, see how to make a chart in Excel.

How to make formulas return a gap instead of zero#

When the chart data comes from formulas, return #N/A for missing values instead of "". Charts don't plot #N/A as a point. The NA() function returns it:

Excel formula
=IF(B4="",NA(),B4)

This returns the sales figure when there is one and #N/A when the cell is empty. Put it in a helper column, such as C, and chart column C instead of B.

The same idea fixes IFERROR formulas. If a calculation can fail, replace the blank fallback with NA():

Excel formula
=IFERROR(B2/C2,NA())

How the chart draws #N/A depends on the chart type:

  • Line charts skip the point. By default, Excel draws the line straight across it. In Microsoft 365, tick Show #N/A as an empty cell in Hidden and Empty Cells, and #N/A then follows your Gaps setting.
  • Column and bar charts show no bar for that category.

The IF function guide and the IFERROR function guide explain both functions, and how to check if a cell is blank covers the different blank tests.

How to hide zero values in a chart#

Real zeros are data, so Excel always plots them. To leave them out, turn them into #N/A in a helper column:

Excel formula
=IF(B6=0,NA(),B6)

For May, this returns #N/A, so the line skips the closed month instead of plunging to the axis. Only do this when a zero really means "no data". If sales were genuinely zero, showing the drop is the honest choice.

Two other ways to deal with zeros:

  • Hide zero data labels. Select the data labels, open Format Data Labels > Number, choose Custom and enter 0;-0;;@. The third section is empty, so zero labels disappear but the point stays.
  • Filter the rows out. Charts skip hidden rows by default, so filtering out the zero rows removes those categories from a column or bar chart.

How to stop #N/A spoiling the table#

The #N/A values the chart needs can look messy in a table people read. You have two clean options:

  1. Keep a helper column for the chart and show the original column to readers. Many dashboards use a hidden chart-data area for this.
  2. Hide the error text with conditional formatting. Select the helper column, go to Home > Conditional Formatting > New Rule > Format only cells that contain, choose Errors, and set the font colour to match the background.

Don't wrap the helper column in IFERROR to hide the #N/A, because that brings back the zero problem. The guide to fixing #N/A errors explains when #N/A is a problem and when it is useful, like here.

How to keep averages from counting blanks and zeros#

A chart's average line or title often uses AVERAGE, and zeros drag it down. AVERAGE already skips truly empty cells but counts zeros:

Excel formula
=AVERAGE(B2:B7)

This returns 1,090: 5,450 divided by 5 months, including May's 0. To average only the months with sales, use AVERAGEIF:

Excel formula
=AVERAGEIF(B2:B7,">0")

This returns 1,362.5: 5,450 divided by the 4 open months. Use it when the zeros mean "closed" or "no data", not real results. For more about line charts and averages, see how to make a line chart in Excel.

Common mistakes with blanks in charts#

These are the usual reasons a chart still shows zeros:

  1. Changing the setting for "" cells. Hidden and Empty Cells only affects truly empty cells. Use NA().
  2. Using IFERROR(x,"") for chart data. Use IFERROR(x,NA()) instead.
  3. Typing a space to "clear" a cell. A space is text, and the chart plots it as zero. Select the cell and press Delete.
  4. Hiding zeros with a number format only. A format like 0;-0;;@ hides the zero in the cell, but the chart still plots it.
  5. Forgetting Show data in hidden rows and columns. If a chart is missing data, hidden rows may be the reason.

Practise it#

The fix for most chart blanks is a short IF or IFERROR formula, so it pays to write them without thinking. Practise IFERROR in a live spreadsheet, then practise the IF function: you type each formula and it is checked instantly. Or try the exercise on this page and average only the months with sales.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

March has no data and May shows 0 because the shop was closed. In D2, use AVERAGEIF to average the Sales in B2:B7, counting only months greater than 0, so the chart's average line isn't dragged down.

fx
ABCDE
1
Month
Sales
2
Jan
1200
Average of open months
3
Feb
1350
4
Mar
5
Apr
1500
6
May
0
7
Jun
1400
8
9
10

Tip: AVERAGEIF takes the range and the condition in double quotes: ">0".

Practise this in a lesson

LessonIFERRORReplace ugly errors like #DIV/0! with a clean fallback value using IFERROR, and learn when hiding errors backfires.LessonThe IF functionMake a cell show one result or another depending on a condition, like Pass/Fail or Over/Under budget.Function guideIFLearn Excel's IF function with practical examples: flag budgets, label rows and return blanks. Avoid the classic mistakes and practice live.Function guideIFERRORUse IFERROR to swap #N/A, #DIV/0! and other errors for a clean value. Examples with division and VLOOKUP, pitfalls, and live practice.

Frequently asked questions

How do I make an Excel chart skip blank cells?

+

Right-click the chart, choose Select Data, then click Hidden and Empty Cells. Choose Gaps to leave a break, or Connect data points with line to join the points either side. This works for cells that are truly empty.

Why does my Excel chart show zero for blank cells?

+

Either the empty cells setting is Zero, or the cells aren't really blank. A formula that returns "" is text, and charts plot text as zero. Return NA() instead so the chart skips the point.

How do I hide zero values in an Excel chart?

+

Use a helper column with =IF(B2=0,NA(),B2) and chart that column instead. Line charts skip the #N/A points, and column charts show no bar for them.

How do I hide #N/A in the table but keep the chart gap?

+

Leave NA() in the cells that feed the chart, and use conditional formatting to colour #N/A text the same as the background. Or keep a clean table for people and a separate helper column for the chart.

Does an Excel chart include hidden rows?

+

Not by default. Charts skip hidden and filtered rows unless you tick Show data in hidden rows and columns in the Hidden and Empty Cells settings.

Sources

  • Create a chart from start to finish - Microsoft Support
  • IF function - Microsoft Support
  • IFERROR function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why does an Excel chart show blank cells as zero?
  2. How to make a chart ignore truly blank cells
  3. How to make formulas return a gap instead of zero
  4. How to hide zero values in a chart
  5. How to stop #N/A spoiling the table
  6. How to keep averages from counting blanks and zeros
  7. Common mistakes with blanks in charts
  8. Practise it

Keep reading

Data tools· 5 min read

Make a Chart in Excel: Column, Bar, Line and Pie

To make a chart in Excel, select your data including the headers, go to Insert and pick a chart, or click Recommended Charts to let Excel suggest one. Use a column or bar chart to compare categories, a line chart for a trend over time, and a pie chart only for a few parts of one whole.

Data tools· 6 min read

How to Make a Line Chart in Excel

To make a line chart in Excel, put dates or months in the first column and values in the next, with headers in row 1. Select the data, go to Insert > Insert Line or Area Chart, and pick Line or Line with Markers. Add a chart title and axis titles, and use one line per series to compare trends over time.

Lookups· 6 min read

How to Fix #N/A Errors in VLOOKUP and XLOOKUP

#N/A means "not available": the lookup couldn't find your value. First find the cause: extra spaces (fix with TRIM), numbers stored as text, a typo, or a table range that moved because it wasn't locked with $. If the item is truly missing, show a message with IFNA, or with XLOOKUP's 4th argument.

More on data tools

  • Add a Target or Average Line to an Excel Chart
  • Combine Data From Multiple Sheets in Excel
  • Combo Chart With a Secondary Axis in Excel
  • Compare Two Excel Sheets and Highlight the Differences
  • Conditional Formatting in Excel: Highlight What Matters
  • Conditional Formatting With a Formula in Excel
All data tools articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free