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
Rakesh M 20Rakesh M 20 

How do i get previous month number of working days excluding weekends ?

AbhishekAbhishek (Salesforce Developers) 
Rakesh,

Your query is answered here,

https://salesforce.stackexchange.com/questions/91880/date-formula-to-calculate-date-excluding-weekends

Make some changes based on your requirement.

For further reference check this,
https://www.cloudtrailz.com/blog/count-business-days-in-salesforce

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.
Mike ArthurMike Arthur
Look at the section 'Find the Number of Business Days Between Two Dates' on this page
https://developer.salesforce.com/docs/atlas.en-us.usefulFormulaFields.meta/usefulFormulaFields/formula_examples_dates.htm
Reproduced here:
"Calculating how many business days passed between two dates is slightly more complex than calculating total elapsed days. The basic strategy is to choose a reference Monday from the past and find out how many full weeks and any additional portion of a week have passed between the reference date and your date. These values are multiplied by five for a five-day work week, and then the difference between them is taken to calculate business days.
 
(5 * ( FLOOR( ( date_1 - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date_1 - DATE( 1900, 1, 8), 7 ) ) )
-
(5 * ( FLOOR( ( date_2 - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date_2 - DATE( 1900, 1, 8), 7 ) ) )

In this formula, date_1 is the more recent date and date_2 is the earlier date. If your work week runs shorter or longer than five days, replace all fives in the formula with the length of your week."