Duration Between Two Dates Is Incorrect

Continuing the discussion from Welcome to Teable Community! :wave::

There are two formulae to calculate the number of days between two dates:

  1. WORKDAY_DIFF
  2. DATETIME_DIFF

The first one is not ignoring weekend days

For 1. if the formula is WORKDAY_DIFF({Start Date},{End Date}) and you choose March 9th 2026 as the start date, then choose March 13th 2026 as the end date and not specify any “Holidays” then the value is 4, it should be 5.

If you do the same but this time the end date is March 20th 2026, then the value is 11, not 10.

If you do the same but this time the end date is March 27th 2026, then the value is 18, not 15.

If I now create a new dates column called Holidays and then reference that as the third variable. When saving the formula, it is accepted but is not considered as part of the calculation.

I also tried a single line text and enter it as the same format as the dates in the start date and end date columns and makes no difference.

For 2. At it calculates correctly (With the “day” qualifier)but the wrong way around. If you enter the variables as Start, then End, you get a negative number, but End first followed by Start then it is a positive number. I assume that it is intended this way around as a positive number.

Thanks for your feedback! Here’s an update on the two issues you raised:

  1. WORKDAY_DIFF calculation issue — Confirmed and logged as a bug. The function doesn’t correctly exclude weekend days when the date range spans across weekends. We’ll get this fixed as soon as possible.

  2. DATETIME_DIFF sign direction — Appreciate the suggestion! The current design follows date1 - date2 logic, we’ll improve the formula documentation to make the parameter order and sign behavior clearer and more intuitive.

Thanks again for taking the time to report these — it really helps us improve the product! :folded_hands: