How to calculate the working days of two different dates?

Naresh

New Member
I have two different dates.
Let's say 23-06-2018 and 30-07-2018.
Holidays : 06th month is 3,9,16,26(days)
:07th month is 6,10,20,28(days) &
:Every Saturday and sunday
Requirement: I need to calculate working days between above mentioned two different dates??
 

VJR

Well-Known Member
Hi Naresh,

You can make use of the Excel's in built NETWORKDAYS function for this exact same purpose.
Refer below link
https://exceljet.net/formula/get-workdays-between-dates
Here you can also specify the list of holidays in the sheet which makes it easy to use.
You just need to insert the start and end date and read the resulting days.


Refer Post #3 in below link on how to make use of a similar functionality using Blue Prism.
http://rpaforum.net/threads/add-7-days-to-a-date.1497/post-4610
If you do not want to keep an excel at a location then you can also dynamically generate the Excel on the fly. But this will require everytime inserting all the holidays and the formulas to calculate the workdays.

Post back if you are having any difficulties in implementing this.

If you do not want to go by the readymade Excel function then you will have to write a customised code stage that achieves this functionality.
 

VJR

Well-Known Member
Hi Naresh,

See if you are able to make use of the existing action 'Get Working Days in Range' of the Calendar VBO to achieve this.
For this you need to create a new Calendar in the System Manager and also add the desired holidays.

View attachment 1530871519209.png
 

Naresh

New Member
Thanq very much VJR

I tried to use 'count working days in range' action.i passed the input parameters i.e.calender name,First date,last date but I got the following error
Internal: The datatype 'text' Cannot be converted into a date.
 

VJR

Well-Known Member
Hi Naresh,

Internal: The datatype 'text' Cannot be converted into a date.

From the error message it looks like you may be storing First Date and Last Date as Text data items but passing them as dates to the VBO action when it is expecting a date. Do check if that is the case.
 
Top