Create a histogram
How to Create a Histogram in Excel, Google Sheets, and Python
A histogram displays the distribution of numerical data by grouping values into bins (intervals). Here’s how to create one in different tools:
1. In Microsoft Excel
Method 1: Using the Built-in Histogram Tool (Excel 2016 & later)
Enter your data in a single column (e.g.,
A1:A50).Define your bins (intervals) in another column (e.g.,
B1:B6).Insert the Histogram:
Select your data.
Go to Insert → Charts → Histogram (under “Statistical Charts”).
Customize bins:
Right-click the x-axis → Format Axis → Adjust bin width, number, or overflow/underflow settings.
Method 2: Using Data Analysis ToolPak (Older Excel Versions)
Enable the ToolPak:
Go to File → Options → Add-ins → Select Analysis ToolPak → Click Go → Check Analysis ToolPak → OK.
Create the Histogram:
Go to Data → Data Analysis → Histogram.
Select input range (your data) and bin range → Check Chart Output.
2. In Google Sheets
Enter your data in a column (e.g.,
A1:A50).Insert a Chart:
Select your data → Insert → Chart.
Change Chart Type to Histogram:
In the Chart Editor → Setup → Change chart type to Histogram.
Adjust Bins:
Click the 3 dots (⋮) on the chart → Edit chart → Customize → Histogram → Adjust bucket size.
3. In Python (Using Matplotlib)
import matplotlib.pyplot as plt
# Sample data
data = [23, 45, 56, 78, 34, 67, 89, 12, 45, 67, 89, 23, 45, 67]
# Create histogram
plt.hist(data, bins=5, edgecolor=’black’) # Adjust ‘bins’ as needed
plt.title(“Histogram Example”)
plt.xlabel(“Value Ranges”)
plt.ylabel(“Frequency”)
plt.show()
Customizations:
bins=5→ Number of intervals.color='blue'→ Change bar color.edgecolor='black'→ Add borders to bars.
Which tool are you using?
For quick analysis → Excel/Google Sheets
For advanced statistics → Python (Matplotlib/Seaborn)