Can we add add a entire year into a trigger action

Hello, I would like to know if we can create an action to add 1 year in a column, I know I can do it with math with +365, but I have to add exactly one year.

Like if my date is 31.12.2022 I want 31.12.2023 or 12.05.2022 want to be 12.05.2023 and not 13 or 12 (depend fo the actual year)

Maybe someone now a trick with template or ? Or someone knows the value of a year in math ?

Thank’s for help !

Is the format important, and does the return value actually need to be a date?
If you’re okay with yyyymmdd format, then a really simple option is to use a Math column.

(Year(Date)+1)*10000
+ Month(Date)*100
+ Day(Date)

I guess it depends what you’re doing with the resultant value. If you’d be using it to create a relation (for example), then it’s actually a good idea to convert your dates to integers, as this removes the time component from the date - which can cause problems if you’re using dates in relations.

I want add a year in a trigger action with set columns (clic into a button and then it’s gonna add a year into our column).

I gonna try with your idea, maybe I can do it.

hmm, if you want to use that to do a Set Column value on an existing date/time column you’ll probably find that it doesn’t work.

So perhaps the below will be a better option in your case:

You’ll just need to decide what happens if todays date is Feb 29 :wink:

2 Likes

It’s working I just change the base of your idea.

I just separated the year the month and the day, and create a template and all is good.

I actually have an updated version of that formula, which I think takes care of a couple of odd issues when adding months to a date that results in the end of February. Probably doesn’t matter for your use case of adding a full year, but if you ever use it for adding months, then I would recommend the new version instead. (I should update my original post)

You could also consider using the EDATE Excel formula in the Excel Formula plugin. Not sure how well it works, but something to try. I think you would use a formula like this.

=EDATE(A1,12)

2 Likes

Thank you for your solution, in our case we don’t need to add a month that’s why this solution suits me. We have contracts that renew tacitly (but not automatically) so we only need to extend the expiry date by one year.

1 Like

That’s fine. Just be aware if you ever have a February 29th leap year situation. Adding a year could give you an invalid date if you aren’t careful.

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.