How to Fix Excel Histogram Gaps When Gap Width is Zero
Question details
The user is trying to remove visual gaps between columns in an Excel histogram, but the gaps persist even after setting the chart's Gap Width to zero and ensuring no empty rows exist in the source data.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Formatting a histogram chart to display a continuous data distribution without arbitrary spacing.
- Observed behavior
- The histogram displays visible empty spaces between certain columns, ignoring the zero gap width configuration.
Verify that your dataset does not contain invisible characters, text values formatted as numbers, or extreme outliers that might force Excel to create empty bins in the distribution.
Adjust the Histogram Bin Configuration
Use this solution to manually adjust how data points are grouped. Automatic binning often creates empty bins if the data distribution is skewed, resulting in gaps.
By default, Excel automatically calculates the bin width and number of bins based on your data range. If your data has a wide spread with clusters, the automatic calculation might generate bins that contain no data points, resulting in visual gaps on the chart.
Right-click the horizontal (category) axis at the bottom of your histogram and select 'Format Axis' from the context menu.
In the Format Axis pane that appears on the right side of your screen, click on the 'Axis Options' tab (represented by a bar chart icon).
Under the 'Bins' section, change the selection from 'Automatic' to either 'Bin width' or 'Number of bins'. Adjust the numerical values until the empty bins are consolidated and the gaps disappear.
Change Axis Type to Text Axis
Apply this fix if your histogram is using a date or numeric axis scale that forces proportional spacing based on missing values.
Configure Hidden and Empty Cell Settings
Check this setting to ensure Excel isn't intentionally leaving gaps for missing data points in your selected range.
Create Seamless Histograms with WPS Spreadsheet
If you are struggling with persistent chart formatting issues in Excel, try WPS Spreadsheet. It offers an intuitive charting engine that makes creating and customizing gap-free histograms incredibly straightforward.
- 1. Insert a new chart: Highlight your dataset, navigate to the 'Insert' tab, click 'Chart', and select the Histogram option.
- 2. Open chart settings: Right-click the horizontal axis of your newly created histogram and select 'Format Axis'.
- 3. Customize bin spacing: Under Axis Options, manually adjust the 'Number of bins' or 'Bin width' to perfectly fit your data distribution without leaving empty gaps.

Frequently Asked Questions
Why does changing gap width to 0% not remove all gaps in my chart?
The 'Gap Width' setting only controls the space between categories (or bins). If a specific bin is mathematically created by Excel but contains zero data points, it will render as an empty space on the axis, creating a gap regardless of your gap width settings.
How do I manually change the number of bins in an Excel histogram?
Right-click the horizontal axis of your histogram, select 'Format Axis', and look under 'Axis Options'. Select 'Number of bins' and type in your desired number to force Excel to redistribute the data accordingly.
Can hidden data cause unexpected gaps in my chart?
Yes. If your chart settings are configured to show empty cells as gaps, any hidden rows or missing data points within your selected range will create visual breaks in the visualization. You can change this in 'Select Data' > 'Hidden and Empty Cells'.
How do outliers affect histogram spacing?
Extreme outliers expand the overall range of your horizontal axis. To maintain uniform bin widths across a massive range, Excel generates numerous empty bins between your main data cluster and the outlier, causing massive gaps. Using the 'Overflow bin' setting resolves this.




