sum every 6th line from another column

MAP77

Board Regular
Joined
Sep 19, 2018
Messages
60
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I need to convert my 5 min interval data into 30 mins by adding up all the 5 min values in the 30 min time slot.
Eg. The 6 highlighted values in column D need to sum in column J. Note: I will add up the values for column D2 to D6 myself as its not a complete 30 mins.
Capture.PNG
 
Thanks for the profile update - & the XL2BB sample data! (y)

One way would be to slightly modify your F3 formula to the following and copy down

=SUM(INDEX(G$3:G$52418,SEQUENCE(6,,ROWS(F$3:F3)*6-5)))
Thanks Peter,
Can you help me understand the logic behind the 6-5?
Regards,
Anita
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Can you help me understand the logic behind the 6-5?
Sure. The SEQUENCE function is returning 6 numbers since it is 6 cells that you want to sum.
ROWS(F$3:F3)*6-5 is the 3rd argument of SEQUENCE and that is the starting value for the 6 numbers

For the formula in F3 ROWS(F$3:F3)*6-5 is exactly that so it gives 1*6-5 = 1 so the 6 numbers are 1,2,3,4,5,6 which sums the first 6 cells in the range G$3:G$52418
For the formula in F4 it becomes ROWS(F$3:F4)*6-5 = 2*6-5 = 7 so the 6 numbers are 7,8,9,10,11,12 thereby summing the next 6 cells
In F5: ROWS(F$3:F5)*6-5 = 3*6-5 = 13 -> 13,14,15,16,17,18
etc
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,580
Members
449,174
Latest member
chandan4057

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top