How to Add a Line in Excel

“Adding a line” in Excel can mean several things: inserting a new row of data, starting a new line of text inside a cell, drawing a line shape on the sheet, adding a border under cells, or adding a line to a chart. This guide covers each one, starting with the most common, so you can jump to the one you need.

Add a New Row (Line of Data)

Step 1: Select the Row

Click the row number on the left side of the sheet where you want the new line. The new row will appear above the one you select.

Step 2: Right-Click and Choose Insert

Right-click the selected row number and choose Insert. Excel adds a blank row and moves everything below it down.

Step 3: Enter Your Data

Click the first cell in the new row and type. Formulas that refer to ranges around the new row, such as =SUM(B2:B20), usually expand to include it automatically.

Faster Ways to Insert Rows

  • Keyboard shortcut: Select a whole row with Shift + Space, then press Ctrl + Shift + + (Ctrl + Plus) to insert a row above it.
  • Ribbon: Click a cell, then go to Home > Insert > Insert Sheet Rows.
  • Several rows at once: Select as many rows as you want to add (for example, three row numbers), then right-click and choose Insert. Excel inserts the same number of blank rows.
  • In an Excel table: Press Tab in the last cell of the table to add a new row at the bottom, or right-click a cell and choose Insert > Table Rows Above.

Microsoft’s guide to inserting rows and columns uses the same steps for columns: select a column letter instead of a row number.

Start a New Line Inside a Cell

To put text on two lines in the same cell, double-click the cell (or press F2), click where you want the break, and press Alt + Enter on Windows or Option + Return on a Mac. Excel turns on Wrap Text automatically. In a formula, use CHAR(10), such as =A2&CHAR(10)&B2, and turn on Home > Wrap Text. For more detail, see how to add a line break in an Excel cell.

Draw a Line Shape

  1. Go to Insert > Illustrations > Shapes.
  2. Under Lines, choose a straight line, an arrow, or a connector.
  3. Click and drag on the sheet. Hold Shift while dragging to keep the line perfectly horizontal, vertical, or at 45 degrees. Hold Alt to snap the ends to cell edges.
  4. With the line selected, use the Shape Format tab to change its color, weight, dash style, or arrowheads.

Shapes float on top of the cells, so they don’t affect data, sorting, or formulas. Right-click a line and choose Format Shape > Properties to choose whether it moves and resizes with the cells.

Add a Border Line Under or Around Cells

For a line that stays attached to the cells, such as a total line under a column of numbers, use a border:

  1. Select the cells.
  2. On the Home tab, click the arrow next to the Borders button.
  3. Choose Bottom Border, Thick Bottom Border, Bottom Double Border, or another style.

To draw borders freehand, choose Draw Border from the same menu and click along gridlines. Choose More Borders to set the color and line style, including diagonal lines across a cell.

Add a Line to a Chart

  • Trendline: Click the chart, click the + (Chart Elements) button, and check Trendline.
  • Average or target line: Add a column with the average or target value, add it to the chart as a new series, and change that series to a line chart type. See how to add an average line in Excel.
  • Line chart: To show your whole data set as a line, select it and go to Insert > Charts > Line.

Tips for Adding Lines in Excel

  • Inserting rows inside a table or filtered list works best when the filter is cleared first, so you can see where the row lands.
  • Use borders, not shapes, for lines that should print with your data and move when you sort.
  • Use Ctrl + Z right away if you insert a row in the wrong place.
  • Freeze the header row with View > Freeze Panes so your headings stay visible as you add data.

Troubleshooting

Insert Is Grayed Out

The sheet may be protected, or you may be in cell edit mode. Press Esc to leave the cell, and check Review > Unprotect Sheet. Shared or co-authored workbooks may also limit inserting.

“Excel Can’t Insert New Cells Because It Would Push Non-Empty Cells Off the End”

There’s data or formatting in the last row of the sheet. Go to the bottom with Ctrl + Down Arrow, select the unused rows below your data, right-click, choose Delete, and save the workbook. Then try again.

Alt + Enter Doesn’t Make a New Line

You need to be editing the cell first. Double-click the cell or press F2, then press Alt + Enter. If the text still shows on one line, turn on Wrap Text and make the row taller.

My Drawn Line Isn’t Straight

Hold Shift while you drag. To fix an existing line, set its height to 0 in Shape Format > Size for a horizontal line.

Frequently Asked Questions

How do I add multiple lines at once?

Select the same number of rows as you want to insert, right-click, and choose Insert. To insert 10 rows, select 10 row numbers first.

Can I add a row using a shortcut?

Yes. Select the row with Shift + Space, then press Ctrl + Shift + +. On a Mac, select the row and press Command + Shift + =.

What if I insert a row by accident?

Press Ctrl + Z to undo it, or right-click the row number and choose Delete.

Do these steps work in all versions of Excel?

Yes. Inserting rows, Alt + Enter, shapes, and borders work in Excel for Microsoft 365, 2024, 2021, 2019, and older versions, as well as Excel for the web, though menus may look slightly different.

Can I insert a row in the middle of existing data?

Yes. Select the row below where you want the new line and insert. Excel shifts the data down and keeps formulas that reference the range up to date.

Related: how to remove lines in Excel.

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy