To make a side-by-side histogram in Excel, put each group’s observations in its own column, define the same bin boundaries for both groups, count the values in each bin, then select the bin labels and counts and insert a 2-D Clustered Column chart. This produces adjacent bars for comparing distributions; it is more reliable for a direct comparison than inserting two separate Histogram charts, which may use different bins.
The steps below are for Excel for Microsoft 365 on Windows. You will build the bin counts in a small summary table, then format a clustered column chart so it reads like a histogram. Before starting, decide which two groups you want to compare and choose bins that make sense for the values.
What You’ll Need
- Numerical observations for at least two groups, with each group in a separate column. For example, one column could contain response times for Method A and another for Method B.
- A blank area for a summary table containing bin boundaries, bin labels, and one frequency column per group.
- A consistent set of bin boundaries. Both groups must use the same boundaries and interval rules for the chart to be a fair comparison.
Step-by-Step
- Arrange and check the raw data. Put the first group’s numeric values in A2:A6 and the second group’s values in B2:B6 for the example below. Use a clear header in each column, such as Method A and Method B. Keep each observation in one cell, remove stray text or totals from the data, and avoid including headers in any later count formula. Unequal group sizes are allowed, but remember that raw counts can make a larger group appear more prominent.
- Choose common bins before counting. For this worked example, use the integer intervals 0–9, 10–19, and 20–29. Enter the upper boundaries 9, 19, and 29 in D2:D4, and enter matching display labels such as 0–9, 10–19, and 20–29 in E2:E4. The counting rule is that the first bin includes values up to and including 9, and each later bin includes values greater than the previous boundary and up to and including its own boundary. For decimal data, choose suitable boundaries too; label the intervals to make their exact limits clear, for example ≤10, >10–20, and >20–30.
- Set up a frequency summary table. Use F1 for Method A frequency and G1 for Method B frequency. The summary table should have the bin labels in E2:E4 and the corresponding counts in F2:G4. Keep the numeric upper boundaries in column D separate from the labels: the formulas use the boundaries, while the chart uses the readable labels. This separation also makes it easier to adjust the chart’s wording without changing the calculations.
- Count the first group’s observations. With Method A’s data in A2:A6, upper boundaries in D2:D4, and its frequencies in F2:F4, enter this in F2. It counts values at or below 9; for the example values 4, 8, 11, 17, and 23, the result is 2.
- Count the later bins for the first group. With the same layout, enter this in F3 and fill it down through F4. In F3, the formula counts values greater than D2 and no greater than D3, so the example returns 2 for 11 and 17. In F4, the filled formula returns 1 for 23. The final first-group frequency total is 5, matching the five input observations.
- Count the second group using the same boundaries. With Method B’s observations in B2:B6, boundaries in D2:D4, and frequencies in G2:G4, enter the first-bin formula in G2. For the example values 6, 12, 18, 22, and 28, it returns 1. Then enter the later-bin formula in G3 and fill down through G4; the results are 2 and 2. The second-group total is also 5. If your groups contain different numbers of observations, the totals should match each group’s actual number of valid numeric values, not necessarily each other.
- Insert the clustered column chart. Select the labels E1:E4 and the two frequency columns F1:G4. If those ranges are not adjacent, select E1:E4, then hold Ctrl while selecting F1:G4. On the ribbon, choose Insert > Insert Column or Bar Chart > 2-D Clustered Column. Excel should use the bin labels as categories and show two differently colored columns in each bin. If the labels or series appear in the wrong places, use Chart Design > Switch Row/Column, or use Chart Design > Select Data to correct the chart data range and category labels.
- Make the chart read like a histogram. Click a column, right-click, and choose Format Data Series. In Series Options, reduce Gap Width to around 0%–20% so neighboring bin groups have little or no space between them. The two series will remain side by side within each bin. If the bars become hard to distinguish, choose contrasting fill colors and retain a visible legend. Add a chart title, such as Method A vs Method B: Frequency by Score Range, and use Chart Design > Add Chart Element to add axis titles if needed.
- Check the result against the source. Verify that the horizontal axis shows bins in increasing order, the legend names both groups, and the vertical axis is a count. Confirm the frequency totals against the number of numeric observations in each source column. In the example, the chart should show counts of 2, 2, 1 for Method A and 1, 2, 2 for Method B. Those values add to five observations for each group and place every example value in exactly one interval.
The example’s count formulas are:
With Method A values in A2:A6, the first upper boundary in D2, and the first frequency in F2, use =COUNTIF($A$2:$A$6,"<="&$D2). It returns 2 for the example, because 4 and 8 are at or below 9.
With Method A values in A2:A6, consecutive upper boundaries in D2:D3, and the second-bin frequency in F3, use =COUNTIFS($A$2:$A$6,">"&$D2,$A$2:$A$6,"<="&$D3). It returns 2 for 11 and 17. Copying it to F4 changes the boundary references to D3 and D4 and returns 1 for 23.
With Method B values in B2:B6, the first upper boundary in D2, and the first frequency in G2, use =COUNTIF($B$2:$B$6,"<="&$D2). It returns 1 for the value 6.
With Method B values in B2:B6, consecutive upper boundaries in D2:D3, and the second-bin frequency in G3, use =COUNTIFS($B$2:$B$6,">"&$D2,$B$2:$B$6,"<="&$D3). It returns 2 for 12 and 18; filling it into G4 returns 2 for 22 and 28. These formulas exclude blank cells and text values, so check that all observations you intend to count are numeric.
Common Mistakes
- Using different bins for each group. If one chart counts 0–9 and another counts 0–4, their bar heights cannot be compared directly. Use one shared set of boundaries in the summary table.
- Leaving gaps or overlaps in the interval rules. The formulas above count each value once by using a first-bin upper limit and then ranges greater than the previous limit through the next limit. Keep the displayed labels consistent with that rule, especially for decimal data and boundary values.
- Selecting a built-in Histogram chart for pre-counted frequencies. Excel’s Histogram chart is designed to bin raw observations. Applying it to a table that already contains bin counts can produce a histogram of those counts rather than the intended two-series comparison. Use a clustered column chart for the summary table.
- Including headers or totals in the chart range. Selecting extra rows can make Excel treat a total as another bin or create confusing series names. Select only the header row and the bin rows in the summary table.
- Using a bin width that hides the shape. Very wide bins can conceal differences; very narrow bins can make the chart noisy. Pick a useful scale and keep it identical across both groups.
- Comparing counts when group sizes differ. A larger group may have taller bars simply because it has more observations. Consider comparing percentages instead: divide each bin count by its group’s total, then chart those proportions and label the vertical axis clearly.
Tips
- Decide on a meaningful bin width before making the chart. For scores, whole-number ranges may be intuitive; for measurements, intervals based on the unit and precision of the data may be more useful.
- Include the largest observation in the final bin. If the final upper boundary is below the maximum value, that value will not be counted. Add another bin or raise the last boundary, and update its label.
- Use the same category order for every group, and keep the bins in ascending order. If Excel sorts text labels alphabetically, arrange the summary table numerically first and verify the plotted order.
- For unequal group sizes, percentage frequencies can make shapes easier to compare. Compute each group’s bin count as a share of that group’s total, use the same bins, and format the vertical axis as Percentage. Do not mix percentages and raw counts on one axis.
- Keep the legend names short and the chart title specific. A reader should be able to tell which groups are compared, what the bins measure, and whether the bars show counts or percentages without opening the source data.
- In Excel for Mac, the same approach works, although ribbon labels or chart formatting controls can be arranged differently. In Excel for the web, you can create the summary and insert a clustered column chart; some chart-formatting controls may be more limited or located in a different pane.
Troubleshooting
The chart shows one bar per bin instead of two. Check that both frequency columns are included in the selected chart range. Choose Chart Design > Select Data and confirm that Method A and Method B are separate series. If Excel interpreted rows as series, try Chart Design > Switch Row/Column.
Some bins show zero, or the totals are too low. Check that the boundary cells in column D contain numbers, not text that looks like numbers, and that the last boundary reaches the highest observation. Review the source columns for numbers stored as text, blanks, or unintended headers. Also check that each formula points to the intended group’s data range.
A value on a boundary seems to land in the wrong bin. The formulas count the first bin as values less than or equal to its upper boundary, then count later bins as greater than the preceding boundary and less than or equal to the current one. For example, 10 belongs in the second bin when the boundaries are 9 and 19. Make the labels reflect this convention and check exact boundary values.
The chart has large spaces between columns. Right-click a series, select Format Data Series, and lower Gap Width. If the bars overlap rather than sit alongside each other, confirm the chart type is 2-D Clustered Column, not Stacked Column, and review Series Overlap in the formatting pane.
Excel displays the wrong horizontal labels. In Chart Design > Select Data, edit the Horizontal (Category) Axis Labels to use the bin-label cells, such as E2:E4. Keep the upper-boundary numbers out of the chart’s category range unless those numbers are the labels you actually want displayed.
Frequently Asked Questions
Can Excel make a side-by-side histogram automatically?
Excel has a built-in Histogram chart for showing the distribution of a single raw data series. For two groups with explicitly shared bins, make a frequency table and use a clustered column chart. This lets you control the boundaries and compare matching intervals.
What is the difference between a histogram and a clustered column chart?
A histogram groups raw numeric observations into intervals and displays their frequencies. A clustered column chart displays values for categories. A frequency table turns the intervals into categories, so a clustered chart can show two groups side by side. Setting a small gap between categories gives it a histogram-like appearance.
Can the two groups have different numbers of observations?
Yes. The count formulas work with groups of different sizes. However, counts may not be a fair comparison of distribution shape when totals differ. Chart each bin as a percentage of its group total if you want to compare relative frequency.
How do I choose a good bin width?
Start with the data’s measurement units and the level of detail a reader needs. Choose a width that produces enough bins to reveal the distribution without creating many nearly empty bars. Use identical boundaries for both groups, and adjust them if important patterns are obscured.
Why do my bin counts not add up to the number of observations?
Values may fall above your final upper boundary, or some entries may be blank or stored as text and therefore not counted. Check the maximum value, confirm the numeric boundaries cover the full range, and inspect the source cells. Each numeric observation should fit exactly one interval.
Can I add a third group?
Yes. Add another raw-data column and another frequency column to the summary table, using the same bin boundaries and interval rule. Include the new frequency column in the chart data range. If several groups make each bin crowded, use percentage frequencies or separate charts with the same axis scale.
Related
- Excel Day and Month Reversed? Fixing Date Formats
- Excel WEEKDAY: Get the Day of the Week from a Date
- Excel Weekday Name: Show the Day from Any Date in Excel
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Pivot Table Field Name Not Valid? Fix ItThe Excel “PivotTable field name is not valid” error usually means the selected source range has a missing…
- Excel Pivot Table: How to Keep Formatting on RefreshTo keep formatting when an Excel PivotTable refreshes, select the PivotTable, open PivotTable Analyze > Options, and on…
- Excel Graph Not Showing Dates Correctly? Fix the AxisIf an Excel graph is not showing dates correctly, first check that the source cells contain real Excel…
- Add a Trendline to an Excel Combo Chart: Full GuideTo add a trendline to an Excel combo chart in Microsoft 365 for Windows, select the chart, click…
- How to Set Up a Pie Chart in Google Sheets EasilyTo set up a pie chart in Google Sheets, put category names in one column and their numeric…
- Excel Box and Whisker Plot X-Axis ExplainedIn an Excel box-and-whisker plot, the x-axis is the horizontal category axis: it identifies the groups represented by…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.