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
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try:

=SUM(INDEX(D:D,6*ROWS($A$1:A1)+1):INDEX(D:D,6*ROWS($A$1:A1)+6))
 
Upvote 0
Provided you are not going to have tens of thousands of these formulas, you could also use the volatile function OFFSET as shown in column J.
Or if you have Excel 365 with the SEQUENCE function you could try the column K (non-volatile) formula.

BTW, I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version.

20 04 02.xlsm
DEFGHIJK
1
28
372727
443131
543838
683737
772929
851414
95
102
112
126
133
146
156
165
179
182
192
209
218
224
237
248
Sum Groups of 6
Cell Formulas
RangeFormula
J3:J8J3=SUM(OFFSET(D$1,ROWS(J$3:J3)*6,,6))
K3:K8K3=SUM(INDEX(D$2:D$42,SEQUENCE(6,,ROWS(K$3:K3)*6)))
 
Upvote 0
Provided you are not going to have tens of thousands of these formulas, you could also use the volatile function OFFSET as shown in column J.
Or if you have Excel 365 with the SEQUENCE function you could try the column K (non-volatile) formula.

BTW, I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version.

Thanks Peter! Your sequence formula did the trick :)
 
Last edited by a moderator:
Upvote 0
Thanks Peter! Your sequence formula did the trick :)
You're welcome.

Why not update your profile as suggested and then for the next question helpers will know that you have Excel 365? ;)
 
Upvote 0
Hi Peter,
So I have another set of data that I'm trying to sum the 6 lines for but this time I want to start from the top row and have the sequence sum every 6 variable. I've tried using the formula you gave me last time but cant work out what needs to change to make it work.

So F3 = Sum of G3:G8
F4 = Sum of G9:G14
etc.


1594018757705.png
 
Last edited by a moderator:
Upvote 0
I have suggested a couple of times that you update your profile so that we know what version of Excel you have and therefore what functions might be best for your circumstances but so far no action. :(
I would like to know that before considering suggestions this time.

Also, could you provide the sample data with XL2BB to make it easier for helpers by not having to manually type out sample data to test with?
 
Upvote 0
I have suggested a couple of times that you update your profile so that we know what version of Excel you have and therefore what functions might be best for your circumstances but so far no action. :(
I would like to know that before considering suggestions this time.

Also, could you provide the sample data with XL2BB to make it easier for helpers by not having to manually type out sample data to test with?

Sorry Peter. I had thought I updated this in my preferences. I have Microsoft 365.
Sum every 6th row sample data.xlsx
ACFG
1Date and timeDate and timeConsumptionConsumption
2[dd.MM.yyyy HH:mm]30 minkWhrs (30 min)kWhrs (5 mins)
301.01.2020 00:0001/01/2020 00:000.8930.022
401.01.2020 00:0501/01/2020 00:300.1020.201
501.01.2020 00:1001/01/2020 01:000.1620.322
601.01.2020 00:1501/01/2020 01:300.318
701.01.2020 00:2001/01/2020 02:000.01
801.01.2020 00:2501/01/2020 02:300.02
901.01.2020 00:3001/01/2020 03:000.02
1001.01.2020 00:3501/01/2020 03:300.02
1101.01.2020 00:4001/01/2020 04:000.022
1201.01.2020 00:4501/01/2020 04:300.018
1301.01.2020 00:5001/01/2020 05:000.01
1401.01.2020 00:5501/01/2020 05:300.012
1501.01.2020 01:0001/01/2020 06:000.013
1601.01.2020 01:0501/01/2020 06:300.019
1701.01.2020 01:1001/01/2020 07:000.022
1801.01.2020 01:1501/01/2020 07:300.04
1901.01.2020 01:2001/01/2020 08:000.041
2001.01.2020 01:2501/01/2020 08:300.027
2101.01.2020 01:3001/01/2020 09:000.013
2201.01.2020 01:3501/01/2020 09:300.023
2301.01.2020 01:4001/01/2020 10:000.021
2401.01.2020 01:4501/01/2020 10:300.02
2501.01.2020 01:5001/01/2020 11:000.023
2601.01.2020 01:5501/01/2020 11:300.02
2701.01.2020 02:0001/01/2020 12:000.021
2801.01.2020 02:0501/01/2020 12:300.022
2901.01.2020 02:1001/01/2020 13:000.02
3001.01.2020 02:1501/01/2020 13:300.012
3101.01.2020 02:2001/01/2020 14:000.011
3201.01.2020 02:2501/01/2020 14:300.009
3301.01.2020 02:3001/01/2020 15:000.021
sample data
Cell Formulas
RangeFormula
C3:C33C3=TEXT(B3,"dd/mm/yyyy")&" "&TEXT(B3,"hh:mm")
F3F3=SUM(INDEX(G$3:G$52418,SEQUENCE(6,,ROWS(F$3:F3))))
F4F4=SUM(G9:G14)
F5F5=SUM(G15:G20)
G3:G33G3=E3/1000
 
Upvote 0
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)))
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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