+ Reply to Thread
Results 1 to 13 of 13

How to eliminate weekends from calculation

  1. #1
    Registered User
    Join Date
    05-17-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    0365
    Posts
    13

    How to eliminate weekends from calculation

    I have a "heatmap chart" which is essentially just numbers on a grid with the corresponding day-month as the header (Resource Summary tab) and it is supposed to show how many hours per day a Person is being used. The numbers are plotted from another table that has date ranges (Data sheet tab, columns F and G) and hours per day (column H) for each activity. The problem is that it plots the hours per day in the correct cells but doesn't account for weekends. So when it plots hours per day over the month, the number of hours is inflated.
    If i have a date range, for example, 20-01-2022 to 15-10-22 with 8 hours per day. Can it automatically skip the weekends or put in a zero when it plots it? The other complication is that the heatmap chart is dynamic based on 3 dropdowns. 1 for month, 1 for year and 1 for project but these are done and are working.
    The current formula which doesn't exclude weekends is:
    =SUMIFS(Table1[[Hours/Day]:[Hours/Day]],Table1[[Resource Name]:[Resource Name]],'Resource Summary'!$B7,Table1[[Start Date]:[Start Date]],"<="&'Resource Summary'!D$6,Table1[[End Date]:[End Date]],">="&'Resource Summary'!D$6,Table1[[Project Name]:[Project Name]],rngProject)

    Resource-Planning-Template-Excel.xlsx


    Any help would be greatly appreciated

  2. #2
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: How to eliminate weekends from calculation

    Try,
    D6=WORKDAY.INTL(EOMONTH(DATE(AA3,T3-1,1),0),1,1)
    E6=WORKDAY.INTL(D6,1,1), copy across.

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: How to eliminate weekends from calculation

    Add 1 criteria for weekday in your SUMIFS to turn it into 0 if it was weekend.
    =(WEEKDAY(D$6,2)<6)*SUMIFS(...)

    Please Login or Register  to view this content.
    Quang PT

  4. #4
    Registered User
    Join Date
    05-17-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    0365
    Posts
    13

    Re: How to eliminate weekends from calculation

    Hi Joseph
    Thanks for that solution! It works, mostly.
    The only issue is that because it removes the weekends, it has brought across the following month's days to fill in the empty cells. For example, January now starts on the 4th (which is the correct first workday) but the last cell is now the 15th Feb. I was hoping to just see the selected month's days. As a workaround I could just show maybe 21 cells which would cover the maximum weekdays in a month but it will spill over with shorter months though. Not an elegant option so i'd hope to avoid that if possible.

    Attachment 807178

  5. #5
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: How to eliminate weekends from calculation

    Try this spill formula, D6=LET(x,UNIQUE(WORKDAY.INTL(SEQUENCE(,30,EOMONTH(DATE(AA3,T3,1),-1),1),1,1),TRUE,FALSE),FILTER(x,MONTH(x)=T3))

  6. #6
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: How to eliminate weekends from calculation

    And, spill formula for D7=SUMIFS(Table1[[Hours/Day]:[Hours/Day]],Table1[[Resource Name]:[Resource Name]],'Resource Summary (4)'!$B7,Table1[[Start Date]:[Start Date]],"<="&'Resource Summary (4)'!D$6,Table1[[End Date]:[End Date]],">="&'Resource Summary (4)'!D$6,Table1[[Project Name]:[Project Name]],rngProject), copy down

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: How to eliminate weekends from calculation

    Quote Originally Posted by josephteh View Post
    Try this spill formula, D6=LET(x,UNIQUE(WORKDAY.INTL(SEQUENCE(,30,EOMONTH(DATE(AA3,T3,1),-1),1),1,1),TRUE,FALSE),FILTER(x,MONTH(x)=T3))
    Amend formula to: =LET(x,UNIQUE(WORKDAY.INTL(SEQUENCE(,31,EOMONTH(DATE(AA3,T3,1),-1),1),1,1),TRUE,FALSE),FILTER(x,MONTH(x)=T3))

  8. #8
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: How to eliminate weekends from calculation

    Ignore previous 3 posts, using spill formulas (no need to copy across or down):

    B4=UNIQUE(Table1[Resource Name])

    D6=LET(x,UNIQUE(WORKDAY.INTL(SEQUENCE(,31,EOMONTH(DATE(AA3,T3,1),-1),1),1,1),TRUE,FALSE),FILTER(x,MONTH(x)=T3))

    D7=SUMIFS(Table1[[Hours/Day]:[Hours/Day]],Table1[[Resource Name]:[Resource Name]],$B7#,Table1[[Start Date]:[Start Date]],"<="&D$6#,Table1[[End Date]:[End Date]],">="&D$6#,Table1[[Project Name]:[Project Name]],rngProject)

  9. #9
    Registered User
    Join Date
    05-17-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    0365
    Posts
    13

    Re: How to eliminate weekends from calculation

    Hi

    I've followed your last post and just copy-pasted into B4, D6 and D7 but i'm getting the following errors.
    In cell B4 and all of row 6 "#SPILL!"
    Cells D7:AH31 are all just blank now
    Attachment 807338

  10. #10
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: How to eliminate weekends from calculation

    Your attachment is invalid. Please read instruction at the top yellow banner how to attach workbook.
    Last edited by josephteh; 11-30-2022 at 09:38 PM. Reason: Attach file

  11. #11
    Registered User
    Join Date
    05-17-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    0365
    Posts
    13

    Re: How to eliminate weekends from calculation

    Thanks Joseph. I tried to attach my file but it looked like it only had an option to inset an image. Now i know, i'll be sure to do so in future.
    On another note, your update has done the trick. I really appreciate your help with this!

  12. #12
    Registered User
    Join Date
    01-04-2023
    Location
    London
    MS-Off Ver
    O365
    Posts
    1

    Re: How to eliminate weekends from calculation

    Hi Cooksley, How you solved the same, am also trying to solve the same but no luck, please help

  13. #13
    Registered User
    Join Date
    05-17-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    0365
    Posts
    13

    Re: How to eliminate weekends from calculation

    My sheet was setup with a specific format and posts 7 and 8 solved it, the attachment in post 10 shows it.

+ 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. SLA Calculation including weekends
    By GambleG1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2019, 09:34 AM
  2. [SOLVED] Eliminate weekends and holidays from schedule
    By joebell in forum Excel General
    Replies: 7
    Last Post: 12-10-2014, 10:28 AM
  3. Statement to search date range and eliminate weekends and holidays
    By mrnuce in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-19-2014, 11:23 AM
  4. calculation to exclude weekends
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 07:05 AM
  5. calculation to exclude weekends
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 04:05 AM
  6. calculation to exclude weekends
    By Need2Know in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. How do I eliminate non-used dates (weekends) from a chart?
    By nanoking in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-10-2005, 03:06 AM

Tags for this Thread

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