Sum vertically until empty cell on Google Sheets

筅森魡賤 提交于 2019-12-20 07:32:12

问题


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),""))))))

This is the spreadsheet in case you need it.

Thanks in advance for all the help.


回答1:


I would just make a small adjustment to your formula:

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

so the first total is 11 instead of 9.



来源:https://stackoverflow.com/questions/53355450/sum-vertically-until-empty-cell-on-google-sheets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!