# How a Histogram Works to Display Data

![Histogram](https://www.investopedia.com/thmb/NmZJz5TEuoPk7-eQAg4a73Nz0dU=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/histogram-4195105-1-5c54bbb774ef4db2aa13a521a8e6afbc.jpg)

*Unlike bar charts where bars are separated, histograms consist of adjacent bars. — Investopedia / Joules Garcia*

> **Definition**
>
> A histogram is a graphical representation of data points similar in appearance to a bar chart.

## What Is a Histogram?

A histogram graphically represents data distribution, showing the frequency of numerical data within specified intervals. The histogram condenses a data series into an easily interpreted visual by taking many data points and grouping them into logical ranges or bins similar in appearance to a [bar graph](https://www.investopedia.com/terms/b/bar-graph.asp).

### Key Takeaways

*   A histogram is a bar graph representation of data that buckets a range of classes into columns along the horizontal x-axis.
*   The vertical y-axis represents the number count or percentage of occurrences in the data for each column
*   Columns can be used to visualize patterns of data distributions.
*   The MACD histogram is used by technical analysts to indicate changes in momentum in trading.
*   The MACD histogram columns can give earlier buy and sell signals than the accompanying MACD and signal lines.

## How Histograms Work

Histograms are commonly used in [statistics](https://www.investopedia.com/terms/s/statistics.asp) to demonstrate how many of a certain type of variable occur within a specific range. A census focused on the [demography](https://www.investopedia.com/terms/d/demographics.asp) of a town may use a histogram to show how many people are between the ages of zero to 10, 11 to 20, 21 to 30, 31 to 40, 41 to 50, 51 to 60, 61 to 70, and 71 to 80.

This histogram example would look similar to the chart below. Let's say the numerals along the vertical access represent thousands of people. You can start with the horizontal axis to read this histogram example. Beginning on the left, you'll see that there are approximately 500 people in the town who are from less than one year old to 10 years old. Four thousand people in town are 11 to 20 years old, and so on.

Histograms can be customized in several ways by analysts. They can change the interval between buckets. There are eight buckets in our example with an interval of 10. This could be changed to four buckets with an interval of 20.

Another way to customize a histogram is to redefine the y-axis. The most basic label used is the [frequency](https://www.investopedia.com/terms/f/frequencydistribution.asp) of occurrences observed in the data but one could use percentage of total or density instead.

![Histogram](https://www.investopedia.com/thmb/ilebTtfvaQER39ue8gEkMIpP6MY=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/Histogram1-92513160f945482e95c1afc81cb5901e.png)

*— Investopedia / Julie Bang*

## Histograms vs. Bar Charts

Both histograms and bar charts provide a visual display using columns and people often use the terms interchangeably.

A histogram technically represents the frequency distribution of variables in a data set, however. A bar graph typically represents a graphical comparison of discrete or categorical variables.

## How to Make a Histogram

You can make a histogram in Microsoft Excel using the Histogram tool associated with the Statistical icon.

Your other option is to do it by hand:

*   Start with the frequency rate of the data for each timespan.
*   Compile this information in a table. Each interval should be the same length.
*   The frequencies should appear on the vertical axis.
*   The intervals should appear on the horizontal axis.
*   Draw a line over each interval based on its frequency.  
    

## Histogram Example: The MACD Histogram   

Technical traders may be familiar with the [moving average convergence divergence (MACD)](https://www.investopedia.com/terms/m/macd.asp) histogram. It's a popular [technical indicator](https://www.investopedia.com/terms/t/technicalindicator.asp) that illustrates the difference between the MACD line and the signal line.

The MACD histogram graphically represents the difference if there's a $5 gap between the two lines. The MACD histogram is plotted on a chart to make it easy for traders to determine a specific security’s [momentum](https://www.investopedia.com/terms/m/momentum.asp).

A histogram bar is positive when the MACD line is above the [signal line](https://www.investopedia.com/terms/s/signal_line.asp). It's negative when the MACD line is below the signal line. An increasing [MACD histogram](https://www.investopedia.com/articles/technical/091001.asp) indicates an increase in upward momentum. A decreasing histogram is used to signal downward momentum.

![Histogram Example](https://www.investopedia.com/thmb/cylSmsA39atQPKFFm0V68dZMKnU=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/INV-terms-h-histogram-1cd926d4c7da4e2aaa35ebf5ffd17e69.jpg)

*— Investopedia / Sabrina Jiang*

## Trading With the MACD Histogram

A weakness of using only the MACD line and the signal line is the lagging nature of the signal given.

The trading signal lags the price when the MACD line crosses over the signal line. They don't cross until a price move has already occurred because the two lines are [moving averages](https://www.investopedia.com/terms/m/movingaverage.asp) so traders forego a portion of an initial move.

> **Important**
>
> Traders shouldn't overlook the MACD histogram when using the MACD indicator to make trading decisions. The MACD histogram helps to alleviate the signal lag problem by generating earlier entry signals.

Traders can track the length of the histogram bars as they move away from the zero line. They may feel that the histogram is generating a [trading signal](https://www.investopedia.com/terms/t/trade-signal.asp) when a bar is shorter in length than the preceding bar. Traders might open a position in the direction of the histogram’s decline when the smaller histogram bar completes.

Other technical indicators should be used in conjunction with the MACD histogram to increase the signal’s reliability. Traders can place a [stop-loss order](https://www.investopedia.com/terms/s/stop-lossorder.asp) to close out the trade if the security’s price doesn't move as anticipated.

## What Is a Histogram in Simple Terms?

A histogram is a graph that shows the frequency of numerical data using rectangles. The height of a rectangle is the vertical axis. It represents the distribution frequency of a variable such as the amount or how often that variable appears.

The width of the rectangle is the horizontal axis. It represents the value of the variable such as minutes, years, or ages.

## What Is a Histogram vs. a Bar Graph?

The histogram displays the distribution frequency as a two-dimensional figure. The height and width of columns or rectangles have particular meanings and both can vary.

A bar chart is a one-dimensional figure. The height of its bars represents something specific. The width of the bars has no meaning.

There are no gaps between columns on a histogram. Column width changes as the variable that's represented changes. The bars usually have gaps between them on bar charts.

## When Should a Histogram Be Used?

A histogram can generally be used whenever there's a need to display a comparison of the distribution of certain numerical data in various ranges of intervals. Histogram examples can help an audience quickly and easily see and understand essential meanings and patterns that are related to a large amount of data. They can be a benefit to a company's or organization's process of decision-making in various departments.

## The Bottom Line

A histogram is a graphical representation and organization of numerous data points. It can be organized to identify ranges that an individual or company needs. Technical analysts and traders can use the MACD histogram to detect changes in trading momentum. A histogram can also benefit a company's or organization's processes of decision-making in various departments.

You can make a histogram in Microsoft Excel using the Histogram tool if you'd like to try it out.

_The comments, opinions, and analyses expressed on Investopedia are for informational purposes online. Read our [warranty and liability disclaimer](https://www.investopedia.com/legal-4768893#toc-warranty-and-liability-disclaimer) for more info._  

> **Article Sources**
>
> 1.  PennState, Eberly College of Science. "[STAT 500, Applied Statistics: 1.6.2 - Histograms](https://online.stat.psu.edu/stat500/lesson/1/1.6/1.6.2)."
>     
> 2.  Microsoft. "[Create a Histogram](https://support.microsoft.com/en-us/office/create-a-histogram-85680173-064b-4024-b39d-80f17ff2f4e8)."
>     
> 3.  Montgomery College, Pressbooks. "[Statistics Study Guide: 2.2 Histograms, Frequency Polygons, and Time Series Graphs](https://pressbooks.montgomerycollege.edu/statnotes/chapter/2-2-histograms-frequency-polygons-and-time-series-graphs/)."