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

Should hopefully be a very quick one here for one of you super clever dudes!

Is there a calculation that will give the total number of week days (excluding weekends within a given period?

If ( Date1 and Date2 ) ;

Let ( [

spanStart = Date1 - Mod ( Date1 ; 7 ) ;

spanEnd = Date2 - Mod ( Date2 ; 7 ) + 6 ;

wkndCount = Div ( spanEnd - spanStart + 1 ; 7 ) * 2 - (spanStart < Date1 ) - ( spanEnd > Date2 )

] ;

Date2 - Date1 + 1 - wkndCount

)

)

Indeed, but Michael's CF is slightly more flexible:

http://www.briandunning.com/cf/452

If you put ValueCount( around it.... it could then be made to deal with regular days off as well!

--sd

  • Author

Tried your calculation replacing date1 and date2 in your calculation with the 'from' and 'to' dates in my database but the first line is coming up with the 'There are too few parameters in this function' message!

Did you call it this way:

ValueCount(WeekDaysInRange ( FromDate ; ToDate ; "1¶7" ))

:

--sd

If ( Date1 and Date2 [color:red]) ;

Remove the bracket in red.

Soren, I agree Michael's is more flexIble than mine.

I don't think you need to use a recursive calculation for this. If you want the flexibility of being able to select which days are considered weekends, see here:

http://www.fmforums.com/forum/showtopic.php?tid/155958/post/156042/#156042

Even better!

--sd

  • Author

Thanks for everyone's help on this. :beertime

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.