April 28, 200322 yr 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.
April 28, 200322 yr Check out the sample that I posted here: http://www.fmforums.com/threads/showflat.php?Cat=&Board=files&Number=54679&page=1&view=collapsed&sb=5&o=all&fpart=1 It will work with negative durations.
April 28, 200322 yr This is also covered in my file under the Handy Bits post in the Samples Section of this forum. Go to the end of the post to get the latest version.
April 30, 200322 yr Author 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.
April 30, 200322 yr 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.
Create an account or sign in to comment