+ Reply to Thread
Results 1 to 5 of 5

identifying saturday and sunday in a date

  1. #1
    Registered User
    Join Date
    05-30-2007
    Posts
    5

    identifying saturday and sunday in a date

    Hi,

    My users have a task that takes 5 days to complete. I need to identify whether the completion date falls on a saturday or a sunday. If it falls on a sunday, the task needs to be moved back 2 days, and 1 day for a saturday.
    Does anyone know how to do this? Thanks in advance,

    Michael

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Moved to correct forum!
    Not all forums are the same - seek and you shall find

  3. #3
    Forum Contributor
    Join Date
    07-09-2008
    Location
    Dallas
    MS-Off Ver
    2007
    Posts
    121
    Try the WORKDAY formula (2007? can't remember if its there for earlier versions). This allows you to point to a start date in a cell, then point to a cell that has number of days it takes to complete the project, and will calculate an 'end date' that is a workday (skips saturday/sunday). The formula also gives you a way to build-in skipping of holidays as well, if you need that.

    =WORKDAY(A1,B1,C1:C10))
    In this example, A1 is your start date, B1 is the number of days you expect the project to take to complete, and the range C1:C10 is where you can put holidays that you want to 'skip' as well (holidays formatted as 'general', not as 'date'). The formula returns the 'end date', skipping weekends and holidays, that you're looking for, I believe.

    Hope that helps!
    Last edited by jwhitwell; 07-15-2008 at 02:18 PM.

  4. #4
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    Weekday

    Two options:
    1. Use the formula =WEEKDAY(...) to return a number between 1-7.
    2. The other option is to put in B1: =A1 and then 'Custom format' (right click Formalt Cells..., Tab: Number, Category: Custom. Set Type to DDDD which will give you the format for example Sunday.

    HTH
    Ola

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    There's a difference between adding 5 days to a date and then jumping to the next weekday if the result isn't one....and just adding 5 workdays to a date. For example the former gives a Monday end date for a Tuesday start, the latter gives a Tuesday end date.

    You describe it as the former which would be

    =WORKDAY(A1+4,1)

    If it's the latter

    =WORKDAY(A1,5)

    For versions of Excel before 2007 WORKDAY is an Analysis ToolPak function

    ...or without Analysis ToolPak function this will do the same as the first formula above

    =CHOOSE(WEEKDAY(A1+5),1,0,0,0,0,0,2)+A1+5
    Last edited by daddylonglegs; 07-15-2008 at 04:32 PM.

+ 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