Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How can I calculate the number of the week based on a date in a list? I tried several examples I found on the internet, but none worked correctly?

The formula should comply with the ISO standard where the week always begins on a Monday, and ISO week 1 begins on the Monday of the first week of the year that contains a Thursday. Said differently, ISO week 1 is the first week (beginning on Monday) that has at least four days.

Anybody has a good solution for that?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

I used the following formula. Week starts on monday. Depending on your regional settings you have to replace the ; with ,

=IF(INT((StartDate-DATE(YEAR(StartDate);1;1)+(TEXT(WEEKDAY(DATE(YEAR(StartDate);1;1)-1);"d")))/7)=0;52;INT((StartDate-DATE(YEAR(StartDate);1;1)+(TEXT(WEEKDAY(DATE(YEAR(StartDate);1;1)-1);"d")))/7))

share|improve this answer
1  
about the regional settings: login with browser locale "en-us". then add this formula in a calculated field, save it. After that,change back the locale ID and the formula automatically replaces with the localized formula. –  Bas Lijten Jul 14 '11 at 16:18
    
This one works. Great thank you. –  mikedevon Jul 14 '11 at 16:30
add comment

On the following link a solution is described:

http://www.petestilgoe.com/2009/08/displaying-the-week-number-using-a-sharepoint-calculated-column/

Please keep in mind that different countries handle weeknumbers differently: week 1 could be: * the week of 1 january (any day) * the first week that has at least 4 days of januari * the first week that has 7 days of januari

share|improve this answer
    
The formula under your link does not seem to work correctly: For example: for 1/1/2012 it returns week 4. It's seems to work for 2011 and 2013, 2014. But not for 2012. Strange. –  mikedevon Jul 14 '11 at 9:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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