垂直求和,直到Google表格上的空白单元格 [英] Sum vertically until empty cell on Google Sheets

查看:101
本文介绍了垂直求和,直到Google表格上的空白单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是场景.我需要获取值的总和,直到达到空白单元格为止.之后,它应该重新开始计算空白单元格之后的总和.我需要分别添加每道菜每种成分的脂肪和碳水化合物.

This is the scenario. I need to get the sum of the values until it reaches a blank cell. After that it should start again calculating the sum after the blank cell. I need to add the fat and carbs of every ingredient of each dish individually.

这是预期的结果.数百种菜肴中的每一种.在这种情况下,我手动输入了数据:

This is the expected result. That for each of hundreds of dishes. In this case I entered the data manually:

我尝试过此操作,但正在添加列中的所有数据:

I tried with this but is adding all of the data from the column:

IF(SUM(C3:C)="","",SUM(C3:C)))

我也尝试过使用此公式,但是不起作用:

I also tried with this formula but is not working:

IF(C3:C="","",SUM(INDIRECT(ADDRESS(ROW(C3:C),COLUMN(C3:C400))&":"&"C"&MIN(ARRAYFORMULA(IF(C3:C400="",ROW(C3:C400),""))))))

这是电子表格,如果您需要它.

预先感谢所有帮助.

推荐答案

我只会对您的公式进行一些小的调整:

I would just make a small adjustment to your formula:

IF(C2="",SUM(C3:INDEX(C3:C,MATCH(TRUE,(C3:C=""),0))),"")

所以第一个总数是11而不是9.

so the first total is 11 instead of 9.

这篇关于垂直求和,直到Google表格上的空白单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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