How can I extract the year from a date using a data column?

I have a list of projects with dates. I would like to filter the items shown by their year, e.g. 2019, 2020…

I assume the best way is to create a new column in the data sheet. However, I cannot work out how to extract the year. The If, then, else function should work since it recognizes dates but I can’t set up the arguments.

I know the workaround is to add a column in my google sheet and use Year() but this means I have to copy down the formula a thousand times, just in case my project list grows and grows.

Isn’t there a way to extract the year using a new data column?

Thanks in advance for any pointers.

If you want to use this approach, just use it with an Arrayformula to copy the formula as new rows are added. Something like:

={“Column Title”; ARRAYFORMULA(IF: A2:A="","",YEAR())}

If you want to keep it all in Glide, I think you could probably create a split column that looks at a Date column in Medium format. This could split that date column at the comma, then you might be able to grab the 4 digit year value from there. I haven’t fully thought this through though… so I don’t really know how to do this in full.

2 Likes

More info on Arrayformula here.

1 Like

Create a math column in the glide data editor and use the year(date) formula. You don’t have to do any of this in the google sheet.

6 Likes

Thanks so much Jeff… it worked like a dream!

2 Likes