Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
07-03-Create a Histogram Chart-Start.xlsx12.2 KB 07-03-Create a Histogram Chart-Complete.xlsx
21.8 KB 7.03 create-a-histogram-chart - Exercise.docx
43 KB Exercise - Create a Histogram Chart.xlsx
36.6 KB 7.03 create-a-histogram-chart - Exercise solution.docx
78.8 KB Exercise Solution - Create a Histogram Chart.xlsx
41.4 KB
Quick reference
Create a Histogram Chart
Create a Histogram chart to group data into buckets to show its distribution.
When to use
Histogram charts can be used whenever we have distributed data. We can group our data into automatic or custom buckets to show how many values fall within a range.
Instructions
Histogram charts are useful for grouping data. We can get Excel to create bins or buckets for us or we can create our own custom buckets.
In this example, we have a list of employees and their ages. The HR team has asked us to analyze the company demographics so we can make sure we are hiring enough people from each age bracket. We can visualize this analysis using a Histogram chart.
NOTE: The Histogram chart is another chart that cannot be created directly from PivotTable data.
Create a Simple Histogram Chart
- Click anywhere in the data.
- From the Insert tab, in the Charts group, click the small diagonal arrow in the corner of the group.
- Click on the All Charts tab.
- Select Histogram from the list.
- Click OK.
Excel will create default bins to group the data. In this example, we have bins that span a 13-year period.
Customize Bins
We can customize the bins that display in the Histogram chart.
- Click on the data labels in the horizontal axis.
- Press CTRL+1 to open the Format Axis pane.
- Notice the bin width is set to automatic by default.
We can modify this to display a specific number of years in each bin.
- Click Bin width.
- Change the value to 5.
We now get a much more detailed analysis.
We can also specify the exact number of bins that we want and Excel will work out the rest.
- Click on the data labels in the horizontal axis.
- Press CTRL+1 to open the Format Axis pane.
- Select Number of bins.
- Change the value to 15.
Create Custom Bins
We can create our custom bins.
For example, maybe I want to show the same data but display the generational labels instead of age buckets.
We first need to define our labels and values. In the table below, we have the age range label, the bin/bucket, and the lower threshold. The lower threshold is just the lowest value from each bucket.
We can now use the XLOOKUP formula to assign the correct label to each employee based on their age. It is important when doing this that the label column is before the age column.
- Select column C.
- Press CTRL+SHIFT++ (CTRL++ on some keyboards) to insert a blank column.
The XLOOKUP formula looks up the age in cell D7, in the Lower Threshold range (J7:J10), and returns the age range (H7:H10). The -1 is the search mode. This means that if Excel cannot find an exact match of the age in the lower threshold column, it will return the next smallest.
- Press Enter and copy the formula down.
- Select the Age Range and the Age columns only.
- From the Insert tab, in the Charts group, click the small diagonal arrow in the corner of the group.
- Click on the All Charts tab.
- Select Histogram from the list.
- Click OK.
- Click on the Data Labels on the horizontal axis.
- Press CTRL+1 to open the Format Axis pane.
- Under Axis Options, select By Category.
Lesson notes are only available for subscribers.