Skip to main content

Converting a formula filed that has year and month (Round to year)

  • July 19, 2022
  • 1 reply
  • 39 views

I have a Service Years column that I would like to round in a new formula filed

This is what the formula looks like in the Service Years column

I would like to have a new field/column that take the year and month and round it up to the year.

Example: (Service Years) 10 years 10 months – (New Field/Column) 11 years

1 reply

Kamille_Parks11
Forum|alt.badge.img+27

If you want to round to the nearest year

IF(
  {Continuous Service Date},
  ROUND(DATETIME_DIFF(TODAY(), {Continuous Service Date}, "months")/12)
)

^I used TODAY instead of NOW because you are calculating years. You don’t need the formulas to refresh frequently, so using TODAY will be more efficient.

If you want to always round up:

IF(
  {Continuous Service Date},
  ROUNDUP(DATETIME_DIFF(TODAY(), {Continuous Service Date}, "months")/12, 0)
)