+ Reply to Thread
Results 1 to 7 of 7

Drag formula 1 cell to the right but have the range of the sum move 3

  1. #1
    Registered User
    Join Date
    03-04-2022
    Location
    Utrecht
    MS-Off Ver
    365
    Posts
    3

    Drag formula 1 cell to the right but have the range of the sum move 3

    Hi all,

    I have data in E4 to DA4. In E11 I have the formula =sum(E4:G4). When I drag the formula to the one cell to the right I want the range if the sum to skip to H4:J4. How do I do this? Thank you so much in advance.

    Kind regards,

    Martin

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

    Re: Drag formula 1 cell to the right but have the range of the sum move 3

    You can use this formula in E11:

    =SUM(INDEX($E$4:$Z$4,(COLUMNS($E:E)-1)*3+1):INDEX($E$4:$Z$4,COLUMNS($E:E)*3))

    then copy across as required. You may need to use semicolons ( ; ) instead of commas ( , ) in the formula, depending on your regional settings.

    Hope this helps.

    Pete

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Drag formula 1 cell to the right but have the range of the sum move 3

    Or even the formula you have already been given
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-04-2022
    Location
    Utrecht
    MS-Off Ver
    365
    Posts
    3

    Re: Drag formula 1 cell to the right but have the range of the sum move 3

    Hi Pete,

    You're a hero.

    I had to modify it a bit but it work like a charm: =SUM(INDEX($E$4:$DB$4,(COLUMNS($E:E)-1)*3+1):INDEX($E$4:$DB$4,COLUMNS($E:E)*3)).

    Could you maybe explain why this works the way it does?

    Thank you so much again.

  5. #5
    Registered User
    Join Date
    03-04-2022
    Location
    Utrecht
    MS-Off Ver
    365
    Posts
    3

    Re: Drag formula 1 cell to the right but have the range of the sum move 3

    Yeah I couldnt get this work for some reason and didnt remember where i post the question hence the report. My bad.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Drag formula 1 cell to the right but have the range of the sum move 3

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new here, I will do it for you this time: https://www.mrexcel.com/board/thread...lumns.1198101/)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: Drag formula 1 cell to the right but have the range of the sum move 3

    Quote Originally Posted by MWDB View Post
    ... Could you maybe explain why this works the way it does? ....
    The COLUMNS function returns the number of columns in the range. Initially the range is $E:E (note that the first is anchored to column E), so it returns 1, but when it is copied across the range changes to $E:F (returning 2), then to $E:G (returning 3), and so on. In the first INDEX the number returned by the COLUMNS function has 1 subtracted and it then multiplied by 3, and then has +1 added back in, so this gives rise to a series of numbers 1, 4, 7, etc. In the second INDEX the number returned by the COLUMNS function is just multiplied by 3, thus giving rise to the numbers 3, 6, 9, and so on.

    The INDEX function returns a cell or range reference, so in this instance of the formula that reference would be E4:G4, and in the next cell it will be H4:J4, then K4:M4 and so on, and the SUM function then adds those 3 cells together.

    Hope this helps.

    Pete



    P.S. If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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] Drag Formula through Data Range
    By jharvey87 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-29-2021, 12:55 PM
  2. Replies: 1
    Last Post: 06-30-2016, 12:36 PM
  3. Drag cell formula down as far as the data range goes with VBA
    By mike_980 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2014, 06:02 AM
  4. VBA Macro to drag a formula from [Cell] to [Cell Range]
    By levitt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-06-2014, 02:44 AM
  5. [SOLVED] Drag down range formula (skipping one row)
    By thaphthia in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-08-2013, 12:52 PM
  6. Drag and copy cell range
    By bsmarks in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-26-2010, 01:53 PM
  7. range stays the same when i drag the formula!!
    By Jfin in forum Excel General
    Replies: 3
    Last Post: 07-30-2008, 03:21 AM

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