We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Excel Pivot Table
Options

sandy700
Posts: 180 Forumite

in Techie Stuff

How do I sum every 5 rows without copy and pasting 90 times? the spreadsheet is 90 days.
I missed the column headers but the columns are A to G
Thanks
0
Comments
-
and the sums are in column H =sum (G7:G4)0
-
Add another column called 'Row loop' or something like that, then =MOD(ROW(A1),5) and filling down will put 1,2,3,4,0,1,2,3,4,0,1 ... and so on down the column.So in your pivot table filter or pivot on Row loop = 0.0
-
Twas a simple question but open to interpretation/confusion as to what you really want to do!Is it get a total (sum) every five rows of the readings list....Or is it sum every five rows of the pivot table, i.e. sum of daily readings?...or something else?The answer depends upon the clarification such as above method (or other methods to do the same) or setting the pivot to give data summed by day....0
-
I want the sum of the values between 08:00 and 11:00 as my table, where I have done the first 3 sums.
It does not matter if it is done in the pivot table or in column B as long as I can show how much gas I have used every day between 08:00 and 11:00 hours.
As I said the only way I can figure out how to do it is to sum(G7:G4) then copy paste in column H every five rows for 90 times.0 -
Using MOD is a clever way, but if you want something simpler
<blank>
<blank>
<blank>
<blank>
=sum(of cells)
Select the cells in the block above then drag down the whole column so the pattern will repeat itself.0 -
if I enter
=MOD(ROW(A1),5)
in the column I have created (column H) it does not give any result, the formula just sits in the cell
0 -
No, you create the row loop column in your source data, column C, not in the pivot table.
0 -
I understand now thanks.Many ways to do it;one approach would to put a formula in column C (the next available to the consumption column) to test the time of day meeting your spec under heading "TOD" or similar so you can add it into the pivot table and use it as a filter.Such a formula in column c could be =AND( HOUR(A2) >= 8, HOUR(A2) <12) ...and copied all the way down of course.....That would return True or False and including that column heading in the pivot table then is straight forward to sum days were that time period is True.One could also use other formulae for other time periods if so desired combined with a lookup table for flexibility but that is beyond your question.
0
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.9K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.9K Work, Benefits & Business
- 598.7K Mortgages, Homes & Bills
- 176.9K Life & Family
- 257.1K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards