[英]Google Sheets - Sum of every nth row displayed in the adjacent column
I am making a spreadsheet to manage my spending on food at work. 我正在制作一个电子表格来管理我在工作中的食品支出。 At the moment, I am getting the total of every week in the last column, but I would also like to total the spending for the month, something like this, but neater and so I can just drag down the rows instead of manually type it every 4 rows.
目前,我在上一列中获得了每周的总计,但我也想总计一个月的支出, 类似这样,但是比较整洁,因此我可以向下拖动行而不是手动键入每4行。
Thanks for the help! 谢谢您的帮助!
This is easy to manage - its all a question of which cell(s) you choose to select and drag. 这很容易管理-这就是您选择选择并拖动哪个单元格的问题。 Don't just click and drag the cell with the formula;
不要只单击并拖动带有公式的单元格; select the three blank cells as well - then drag four cells down the column.
同时选择三个空白单元格-然后将四个单元格向下拖动到列中。 This will give a formula in every fourth row.
这将在每第四行给出一个公式。
The SUM formula calculates the costs for the first 4 week period. SUM公式计算前4周的费用。 All Good.
都好。
Now, if you select this cell and simply drag it down, then every cell will get a copy of that formula. 现在,如果选择此单元格并简单地将其向下拖动,则每个单元格都将获得该公式的副本。 not good.
不好。
But... if you select the first four rows of the first month ( including the blank weeks 1, 2 and 3 ). 但是...如果您选择第一个月的前四行( 包括空白的第1、2和3周 )。 Like this
像这样
and then drag all four cells down the column, then only every fourth cell will have a formula and the preceding three cells will be blank. 然后将所有四个单元格向下拖动到该列中,那么只有每四个单元格都有一个公式,而前面的三个单元格将为空白。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.