How to Plot a Gaussian Distribution in Excel
In this article
To plot a Gaussian distribution in Excel, you need two columns: one with a range of x-values and one with the corresponding normal probability density values calculated using the NORM.DIST function. Then insert a scatter chart with smooth lines. There is no built-in Gaussian chart type, so you build it from a formula and a scatter plot. This guide walks through the exact steps, the formula syntax, and the common pitfalls.
What You'll Need
- Excel 2010 or later (NORM.DIST replaced NORMDIST in 2010; both work, but NORM.DIST is preferred).
- Your mean (average) and standard deviation values, or a dataset to calculate them from.
- A blank worksheet or a column of existing data.
Step-by-Step
- Set up your parameters. In two empty cells, enter your mean and standard deviation. For example, put the mean in cell E1 and the standard deviation in E2. If you have raw data, use
=AVERAGE(range)and=STDEV.S(range)to calculate them. Label them so you remember which is which. - Create your x-values. In column A, starting at A2, enter a sequence of numbers that spans roughly three standard deviations below and above the mean. A common approach: in A2 type
=E1-3*E2, then in A3 type=A2+E2/10and drag down until you reachE1+3*E2. This gives about 60 points, which is smooth enough for a chart. Alternatively, use the Fill Series feature: type the first value, then drag the fill handle while holding Ctrl to increment. The exact spacing matters less than covering the range evenly. - Enter the NORM.DIST formula. In B2, type
=NORM.DIST(A2,$E$1,$E$2,FALSE). The dollar signs lock the mean and standard deviation cells so you can copy the formula down. The FALSE argument tells Excel to return the probability density (the bell curve height), not the cumulative probability. Press Enter. - Copy the formula down. Select B2, double-click the fill handle (the small square at the bottom-right of the cell) or drag it down to the last x-value. Each row now has an x and its corresponding density.
- Insert a scatter chart. Select both columns (A2:B61 or however many rows you have). Go to the Insert tab, click the Scatter chart icon, and choose Scatter with Smooth Lines. Do not choose a line chart; a line chart treats x-values as categories and will distort the shape.
- Format the chart. Right-click the horizontal axis and choose Format Axis. Set the minimum and maximum to your x-range (e.g., mean minus 3 SD to mean plus 3 SD). Add axis titles and a chart title. You can also remove the legend if it is not needed.
- Verify the curve. The peak should be at the mean, and the curve should be symmetric. The height at the mean is approximately 1/(SD * sqrt(2π)). If your curve looks flat or spiky, check your x-spacing and the FALSE argument.
Common Mistakes
- Using TRUE instead of FALSE in NORM.DIST. TRUE returns the cumulative distribution (an S-curve), not the bell curve. Use FALSE for density.
- Choosing a Line chart instead of a Scatter chart. A line chart plots x-values as evenly spaced categories, so unequal spacing gets distorted. Always use Scatter with Smooth Lines.
- Forgetting absolute references. If you copy
=NORM.DIST(A2,E1,E2,FALSE)down without dollar signs, the mean and SD cells shift and the curve breaks. Use$E$1and$E$2. - Too few x-values. Ten points produce a jagged, angular curve. Use at least 50 points for a smooth appearance.
- Using STDEV.P when your data is a sample. For a sample, use STDEV.S; for a population, use STDEV.P. The difference is small but affects the curve width.
Tips
- To shade the area under the curve, add a second series with the same x-values and zero y-values, then use a stacked area chart or a combo chart. This is optional and more advanced.
- If you want to compare two distributions, add a second density column with different mean and SD, and plot both series on the same scatter chart.
- Use named ranges for mean and SD (Formulas > Define Name) to make formulas easier to read.
- Press Ctrl+` (grave accent) to toggle formula view and check that all cells reference the correct parameters.
- For a quick check, the area under the density curve should be approximately 1. You can approximate it by summing density * x-spacing.
Troubleshooting
- The curve is a flat line. Check that you used FALSE, not TRUE. Also verify that your x-values actually span a range around the mean; if all x-values are far from the mean, densities are near zero.
- The curve is an S-shape. You used TRUE. Change to FALSE.
- #NUM! error. Standard deviation is zero or negative. Check your SD cell; it must be positive.
- #VALUE! error. One of the arguments is text. Ensure mean, SD, and x-values are numbers.
- The chart looks jagged. Increase the number of x-values (smaller step size) or use Scatter with Smooth Lines.
- The peak is not at the mean. Check that your x-values are symmetric around the mean and that the formula references the correct mean cell.
Frequently Asked Questions
Can I plot a Gaussian distribution without raw data?
Yes. You only need a mean and standard deviation. Enter them manually and follow the steps above.
What is the difference between NORM.DIST and NORMDIST?
NORMDIST is the legacy function; NORM.DIST is its replacement in Excel 2010 and later. Both work, but NORM.DIST is recommended for compatibility.
How many x-values should I use?
At least 50 for a smooth curve. More points give a smoother line but are not necessary for most purposes.
Can I plot a Gaussian distribution in Excel Online?
Yes, Excel Online supports NORM.DIST and scatter charts, though the interface may differ slightly.
Why does my curve look cut off at the edges?
Your x-range may not extend far enough. Extend to at least three standard deviations on each side of the mean.
How do I add a normal curve to an existing histogram?
Create the histogram with the Data Analysis ToolPak, then add a scatter series with the density values on a secondary axis. This is more advanced and requires careful axis scaling.