+ Reply to Thread
Results 1 to 6 of 6

Repeat the same operation at another (over and over again)

  1. #1
    Registered User
    Join Date
    02-08-2016
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    3

    Repeat the same operation at another (over and over again)

    I have over 10,000 rows and 3 columns. And I want totals at certain intervals (say after every 110th row), then a “horizontal” total of the columns at that stop. These results could be placed in new columns beside, “pivot style”.
    This operation must be repeated throughout all the 10,000 records (rows), hence about 90 times.
    The interval (say 110 rows) will be the same.
    Is there any formula without going VBA?

    I attach a small sample to describe the idea. Yellow is where the formulas are made, blue is where it should be repeated (here only after 8 rows for simplicity)
    Thanks for ideas,
    Ingemar
    ingemar@saevfors.se
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Repeat the same operation at another (over and over again)

    I'm not sure why your total in column F is adding columns C to E - doesn't that mean that you are double-counting?

    I presume your data is continuous, so it might be better to have a separate table of totals, so you can put this formula in G4:

    =SUM(INDEX(C:C,(ROWS($1:1)-1)*9+4):INDEX(C:C,ROWS($1:1)*9+3))

    Copy this into H4:I4 and put your SUM formula in J4. Then you can copy this down as far as you need to.

    Note that in your example you are summing over 9 rows (hence the 9 in red in the formula - you will probably want to make this 110 in your real file). Also, your data starts on row 4 (hence the 4 in blue in the formula, and the 3 in purple - this should be 1 less than the start row). Also, you may need to use a semicolon ( ; ) instead of the commas ( , ) in the formula.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    02-08-2016
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    3

    Re: Repeat the same operation at another row (over and over again)

    Pete,
    Thanks a million for suggesting a solution to this number crunching.
    I tried your formula on the data but there were some differences, see colored areas.
    I’m not that comfortable with the INDEX syntax and need to study it more. Did you use the Array form? Is this use of brackets not that important?
    Thanks for helping,
    Ingemar
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Repeat the same operation at another row (over and over again)

    You forgot to adjust the 4 and the 3, as your data starts in row 3 - you can change the formula in L2 to this:

    =SUM(INDEX(C:C,(ROWS($1:1)-1)*110+3):INDEX(C:C,ROWS($1:1)*110+2))

    then copy across and down.

    If you are not happy using INDEX (which returns a cell reference in the above formula), then you can use this alternative (e.g. in cell O2):

    =SUMIFS(C:C,$A:$A,RIGHT($K3,4))

    (use semicolons instead of commas). You can copy this into P2:Q2, then copy the formulae down - it relies on you having the word "year " in front of the actual year in cell K3 and below.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    02-08-2016
    Location
    Stockholm
    MS-Off Ver
    2013
    Posts
    3

    Re: Repeat the same operation at another (over and over again)

    Thanks Pete,
    It works perfectly now.
    Can you recommend any EXCEL FORMULA literature to get more insight in the syntax writing?
    Ingemar

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Repeat the same operation at another (over and over again)

    wrong post
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Count Instances of Repeat and Non-Repeat Dates
    By mgs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-08-2015, 09:54 PM
  2. Replies: 4
    Last Post: 03-08-2014, 08:01 AM
  3. Time difference based on day of operation and time of operation
    By Guest79 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-18-2013, 04:28 AM
  4. Replies: 0
    Last Post: 10-11-2012, 11:30 AM
  5. Replies: 3
    Last Post: 02-20-2012, 10:34 AM
  6. what does $ operation mean
    By JO in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-15-2005, 08:45 PM
  7. Replies: 2
    Last Post: 08-24-2005, 12:05 PM

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