How to Add and Subtract Lines in Excel

How-to basics · Updated November 24, 2026

Adding or subtracting entire rows (lines) in Excel usually means inserting or deleting rows, but sometimes you need to add or subtract the values across rows. This guide covers both: inserting/deleting rows and using formulas to add or subtract values from a row. You’ll learn the fastest methods using keyboard shortcuts and the ribbon.

What You’ll Need

  • Microsoft Excel (Microsoft 365, Excel 2021, or any recent version) on Windows, Mac, or Excel for the web.
  • A worksheet with data you want to modify.
  • Basic familiarity with selecting cells and typing formulas.

Step-by-Step

Adding a New Row (Inserting a Line)

  1. Click on the row number (e.g., row 5) where you want the new row to appear. The new row will be inserted above the selected row.
  2. Right-click the selected row number and choose Insert. Alternatively, use the shortcut Ctrl+Shift+Plus (Windows) or Cmd+Shift+Plus (Mac). On Excel for the web, use the right-click menu.
  3. A new blank row appears. If you need multiple rows, select the same number of existing rows first (e.g., select 3 rows to insert 3), then insert.
  4. If you want to copy formatting from the row above, use the Format Painter (Home tab) after inserting, or insert using the Insert button on the Home tab > Cells group > Insert > Insert Sheet Rows.

Subtracting a Row (Deleting a Line)

  1. Click on the row number(s) you want to delete.
  2. Right-click and choose Delete. Or use the shortcut Ctrl+Minus (Windows) or Cmd+Minus (Mac). On Excel for the web, right-click and choose Delete.
  3. Confirm that you selected the correct rows—deleting removes the entire row and shifts all rows below up.

Adding Values Across a Row (Sum a Row)

To add up numbers in a single row (e.g., sales for each month), use the SUM function.

  1. Assume you have numbers in cells B2 through G2. Click on cell H2 where you want the total.
  2. Type =SUM(B2:G2) and press Enter. Excel adds all numbers in that range.
  3. To add only specific cells, use =SUM(B2,D2,F2) (adds B2, D2, and F2).
  4. For a quick total without typing, select the cells and look at the status bar (bottom right) for the sum. Or press Alt+Equals (Windows) or Cmd+Shift+T (Mac) after selecting the row of numbers to auto-insert a SUM formula.

Subtracting Values Across a Row

To subtract one cell from another in a row, use a simple formula.

  1. Suppose you have revenue in B2 and expenses in C2. Click on D2 for the result.
  2. Type =B2-C2 and press Enter. The result is revenue minus expenses.
  3. To subtract multiple cells, extend the formula: =B2-C2-D2 subtracts C2 and D2 from B2.
  4. For subtracting a constant, e.g., subtract 500 from B2: =B2-500.

Adding or Subtracting a Value to an Entire Row (Using Fill)

If you want to add or subtract the same number to every cell in a row, use Paste Special.

  1. Type the number you want to add or subtract in a blank cell (e.g., type 100 in J1).
  2. Copy that cell (Ctrl+C or Cmd+C).
  3. Select the row range you want to change (e.g., B2:G2).
  4. Right-click the selection, choose Paste Special (or on Home tab > Paste > Paste Special).
  5. Under Operation, choose Add or Subtract, then click OK. Excel adjusts each selected cell by that number.

Common Mistakes

  • Inserting a row but losing formulas: When you insert a row inside a range, Excel usually adjusts formulas, but if you insert a row at the bottom of a SUM range, the range may not extend automatically. Always check your formulas after inserting.
  • Deleting the wrong row: Deleting a row removes all data permanently (unless you undo immediately). Double-check the row numbers before pressing Delete.
  • Using SUM with text: If any cell in the range contains text, SUM ignores it, but if you use a manual formula like =B2+C2 and C2 is text, you’ll get a #VALUE! error.
  • Paste Special on merged cells: Paste Special with Add/Subtract may not work correctly on merged cells—unmerge first.

Tips

  • To quickly insert multiple rows, select the number of rows you want to add (e.g., select rows 5–7 to insert 3 rows above row 5), then right-click and Insert.
  • Use the Undo shortcut (Ctrl+Z or Cmd+Z) immediately if you make a mistake with insertion or deletion.
  • When using formulas, use absolute references (e.g., $B$2) if you plan to copy the formula across columns and want to keep a specific cell constant.
  • For large datasets, consider using an Excel Table (Ctrl+T) so that formulas automatically fill down when you add new rows.
  • To see the sum of a row quickly without a formula, select the cells and look at the status bar—it shows Sum, Average, and Count by default.

Troubleshooting

  • Insert option is grayed out: This happens if the worksheet is protected. Go to Review > Unprotect Sheet (enter password if needed).
  • Formulas return #VALUE! after adding a row: The new row may contain text or empty cells that break a manual addition. Check for non-numeric entries and adjust the formula range.
  • Paste Special doesn’t show Add/Subtract: Make sure you copied a numeric cell (not a formula that returns text) and that the target cells are not formatted as text. Select the target cells and change number format to General.
  • Row numbers disappear after deleting: That’s normal—Excel renumbers rows automatically. If you need to keep track of original row numbers, add a column with row numbers before deleting.
  • AutoSum (Alt+=) selects the wrong range: Click on the cell where you want the sum, then manually type the correct range in the formula bar, or select the range with your mouse while holding Ctrl.

Frequently Asked Questions

How do I add a line in Excel without messing up formulas?

Insert the row within the range that your formulas reference. Excel automatically adjusts most formulas when you insert rows inside the referenced area. For SUM ranges, if you insert a row at the bottom, extend the range manually (e.g., change =SUM(B2:B10) to =SUM(B2:B11)).

Can I subtract a row from another row in Excel?

Yes, use a formula like =A2-A3 to subtract the value in row 3 from row 2. To subtract entire rows element-wise, you’d need a formula in each column, or use array formulas (in Microsoft 365, you can use =A2:G2-A3:G3 which spills results).

What is the shortcut to insert a row in Excel?

On Windows, select a row and press Ctrl+Shift+Plus. On Mac, press Cmd+Shift+Plus. On Excel for the web, use the right-click menu—there is no keyboard shortcut for inserting rows in the web version.

How do I add a constant number to every cell in a row?

Use Paste Special: type the number in a cell, copy it, select the row range, right-click > Paste Special > Add, then OK. This adds the number to each selected cell.

Why does my SUM formula not include the new row I added?

If you inserted a row at the bottom of the range, the SUM range may not update automatically. Edit the formula to include the new row, or convert your data to a Table (Ctrl+T) so that ranges expand automatically.

Can I subtract a percentage from a row?

Yes. To subtract 10% from each cell, use Paste Special with Multiply by 0.9 (since subtracting 10% means keeping 90%). Or use a formula like =B2*0.9 in a new cell.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.