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.

calculate a range of days without weekends

Featured Replies

  • Newbies

I would like to calculate how many days it takes to finish a project. It is an easy formula: shipDate - invoiceDate. What I would like to be able to do is eliminate any weekend days that would be contained in that formula. If I'm working on a project for two days I don't want it to show up as four days because I worked on it Friday and Monday.

Hi

try to enter this custom function:

/*

WorkingDays ( dateStart ; dateEnd )

parameters:

dateStart = date

dateEnd = date

Returns all the dates between dateStart and dateEnd w/o weekends

*/

Let([

dateStart = Case ( DayOfWeek ( dateStart ) = 7 ; dateStart + 2 ; DayOfWeek ( dateStart ) = 1 ; dateStart + 1 ; dateStart );

result = Case ( dateStart < dateEnd ; dateStart & ¶ & WorkingDays ( dateStart + 1 ; dateEnd ) ; dateStart = dateEnd ; dateStart ; "" )

];

result

)

The custom function returns, as text, a list of dates;

for example: WorkingDays ( "02/09/2007" ; "02/19/2007" ) returns:

02/09/2007

02/12/2007

02/13/2007

02/14/2007

02/15/2007

02/16/2007

02/19/2007

To count the working days the calc is:

ValueCount ( WorkingDays ( dateStart ; dateEnd ) )

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.