excel公式 - 根据范围自动更新SUM公式,当行添加/删除时 [英] excel formulas - auto update SUM formula based on range, when rows added/deleted

查看:589
本文介绍了excel公式 - 根据范围自动更新SUM公式,当行添加/删除时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有SUM公式的工作簿(在E15中),它将在下面的4个单元格(E16:E19)中输入的值相加。在下面的列表(E20以上)是另一个SUM公式,将下一个4个单元格(E21:E24)相加。在整个工作簿中重复计算一系列项目的子总计,但是,我将需要添加和删除行,因此要添加到每个公式的单元格总数不会始终为4。



如果添加或删除新行时,如何确保SUM公式自动更新以包含下面输入的所有值?公式搜索下面的单元格,到达下一个公式时停止?



EG:
E15中的公式= SUM(E16:E19)
然后我可能想在E16中添加三行,删除中间的某个位置。
E15中的公式现在读取= SUM(E19:E21),但是我需要它读= SUM(E16:E21)。



这需要自动发生,所以用户不必每次手动修改SUM范围。



任何帮助非常感谢。

解决方案

如果您担心用户修改工作簿,您仍然可以总结范围,但保护工作表。这很容易,听起来像你所需要的。



我不知道你的Excel版本,但你应该可以在审阅选项卡下找到它。祝你好运。


I have a workbook with a SUM formula (in E15), which adds together the values entered in the 4 cells below (E16:E19). Below that list (E20 onwards) is another SUM formula that adds together the next 4 cells (E21:E24). This repeats throughout the workbook to calculate sub-totals of a range of items, however, I will need to add and delete rows so the total number of cells to be added to each formula will not always be 4.

How can I ensure the SUM formula updates itself to include all of the values entered below when a new row is added or one deleted? Could the formula search cells below and stop when it reaches the next formula?

EG: Formula in E15 =SUM(E16:E19) Then I may want to add three rows at E16, delete one somewhere in the middle.. Formula in E15 now reads =SUM(E19:E21), but I need it to read =SUM(E16:E21).

This needs to happen automatically so users don't have to manually amend the SUM range every time.

Any help much appreciated.

解决方案

If you are worried about users modifying the workbook, you can still sum the range but protect the worksheet. It's a lot easier and sounds like what you need.

I don't know your version of Excel, but you should be able to find it under the Review tab. Good luck.

这篇关于excel公式 - 根据范围自动更新SUM公式,当行添加/删除时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆