Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to update formula when inserting rows in Excel? 

doc update formula inserting rows 1

For example, I have a formula =sum(D2:D7) in cell D8, now, when I insert a row at the second row and enter new number, the formula will be changed to =sum(D3:D8) automatically which excludes the cell D2 as following screenshot shown. In this case, I need to change the cell reference in the formula each time when I insert rows. How could I always sum the numbers start from cell D2 when inserting rows in Excel?

Update formula when inserting rows automatically with formula

arrow blue right bubble Update formula when inserting rows automatically with formula

The following simple formula can help you to update the formula automatically without changing the cell reference manually when inserting new rows, please do as this:

1. Enter this formula: =SUM(INDIRECT("D2:D"&ROW()-1)) (D2 is the first cell in the list that you want to sum) at the end of the cells that you want to sum the number list, and press Enter key.

2. And now, when you insert rows anywhere between the number list, the formula will be updated automatically, see screenshot:

doc update formula inserting rows 2

Tips: The formula only work correctly when you place it at the end of the data list.

Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 80% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Katie · 9 months ago
    This is really helpful ... except it does not update the row/column when copying and pasting this formula, so if I have a bunch of them, I have to update the column/row manually (like in the example, if I copy this to the adjacent column E, it still has D ...)

    Unless someone knows a workaround to that problem, too?
    • To post as a guest, your comment is unpublished.
      Beatrice · 6 months ago
      you can use a different formula SUM(D$2:D12) as you insert a new row it continues to sum it up
  • To post as a guest, your comment is unpublished.
    Rayan · 2 years ago
    I have a simple cell reference in one of my cells down a column e.g.:"=H6", “=H7” etc.

    When I insert a row in Excel and copy formulas from row above, the cell reference in 'Opening Stock' does not update automatically in the row after the new blank row (should be equal to previous row balance, which is 60 now). But it updates correctly in all other rows below. Is there a way to force Excel to update cell reference to the cell in blank row above?

    Have searched the web, but did not get any satisfactory answer. I do not want to convert the data to a table, since it messes up the filters and formatting. Macros don't solve the problem either - they don't copy to the row following the blank one.

    Can anyone please help?