Forum Discussion
RJF61
Oct 26, 2023Copper Contributor
Calculated Column with Dates and "IF"
I've been working on this for a bit and just can't find the correct syntax. if(([Created] > 6/30/21 and [Created] <7/1/2022), "2022", if(([Created] > 6/30/22 and [Created] <7/1/2023), "2023", "20...
ganeshsanap
Oct 27, 2023MVP
RJF61 Use calculated column formula like below:
=IF(AND([Created] > DATE(2021,6,30), [Created] < DATE(2022,7,1)), "2022", IF(AND([Created] > DATE(2022,6,30), [Created] < DATE(2023,7,1)), "2023", "2024"))
Where syntax for DATE function is like:
DATE([Year],[Month],[Day])
Note:
- Sometimes comma( , ) does not work in formula (it is based on language or regional settings on your site). So in that case use semicolon( ; ) instead of comma( , ).
- Use correct display name of your SharePoint columns in above formula.
- Wrap column names inside [] if your column name has space in it. For example: [My Column Name].
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.