8

I have a Year column and I already know that it's not possible to filter a view using Year equals =YEAR([TODAY]) and use [TODAY] in calculated columns does not work as expected.

Does there exist a workaround to filter the items accordingly to the current year?

9

In the Filter settings of a View you can only use [Today] as is, you can do simple +- calculations but you can not use Functions.

Remember: Do not add spaces in your View Filter calculations: [Today]-7

So you need to add two Calculated Columns calculating

january1st

=DATE(Year([YourDate]),1,1)

and december31st

=DATE(Year([YourDate]),12,31)

and then compare in your View Filter if [Today] is between those dates

  • you're missing a closing square bracket. Also, what format is the date parameter in? Does it need quotes? – Colbs Nov 15 '17 at 19:21
  • I'm working with SharePoint 2013 and when I'm created a calculated column it doesn't accept me functions =DATE() neither =TEXT().... what can I use instead? THANK YOU! – Eliza Villegas Aug 23 '18 at 20:51
2

You will need to use some workaround as mentioned below.

1) Create two calculated columns Start Year and End Year

2) Start Year = DATE(YEAR([Expiry Date]),1,1)

3) End Year = DATE(YEAR([Expiry Date]),12,31)

4) Create a View and Filter Condition will be

Start Year is Less Than or Equal to [TODAY] AND End Year is Greater Than Equal To [TODAY]

2

You can try this workaround:

1) Create a calculated column StartYear = DATE(YEAR([your date field]),1,1)

2) Create a calculated column EndYear = DATE(YEAR([Expiry Date]),12,31)

3) Create a View and Filter:

StartYear is Less Than or Equal to [TODAY] AND EndYear is Greater Than Equal To [TODAY]

Source.

0

My quick-n-easy approach to this it to create a calculated column called Year to extract a text Year value from the existing date field:

=TEXT([your date field name],“yyyy”)

Then filter by Year column. Usually if a client needs to filter data for current year, they'll need past and future years too, or a range. They can still do that with this column.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.