+ Reply to Thread
Results 1 to 4 of 4

add days using networkdays

Hybrid View

  1. #1
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    I'm sure this could be done with a formula (or more efficiently in code), but here's a quick hack:
    Function NextWorkDay(dat As Date, nDays As Long) As Date
        Dim iSgn As Long
        
        NextWorkDay = dat
        iSgn = Sgn(nDays)
        
        Do Until nDays = 0
            NextWorkDay = NextWorkDay + iSgn
            If Weekday(NextWorkDay, vbSaturday) > 2 Then nDays = nDays - iSgn
        Loop
    End Function

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,864
    You can use WORKDAY function,

    =WORKDAY(A1,5)

    where A1 contains your date. WORKDAY also allows you to specify a range of holiday dates to be excluded.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Humbug ...

+ 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