Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Date Diff Rounded By Month

248 1
cancel
Showing results for 
Search instead for 
Did you mean: 

I have 2 date columns…

Date 1, Date 2
2020-10-01, 2023-02-01
2019-04-01, 2022-03-31

I’m using the formula specified here to output the difference in years/months…

IF(AND({Date 1}, {Date 2}), DATETIME_DIFF({Date 2},{Date 1}, 'years') & ' years & ' & (DATETIME_DIFF({Date 2},{Date 1}, 'months') - DATETIME_DIFF({Date 2},{Date 1}, 'years')*12) & ' months')

It currently outputs “2 years & 4 months” for Column 1 (correct), and “2 years & 11 months” for Column 2 (incorrect). Column 2 is 1 day off 3 years exactly, and I need a way to round it to the nearest month. Any ideas would be very much appreciated.

1 Reply 1

P.s. the fact that the dates 2021-02-01 and 2023-02-28 display “2 years & 0 months” suggests that months are being rounded down, but instead I want to round up