Jump to content

This topic is 8209 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Anyone's Help would be greatly appreciated....

In a template that comes with V5.5 there is a file called Calculations

and Scripts. Within that file there is a calculation that calculates the

future end date of a project excluding weekends when given a number of work days. The calculation for the end date is as follows;

StartDate + Int (WorkDays/5) * 7 +

Middle ("12345012340123601256014560345623456",

(DayOfWeek (StartDate) - 1) * 5 +

Mod (WorkDays,5) + 1, 1)

I need it to do the opposite. I have an end date or a Project delivery date. I need to put in the number of days it will take to complete the project and end up with a start date or the date the the project needs to be started by excluding weekends. I read a post in this forum that suggested using the following calculation for the StartDate;

EndDate-Int(WorkDays/5)*7-Mod(WorkDays,5)

This works except, for example, when the end date is a Thurday, say Aug 28, 02 and the WorkDays is only 3. The answer should be Aug 23, but it come back with Aug 25. The "Middle" function in the above example addresses this. But I can't seem to manipulate it to achieve my needs.

I've been racking my brain for a week now. Any help would be immensely appreciated.

Nick Peterson

[email protected]

Posted

What would happen if you put a negative number of days into the first (end date) calculation?

This topic is 8209 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.