Skip to main content

Formula to determine days remaining until a due date

  • October 9, 2023
  • 3 replies
  • 272 views

Forum|alt.badge.img+2

Hey guys,

Just trying to work out a simple Formula to create a day count until a certain date (based on one of our fields) without including weekends. For example. We have a customer due date for an order which is put into a field, just wanting to have a field that calulates how many days we have for production until that date. 

So far I have:

 

DATETIME_DIFF(
  {Due Date},
  TODAY(),
  'days'
)

Which works fine but is including weekends. To combat this, I did try:

WORKDAY_DIFF(
  {Due Date},
  TODAY(),
  'days'
)

But this is throwing an #ERROR. I know I am definetly missing something. 

Any help is appreciated.

 

3 replies

Forum|alt.badge.img+11
  • Participating Frequently
  • October 9, 2023

Hi @RyanCP,

You are seeing that error message because the formula syntax is not correct. To resolve this, you should use the following syntax: WORKDAY_DIFF({Due Date}, TODAY(), 'holidays') where 'holidays' is a list of holiday dates that you would like to exclude in this format: "2022-01-01, 2022-01-17" - you do not need to add weekends to the holidays list because those are excluded by default.

I hope this helps!

Website: https://alessiomonino.com
Calendly: https://alessiomonino.com/contact
Email: alessio.monino@gmail.com


Forum|alt.badge.img+2
  • Author
  • New Participant
  • October 9, 2023

Hi @RyanCP,

You are seeing that error message because the formula syntax is not correct. To resolve this, you should use the following syntax: WORKDAY_DIFF({Due Date}, TODAY(), 'holidays') where 'holidays' is a list of holiday dates that you would like to exclude in this format: "2022-01-01, 2022-01-17" - you do not need to add weekends to the holidays list because those are excluded by default.

I hope this helps!

Website: https://alessiomonino.com
Calendly: https://alessiomonino.com/contact
Email: alessio.monino@gmail.com


Hey @Alessio_Monino 

So I have entered that formula and it's still throwing an error. 

WORKDAY_DIFF(
  {Due Date},
  TODAY(),
  'holidays'
  )


Do I need to enter dates?


Forum|alt.badge.img+11
  • Participating Frequently
  • October 14, 2023

Hey @Alessio_Monino 

So I have entered that formula and it's still throwing an error. 

WORKDAY_DIFF(
  {Due Date},
  TODAY(),
  'holidays'
  )


Do I need to enter dates?


Hi @RyanCP ,
you can either add the dates in the 'holidays' text or leave that option entirely blank so for example either:


WORKDAY_DIFF
(
  {Due Date},
  TODAY()
  )

OR

WORKDAY_DIFF(
  {Due Date},
  TODAY(),
"2022-01-01, 2022-01-17"
  )

Website: https://alessiomonino.com
Calendly: https://alessiomonino.com/contact
Email: alessio.monino@gmail.com