如何自动总和到没有找到数字?

发布于 2025-02-12 09:24:56 字数 309 浏览 2 评论 0原文

我想制作一个单元格自动计算上述所有数字,直到没有数字为止(在我的示例中,直到符合合并的单元格“文本行”)。

为了更好地理解,有屏幕截图: https://prnt.sc/7p8fppagzt3ep

到目前为止计算直到给定电池E2: = sum(e2:index(e:e; row() - 1)) 问题是我必须在公式中编写E2。有什么办法可以在E2上制作公式自动停止?

I want to make a cell auto calculate all numbers above until there is no number (in my example until it meets merged cell "TEXT ROW").

For better understanding there is screenshot: https://prnt.sc/7p8fPagzt3Ep

So far I've made cell E8 to count up until given cell E2: =SUM(E2:INDEX(E:E;ROW()-1))
The problem is that I have to write E2 in formula. Is there any way to make formula auto stop at E2?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓬勃野心 2025-02-19 09:24:56

此公式应为您工作:

= sum(间接(“ e”& row() - counta(a2:a)&“:e”& row() - 1))

by使用row() - counta(a2:a),我正在采用公式所在的行,并减去从A2开始的数据条目的数量(即忽略AT的合并单元格顶部)。这将使您成为首发行,2

。 /eenl.png“ alt =” ex“​​>

如果您对此有任何问题,请告诉我。

This formula should work for you:

=SUM(indirect("E"&row()-counta(A2:A)&":E"&ROW()-1))

By using row()-counta(A2:A), I am taking the row that the formula is in, and subtracting the number of data entries starting at A2 (ie ignoring the merged cell at the top). This will get you the starting row, 2.

ex

Please let me know if you have any issues with this.

咋地 2025-02-19 09:24:56

尝试:

=SUM(INDIRECT(ADDRESS(COLUMN(), 2, 4)&":"&ADDRESS(COLUMN(), ROW()-1, 4)))

或:

=SUM(INDIRECT("E2:E"&ROW()-1))

try:

=SUM(INDIRECT(ADDRESS(COLUMN(), 2, 4)&":"&ADDRESS(COLUMN(), ROW()-1, 4)))

or:

=SUM(INDIRECT("E2:E"&ROW()-1))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文