Aug 12 2019 07:03 AM
Hi.
First of all, I Am new to this site and stumbled upon it while trying to find a solution for the problem I currently have.
I am about to transfer content from older SharePoint site to SharePoint 365 (online).
In the older site we used many different formulas to set up many of our lists.
But in the online version all of the formulas gives me syntax errors.
Example 1:
=YEAR(Created)&" : "&IF(INT((Created-DATE(YEAR(Created-WEEKDAY(Created-1)+4);1;3)
+WEEKDAY(DATE(YEAR(Created-WEEKDAY(Created-1)+4);1;3))+5)/7)<10;"0"&INT((Created-DATE(YEAR(Created-WEEKDAY(Created-1)+4);1;3)
+WEEKDAY(DATE(YEAR(Created-WEEKDAY(Created-1)+4);1;3))+5)/7);INT((Created-DATE(YEAR(Created-WEEKDAY(Created-1)+4);1;3)
+WEEKDAY(DATE(YEAR(Created-WEEKDAY(Created-1)+4);1;3))+5)/7))
Example 2
This is a list that have been made in to a journal. In the old journal we have columns that sort from year and month. Type of column is "calculated (calculated based on other columns). In the old we used this code:
Year:
=TEXT(Date;"yyyy")
Month:
=TEXT(Date;"MMMM")
Not any of the formulas that I have used in the older version works in SharePoint online.
why is that?
Aug 13 2019 06:46 PM
Hello @mortenf,
Your code from example #2 should work. Using the "Created" column the code works in my SPO test list.
=TEXT(Created,"yyyy")
=TEXT(Created,"MMMM")
The code in example #1 is more complicated and harder to debug. If you are looking for week of year this formula will work:
=INT((Created-DATE(YEAR(Created-WEEKDAY(Created-1)+4),1,3)+WEEKDAY(DATE(YEAR(Created-WEEKDAY(Created-1)+4),1,3))+5)/7)
I hope this helps.
Norm