The simplest way to add a line in Excel

To add a line in Excel, you draw it using the drawing tools built into the program. Open your spreadsheet, go to the Insert tab at the top, click Shapes, then select Line from the dropdown menu. Your cursor will change to a crosshair — click and drag on your spreadsheet to draw the line wherever you need it.

The line appears as an object on top of your cells, not inside them. You can move it, resize it, or change its color and thickness after you draw it. This method works the same way in Excel for Windows, Excel for Mac, and Excel online.

Key Takeaways

  • Lines in Excel are drawn objects placed on top of cells, accessed through Insert > Shapes > Line.
  • You can change a line's color, thickness, and style after drawing it by right-clicking and selecting Format Shape.
  • To add a horizontal or vertical line that snaps to the grid, hold Shift while dragging to lock the angle.
  • If you want a line as part of a cell border instead of a floating object, use the border tool in the Home tab.

Drawing a line step by step

Start by clicking the Insert tab in the ribbon at the top of Excel. Look for the Shapes button — it usually shows a small square or circle icon. Click the dropdown arrow next to it to open the shapes menu.

In the menu that appears, find Line in the "Lines" section at the top. Click it once. Your cursor will turn into a crosshair, and the spreadsheet is now ready for you to draw. Click the starting point of your line, then drag to the ending point and release. The line appears immediately.

If you want a perfectly horizontal or vertical line, hold down the Shift key while dragging. This locks the line to 15-degree angles, making it easy to draw straight lines without wobble.

Changing the line's appearance

Once the line is drawn, click it to select it. Small squares appear at the corners and edges — these let you resize or rotate the line. To change how it looks, right-click the line and select Format Shape from the menu that appears.

A panel opens on the right side of the screen with options for Line settings. Here you can change the color by clicking the color dropdown, adjust the thickness (called "Width"), and choose a line style — solid, dashed, dotted, or combinations. You can also add arrow heads to either end of the line if you need directional indicators.

If the Format Shape panel does not appear, you can also right-click the line and look for Line or Line Color options directly in the context menu, depending on your Excel version.

Moving and deleting lines

To move a line you have already drawn, click it once to select it, then drag it to a new location. The line stays selected while you move it, so you can position it precisely. If you need to move it just a few pixels, click it and use the arrow keys on your keyboard to nudge it into place.

To delete a line, click it to select it and press the Delete key. The line disappears immediately. If you accidentally delete a line, press Ctrl+Z (or Command+Z on Mac) to undo.

Using cell borders instead of drawn lines

If you want a line that is part of the cell structure rather than a floating object, use the border tool instead. Select the cells where you want the border, then go to the Home tab and click the Borders dropdown (it looks like a small grid). Choose which sides of the cells should have a border — top, bottom, left, right, or all sides.

Borders are useful when you want lines to stay attached to specific cells and move with them if you insert or delete rows. Drawn lines stay in the same position on the spreadsheet regardless of what happens to the cells underneath.

Grouping multiple lines together

If you draw several lines and want to keep them together as a single unit, select all of them at once. Click the first line, then hold Ctrl (or Command on Mac) and click each additional line. All selected lines will have selection handles around them.

Right-click the group and select Group from the menu. Now the lines move, resize, and format as one object. If you need to edit individual lines later, right-click the group and select Ungroup to separate them again.

Frequently Asked Questions

Can I make a curved line instead of straight?

Yes. Go to Insert > Shapes and select Curve instead of Line. Click multiple points on your spreadsheet to create the curve shape, then double-click to finish. You can adjust the curve by dragging the control points that appear.

Why is my line not showing up?

The line may be white or very thin. Click it to select it, right-click, and choose Format Shape. Check the line color and width settings. If the line is behind cells, right-click it and select "Bring to Front" to move it on top of the spreadsheet content.

How do I make a line thicker or thinner?

Click the line to select it, right-click, and choose Format Shape. In the panel that opens, find the Width setting under Line and drag the slider or type a number. Width is measured in points — 1 point is very thin, and 5 or 6 points is noticeably thick.

Can I add arrows to my line?

Yes. Select the line, right-click, and choose Format Shape. Look for the Line section and find the arrow options. You can add an arrow to the start, end, or both ends of the line, and choose from different arrow styles.

What is the difference between a line and a border?

A line is a floating object that sits on top of your spreadsheet and stays in one place. A border is attached to cells and moves with them if you insert or delete rows. Use lines for diagrams and annotations, and borders for organizing data within your table.