Salesforce and other SMB Solutions are coming soon. ×

# Number of days less weekends calc

## Recommended Posts

Can anyone help? I cannot see any way that I can calculate the number of days elapsed less weekend days. I currently have;

If (IsEmpty ( Date finished ) ; ((Get ( CurrentDate )-Date Recieved)-Waiting quote) ;((Date finished - Date Recieved) - Waiting quote))

Should I bee approaching this from another direction?

Cheers.

##### Share on other sites

Well for once, I'm not going to attack each new problem/post afresh. Here's a solution I posted elsewhere recently (hopefully adjusted to your need). What is waiting quote? I hope it is a number. I manually adjusted the calc depending upon what I THINK you are doing; let us know if it needs adjusted.

Let ( [

theDate = If ( not DateFinished ; Get ( CurrentDate ) ; DateFinished ) - WaitingQuote ;

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

wkndCount = Div ( spanEnd - spanStart + 1 ; 7 ) * 2 - (spanStart theDate )

] ;

theDate - DateReceived + 1 - wkndCount

)

)

The span starts at the first Sunday prior to the DateReceived and the span ends on Saturday after theDate ( DateFinished - WaitingQuote ) or Get ( CurrentDate) - WaitingQuote). Weekend count is the full weeks in between then boolean test deducts one day if span starts before DateReceived (indicating first day of span is Sunday and NOT within the range) and deducts one day if span ends after theDate (indicating last day of span is Saturday and not within the range). Once we know the weekend count, we subtract weekend count from total days in the (inclusive) date range.

If I left a parenth or semicolon out during this manual manipulation of the calc, I plead Friday-syndome. The calc does work. smiley-laughing

UPDATE: Oh, calc result is NUMBER and must be UNSTORED.

LaRetta

##### Share on other sites

Oh how terribly rude of me! I didn't welcome you!

Welcome to the Cafe' and feel free to ask any questions you wish! smiley-laughing

##### Share on other sites

Hi LaRetta,

Thanks for the welcome, and the reply!

Waiting Quote is a calculated number.

I'll try what you suggested and see how I go with it

Mark

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• ### Images

• 0
By Soliant Consulting,
• 0
By Soliant Consulting,
• 0
By Soliant Consulting,
• ### Forum Statistics

• Total Topics
33.6k
• Total Posts
141.4k
×
×
• Create New...