+ Reply to Thread
Results 1 to 7 of 7

Thread: Changing working days

  1. #1
    Greg
    Guest

    Changing working days

    This post appeared on 7/11/2006.
    I repeat it because the author didn't get the answer. I have the same problem.
    "Excel count weekly off Saturday & Friday. But my case it is Friday &
    Saturday. I want to define that while using networkdays and workday functions"

    In my words, if today is Thursday, then WORKDAY (today(),1,0) will give not
    the next (friday's) date but Sunday's.

    Please help
    Greg

  2. #2
    Forum Guru VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    12,010
    Not sure if I follow you.

    If A1 = thursday do you want to drag down a list of dates excluded Fri and Sat. If this is the case then put this formula into cell A2 and drag down

    =IF(OR(WEEKDAY(A1+1)=6,WEEKDAY(A1+1)=7),A1+3,A1+1)

    VBA Noob

  3. #3
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,057
    If you want to use NETWORKDAYS and WORKDAY functions with Friday and Saturday weekends then use

    =NETWORKDAYS(A1+1,B1+1)

    where A1 is your start date and B1 your end date

    and

    =WORKDAY(C1+1,D1)-1

    where C1 is your start date and D1 the number of workdays you wish to advance.

    If you also have a holiday range to exclude then you can use these

    =NETWORKDAYS(A1+1,B1+1,holidays+1)
    =WORKDAY(C1+1,D1,holidays+1)-1

    both of which need to be confirmed with CTRL+SHIFT+ENTER

  4. #4
    Greg
    Guest

    Re: Changing working days

    It's not so simple.
    For example Wednesday+3 will give Monday,
    but I need Sunday

    "VBA Noob" wrote:

    >
    > Not sure if I follow you.
    >
    > If A1 = thursday do you want to drag down a list of dates excluded Fri
    > and Sat. If this is the case then put this formula into cell A2 and
    > drag down
    >
    > =IF(OR(WEEKDAY(A1+1)=6,WEEKDAY(A1+1)=7),A1+3,A1+1)
    >
    > VBA Noob
    >
    >
    > --
    > VBA Noob
    > ------------------------------------------------------------------------
    > VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
    > View this thread: http://www.excelforum.com/showthread...hreadid=566388
    >
    >


  5. #5
    Bob Phillips
    Guest

    Re: Changing working days

    As the crane-fly said

    =WORKDAY(A1+1,3)-1

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Greg" <Greg@discussions.microsoft.com> wrote in message
    news:54DE410F-7C96-4F6B-970E-3C0210E6FC7E@microsoft.com...
    > It's not so simple.
    > For example Wednesday+3 will give Monday,
    > but I need Sunday
    >
    > "VBA Noob" wrote:
    >
    > >
    > > Not sure if I follow you.
    > >
    > > If A1 = thursday do you want to drag down a list of dates excluded Fri
    > > and Sat. If this is the case then put this formula into cell A2 and
    > > drag down
    > >
    > > =IF(OR(WEEKDAY(A1+1)=6,WEEKDAY(A1+1)=7),A1+3,A1+1)
    > >
    > > VBA Noob
    > >
    > >
    > > --
    > > VBA Noob
    > > ------------------------------------------------------------------------
    > > VBA Noob's Profile:

    http://www.excelforum.com/member.php...o&userid=33833
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=566388
    > >
    > >




  6. #6
    bplumhoff@gmail.com
    Guest

    Re: Changing working days

    Hi Greg,

    A1 Your date
    A2 number of working days to add (Fridays and Saturdays being NO
    working days)

    Result:
    =A1+A2+INT((A2-MOD(A1+A2-6,7)+7)/7)+INT((A2-MOD(A1+A2-7,7)+7)/7)+(MOD(A1+A2+INT((A2-MOD(A1+A2-6,7)+7)/7)+INT((A2-MOD(A1+A2-7,7)+7)/7),7)=6)*2+(MOD(A1+A2+INT((A2-MOD(A1+A2-6,7)+7)/7)+INT((A2-MOD(A1+A2-7,7)+7)/7),7)=0)

    Please test it. This is just a quick and dirty derivative from
    http://www.sulprobil.com/html/date_formulas.html

    HTH,
    Bernd


  7. #7
    Greg
    Guest

    Re: Changing working days

    Hi Bob
    Your formula is the best: nice, shortest and correct.
    Thanks indeed
    Greg

    "Bob Phillips" wrote:

    > As the crane-fly said
    >
    > =WORKDAY(A1+1,3)-1
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "Greg" <Greg@discussions.microsoft.com> wrote in message
    > news:54DE410F-7C96-4F6B-970E-3C0210E6FC7E@microsoft.com...
    > > It's not so simple.
    > > For example Wednesday+3 will give Monday,
    > > but I need Sunday
    > >
    > > "VBA Noob" wrote:
    > >
    > > >
    > > > Not sure if I follow you.
    > > >
    > > > If A1 = thursday do you want to drag down a list of dates excluded Fri
    > > > and Sat. If this is the case then put this formula into cell A2 and
    > > > drag down
    > > >
    > > > =IF(OR(WEEKDAY(A1+1)=6,WEEKDAY(A1+1)=7),A1+3,A1+1)
    > > >
    > > > VBA Noob
    > > >
    > > >
    > > > --
    > > > VBA Noob
    > > > ------------------------------------------------------------------------
    > > > VBA Noob's Profile:

    > http://www.excelforum.com/member.php...o&userid=33833
    > > > View this thread:

    > http://www.excelforum.com/showthread...hreadid=566388
    > > >
    > > >

    >
    >
    >


+ 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.2.0