Forum Discussion
Gogi_Putkaradze
Apr 21, 2022Copper Contributor
Formula calculated column: show date as week number
I have the following issue in SharePoint List: I have a column name SalesWeek and I want to show in another column named "WeekNB" the week number. In short show 4/21/2022 in Salesweek as week ...
RobElliott
Apr 21, 2022Silver Contributor
Gogi_Putkaradze you can do this with the following formula. Change Alert to Salesweek:
=INT((Alert-DATE(YEAR(Alert),1,1)+(TEXT(WEEKDAY(DATE(YEAR(Alert),1,1)),"d")))/7)
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
Lev_Kr
Jan 04, 2023Copper Contributor
Hey, Ive been using this formula for a while now without issues. In 2023 the week number is off by 3 or 4 weeks. So data entered today is coming out to week #4. 12/31/2023 comes out to week #56. Im trying to find a solution that would keep the previous years data accurate and work for 2023 as well.
=INT(([Completion Date]-DATE(YEAR([Completion Date]),1,1)+(TEXT(WEEKDAY(DATE(YEAR([Completion Date]),1,1)),"d")))/7)
- NonesbusinessJan 06, 2023Copper Contributor
Lev_Kr my network operations team was able to fix the same problem using this code. We are in SP2016, with on prem servers.
=CONCATENATE(TEXT(IF(INT(([Work date]-DATE(YEAR([Work date]),1,1)+(TEXT(WEEKDAY(DATE(YEAR([Work date]),1,1)-1),"d")))/7)=0,52,INT(([Work date]-DATE(YEAR([Work date]),1,1)+(TEXT(WEEKDAY(DATE(YEAR([Work date]),1,1)-1),"d")))/7)),"0"))
- bonbrianOct 10, 2023Copper Contributorhow come when i tried to manually input Jan 1,2024, the output workweek is 4 instead of 1?
- SueDickersonFeb 10, 2023Copper ContributorWhile this works, in O365 SharePoint, you cannot filter or group or create a view by the result of the calculation. Very odd!!
- BillD98Jan 30, 2023Copper ContributorI have the same issue as Lev, but this new formula will not work for me. It simply tells me I have an error when I try to save the formula above. We are using SP in the cloud. Any thoughts?
- SueDickersonFeb 10, 2023Copper ContributorBe sure to rename the field to what yours is called. I know this sounds really dumb, but I just copied and pasted the first time as well, since I was so excited. I forgot to change the column called Work day, to the column in my list that I needed it to reference.