Help with Workday formula

Copper Contributor

Hi, 

I am having issue with the workday formula calculating 1 Jan 2018 (which is also bank holiday) to show next working day.

 

For example:

A1: 01/01/2018

A2: 01/01/2018 (holiday)

A3: =WORKDAY(A1,1,A2)   --> Result = 02/01/2018 (2nd January instead of 3rd January, which is the next working day as 1st Jan is holiday).

 

 

7 Replies

Hi Grace,

 

That's correct result - after Mon, 01 Jan the next working day is Tue, 02 Jan since it's not day-off (not public holiday and not weekend).

Hi Sergei,

 

Thanks for the quick response. But in the formula stated that 1st Jan is a holiday hence I expect that the first working day is on the 2nd, and the next working day is the 3rd?

 

Grace

Hi,

 

The result of the formula is correct!

 

Please note that the WORKDAY function works this way:

  • It looks at the start date.
  • It skips the to the next workday that is nonweekend and nonholiday.
  • The number of skips is based on the second argument of the function (days).
  • You have an option to define the holidays in the third argument, to make the function take them into account.
  • The holidays' argument is optional, you can omit it, which is means that there are no holidays.
  • No matter if the start date is a holiday or weekend, it's just a starting point.

 

In the formula above, since the start date is 01/01/2018 and the number of days (skips) is 1, it will return the next workday 02/01/2018 which is nonweekend and nonholiday.

 

The formula will return 03/01/2018 in case if you make the day of 02/01/2018 is the holiday.

 

Hope that helps

Haytham

Hi Haytham,

Thanks for the explanation.

Can you recommend the formula so that for 1st Jan is accounted for holiday as it is the start date? So Excel can find that 2 Jan is the actual start date (acknowledging the start date is holiday) and the so than it can then find that the next working day so the result showing as 3 Jan?

Grace

Hi,

 

I suggest using this formula instead:

=WORKDAY(IF(A1=A2,A1+1,A1),1,A2)

 

This portion of the formula IF(A1=A2,A1+1,A1) will check if the start date is equal to the holiday.

If so, it will add one day to the start day, otherwise, will still as it is.

Thank you, much appreciated.

Grace

@Haytham Amairah 

Hi,

I have made the attached excel project plan and it is working fine but I have to select holidays manually by seeing the country of the assignee. I want this to be done as per the countries defined in the project plan by seeing the list of per country holidays from the field value of the assignee location. My excel sheet is attached to this email.

I am using this formula to calculate the start and end dates of each task:

=WORKDAY(E12,(F12),Holidays!$B$5:$B$8)

I have tried to change the above formula by adding different conditions but nothing works.

I am also looking to protect/lock formula cells dynamically, i.e., when we defined formula. Is it possible?

I am also looking to have different colors for formula fields dynamically. I don't know whether it is possible?

I have lost a lot of my time to sort out this formula but none was successful. Your kind help is appreciated.

Thank you in advance for your help.

Muzaffar