In a formula-type column, the MONTH_DELTA() function calculates the difference, in months, between two date-type columns.
-
Function name:
MONTH_DELTA()
Syntax
MONTH_DELTA(date_1, date_2)
Function parameter usage in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to add within quotes.
- do not use quotes for numbers.
Parameters
| Parameter | Description |
|---|---|
date_1 |
The start date, the reference point for the calculation. |
date_2 |
The compared date. The result expresses the number of months from date_1 to date_2: positive if date_2 is later than date_1, negative if it is earlier. |
Example
MONTH_DELTA($Start, $End)
The column returns the number of months difference between the two dates.
For the 2nd project, there is a 2 month difference between the End column and the Start column.
Note: the formula subtracts the start month from the end month without considering the day. You might need an intermediate operation to get the expected result. Example: start 01-01-2022, end 30-09-2022, MONTH_DELTA returns 8 although 9 would be expected. See below the section Counting months inclusively.
Understanding the sign of the result
The sign of the result indicates the direction of the difference, and both cases are useful depending on the need:
-
Positive result:
date_2is later thandate_1. Useful for elapsed duration, contract seniority, subscription length. -
Negative result:
date_2is earlier thandate_1. Useful to identify a deadline already passed, for exampleMONTH_DELTA($Today, $Deadline).
Choose the order of the dates depending on what you want to read. To always get a positive difference regardless of order, place the older date first.
Counting months inclusively
By default, MONTH_DELTA() counts the difference between the month boundaries. For the period from 08-17-2026 to 11-20-2026, it returns 3.
To count both the start month and the end month, add 1 to the result:
MONTH_DELTA($Start, $End) + 1
In this example: (8 − 11) + 1 = 4. The period indeed covers August, September, October, and November.
If the period spans two years, use an explicit year plus month calculation:
This formula adds the difference in years converted to months and the difference in months, then adds 1 to count both boundary months.
- (YEAR($End) - YEAR($Start)) * 12: converts the year difference to months.
- (MONTH($End) - MONTH($Start)): adds the month difference.
- + 1: counts both the start and end months.
Example, from 08-17-2025 to 11-20-2026:
(2026 - 2025) * 12 + (11 - 8) + 1 = 12 + 3 + 1 = 16.
The period indeed covers 16 months, from August 2025 through November 2026 inclusive.
(YEAR($End) - YEAR($Start)) * 12 + (MONTH($End) - MONTH($Start)) + 1
Return type
The function returns a number (the difference expressed in months).