简体   繁体   中英

How to reset/slightly change a formula in Excel after n number of rows

I have a column in Excel that needs to take the continuous sum of another column for 8 rows and then start again with a new continuous sum for the next 8 rows. In other words, my current formula is SUM(A$1:A1) which is then pasted down until SUM(A$1:A9), but after this I need it to turn into SUM(A$10:10) and go until SUM(A$10:18) and so on. Any ideas on how to do so other than manually?

Use INDEX and some math:

=SUM(INDEX(A:A,(INT((ROW(1:1)-1)/9)*9 +1)):A1)

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM