Formula - Adding Years to a Date

Hello again, I have been trying to automate a field that adds a set amount of years to a date field but it keeps throwing errors so 'guessing its wrong or too complicated.

Signedupdate is a date field (18/04/2024) & Product Term is an integer (10). so in this example the formula result would be 18/04/2034.

it works great in Excel, but not in Noloco so and advice would really be appreciated.

=DATE(YEAR(Signedupdate) + Product Term, MONTH(Signedupdate), DAY(Signedupdate))

Actually I think what happened here @garyGHL is that the field was created, so you can’t create the field again.

If you reload the page I think the field will be there and you can edit it from there on.

We will try to figure out why it didn’t save correctly the first time

Thanks @darragh, I had checked that, usually when I create any formula the spinner just spins for minutes, I close it, refresh and the column is there. This one though says failed to fetch, I left it running for around 6 minutes before closing, opening, refreshing but still it doesn’t create. Ill have another go tomorrow.

Edit ** I tried again and it saved ok, but the formula doesnt calculate anything, just blank fields.

Quick update @darragh , this doesn’t work either, both are fine in Excel so not entirely sure what is wrong. The formula window just spins and spins, I close the window, refresh and it appears but with no data.

How many Rows are in this table @garyGHL ?

@darragh 24,000 in the table, 1,700 that it actually affects. That may explain why it spins and spins.

As a test I also created a new Noloco table with just 10 records, the fomula creating was quick but it also doesn’t calculate that either. Just blank records.

Hi @garyGHL

There are some minor differences between formulas in Excel & Noloco to note.

  • We don’t use a prefix = character for our formulas
  • To get a date to format correctly we require TODATE() to be called on the result
  • Some operations aren’t supported

A formula like the below should be a good starting point for your use case:
Screenshot 2024-04-19 at 11.09.48

I’d recommend checking out our guide, it has some examples & a list of the supported operators for formulas:

1 Like

Brilliant, that works perfectly. Thank you @Niall & @darragh .

Just to note and its not a problem really but creating formulas on large tables seems to still have the issue whereby it spins and spins until I close the browser and log back in.

Thanks again

1 Like