Excel does not offer a built-in stacked histogram chart type. To make one in Microsoft Excel for Microsoft 365 on Windows, count each group’s values inside the same set of numeric bins, select the bin labels and group counts, then choose Insert > Insert Column or Bar Chart > 2-D Stacked Column; set the chart’s gap width to zero so the columns touch.
What a stacked histogram shows
A histogram shows how often numeric observations fall within consecutive ranges, called bins. A stacked version divides each bin’s total into colored segments for different groups. For example, a business could compare the distribution of delivery times for two carriers, or a teacher could compare test-score ranges for two classes. The horizontal axis represents numeric intervals, and the vertical axis represents the number of observations.
The visual is useful when you want to see both the overall amount in each range and how groups contribute to that amount. It is not the same as placing separate histograms side by side: stacked columns combine the groups’ counts into one total column per bin. That makes totals easy to compare, but can make it harder to compare a group’s segment when that segment does not start at the baseline.
Why Excel needs a workaround
Excel’s built-in Histogram chart is designed to summarize one series of numeric data into bins. It does not provide a standard option to stack multiple groups within each bin. A practical workaround is to calculate the bin counts in a small table and chart that table as a 2-D Stacked Column chart.
This distinction matters because the chart is technically a stacked column chart formatted to look like a histogram, rather than Excel’s dedicated Histogram chart. The result can communicate the same grouped frequency information, but you control the bin definitions and count calculations yourself. This also makes it easier to use identical bins for every group, which is essential for a fair comparison.
Prepare the data and choose shared bins
Keep the group label and numeric measurement in separate columns. In this example, enter the following values in F2:G13, with group names in column F and measurements in column G:
- Group A: 12, 18, 22, 27, 31, 36
- Group B: 15, 21, 24, 29, 34, 39
Set up a counting table with group headers in D1:E1 (Group A and Group B). In A1:C1, enter Bin, Lower, and Upper. Add three rows: 10–19 with lower bound 10 and upper bound 20; 20–29 with lower bound 20 and upper bound 30; and 30–40 with lower bound 30 and upper bound 40. The labels are for readers; the lower and upper columns hold the numeric limits used in the calculations.
These intervals use a lower-inclusive, upper-exclusive rule for the first two bins: 10 is included in the first bin, while 20 belongs to the second. The last bin includes its upper endpoint, so a value of 40 is counted. Using consistent, non-overlapping limits prevents values from being counted twice or omitted at a boundary.
Count each group in each bin
With group names in D1:E1, lower and upper bounds in B2:C4, raw group labels in F2:F13, and measurements in G2:G13, enter this formula in D2. It counts Group A values from the lower limit up to, but not including, the upper limit; the result is 2.
=COUNTIFS($F$2:$F$13,D$1,$G$2:$G$13,">="&$B2,$G$2:$G$13,"<"&$C2)
Fill D2 across to E2 and down through row 3. The relative references adjust the group header and bin limits, while the dollar signs keep the raw-data ranges fixed. The resulting counts should be 2 and 1 for the first bin, then 2 and 3 for the second.
For the last bin, use a formula that includes the upper endpoint. With the same cell layout, enter this in D4; it returns 2 for Group A. Fill it right to E4, which returns 2 for Group B.
=COUNTIFS($F$2:$F$13,D$1,$G$2:$G$13,">="&$B4,$G$2:$G$13,"<="&$C4)
Your final count table is therefore 2 and 1, 2 and 3, and 2 and 2. The totals are six observations for each group and 12 overall, matching the example data. If your bins should all be upper-exclusive instead, define the final upper limit beyond the largest possible value or use a clearly specified alternative boundary rule.
Build the stacked histogram chart
- Ensure the bin labels are in A2:A4 and the group counts are in D2:E4, with the group names in D1:E1.
- Select A1:A4, then hold Ctrl on Windows and select D1:E4. This gives Excel the category labels and both named data series without including the numeric boundary columns.
- Choose Insert > Insert Column or Bar Chart > 2-D Stacked Column.
- If Excel places the groups on the horizontal axis instead of using them as stacked series, select the chart and choose Chart Design > Switch Row/Column.
- Right-click a column and choose Format Data Series. In Series Options, set Gap Width to 0% or a small value so adjacent bins appear continuous.
On a Mac, the chart type is also available from the Insert tab’s column-chart menu, although the ribbon layout can vary by Excel release. Use Command rather than Ctrl when selecting separate ranges. In Excel for the web, a contiguous helper table containing the bin labels and group counts is often the simpler selection; create the same stacked column chart from that table, then adjust the series formatting if the options are available in your interface.
Choose bin widths that make sense
Bin width determines how much detail the chart reveals. Very wide bins hide variation by combining many observations; very narrow bins can leave lots of empty or sparse columns. The best width depends on the measurement scale, the amount of data, and the question being asked. Use the same boundaries for every group, and label bins clearly enough that readers can interpret the ranges.
For example, if delivery times are measured in minutes, ten-minute bins may be easier to interpret than arbitrary intervals. If the groups have very different sample sizes, raw counts can make the larger group dominate the chart. In that case, consider whether percentages or another normalized display better answers the question. A stacked percentage chart changes the emphasis from total frequency to group proportions; it should not be described as showing raw counts.
Format and label it for interpretation
A useful chart title says what is being measured and which groups are compared, such as “Delivery times by carrier.” Add axis titles when the units or counting method are not obvious. The vertical axis should say “Number of deliveries” for counts, or identify the percentage basis if values have been normalized. Keep the legend visible and use distinct colors that remain distinguishable for readers with color-vision differences.
Excel treats the bin labels as category text in this setup. It does not infer that they are continuous numeric intervals, so labels such as “10–19” and “20–29” are important. Avoid showing only the lower limits unless the bin width and boundary convention are explained elsewhere. If you use unequal bin widths, the height of each column alone can be misleading: a conventional histogram may require frequency density (count divided by bin width) rather than raw counts. Equal-width bins are the clearest choice for this stacked-count approach.
Common problems and checks
- A value seems missing: Check the lower and upper comparison signs. A value equal to an upper boundary is excluded from a bin using “less than,” so the next bin should include it at its lower boundary.
- Counts are unexpectedly zero: Confirm the measurement cells contain numbers rather than numbers stored as text, and check that the group labels match the headers exactly. Extra spaces or inconsistent spelling can prevent a group match.
- The chart has the wrong orientation: Use Chart Design > Switch Row/Column so each group is a series and each bin is a category.
- The columns have gaps: Set the series Gap Width to zero or a small percentage. A small gap can make the bins easier to distinguish, but large gaps weaken the histogram-like appearance.
- The result looks like a total chart, not a distribution: Confirm that the horizontal axis contains bins and that the vertical axis contains counts. Do not chart the original measurements as if they were already frequency data.
After changing the raw data, check that the count formulas cover every data row and that all values fall into the chosen bins. A useful audit is to compare the sum of all bin counts with the number of valid observations in each group. If those totals differ, the bins may not cover the full data range, or a boundary, blank, or text value may need attention.
When a stacked histogram is—and is not—best
Use a stacked histogram when the total count in each interval matters and the group contributions are useful context. It can show, for example, that most observations cluster in a particular range while also indicating which groups make up that cluster.
Choose side-by-side columns instead when the main task is to compare group counts within each bin. In a stacked chart, only the bottom series shares a common baseline; upper segments start at the previous segment’s height, which makes their heights harder to compare across bins. A separate histogram for each group can be appropriate when distributions need to be inspected independently, though aligned axes and common bins are still important.
For unequal sample sizes, plot percentages rather than counts only if proportions are the intended comparison. A 100% stacked column chart can show the composition of each bin, but it hides how many observations each bin contains. Consider showing sample sizes in labels or alongside the chart so the proportional view is not mistaken for a count view.
Frequently Asked Questions
Can Excel make a stacked histogram directly?
Not as a dedicated built-in chart type. Calculate counts for each group and shared bin, then chart those counts using a 2-D Stacked Column chart and reduce the gap width.
What is the difference between a stacked histogram and a stacked column chart?
A stacked histogram displays frequency counts across numeric intervals. In Excel, it is commonly made with a stacked column chart whose category labels are bins and whose series are group counts. The chart type is a column chart; the binning and formatting make it function as a histogram.
Should histogram bins include their upper boundary?
Choose and document one rule. A common approach is to include the lower boundary and exclude the upper boundary, then include the final bin’s upper endpoint. This avoids double-counting values that fall exactly on an interior boundary.
Can I compare groups with different sample sizes?
Yes, but raw counts reflect both distribution and sample size. If the goal is to compare the share of each group in a range, calculate percentages using an appropriate group total and label the chart accordingly; retain counts when absolute volume is the question.
Why do my stacked columns have spaces between them?
Excel’s default column-chart gap is greater than zero. Right-click a series, choose Format Data Series, and reduce Gap Width. Zero makes the columns touch, while a small gap may keep adjacent bins visually distinct.
Related
- Power Automate Excel Consolidation: A Practical Guide
- Postcode Heat Map in Excel: Data, Setup and Limits
- Polynomial Solver in Excel: Methods, Limits, and Tips
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Chart Maker: Create, Format, and Choose ChartsExcel’s built-in chart maker turns selected worksheet data into a chart: select a well-organized range, then choose Insert…
- HR Dashboard in Excel: Metrics, Setup, and Best PracticesAn HR dashboard in Excel is a concise, refreshable view of workforce measures such as headcount, turnover, hiring,…
- How to Center Bars in an Excel ChartTo center bars within their category spaces in Excel, select the chart’s category axis, open Format Axis, and…
- Excel Chart Creation: Steps, Choices, and FixesYes—Excel makes chart creation straightforward: select your data, choose Insert > Recommended Charts, pick a chart, and select…
- Sunburst Chart Excel Template: How to Build and FormatA Sunburst chart Excel template is a workbook layout with hierarchical category columns and one numeric value column,…
- Excel Line Chart Comparing Two Years: A Clear SetupTo make an Excel line chart comparing two years, put the shared time periods in the first column…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.