Shading under a curve in Excel is a way to visually highlight the area between a plotted line and the horizontal axis (or between two lines). It is commonly used in charts like normal distribution curves, cumulative data, or any area chart where the region below a threshold matters. The easiest method is to use an area chart instead of a line chart, but if you already have a line chart, you can convert it in a few clicks. This guide covers both the quick approach and the more flexible method using a helper column, so you can shade exactly the part of the curve you need.
What You'll Need
- Excel 2013 or later (the steps are the same in Excel for Microsoft 365, Excel 2021, and Excel 2019).
- A dataset with at least two columns: one for the X values (e.g., time, score, price) and one for the Y values (the curve itself).
- If you want to shade only part of the curve (e.g., only the area to the left of a cutoff), you will also need a column that contains the Y values for the shaded region and blanks elsewhere.
Step-by-Step
Method 1: Quick Shade Using an Area Chart
- Select your data. Click and drag to highlight both the X and Y columns. Include the header row if you have one.
- Insert an area chart. Go to the Insert tab, click the Area Chart icon (it looks like a filled line graph), and choose the first option, 2-D Area. Excel will create a chart with the area under the curve filled with a solid color.
- Remove the border line (optional). If you want only the shaded area without the outline, click on the chart's top edge (the series line), right-click, and choose Format Data Series. Set the Border to No line.
- Adjust the axis if needed. If the shaded area starts from the bottom of the chart rather than from the X-axis, right-click the vertical axis, choose Format Axis, and set the Minimum to the value where your curve begins (often 0).
This method shades the entire area under the curve. If you need to shade only a portion—say, the region to the left of a specific X value—use Method 2.
Method 2: Shade a Specific Region Under the Curve
- Add a helper column. In a new column next to your Y values, create a formula that returns the Y value only for the rows you want shaded, and returns
=NA()for all other rows. For example, if your X values are in column A (rows 2 to 20) and Y values in column B, and you want to shade everything where X is less than 5, put this in C2 and drag down:=IF(A2<5, B2, NA()). TheNA()function creates a gap in the chart, which is what tells Excel to leave that part unshaded. - Select all three columns (X, Y, and the helper column) and insert a 2-D Area chart as in Method 1.
- Right-click the chart and choose Select Data. In the left pane (Legend Entries), you will see two series: the original Y and the helper. Click on the helper series and click Edit to set its name if you want (e.g., "Shaded Region").
- Format the helper series. Right-click the helper series in the chart (it may appear as a separate area), choose Format Data Series, and set its fill color to a distinct shade (e.g., a light blue) and border to No line. The original series can be left as a line or formatted to have no fill.
- Remove the original series fill. If the original Y series also shows as an area, right-click it, choose Format Data Series, and set Fill to No fill. Then add a border to make it look like a line (or keep it as a line chart by changing the chart type of that series to Line).
This method gives you precise control over the shaded region. You can also shade between two curves by using two helper columns—one for the lower bound and one for the upper bound—and stacking them, but that is more advanced and usually requires a stacked area chart trick.
Common Mistakes
- Using a line chart instead of an area chart. Line charts do not have a fill option. You must use an area chart (or change the chart type of the series to area).
- Forgetting to set the axis minimum. If your Y values start at a number other than zero, the area chart will shade from that number down to the axis minimum, which may not be zero. This makes the shaded region look wrong. Always check the vertical axis bounds.
- Using blank cells instead of
NA()in the helper column. Blank cells create gaps in the area chart, but they also break the line into segments.NA()is the correct way to create a continuous line with a missing section for shading. - Not sorting the X values. Area charts require the X values to be in ascending order. If your data is unsorted, the chart will look like a zigzag mess. Sort your data by the X column before creating the chart.
Tips
- Use a secondary axis if your Y values are very large or very small. If the curve is flat compared to another series, you can right-click the series, choose Format Data Series, and select Secondary Axis to give it its own scale.
- Add data labels to the shaded area if you want to show the area's value. Right-click the shaded series, choose Add Data Labels, and position them above the area.
- For a normal distribution curve, use the
NORM.DISTfunction to generate Y values, then shade the area under the curve for a specific range (e.g., between -1 and 1 standard deviations) using the helper column method. - Change the transparency of the fill. Right-click the shaded area, go to Format Data Series > Fill, and adjust the transparency slider to make the underlying gridlines visible.
Troubleshooting
If the shaded area does not appear at all: Check that you have selected the correct chart type (2-D Area). Also verify that your helper column contains numbers, not text. If you used NA(), Excel will skip those points, but the remaining points must form a contiguous range.
If the shaded area covers the entire chart, ignoring your IF condition: Make sure your formula is correct and that you dragged it down to all rows. Also, check that the X values are sorted. If they are not, the area chart will connect points in the wrong order, and the shading will appear over the whole range.
If the shaded area is not touching the X-axis: This happens when your Y values do not include zero. Right-click the vertical axis, select Format Axis, and set the Minimum to 0. If your data naturally starts at a higher value, you may want to add a baseline row with Y=0 at the beginning and end of your data, but that will affect the curve's shape.
If you see a gap in the shaded area: This usually means you have blank cells in the helper column. Replace them with =NA(). Also, ensure that the X values are strictly increasing—duplicate X values can cause gaps.
If the chart looks like a line chart with no fill: Right-click the series, choose Change Series Chart Type, and select Area for that series. Excel sometimes defaults to a line chart if the data has many points.
Frequently Asked Questions
Can I shade under a curve in Excel for Mac?
Yes. The steps are the same in Excel for Mac. The Insert tab has an Area Chart icon, and you can format the series fill the same way. The NA() function also works the same.
How do I shade only the area between two curves?
You can use a stacked area chart. Create two helper columns: one for the lower curve and one for the difference between the upper and lower curves. Then insert a stacked area chart and format the lower series to have no fill. This creates a shaded band between the two lines.
Why does my area chart start from the top of the chart instead of the bottom?
This usually happens when your Y values are negative or when the axis minimum is not set correctly. Right-click the vertical axis, choose Format Axis, and adjust the Minimum to a value lower than your lowest Y value (often 0).
Can I shade under a curve in a scatter plot?
Scatter plots do not support area fills directly. You need to convert the scatter plot to an area chart, but that will change the X-axis to a category axis. A better approach is to use a line chart with a helper column, or use the scatter plot's Error Bars to simulate shading, which is complicated. For most purposes, an area chart is the right tool.
How do I change the color of the shaded area?
Click on the shaded area to select it, then go to the Format tab (or right-click and choose Format Data Series). Under Fill, choose a solid color, gradient, or pattern. You can also adjust transparency there.
Can I shade under a curve dynamically based on a cell value?
Yes. Instead of a fixed IF condition, reference a cell. For example, if cell D1 contains the cutoff value, use =IF(A2<$D$1, B2, NA()). When you change D1, the chart will update automatically.