How to Add Vertical Line to Histogram in Excel (With Easy Steps)

What Is a Histogram in Excel?

A histogram shows the frequency of data in different intervals within the data range. It is a graph with a series of rectangular bars. The number and height of the bars are proportional to the number of different ranges called bins and to the frequency of data within those bins.

For example, if you want to create a histogram from the result scores of the students in a class, you can assess the performance of the class at a glance. You will know how many students failed, how many of them got good grades, etc. from the histogram.


How to Add a Vertical Line to a Histogram in Excel: Step-by-Step Procedures


STEP 1 – Prepare the Dataset

  • We have a simple dataset with student names and their marks.

Sample Dataset for adding vertical line to histogram in Excel


STEP 2 – Insert the Histogram Chart

  • Select the C5:C15 range to select the marks.
  • Go to the Insert tab.
  • From the Charts group section, select the Insert Statistic Chart and then select Histogram.

Insert histogram Using Insert Tab in Excel

  • The histogram will appear.
  • Modify the horizontal axis to beautify the histogram.

Result after Insertion of histogram


STEP 3 – Format the Axes

  • Double-click on any rectangle of the histogram.
  • A new window named Format Data Point will appear on the right side of the Excel sheet.
  • Increase the gap width according to your preference. We have made the gap width as 15%.

Increase Gap width of histogram

  • Double-click on the horizontal axis or bins values. Bins indicate the range of the rectangle of the histogram.
  • From the Axis Options, change the Bin width according to your choice.
  • The Bin width represents the width of the rectangle. We have made the width 10.
  • You may also change the Overflow bin and Underflow bin.
  • The Overflow bin represents the maximum limit of the bin and the Underflow bin indicates the minimum limit of the bin.

Settle axis of histogram


STEP 4 – Insert the Title

  • Double-click on the Chart Title.

Insert Chart Title in Excel

  • Type the new title. We have provided the title Histogram.

Change Chart Title of histogram


STEP 5 – Add a Vertical Line to the Histogram

  • Cick on the Insert tab.
  • Select Illustrations, go to Shapes, and select Line to insert the vertical line.

Add vertical line to histogram in Excel using Shapes

  • Your mouse cursor will be changed.
  • Hover over where you want to insert the line. We’ll add the line between two rectangles of the histogram.
  • Hold down your Shift key on the keyboard.
  • Click where you want your line to begin and drag to draw.
  • Release the Shift and the mouse button.

Output after adding vertical line


STEP 6 – Modify the Vertical Line

  • Double-click on the vertical line.
  • This will take you to the Shape Format tab.
  • Click on the arrow icon in Shape Styles to shape the line.

Modify the color and shape of the Vertical line

  • A wizard will pop out. We have selected a yellow wide-line option. You can select as per your preference.

Select color and shape of the Vertical line

  • You can also move your vertical line in your histogram. To do so, click on the line and drag it left or right.

Move the Vertical line left and right between histogram in Excel


Final Output

  • We have placed our line in the range of 66 to 76.

Final result after adding vertical line to histogram


Things To Remember

  • For other types of charts, it is easy to add vertical lines. You can insert vertical lines by using Excel Shapes, applying Combo Charts, and creating a Chart Trendline.
  • For histograms, you can only insert vertical lines using Excel Shapes.
  • For other charts, you can also insert dynamic vertical lines, but this is not possible to histogram.

Download the Practice Workbook


Related Articles


<< Go Back to Excel Histogram | Excel Charts | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Sudipta Chandra Sarker
Sudipta Chandra Sarker

Sudipta Chandra Sarker, BSc, Electrical and Electronic Engineering, Bangladesh University of Engineering and Technology, Bangladesh, has worked on the ExcelDemy project for over a year. For ExcelDemy, he has authored 42 articles and reviewed over ten articles. He is employed as a junior software developer at the moment. He aims to create various useful Microsoft Office Add-ins, extending the functionality of Office programs. His interests span Microsoft Office Suites, Data Science, VBA, VB.NET, ASP.NET, C#, Excel, and Desktop... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo