+ Reply to Thread
Results 1 to 4 of 4

Adding several rows of data to create smaller data set

  1. #1
    Registered User
    Join Date
    10-21-2012
    Location
    nyc, ny
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Adding several rows of data to create smaller data set

    My title doesn't make as much sense as I could write it currently.

    I have a spreadsheet which has approx 800 lines.
    That is my main spreadsheet, the values I have in that spreadsheet is the amount of energy used per hour.

    In this other spreadsheet I have, it has approx 1k lines, it has the amount of energy provided per 10 minutes (so the data was taken in 10 min intervals instead of hourly intervals).
    Since I know that there are 6 "10 minutes" in an hour, I wanted to be able to take 6 rows each (all rows in the same column) and then sum them to convert the 10 minute interval to hour. I've done a few by hand, which isn't ideal for the number of lines I have, I also tried playing around with Group and SubTotal in the Data tab. What should I do to make this way more efficient?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Adding several rows of data to create smaller data set

    this will help you a bit. my formula assumes that your data starts in A1. copy this down, then value the answers, filter on "" and delete those rows (if you dont want them). you will be left with the remaining 6th rows

    =IF(MOD(ROW(),6)=0,SUM(A5:A10),"")
    if your data does not start in A1 (most likely doesnt), use this instead and change the -4 to suite how many rows below 1 your data starts

    =IF(MOD(ROW()-4,6)=0,SUM(A5:A10),"")

    let me know how you make out please?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-21-2012
    Location
    nyc, ny
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Adding several rows of data to create smaller data set

    Hello,

    It seemed to have worked (comparing it against some of the hand calculations I did), I'm pretty sure it did, thank you!

    This is what I had to do though: =IF(MOD(ROW()-2,6)=0,SUM(A3:A8),"") (okay, my actual data is col E, but it doesn't matter). My data starts 2 rows down, it made sense to subtract -2, I got that, when you told me and that the modulus function looks to see if there are any remainders between the row numbers when divided... understood, I guess because my actual data started on the 3rd row and I wanted data up to the 8th row thus making 6 sets of numbers, I had to change it from A5:A10 to 3-8 but still consider the if statement to look at where my actual data starts also.

    Now I have a whole bunch of spaces in between those numbers being summed up, what would remove the 5 line spacing?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Adding several rows of data to create smaller data set

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1