+ Start a Discussion
Shailesh DeshpandeShailesh Deshpande 

Calculate business days!!



I have a case where i need to process an opportunity after 30 business days of its creation . 

(Given the Start Date, No. Of Business days, find End_Date..) . Can anybody suggest the best way to do it using formula?


Thanks in advance.


I gave the following logic for calculating the number of Sundays and Saturdays. You can use the reverse login for your purpose.


In case if your requirment is just to calculate the number of Saturdays and Sundays between two dates then try the following:-

Subtract the one date from the other and divide by 7. That gives you whole weeks for which there is one each Saturday and Sunday. If the start date  is a Sunday or end Date is a Saturday but not both then add one to the previous result.


You may not be able to find out if a Date falls on a Sunday or saturday, but I think your atctivity will not start or end on weekend , hence it can work for you.

In case it is the other way round you can have a small invisible VF widget which does this for you in the backgroup and updates the respective field.

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.


So how do you accomplish that using Apex ?