How to Shade Between Two Lines in Excel
In this article
You shade the area between two lines in Excel by adding a helper data series that fills the gap and plotting it as a stacked area chart behind your line series. Excel has no built-in "fill between lines" button, so the trick is to build the fill yourself: one series for the lower line, one for the difference between the lines, both stacked, with the lower series made invisible. This works for two straight lines, two curved trend lines, or a line and a baseline. You need your source data laid out in columns and a chart already plotted or ready to plot.
What You'll Need
- Excel on Windows, Mac, or Excel for the web. The chart type and formatting options used here exist in all three, though the exact ribbon labels can differ slightly by version, device, and region.
- Two series of numbers that share the same X values (dates, months, or any category).
- A blank column next to your data for the helper calculation.
- Basic familiarity with Insert > Chart and the Format pane.
Step-by-Step
- Lay out your data in three columns. Put your shared X values in column A, the upper line's values in column B, and the lower line's values in column C. Keep the headers in row 1 so Excel names the series for you.
- Add a helper column for the gap. In D2, enter a formula that subtracts the lower value from the upper value, for example
=B2-C2. Copy it down to the last row. This column is the height of the shaded band at each X point. - Select the whole block (A1 through D-last row) and go to Insert > Chart and choose a chart. A Line chart is fine as a starting point.
- Convert the chart to a combo chart. Right-click the chart and choose Change Chart Type. In the dialog, pick Combo at the bottom of the list. Set the upper-line series (column B) to Line, the lower-line series (column C) to Line, and the helper series (column D) to Stacked Area. Tick the secondary axis box for the helper series only if your scales are wildly different; normally leave it off so everything shares one scale.
- Stack the two fill series. A combo chart cannot stack a line with an area, so the reliable route is this: instead of plotting column C as a line in the combo, plot column C as a Stacked Area as well, and plot column B as a Stacked Area. Then add your real lines back as separate series. Practically, the cleanest build is a Stacked Area chart of C and D, with B added afterwards as a line series. If the Change Chart Type dialog will not let you stack, close it and rebuild with Insert > Chart > Area > Stacked Area on columns C and D first, then add B as a line.
- Hide the lower fill. Click the bottom band in the chart (the one representing column C). In the Format pane, open Fill and set it to No Fill. Also set its Border to No Line. The band disappears but still reserves the space, so the helper band now floats exactly between the two lines.
- Format the visible band. Select the top band (column D) and set a Fill colour and transparency, for example a light blue at 40% transparency. Set its border to No Line so the edges look clean.
- Re-add your line series if needed. Right-click the chart, choose Select Data, and add column B as a new series if it is not already there. Change its chart type to Line with markers off, and give it a solid dark colour.
- Tidy the axes and legend. Delete the legend entries for the two area series so only your real lines are listed, or delete the legend entirely. Fix the Y axis minimum so the bands do not look distorted.
- Handle negative gaps. If the upper line ever drops below the lower line, the helper value goes negative and the band flips. Wrap the formula in MAX, for example
=MAX(0,B2-C2), or swap the columns so the larger value is always first.
Common Mistakes
- Plotting the helper as a plain Area chart instead of Stacked Area. A normal area chart draws each series from zero, so the band sits on the axis instead of between the lines.
- Forgetting to hide the lower series. If column C stays visible, you get two solid blocks instead of one band.
- Mixing a line and an area in a combo chart and expecting them to stack. Excel will not stack across chart types; keep the two fill series in the same stacked area group.
- Leaving gaps in the source data. Blank cells break the band. Fill them or use
NA()deliberately. - Using a secondary axis for one fill series. The bands then scale differently from the lines and no longer line up.
Tips
- Name your helper column something obvious like "Gap" so the legend and Select Data dialog stay readable.
- Use a light fill at 30–50% transparency so gridlines and data labels remain visible through the band.
- If you only need the band between a line and a fixed baseline (such as a target), you can skip the second line entirely and stack the line's values against the baseline.
- For a smooth band, use a Scatter with Smooth Lines chart type for the line series and an XY area equivalent for the fill; the smoother the line, the more X points you need for the band to follow it.
- Once built, copy the chart and use Paste Special to relink it to a new data range rather than rebuilding from scratch.
Troubleshooting
The band sits on the X axis. Your helper series is being plotted as a standard Area, not Stacked Area. Change the chart type or rebuild the chart as Stacked Area.
No band appears at all. Check that the helper formula returns positive numbers and that the series is actually included in Select Data. A column of zeros produces an invisible band.
The band covers the lines. Right-click the band, choose Send to Back, or reorder the series in Select Data so the lines sit on top.
The band is jagged or steps oddly. This happens with category axes and uneven spacing. Switch the X axis to a date axis or use a scatter chart so points are placed proportionally.
Change Chart Type greys out the Stacked Area option. You have a line series selected in the same group. Move the line series to its own group in the combo dialog, or add it after the area chart is built.
If that did not work, start clean: select only columns C and D, insert a Stacked Area chart, hide C's fill, then use Select Data to add column B as a line. Rebuilding is usually faster than fighting the combo dialog.
Frequently Asked Questions
Can Excel shade between two lines automatically?
No. There is no native fill-between-lines option. The helper-column stacked area method is the standard workaround and updates automatically when your source numbers change.
Does this work in Excel for the web?
Yes, stacked area charts and the Format pane are available there, though some fine-grained formatting options are more limited than in the desktop app.
Can I shade between a line and a horizontal target line?
Yes. Use the target as the lower series and the difference between the line and the target as the helper, then stack them the same way.
Why does my band change shape when I add data?
The chart range probably does not include the new rows. Right-click the chart, choose Select Data, and extend each series range to cover the added rows.
Can I shade between two lines on a scatter chart?
Not directly, because scatter charts do not support stacked areas. Use a line chart with a date or category axis instead, or approximate the band with a filled shape.
Will the band print and export correctly?
Yes, once the fill is set on the series rather than drawn as a shape, it prints and exports to PDF with the rest of the chart.