+ Reply to Thread
Results 1 to 11 of 11

Sum every nth column with moving date range

  1. #1
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Sum every nth column with moving date range

    Hi Everyone,

    I would like to nth column with a moving date range
    Please see attached

    Any help greatly appreciated

    Thanks

    Kevin
    Attached Files Attached Files

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Sum every nth column with moving date range

    Everu 1st 14 500
    Everu 2nd 14 700
    Everu 3rd 14 900

    Everu 1st 21 1200
    Everu 2nd 21 1500
    Everu 3rd 21 1800

    how it comes, what is the logic for this
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Sum every nth column with moving date range

    Hi Siva,

    Every date has 3 columns, it is the sum of every 1st column within a date range and every 2nd etc.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Sum every nth column with moving date range

    d14=IF($B14="","",SUMPRODUCT(($C$9:INDEX($C$9:$AC$9,COUNTIF($B$14:$B14,$B14)*3))*($C$6:INDEX($C$6:$AC$6,COUNTIF($B$14:$B14,$B14)*3)=MOD(ROWS(E$14:E14),4))))
    try this and copy towards down

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Sum every nth column with moving date range

    or
    B14=LOOKUP(MOD(ROWS(B$14:B14)-1,4)+1,{1,2,3,4},{"Everu 1st","Everu 2nd","Everu 3rd",""})
    C14=IF(B14="","",D$2*CEILING(ROWS(B$14:B14),4)/4)
    D14=IF($B14="","",INDEX($C$9:$AC$9,COUNT($C$14:$C14))+IF(ROWS(D14:D14)<4,OFFSET(D14,-4,)))
    Try this and copy towards down

  6. #6
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Sum every nth column with moving date range

    Hi Siva,

    Thank you, it works but not the way i would like it to.

    When I adjust the date range by changing D2 I would like to see my expected results in B27:D27, so B27 would display the sum of all the 1st cells within the date range B28 the 2nd and B29 the 3rd

    sorry if i wasn't clear in post 1

    Thanks for looking

    Kevin

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Sum every nth column with moving date range

    Please reattach file with one example with expected result

  8. #8
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Sum every nth column with moving date range

    I have attached the file showing results for 21 day date range, if the range were 7 days (adjusted in D2) the results would be displayed within the same cells but different values as show on sheet

    Thanks
    Attached Files Attached Files

  9. #9
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: Sum every nth column with moving date range

    Hi,

    In B27 put this formula:

    =SUMPRODUCT(($C$6:$AC$6=COLUMN()-1)*($C$8:$AC$8>=$C$2)*($C$8:$AC$8<$E$2)*$C$9:$AC$9)

    then drag to right.

  10. #10
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Sum every nth column with moving date range

    B27=SUMIFS($C$9:$AC$9,$C$8:$AC$8,">="&$C$2,$C$8:$AC$8,"<="&$E$2-1,$C$6:$AC$6,C$6)
    Try this and copy towards right

  11. #11
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Sum every nth column with moving date range

    Thanks Siva it works great, thanks for your help

    Indi_Ra Thank you, works too

    Kevin

+ 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. Moving to the date in a row based on earliest date in a column.
    By BDBJ1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-19-2016, 11:34 AM
  2. VBA VLookUp range moving down a row or across a column
    By relo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-27-2015, 08:43 AM
  3. Moving date range?
    By slade8200 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-27-2014, 11:51 AM
  4. [SOLVED] Single column countif with moving range based on today's date
    By JonesyCC in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-16-2013, 02:45 PM
  5. Replies: 8
    Last Post: 11-15-2011, 12:29 PM
  6. MOVING DATE RANGE ON A CHART
    By Drew in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-02-2006, 09:50 PM
  7. Moving Range Selection Right One Column at a Time
    By TexDad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2005, 03:30 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