Niet32 Posted June 8, 2006 Posted June 8, 2006 (edited) Meant to put this in Define Fields. OK. I looked through the posts and can't figure this one out. I have one date, a Deadline date, and need to show the date 3 days prior from that date. The problem is I can't include weekend days. All the formulas I have seen are based off of a start and end date. Even when I reference a field (end date) that takes the Deadline and subtracts 3 days it doesn't worked. Thanks for any help. I am sure I am missing something. Edited June 8, 2006 by Guest
John Mark Osborne Posted June 8, 2006 Posted June 8, 2006 Here is a formula that will allow you to specify a Start Date and a number of days: Start Date + Div(Days; 5) * 7 + Middle("12345012340123601256014560345623456"; (DayofWeek(Start Date) - 1) * 5 + Mod(Days; 5) + 1; 1) You need to make sure the Start Date falls on a week day date. The series of numbers included in the middle function represent the number of days you need to add to each day of the week in order to make it a week day. For example, the first 5 digits refer to Sunday (12345). Adding 1 day to Sunday makes it Monday, adding 2 days makes it Tuesday, etc. The next 5 digits refer to Monday (01234). Adding 0 days makes it Monday, adding 1 day makes it Tuesday, etc. The next 5 digits represent Wednesday (01236). The jump from three to six represents the weekend (i.e. 4, 5).
Niet32 Posted June 8, 2006 Author Posted June 8, 2006 What does Days refer to? Is that the 3 days prior? Should I put that in as a number? Thanks
comment Posted June 8, 2006 Posted June 8, 2006 Your question is not very clear. Do you want the last work day that is at least 3 days before the deadline, or do you want a date that is 3 work days before the deadline?
Niet32 Posted June 8, 2006 Author Posted June 8, 2006 I am looking for the date 3 work days prior to the deadline. Thanks...
comment Posted June 8, 2006 Posted June 8, 2006 If you are willing to hardcode the number -3 into the formula, you could use a simple mini-lookup like this: Deadline - Middle ( "4555333" ; DayOfWeek ( Deadline ) ; 1 ) Very much like John Mark's formula above, it simply pre-computes the number of days you need to subtract, depending on the day-of-week of deadline (here the deadline is allowed to fall on the weekend). For a more general formula, see here.
John Mark Osborne Posted June 8, 2006 Posted June 8, 2006 Days refers to the number of days in the future. You can replace it with the number 3 if you like.
Recommended Posts
This topic is 6741 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now