Consulting

Results 1 to 4 of 4

Thread: Solved: working with Dates

  1. #1
    VBAX Tutor
    Joined
    Dec 2008
    Posts
    244
    Location

    Solved: working with Dates

    is there a formula to subtract dates but exclude weekends.

    Example, cell Q1, i have =Today()
    I want Cell P1 to be QA1 - 1 and the formula remains constain all the way to A1. But the problem is I have weekends in there. Is there a way to skip the weekend?

    attached is example.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =IF(WEEKDAY(Q1)=2,Q1-3,Q1-1)
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Dec 2008
    Posts
    244
    Location
    wow you make everything looks easy xld. thanks

  4. #4
    VBAX Regular
    Joined
    Feb 2009
    Posts
    16
    Location
    Quote Originally Posted by xld
    =IF(WEEKDAY(Q1)=2,Q1-3,Q1-1)
    Just keep in mind that this will not work if the date in Q1 is a Sunday (WEEKDAY(Q1)=1). Since it looks like this can't occur in your case, this is not an issue for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •