Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Shade Between Lines in Excel: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To shade between lines in Excel, you use a line chart with a filled area between two series, or you use a scatter chart with a shaded region drawn as a shape. The simplest reliable method is to create a stacked area chart from helper columns that calculate the gap between your upper and lower lines, then format the lower series as invisible. This gives a clean shaded band that updates when your data changes. You will need Excel 2013 or later on Windows or Mac; the steps are nearly identical on both, though menu labels can differ slightly by version and region.

What You'll Need

  • Excel 2013 or newer (Microsoft 365, Excel 2019, 2021, or 2024).
  • Two sets of data: an upper line and a lower line, with matching X values (dates, months, or numbers).
  • Your data laid out in columns with headers in the first row.
  • Basic familiarity with inserting charts and opening the Format pane.

Step-by-Step

  1. Set up helper columns. Suppose column A has your X values, column B has the lower line, and column C has the upper line. In column D, calculate the gap: =C2-B2 and fill down. In column E, copy the lower line values: =B2 and fill down. These two columns will become the stacked areas.
  2. Select the helper columns. Highlight the X values in column A, then hold Ctrl (Windows) or Command (Mac) and also select columns D and E. Do not select the original B and C columns for the chart yet.
  3. Insert a stacked area chart. Go to Insert > Charts > Stacked Area (the icon with layered filled areas). A chart appears with two stacked bands. The bottom band represents column E (the lower line), and the top band represents column D (the gap).
  4. Make the lower band invisible. Click the bottom band once to select the series, then right-click and choose Format Data Series. In the Format pane, set Fill to No Fill and Border to No Line. The bottom band disappears, leaving only the shaded gap between the two original lines.
  5. Add the original lines as line series. Right-click the chart and choose Select Data. Click Add, set the Series name to your upper line header (C1), and set Series values to the upper line range (C2:C10). Repeat to add the lower line (B2:B10). These appear as line series on top of the shaded band.
  6. Format the lines. Select each line series, open Format Data Series, and set a distinct line color and weight (for example, 2 pt). This makes the boundaries of the shaded area clear.
  7. Adjust the X axis. If the X axis shows 1, 2, 3 instead of your labels, right-click the chart, choose Select Data, and edit the Horizontal (Category) Axis Labels to point to your X range (A2:A10).
  8. Clean up the chart. Delete the legend if it is not needed, add axis titles, and set the Y axis minimum and maximum to sensible values so the shaded band is not squashed. Right-click the Y axis > Format Axis to adjust bounds.

Common Mistakes

  • Selecting the original columns instead of the helper columns. If you build the stacked area from B and C directly, Excel stacks them and the shading appears above both lines, not between them. Always use the gap column and the lower-line copy.
  • Forgetting to hide the lower band. The bottom band will cover the area below your lower line, making the chart look like a solid block. Set it to No Fill.
  • Using a line chart instead of an area chart. A standard line chart cannot fill between two lines. You need a stacked area chart or a shape overlay.
  • Mismatched X values. If the upper and lower series use different X ranges, the shaded band will be misaligned. Ensure both series share the same X values.
  • Leaving the gap column as a formula that returns errors. If B or C contains #N/A, the gap column will also error and the chart may show gaps. Clean your data first.

Tips

  • Name your helper columns clearly (for example, "Gap" and "Lower") so you can rebuild the chart later.
  • Use a light fill color with some transparency (Format Data Series > Fill > Transparency) so gridlines and other series remain visible.
  • If you need to shade between a line and a fixed value (such as a target), set the lower line to that constant value in the helper column instead of referencing a cell.
  • For a quick one-off, you can draw a freeform shape between the lines, but it will not update with data. The chart method is better for reports.
  • Copy the finished chart to other sheets and update the series ranges via Select Data rather than rebuilding from scratch.

Troubleshooting

  • The shaded area appears above both lines. You likely used the original upper and lower columns as the stacked series. Rebuild using the gap column and the lower-line copy as described in steps 1–3.
  • The chart shows only one band. Check that both helper columns have data for every X value. Blank cells can collapse the stack.
  • The lines do not align with the band edges. The line series may be plotted on a secondary axis or use a different category axis. Right-click each line series > Format Data Series > Axis and ensure it is set to Primary Axis.
  • Excel crashes or the chart is slow with large data. Reduce the number of rows or convert the helper columns to values (copy > Paste Special > Values) to lighten the calculation load.
  • You cannot find Stacked Area. Look under Insert > Charts > Insert Area Chart; the stacked option is the second icon. On Mac, the chart gallery may label it "Stacked Area" in the Area section.

Frequently Asked Questions

Can I shade between two lines without helper columns?

Not directly with a built-in chart type. You can draw a shape manually, but it will not update when data changes. Helper columns are the reliable method.

Does this work in Excel for Mac?

Yes. The chart types and Format pane are the same, though menu names may differ slightly (for example, "Charts" tab instead of "Insert" tab in some versions).

Can I shade between a line and the X axis?

Yes. Use a standard area chart for that series, or set the lower helper column to zero and follow the same stacked area method.

Why is my shaded band a solid color with no lines visible?

The line series may be hidden behind the area or formatted with no line. Select each line series and set a visible line color and weight.

Can I make the shading conditional, such as only when one line is above the other?

You can use a formula in the gap column that returns the positive difference only, and another column for the negative difference, then plot both as separate stacked areas with different colors. This requires more setup but is possible.

Will the chart update if I add new rows?

Only if the chart's source range includes those rows. Convert your data to an Excel Table (Ctrl+T) before building the chart, and the chart will expand automatically as you add rows.