Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a variable vToday = Date(Today())
I would like to create a variable which shows the last business day date, based on the above variable.
I thought this could be achieved by the following; vLastWorkDay = LastWorkDate(vToday,-1). However this doesn't return any values.
Any help would be much appreciated.
Regards,
Daniel
Hi Daniel,
The function LastWorkDate(StartDate, NumberOfDays) returns the last date of a time period starting on the StartDate, and containing NumberOfDays working days (weekends excluded).
It is not clear what you're tying to find. Start date can be today, but the number of working days must be positive. For example you allocate 30 working days for a task, and start day is today, you can find the last business date for that task:
LastWorkDate(today(),30).
Regards,
Michael
Considering you have working days as Monday to Friday... you can get last work date as below
=IF(NUM(WeekDay(Today()))=0,Date(Today()-3),Date(Today()-1))