function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shailesh DeshpandeShailesh Deshpande 

Calculate business days!!

Hi,

 

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.

incuGuSincuGuS

Hi Shailesh,

 

Searching throught the forums brought lots of results (full list here) but one stood out :

http://community.salesforce.com/t5/Formulas-Validation-Rules/Formula-for-tracking-ONLY-Business-Days/m-p/37478

 

When in need of an answer the Search is your friend :P.

 

Let me know if it worked, didnt read the whole thread, if you have any doubts or further questions ill be glad to help out,

Gaston.

Shailesh DeshpandeShailesh Deshpande

Hi,

 

Thanks for your reply. But that doesnt seem to work.

Any workaround?

incuGuSincuGuS

I kept diggin in the boards, and found another post:

http://community.salesforce.com/t5/Formulas-Validation-Rules/Formula-to-calculate-the-number-of-working-days-between-2-dates/m-p/104688

 

I haven't tested myself, but seems to work from the comments. They even found a bug and fixed it :)

 

 

Let me know if it works, other solutions might be creating a field and filling it within a Trigger or APEX class when insterting the record. But it seems possible with formulas.

Gaston.

Shailesh DeshpandeShailesh Deshpande

Hey Gaston, i have seen this post before....but the problem i have is somewhat different...in their case they happen to have the start date and end date....and based on those two dates, they are calculating business days....whereas in my case i have start date and the number of business days and i want to calculate the end date....The link which you suggested in your previous reply seems to work fine if i create an opportunity on days between monday to thursday..but it fails if i create an opportunity on friday....i somehow managed to make it work for fridays too...but then it now fails in case of saturdays and sundays as in if i cerate an opportunity on saturday or sunday...it does not calculate the proper end date.....i think you might be able to help me if you try and go through that formula...

 

Thanks.

incuGuSincuGuS

Ok got your point :) ,

 

I might give it shot today if i can find some time.

Have you tried any approaches? if so could you post what you got so i can start from where you are?

Shailesh DeshpandeShailesh Deshpande

I've done the same thing that is suggested in that post..except that for calculating the End Date (Completed date ) i've changed the formula to the following :

 

Start_Date__c + (Number_of_Days__c)) + ((CEILING(((Weekday_Code__c + (Number_of_Days__c -1))*0.2))/0.2)-5)/2.5