Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

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.

  • 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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.