Skip to main content
Solved

Work weekends but not work on holidays

  • June 8, 2020
  • 2 replies
  • 36 views

Kim_Trager1
Forum|alt.badge.img+23

I’m trying to make gantt chart that calculates how long different product will take to make.
Depending on how busy the workshop is we might work in the weekends - however if there is a national holiday or something similar we’ll not work.

I’ve made comma separated iso dates for all holidays.

I can easily calculate an end date with the WORKDAY(startDate, numDays, [holidays]) but I’m trying to find a way to calculate an end date if we worked in the weekends but not holiday.

So basically is it possible to only exclude the holidays?

Best answer by kuovonne

This would be incredibly difficult in a formula field.

While you could write a formula that adds days, you would have to have check if the end date included a holiday. If the end date includes a holiday, you would need to push out the end date. However, then you would have to check to to see if the new end date was affected by a different holiday, and possibly push out the end date again.

You might be better off writing a script.

2 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • Answer
  • June 8, 2020

This would be incredibly difficult in a formula field.

While you could write a formula that adds days, you would have to have check if the end date included a holiday. If the end date includes a holiday, you would need to push out the end date. However, then you would have to check to to see if the new end date was affected by a different holiday, and possibly push out the end date again.

You might be better off writing a script.


Kim_Trager1
Forum|alt.badge.img+23
  • Author
  • Brainy
  • 168 replies
  • June 9, 2020

This would be incredibly difficult in a formula field.

While you could write a formula that adds days, you would have to have check if the end date included a holiday. If the end date includes a holiday, you would need to push out the end date. However, then you would have to check to to see if the new end date was affected by a different holiday, and possibly push out the end date again.

You might be better off writing a script.


I do get all the holidays with a script, so might as-well calculate the end time with a script as-well. Was hoping there was a quick way of doing it.