How to get the number of business days for a specify month.(Power Automate Desktop)


Japanese version.

Introduction to how to get the number of business days for a specify month in Power Automate Desktop.

Overall view of Flow

Robin(for copy and paste)

It can be copied and pasted into Power Automate Desktop.

Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Test\\business_days_e.xlsx''' Visible: False ReadOnly: False Instance=> ExcelInstance
Excel.SetActiveWorksheet.ActivateWorksheetByName Instance: ExcelInstance Name: $'''Sheet1'''
DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime
Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: CurrentDateTime Column: 1 Row: 1
Excel.ReadFromExcel.ReadCell Instance: ExcelInstance StartColumn: 2 StartRow: 1 ReadAsText: False CellValue=> ExcelData
Excel.CloseExcel.Close Instance: ExcelInstance

Flow creation steps

Power Automate Desktop alone is labor intensive, so we will utilize Excel sheets.

First, prepare a Holidays sheet in the Excel book and list all holidays other than Saturday and Sunday in column A.Data rows from line 1. Header lines are not required.

The number of business days in the month for the date entered in cell A1 will now be displayed in cell B1.

After saving the Excel book, create a Power Automate Desktop flow.

Set up an Excel Launch Action and specify an Excel book.

Launch Excelan open the following document
Document pathSaved Excel file.
Make instance visibleOFF
Open as ReadOnlyOFF

Set up an Set active Excel worksheet Action and specify the sheet with the formula.

Set up a  Write to Excel worksheet Action.

The Value to Write can be a textual value of the year and month for which you want to retrieve the number of business days, or a Datetime variable that can be retrieved with the Get current date and time Action.

Value to writeThe year and month for which you wish to obtain the number of business days.
Any number of days is acceptable as long as the year and month are correct.
Write modeOn specified cell

Set up a Read from Excel worksheet Action to retrieve the number of business days.

RetrieveThe value of a single cell

Close the book by placing a Close Excel Action.

When this flow is executed, the Read from Excel worksheet Action The number of business days is set to the Variable produced. Variable name ExcelData by default.

For those who want to learn Power Automate Desktop effectively

The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.


How to get the last business day of the specified month.

Tips(Power Automate Desktop)