Yes. In Excel for Microsoft 365 on Windows, the most dependable way to put a line on a histogram is to summarize your numbers into bins, then create a combo chart using columns for the bin counts and a line for either those same counts or a second measure such as cumulative percentage. Excel’s built-in Histogram chart is useful on its own, but a binned table gives you more control over the line and the chart’s appearance.
What a histogram with a line can show
A histogram displays the distribution of numerical data. It groups values into intervals, called bins, and uses the height of each column to show how many observations fall in that interval. A line can add a second view of the same distribution or provide another statistic alongside it.
There are two common interpretations of “histogram with a line”:
- A frequency line: The line connects the bin counts, making the distribution’s overall shape easier to follow. A formal frequency polygon places each point at the midpoint of its bin.
- A cumulative line: The line shows the running total or running percentage of observations up to each bin. This is useful for questions such as “What percentage of results are below 30?”
These lines answer different questions. A frequency line traces how counts rise and fall; a cumulative line generally moves upward and shows how much of the data has accumulated. Label the line clearly so readers do not mistake one for the other.
Why a binned table is usually the better starting point
Excel’s built-in Histogram chart automatically groups a raw data column into bins. To make one, select the numeric data and choose Insert > Insert Statistic Chart > Histogram. You can adjust bin settings by right-clicking the horizontal axis, choosing Format Axis, and changing options such as Bin width or Number of bins. This is a quick way to inspect a distribution.
However, the built-in statistical chart does not behave like an ordinary column chart with a simple, editable frequency series. That makes it less convenient when you want a combo chart with a line. For a histogram-plus-line chart, create a small summary table and use a regular column chart as the histogram base. The columns still represent counts in intervals, but the table exposes the values that Excel needs to plot the line.
This approach also makes the bin boundaries explicit. That matters when you need consistent intervals across multiple data sets, want to explain exactly how values were grouped, or need to adjust the line independently of the bars.
Build a frequency table with equal-width bins
For a concrete example, suppose 20 measurements are in H2:H21. Use five bins: 0 to less than 10, 10 to less than 20, 20 to less than 30, 30 to less than 40, and 40 to 50 inclusive. Put each lower boundary in A2:A6 and its upper boundary in B2:B6: 0 and 10 in row 2, 10 and 20 in row 3, continuing in the same pattern through 40 and 50 in row 6. Add headings for Lower, Upper, Count, Bin label, Midpoint, Cumulative %, and Line count in columns A:G.
With the raw measurements in H2:H21, lower boundaries in A2:A6, and upper boundaries in B2:B6, enter this formula in C2 and fill it down through C5 to count each interval, including the lower boundary but excluding the upper boundary:
=COUNTIFS($H$2:$H$21,">="&A2,$H$2:$H$21,"<"&B2)
For the final bin, use an inclusive upper boundary so a value of exactly 50 is counted. With the same layout, enter this in C6:
=COUNTIFS($H$2:$H$21,">="&A6,$H$2:$H$21,"<="&B6)
For example, if the 20 values are 4, 7, 9, 12, 14, 15, 18, 19, 21, 23, 24, 26, 28, 29, 31, 33, 35, 37, 42, and 47, the five counts are 3, 5, 6, 4, and 2. They add to 20, so every observation in this example is included once. If your counts do not add up to the number of valid source values, check for values outside the chosen boundaries, missing values, or an unintended gap or overlap between bins.
For readable category labels, enter text such as “0–<10” in D2 and continue for the other intervals. With lower and upper boundaries in A2:B6, calculate the bin midpoint in E2 and fill down through E6 using:
=(A2+B2)/2
With counts in C2:C6, calculate the cumulative percentage in F2 and fill down through F6 using:
=SUM($C$2:C2)/SUM($C$2:$C$6)
Format F2:F6 as Percentage. For the example counts, the cumulative results are 15%, 40%, 70%, 90%, and 100%. With counts in C2:C6, make a separate frequency-line series in G2:G6 by entering =C2 in G2 and filling down. This helper column lets Excel plot the same bin counts once as columns and once as a line.
Create the combo chart in Excel
- Select the bin labels in D2:D6, then hold Ctrl on Windows and select the count and line-count ranges C2:C6 and G2:G6. Include the headings if you want Excel to use them as series names.
- Choose Insert > Insert Combo Chart, then select the option that pairs a clustered column with a line. If that option is not visible, open Insert > Recommended Charts > All Charts > Combo and set Count to Clustered Column and Line count to Line.
- Confirm that the count series is a column and the helper series is a line. For a frequency line, keep both on the primary axis because both series are counts.
- Use the chart’s Chart Design and Format tabs to add a chart title and axis titles. Label the vertical axis as Frequency or Count, and name the horizontal axis Bin.
The resulting bars have one category position per bin, and the line connects the count at each position. If you prefer to build the chart first, select the table columns and use Insert > Insert Column or Bar Chart > Clustered Column, then use Chart Design > Change Chart Type > Combo to assign the line type to the helper series.
Choose between a frequency line and a cumulative line
For a frequency line, plot the helper values in G2:G6 as a line and leave the line on the primary axis. This emphasizes the same pattern as the bars: in the example, counts rise from 3 to 6, then fall to 2. It is an easy-to-read overlay, especially when the bin widths are equal.
A formal frequency polygon uses the midpoint of each bin as its horizontal coordinate and joins the frequency values at those midpoints. A combo chart with a category axis places the line at the centers of its bin categories, which is a practical visual approximation for equally spaced bins. If exact numerical x positions matter, use an XY scatter chart for the frequency series and plot the midpoint values from E2:E6 against the counts. A scatter chart uses a value axis, unlike the category axis of the column chart, so combining and aligning it with histogram columns takes more setup.
For a cumulative line, use the percentages in F2:F6 instead of the frequency helper series. In the combo chart settings, assign Count to Clustered Column and Cumulative % to Line, then select the Secondary Axis option for the percentage series. The columns use the primary count scale, while the line uses a separate percentage scale. Format that secondary vertical axis as 0% to 100% when appropriate. This avoids comparing counts directly with percentages, which have different units.
Make the bars read like a histogram
A regular clustered column chart may leave visible gaps between columns. To make it resemble a histogram, select a column, open Format Data Series, and reduce Gap Width—often to 0% or a small value. The setting is available from the series formatting pane; the exact pane layout can vary slightly with window size. Keep thin borders if they help distinguish adjacent bins.
Use equal-width bins when comparing bar heights as frequencies. If the intervals have unequal widths, a wider bin can contain more observations simply because it covers more values. In a statistically scaled histogram with unequal bins, bar height should represent frequency density (count divided by bin width), so bar area—not height alone—corresponds to frequency. A simple column chart of counts does not make that adjustment automatically. For most introductory or operational summaries, equal-width bins avoid this complication.
Choose a bin width that reveals a useful pattern without making the chart noisy. Very wide bins can hide peaks or clusters; very narrow bins can make random variation look like meaningful structure. If you are comparing groups, keep the same bin boundaries and chart scale for each group. Changing the bins between charts can make distributions appear more different or more similar than they are.
Common problems and how to fix them
- The line appears as another set of bars. Open Chart Design > Change Chart Type > Combo and explicitly assign the helper series to Line.
- The line is hard to see. Format it with a contrasting color and a visible width or markers. If it overlaps the tops of the columns, that is expected for a frequency line using the same counts; use markers or a different line style to make the points clearer.
- The cumulative line looks flat or detached. Put it on the secondary axis and format that axis as a percentage. Do not put percentages on the count axis.
- The bin totals are short by one or more values. Check the first and last boundaries and confirm that adjacent bins do not omit a boundary value. The example counts each lower edge in its bin and excludes the next upper edge, except for the final inclusive bin.
- Text or blank cells cause surprising results. The COUNTIFS formulas count numeric values that meet the criteria; inspect the source column for numbers stored as text and values outside the selected range.
- The chart changes after new data is added. Expand the raw-data range and the formula references, or place the source data in an Excel table so added rows can be included more easily. Check the chart’s source range after changing the table.
Excel for Mac and Excel for the web
The core method—make a frequency table, then use a column-and-line combo chart—also applies in Excel for Mac. Ribbon organization and the wording or placement of chart controls can differ by release, so look for the Insert chart options and the combo-chart settings rather than relying on a Windows-only shortcut. On Mac, the common equivalent of Ctrl-clicking to select separate ranges is holding Command while selecting them.
Excel for the web supports many chart and formula tasks, but chart-type choices and formatting controls can be more limited or arranged differently from the Windows desktop app. If the web version does not expose the combo settings or axis options you need, open the workbook in the desktop version of Excel. The data table remains useful and can be edited in either environment.
Frequently Asked Questions
Can Excel add a line directly to its built-in Histogram chart?
For a flexible line overlay, use a binned frequency table and a combo chart rather than relying on the built-in Histogram chart. The table makes the bin counts available as ordinary chart series, which you can assign to columns and a line.
Should the line show frequency or cumulative percentage?
Use frequency when you want to trace the distribution’s shape. Use cumulative percentage when you want to show how much of the data falls at or below successive bins. A cumulative line should normally use a secondary percentage axis.
How many bins should a histogram have?
There is no single best number for every data set. Try a few sensible widths and choose one that shows meaningful structure without obscuring it with overly broad bins or excessive noise. For comparisons, use the same boundaries across the groups.
Why do my histogram bars have spaces?
A standard column chart includes a gap between categories. Select the column series, open Format Data Series, and reduce Gap Width to make adjacent bins touch or nearly touch.
Can the histogram line use a different vertical scale?
Yes. In the combo chart settings, select Secondary Axis for the line series when it has different units, such as cumulative percentage. Do not use a second scale for a frequency line that repeats the column counts.
Is a line over histogram bars the same as a normal-distribution curve?
No. A frequency line connects observed bin counts, while a normal curve is a theoretical distribution curve fitted or scaled to the data. A simple combo chart does not calculate or add a normal curve automatically; that requires additional calculations and an appropriate chart series.
Related
- Excel Data Validation: Change Cell Colors Automatically
- Excel Data Validation Character Limits and Messages
- Excel Data Validation: Create a Filtered Dropdown List
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Gantt Chart Setup: Build a Project TimelineTo set up a Gantt chart in Excel, list each task with a start date and finish date,…
- Wedding Seating Chart in Google Sheets: A Practical GuideYes. You can make a wedding seating chart in Google Sheets by keeping guest details and table assignments…
- Link a Pivot Chart to a Slicer in ExcelTo link a slicer to an Excel PivotChart, select the PivotTable or PivotChart, choose PivotTable Analyze > Insert…
- Excel Pivot Filter by Color: How to Filter the DataExcel PivotTables cannot directly filter their source records by cell fill color or font color. To filter a…
- Excel Chart Horizontal Line: Add a Constant or TargetTo add a horizontal target or constant line to an Excel chart, add a new data series whose…
- Excel Sparkline Shortcut: Insert Line, Column, or Win/LossIn Excel for Microsoft 365 on Windows, select the cell where the sparkline should appear, then press Alt,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.