+ Reply to Thread
Results 1 to 4 of 4

How to Calculate Days elapsed where Weekend is calculated as 1 Working Day?

Hybrid View

speakbones How to Calculate Days elapsed... 11-14-2007, 05:21 PM
Excelenator I have to give props to Chuck... 11-14-2007, 05:38 PM
daddylonglegs What happens if the date... 11-14-2007, 07:17 PM
daddylonglegs The formula I posted above is... 11-14-2007, 07:20 PM
  1. #1
    Registered User
    Join Date
    11-14-2007
    Posts
    1

    How to Calculate Days elapsed where Weekend is calculated as 1 Working Day?

    Dear All

    Please advise how to calculate A to B as below where A is Day 0 and Weekend (Sat and Sun) is calculated as 1 Working Day.

    A = 11/13/2007
    B = 11/21/2007

    or A = 08/31/2007
    B = 10/24/2007

    We are puzzeled on this since last 7 days because the Weekend - Sat and Sun need to be considered as 1 Week Day.

    Appreciate your help.

    SpeakBones

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    I have to give props to Chuck Pearson for the array formula that finds the Number of Mondays (this can be adjusted to any day you wish) between dates.

    Here is the formula that I used. It is an array formula so you will need to use Ctl Shft Enter to enter it.

    =NETWORKDAYS(A2,B2)+SUM(IF(WEEKDAY(A2-1+ROW(INDIRECT("1:"&TRUNC(B2-A2)+1)))=1,1,0))/2+SUM(IF(WEEKDAY(A2-1+ROW(INDIRECT("1:"&TRUNC(B2-A2)+1)))=7,1,0))/2
    The assumptions are that the start date is in cell A2 and the End date is in Cell B2. The NETWORKDAYS function will give you all weekdays in the absence of a holiday arguemnt. The two sum formulas count the number of Saturdays and Sundays and divides them by 2 so that effectively they equal 1 day.
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,681
    What happens if the date range starts or ends on a weekend?

    I'm assuming you're only interested in date ranges which start and end on weekdays. If start date is in A2 and end date in B2 try

    =B2-A2-INT((WEEKDAY(A2)+B2-A2-1)/7)

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,681
    Quote Originally Posted by Excelenator
    I have to give props to Chuck Pearson for the array formula that finds the Number of Mondays (this can be adjusted to any day you wish) between dates.
    The formula I posted above is a variation on this formula which gives Mondays in a period

    =INT((WEEKDAY(A2-2)+B2-A2)/7)

    The 2 can be replaced with other numbers (1=sun to 7=sat) to count other days

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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