Jump to content

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

Recommended Posts

Posted

There are various ways to calculate work days between 2 dates that have been posted but I need one with a different twist. All of the calculations I have found assume that date 2 is after date one. What if date 2 is before date one and I want it to appear as a negative.

Here is what I am trying to do.

A project has a target date. It has an actual completion date. If the actual date is before the target date(early) I need it to show as a negative if it is after the target date is should be a positive.

This shouldn't be that this hard but every time I reverse the calculation or try and multiple by -1 the calculation fails if it spans several weeks.

Any help would be appreciated.

Posted

Bob,

I downloaded your files and went through them. It seems like a pretty simple

solution for my problem. I actually already am using a holidays file in another part of the solution so this would be a good extension.

Is there any reason you couldn't keep existing work days in the workdays file and just keep adding the new year to it so we don't loose last years calculations?

Thanks very much for the demo files.

Posted

Is there any reason you couldn't keep existing work days in the workdays file and just keep adding the new year to it so we don't loose last years calculations?

No reason at all. When I set up the example, I was thinking in terms of a project that would have a finite beginning and end. So, I just set up a quick script to generate a range of dates that would cover the required period. But, there is no reason why you can't change the script to extend the range whenever necessary rather than replace it. Or, you could just generate something like 200 years worth of dates, so that it would never run out for the lifetime of the application. It wouldn't create a very big file.

By the way, I've revised the example files but haven't posted the new version yet. In the new version, you will be able to define recurring annual holidays so that you don't have to enter them manually. I will post it as soon as I get is cleaned up a bit.

This topic is 7948 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.