跳到主要內容

在Excel中插入行時如何更新公式? 

doc更新公式插入行1

例如,我在單元格D2中有一個公式= sum(D7:D8),現在,當我在第二行插入一行並輸入新數字時,該公式將自動更改為= sum(D3:D8),單元格D2,如下圖所示。 在這種情況下,每次插入行時,都需要在公式中更改單元格引用。 在Excel中插入行時,如何總是對從單元格D2開始的數字求和?

使用公式自動插入行時更新公式


箭頭藍色右氣泡 使用公式自動插入行時更新公式

以下簡單公式可以幫助您自動更新公式,而無需在插入新行時手動更改單元格引用,請執行以下操作:

1。 輸入以下公式: = SUM(INDIRECT(“ D2:D”&ROW()-1)) (D2 是要求和的列表中的第一個單元格),在要對數字列表求和的單元格的末尾,然後按 Enter 鍵。

2。 現在,當您在數字列表之間的任意位置插入行時,公式將自動更新,請參見屏幕截圖:

doc更新公式插入行2

保養竅門:僅當將公式放在數據列表的末尾時,該公式才能正常工作。

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thank you very much.
This comment was minimized by the moderator on the site
Hello,
You are welcome. Glad it helps. Any questions, please feel free to contact us. Have a great day.
Sincerely,
Mandy
This comment was minimized by the moderator on the site
Please help me with Excel formula that update automatically without changing the cell reference manually when inserting new row at the bottom only. But not when inserting new row at the top. Thanks
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
you can use a different formula SUM(D$2:D12) as you insert a new row it continues to sum it up
This comment was minimized by the moderator on the site
I found that this only works if there is more than 1 row to total at the start.  Any ideas how you would do this for totalling 1 row to start and then adding in rows as you work on the spreadsheet?

This comment was minimized by the moderator on the site
You are the best! It works!
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
Hi Rayan!

Please if you see this let me know! You are the only one I found online who brought this issue up. However, my data is table not normal range. The automatic filling of the formula really helps and copy/pasting is a hassle. Anyway, when insert a row, the formulas update for all columns except one! In the row and the cell, instead of the formula shifting from =if(C24 = C25) to =if(C25 = C26), it goes to =if(C24 = C26) although C24 is not fixed!!! I've really tried all possible solutions...................
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations