Adding a horizontal line to your Excel graph
A horizontal line in an Excel graph marks a target, average, or threshold you want to highlight. Excel calls this an axis line or reference line, and you add it by inserting a shape or by using a second data series formatted as a line. The fastest method depends on whether you want the line to sit at a specific value (like an average) or just mark a visual reference point.
The most common approach is to add a line shape directly onto your chart, which takes about 30 seconds and works in any Excel version. If you need the line to align precisely with your data values, you can instead add a helper column and plot it as a second series — this is more work but gives you exact positioning tied to your numbers.
Key Takeaways
- You can draw a line shape directly on a chart by selecting the chart, going to Insert > Shapes, choosing a line, and dragging it across the chart at the height you want.
- For a line that aligns exactly with a data value (like an average), add a helper column with that value repeated for every row, then plot it as a second series and format it as a line.
- A line drawn as a shape stays in place when you update your data, but a line created from a data series moves if the data changes.
- You can format any line you add by right-clicking it, choosing Format Shape or Format Data Series, and adjusting color, thickness, and style.
Drawing a line shape directly on the chart
This is the quickest method and works when you want a visual marker at a specific height. First, click on your chart to select it — you should see a gray border around it. Then go to the Insert tab at the top of the ribbon and click Shapes. A dropdown menu appears with shape options; look for Line (usually in the top row) and click it.
Your cursor changes to a crosshair. Click and drag horizontally across the chart at the height where you want the line to appear. Start at the left edge of the chart area and drag to the right edge. Release the mouse button when you reach the right side. The line appears on your chart.
To adjust the line's position after you draw it, click and drag it up or down. To change its appearance, right-click the line and select Format Shape. A panel opens on the right side where you can change the line color under Line, adjust thickness by moving the Width slider, or change the style (solid, dashed, dotted) from the Dash type dropdown.
Using a data series as a horizontal line
This method is more precise if you want the line to sit exactly at a calculated value like an average or a sales target. You create a helper column in your spreadsheet with that value repeated for every row, then plot it as a second series on your chart.
Start in your spreadsheet, not in the chart. In an empty column next to your data, type a header like "Target" or "Average". In the cell below it, enter the value where you want the line to appear — for example, if your average is 50, type 50. Then click that cell and drag the fill handle (the small square at the bottom-right corner of the cell) down to match the number of rows in your data. This copies the value down the entire column.
Now click on your chart to select it. Go to Chart Design (or Design depending on your Excel version) and click Select Data. A dialog box opens. Click Add and then select your helper column as the new series. Click OK. Your chart now shows two series — your original data and your new helper column.
The helper column usually appears as bars or points by default. To turn it into a line, right-click on the new series in the chart and select Change Series Chart Type. Choose Line from the list and click OK. The series now displays as a line. Format it by right-clicking and choosing Format Data Series, then adjust the line color and thickness as needed.
Positioning the line at the exact right height
If you drew a line shape and need to move it to a precise location, you can use the arrow keys for fine adjustments. Click the line to select it, then press the up or down arrow key on your keyboard. Each press moves the line slightly. Hold Shift while pressing the arrow key to move it in larger increments.
If you used a data series method and the line is not at the height you expected, check your helper column value. If you typed 50 but the line appears at 40, you may have made a typo. Go back to your spreadsheet, correct the value in the helper column, and the chart updates automatically.
For a line created from a shape, you can also right-click it, select Format Shape, go to the Position & Size section (if available in your version), and enter an exact vertical position. This is useful if you need the line at a very specific spot and dragging is not precise enough.
Formatting your horizontal line
Once your line is in place, you can change how it looks. Right-click the line and choose Format Shape (for a drawn line) or Format Data Series (for a line from a data series). A panel or dialog opens with formatting options.
Under Line, you can pick a new color by clicking the color dropdown. Choose from the palette or click More Colors for custom shades. Adjust the thickness by moving the Width slider — a thicker line stands out more. Change the line style using the Dash type dropdown: solid is a plain line, dashed creates breaks, and dotted creates small dots. A dashed or dotted line is useful if you want it to look different from your data lines.
If your line is hard to see against your chart background, try a brighter color or increase the width. If it blends in too much, make it darker or add a dash pattern. You can also add a label to explain what the line represents — right-click the line, select Add Data Label (if it is a data series), or insert a text box near the line and type a description.
Removing or hiding a horizontal line
If you no longer need the line, click it to select it and press Delete. The line disappears immediately. If you want to keep it but hide it temporarily, right-click it, select Format Shape or Format Data Series, and set the line color to No Color or move the transparency slider all the way to the right.
If you added a line as a data series and want to remove it, right-click the line on the chart, select Delete, and confirm. The series is removed from the chart but your helper column in the spreadsheet remains — you can delete that column too if you no longer need it.
Troubleshooting common issues
If you cannot find the Shapes option, make sure you have clicked on the chart first. The Insert tab changes depending on whether a chart is selected. If the chart is not selected, the Shapes option may not appear or may be in a different location.
If your line appears but looks very faint or invisible, it may be white or very light gray. Right-click it and change the color to something darker. If the line is behind your data bars or points, right-click it and look for a Send to Back or Arrange option to move it behind the data, or Bring to Front to move it in front.
If you used a data series method and the line does not align with your data, double-check that your helper column has the correct value in every row. If some cells are blank or have different values, the line will not be straight. Also verify that you selected the correct range when adding the series to the chart.
Frequently Asked Questions
Can I add more than one horizontal line to the same chart?
Yes. You can draw multiple line shapes or add multiple helper columns as separate data series. Each line can be a different color or style. This is useful if you want to show both an average and a target, for example.
Will the line move if I update my data?
A line drawn as a shape stays in the same place. A line created from a data series stays at the same value but may appear to move if your chart axis rescales. If your data changes and the chart zooms out, the line position relative to the chart area may shift.
How do I make the line go all the way across the chart?
When you draw a line shape, drag from the far left edge of the chart area to the far right edge. If the line does not reach the edges, click it and drag the endpoints to extend it. For a data series line, it automatically spans the full width of the chart.
Can I add a vertical line instead of a horizontal one?
Yes. Use the same methods — draw a line shape vertically, or create a helper column with a category value and plot it as a series. The steps are the same; only the direction changes.
What if my line appears behind the data and I cannot see it?
Right-click the line and look for an Arrange or Send/Bring option. Select Bring to Front to move it in front of the data. You can also make the line thicker or change its color to make it more visible.