Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
199 views
in Technique[技术] by (71.8m points)

google sheets - Is there a function to sum every group of 7 cells?

For example, I have a column where I want each cell to be sum of 7 cells. So the first cell I want to Sum A1:A7, next cell I sum A8:A14 and next cell A15:A21 and so on. How can I do that without having to type in Axx:Axx for every cell?

question from:https://stackoverflow.com/questions/65621373/is-there-a-function-to-sum-every-group-of-7-cells

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

use:

=INDEX(QUERY({ROUNDUP(SEQUENCE(ROWS(A:A), 1)/7), A:A}, 
 "select sum(Col2) 
  where Col2 is not null 
  group by Col1 
  label sum(Col2)''"))

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...