Mar 28 2023 05:58 AM
Hi
I'm creating a new column in my Sharepoint List. I'm using a calculated value for this column that extracts the year from a 'date' column.
Example:
Date column: 23-02-2023 Year column: 2023
The formule I used for this was =YEAR([Date]). But it's giving me 2.023 instead. The notation is set on numbers with 0 decimals. Tried some changes but can't figure this one out.
Mar 28 2023 06:29 AM
@Jonas_Daragas Are you using calculated column? Can you show us the screenshot of calculated column settings?
Also just to confirm, what is the data type of another column, date and time?
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Mar 28 2023 06:40 AM
Hi this a screenshot of my column settings. The column 'Datum JAP' is a standard date&time column.
Mar 28 2023 06:40 AM
@Jonas_Daragas I just tried it at my end and it works for me. Formula I used:
=IF(ISBLANK([Date]),"",YEAR([Date]))
Column Settings:
Output:
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Mar 28 2023 06:43 AM
Mar 28 2023 06:44 AM
Note:
Documentation: Calculated Field Formulas
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Mar 28 2023 06:48 AM
Mar 28 2023 06:50 AM - edited Mar 28 2023 06:59 AM
@Jonas_Daragas Try using formula in this format:
=IF(ISBLANK([Date]),"",TEXT([Date],"yyyy"))
Output:
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Mar 28 2023 06:57 AM
@Jonas_Daragas You have to adjust the formula as per the language of your SharePoint site.
Refer to my above note about using semicolons instead of commas now. Refer documentation link for more information about functions used in calculated column formula.
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs