Forum Discussion
Combine Workday function with calendar day formula
- May 26, 2022
If A4 equals 6/1/2022 and E45 ends in 16:
$A$4+RIGHT(E45,2)-1 = 6/1/2022 + (16-1) days = 6/1/2022 + 15 days = 6/16/2022.
6/16/2022 is a Thursday. The next workday is 6/17/2022.
Perhaps you want
=WORKDAY($A$4+RIGHT(E45,2)-2,1,Holidays[Dates])
This will return 6/16/2022.
I don't understand your second example.
In the first place, if $A$4+RIGHT(E45,2)-1 equals 6/16/2022, the formula returns 6/20/2022 for me, not 6/21/2022. Is that because of Juneteenth (I don't live in the USA)?
In the second place, why should the formula return 6/16/2022? It always returns a date after =WORKDAY($A$4+RIGHT(E45,2) = 6/17/2022 in this example.
- Jennifer_EgglestonMay 26, 2022Copper Contributor
Yes, Juneteenth is a holiday for our company and, since it falls on Sunday this year, the holiday is 6/20.
If I use the formula
=WORKDAY($A$4+RIGHT(E45,2)-1,1,Holidays[Dates])
- If A4 is 6/1/2022 and RIGHT(E45,2) is 16 (minus 1 = 15), I get 6/17/2022 but it should be 6/16
- If A4 is 6/1/2022 and RIGHT(E45,2) is 25 (minus 1 = 24), I get 6/27/2022 which is correct
- HansVogelaarMay 26, 2022MVP
If A4 equals 6/1/2022 and E45 ends in 16:
$A$4+RIGHT(E45,2)-1 = 6/1/2022 + (16-1) days = 6/1/2022 + 15 days = 6/16/2022.
6/16/2022 is a Thursday. The next workday is 6/17/2022.
Perhaps you want
=WORKDAY($A$4+RIGHT(E45,2)-2,1,Holidays[Dates])
This will return 6/16/2022.
- Jennifer_EgglestonMay 27, 2022Copper ContributorIt works! Thank you!