Составление расчетного столбца за неделю в sharepoint 2007 г.

1376
Spon4ik

Я использую sharepoint 2007, и нет встроенной функции weeknum. Как я могу добавить вычисляемый столбец в списке sharepoint, чтобы показать число недели в другом столбце?

0

1 ответ на вопрос

0
Spon4ik

here is a formula to show a weeknum in sharepoint (no built-in function).

=IF(ROUNDUP((ROUNDDOWN([Date],0)-(DATE(YEAR(ROUNDDOWN([Date],0)),1,1))+WEEKDAY((DATE(YEAR(ROUNDDOWN([Date],0)),1,1))))/7,0)>52,1,ROUNDUP((ROUNDDOWN([Date],0)-(DATE(YEAR(ROUNDDOWN([Date],0)),1,1))+WEEKDAY((DATE(YEAR(ROUNDDOWN([Date],0)),1,1))))/7,0)) 

the formula returns always up to 52 weeks, and the week that has 1st January is the first week in a year. the week starts on a weekday depended on your SP server settings.

if you need to use the 53 weeks standart, use this part only

=ROUNDUP((ROUNDDOWN([Date],0)-(DATE(YEAR(ROUNDDOWN([Date],0)),1,1))+WEEKDAY((DATE(YEAR(ROUNDDOWN([Date],0)),1,1))))/7,0)