+ Reply to Thread
Results 1 to 6 of 6

Drag a sum of 7 days across so each new cell is the next week

  1. #1
    Registered User
    Join Date
    08-28-2014
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    6

    Drag a sum of 7 days across so each new cell is the next week

    Hey,

    I dont know the best way to describe this. Basically i have data that has spend per day across the whole of the year. Then in another worksheet i want that data by week (starting sunday). So if the first cell in data by week is "='Data By Day'!C4:I4", i want the next cell to be "='Data By Day'!J4:P4" then "='Data By Day'!Q4:W4". Instead when i drag it across it goes "='Data By Day'!C4:I4" then the next cell is "='Data By Day'!D4:J4".

    Is there a way i can drag a large amount of data across by the desired amount of cells each time rather than moving across in a relative fashion

    Thanks in advance

  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,959

    Re: Drag a sum of 7 days across so each new cell is the next week

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Drag a sum of 7 days across so each new cell is the next week

    Hi,

    If you're wanting the sum of C4:I4, J4:P4..etc, then the following in column A copied across

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However you may wish to rethink your data layout so that you could analyse it with a Pivot Table and generate your totals by week.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    08-28-2014
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    6

    Re: Drag a sum of 7 days across so each new cell is the next week

    Thanks heaps for your help, That formula is perfect but is there a way to change it so i can start in a different different column, so im starting in column C rather than A due to row headings?

    I use pivots for this all the time and it is much easier. We just have a new client whose data is updated each week as things that were booked become applied so i have to overlay the data each week.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Drag a sum of 7 days across so each new cell is the next week

    you need a different way for the start point column() just returns the col ref the formula is in
    will be ok if placed in col a as when filled across it gives 1 then 2 then 3 but starting in col b would give 2,3,4
    there are various methods to do that
    columns($a:a) would give 1,2,3,4 as it counts the cols between the 2 references
    so would columns($c:c) or columns($z:z)
    change the formula to
    =SUM(OFFSET('data by day'!$C4,0,COLUMNS($A:A)*7-7,1,7)) you can put it in any cell
    Last edited by martindwilson; 12-28-2014 at 08:50 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    08-28-2014
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    6

    Re: Drag a sum of 7 days across so each new cell is the next week

    Thanks mate, that will be very helpful

+ 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] Cell colors representing 7 different days of the week
    By damianberry in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-21-2013, 10:44 AM
  2. Conditional formatting cell colors for the 7 days of the week
    By damianberry in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-19-2013, 02:51 AM
  3. Week & days in a cell
    By Sajj55 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-01-2013, 10:06 AM
  4. Replies: 3
    Last Post: 08-13-2012, 01:03 AM
  5. Days of the "Week" Drag
    By jayclinton in forum Excel General
    Replies: 2
    Last Post: 11-30-2010, 11:06 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