+ Reply to Thread
Results 1 to 7 of 7

Sum column by the last X number of workdays

  1. #1
    Forum Contributor
    Join Date
    04-27-2009
    Location
    Dallas, TX
    MS-Off Ver
    Office 365
    Posts
    215

    Sum column by the last X number of workdays

    I need a formula that will sum the previous 4 workdays. Right now my formula gets messed up when it is summing over the weekend. I have no activity over the weekend so my 4 day avg is too low. But if I include the data from wednesday, thursday, friday, and today....well then my data is accurate.
    Attached Files Attached Files
    Last edited by mvparker79; 01-13-2021 at 04:05 PM. Reason: Solved

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

    Re: Sum column by the last X number of workdays

    You can use this formula in I6:

    =SUMIFS(B:B,A:A,">="&I4-IF(WEEKDAY(I4,2)<4,5,3),A:A,"<="&I4)

    Hope this helps.

    Pete

  3. #3
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Sum column by the last X number of workdays

    This seems to work

    Please Login or Register  to view this content.
    change the range to suit your needs

    edit - My formula calculated the average. I note you want the sum so I've amended it.
    Last edited by Crooza; 01-11-2021 at 08:22 PM.
    Happy with my advice? Click on the * reputation button below

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

    Re: Sum column by the last X number of workdays

    Here's another one:

    =SUM(INDEX(B:B,MATCH(I4,A:A,0)-3):INDEX(B:B,MATCH(I4,A:A,0)))

    Hope this helps.

    Pete

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Sum column by the last X number of workdays

    Just a note. While ever your data is in the format that it is in now (ie missing weekends) all these will work. I wrote mine with the thought a weekend date might creep into the data and you would still want to exclude it so it ignores weekend dates even if they do get included in the data set. Belts and braces maybe!

  6. #6
    Forum Contributor
    Join Date
    04-27-2009
    Location
    Dallas, TX
    MS-Off Ver
    Office 365
    Posts
    215

    Re: Sum column by the last X number of workdays

    Thank you so much to everyone that has posted their response. These replies were exactly what I needed! Thank you!

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

    Re: Sum column by the last X number of workdays

    Glad to hear it. You could show your appreciation by clicking on the "star" icon below any post that you have found to be helpful.

    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] Need to get a formula to display only number of workdays
    By john dalton in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 06-10-2014, 05:07 AM
  2. [SOLVED] Substract number of workdays from a date
    By Link in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-26-2014, 04:53 PM
  3. Max number over a set amount of workdays
    By mk3ll00 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2013, 01:17 AM
  4. Number of Workdays
    By aresquare1 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-15-2008, 10:25 AM
  5. workdays additions and cell number display
    By XLS-EXCEL in forum Excel General
    Replies: 7
    Last Post: 09-07-2007, 08:05 AM
  6. Replies: 1
    Last Post: 03-26-2005, 09:41 AM
  7. Number of workdays in a month
    By Nigel Bennett in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2005, 08:06 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