Smart Systems for Home

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

How to Shade Area Between Two Lines in Excel

· 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 the area between two lines in Excel, you need a helper data series that calculates the difference between the lines, then a stacked area chart with the lower line made invisible. The quickest working method is: add a column for the gap between the lines, insert a stacked area chart using the lower line and the gap column, then set the lower area fill to No Fill so only the gap is shaded. This works in Excel for Microsoft 365, Excel 2021, 2019, and 2016 on Windows and Mac. Menu labels can differ slightly by version, device, or region.

What You'll Need

  • Excel 2016 or later (Microsoft 365, 2021, 2019, or 2016) on Windows or Mac. The steps below use the desktop app; Excel for the web has fewer chart formatting options and may not support every fill setting.
  • Two data series plotted against the same category or date axis, with matching X values.
  • Your data laid out in columns: one column for the category or date, one for the upper line, one for the lower line.
  • A blank helper column for the gap calculation.

Step-by-Step

  1. Lay out your data. Put your category or date values in column A, the upper line values in column B, and the lower line values in column C. Make sure both series have a value in every row; blank cells can break the area chart.
  2. Add a helper column for the gap. In cell D1, type a label such as Gap. In D2, enter the formula =B2-C2. Copy it down to the last row. This calculates the vertical distance between the two lines at each point.
  3. Check for negative gaps. If the lower line ever rises above the upper line, the gap becomes negative and the stacked area chart will not render correctly. Fix this by ensuring the upper line column always contains the larger value. If your lines cross, swap the values in those rows or use =ABS(B2-C2) and accept that the shading will not follow the crossover direction.
  4. Select the lower line and gap columns. Highlight the category column (A), the lower line column (C), and the gap column (D). Do not include the upper line column yet.
  5. Insert a stacked area chart. Go to Insert > Charts > Insert Area or Radar Chart (the icon looks like a filled area) and choose Stacked Area. On some versions the path is Insert > Recommended Charts > All Charts > Area > Stacked Area.
  6. Hide the lower area. Click the lower band in the chart (the one representing column C) to select it. Right-click and choose Format Data Series. In the Format Data Series pane, open Fill and select No Fill. Also set Border to No Line. The lower band disappears, leaving only the gap shaded.
  7. Format the shaded area. With the gap series still selected, set a fill colour and transparency in the same Format Data Series pane. A light colour with 40–60% transparency usually looks best behind gridlines.
  8. Add the two original lines back as line series. Right-click the chart and choose Select Data. Click Add, set the series name to your upper line header, and set the series values to column B. Repeat for the lower line using column C. With each new series selected, right-click and choose Change Series Chart Type, then set both to Line (not stacked). This overlays the actual lines on top of the shaded gap.
  9. Clean up the chart. Delete the legend entry for the invisible lower area if it appears, remove any unwanted gridlines, and adjust the Y-axis minimum if the shading looks compressed. Save the workbook.

Common Mistakes

  • Including the upper line in the stacked area chart. If you stack both original lines plus the gap, the upper line gets added on top of the lower line and the shading sits in the wrong place. Only the lower line and the gap belong in the stacked area.
  • Forgetting to set the lower area to No Fill. Without this step the chart shows two solid bands instead of a shaded gap.
  • Leaving negative gap values. Stacked area charts treat negative values unpredictably; the shaded band can flip or vanish. Always check that the gap column is zero or positive.
  • Using a line chart instead of an area chart. A line chart cannot fill between two lines in Excel. The stacked area approach is the supported method.
  • Adding the lines back as stacked lines. When you re-add the original series, set them to plain Line, not Stacked Line, or they will shift vertically.

Tips

  • Name your helper column clearly, such as Gap (Upper minus Lower), so anyone opening the file understands the chart.
  • Use a light fill with transparency so gridlines and data labels remain readable.
  • If your X-axis is dates, make sure the axis is set to a date axis rather than text; otherwise the area chart may space points evenly and distort the shape.
  • To shade only part of the chart, set the gap formula to return NA() outside the range you want shaded. Area charts skip #N/A values, which creates a clean break.
  • Keep a copy of the original data columns untouched so you can rebuild the chart if formatting goes wrong.

Troubleshooting

  • The shaded band is in the wrong place. Check that the gap column is calculated as upper minus lower, not lower minus upper. Also confirm the lower line column is the one set to No Fill.
  • The shading disappears at some points. Look for blank cells or text in the data range. Area charts need numeric values in every row.
  • The lines do not sit on the edges of the shading. Re-add the original series as Line chart type and verify their values match columns B and C exactly.
  • The chart looks squashed. Right-click the vertical axis, choose Format Axis, and set a minimum value slightly below your lowest data point rather than zero.
  • Format Data Series options are greyed out. Make sure you have selected the series itself, not the chart area. Click directly on the coloured band, then right-click.
  • Excel for the web does not show the No Fill option. Open the file in the desktop app to finish the formatting, then save; the shading will remain when viewed online.

Frequently Asked Questions

Can I shade between two lines without a helper column?

No. Excel has no built-in “fill between lines” feature. The helper column is what creates the area to shade.

Does this work with dates on the X-axis?

Yes, provided the date column is formatted as dates and the chart axis is set to a date axis. Text dates can cause uneven spacing.

Can I shade between lines that cross each other?

Not cleanly with a single stacked area series. Where the lines cross, the gap changes sign and the shading breaks. You can split the data into segments at the crossing point and build separate shaded ranges.

Will the shading survive if I open the file in Google Sheets or Excel for the web?

Google Sheets and Excel for the web may not preserve every fill and transparency setting. The chart usually remains, but colours and No Fill settings can change. Check the file in the desktop app before sharing.

Can I add data labels to the shaded area?

You can add labels to the gap series, but they will show the gap value, not the line values. For line values, add labels to the line series instead.

Why does my shaded area look like a solid block?

The lower series is probably still filled. Select it, open Format Data Series, and set Fill to No Fill and Border to No Line.