Back to ISO-8601, Swedes, Standards, Related.
Excel-Function Returning Week Number
Excel-function returning Week Number as per used in (e.g.) Sweden. Date in cell A1.
=INT((A1-(DATE(YEAR(A1-WEEKDAY(A1-1)+4),1,3)) + WEEKDAY(DATE(YEAR(A1-WEEKDAY(A1-1)+4),1,3)) + 5) / 7)
Created the above after finding VBA function 2008-05-29 at www.xldennis.com/veckonummer(vba).htm
Function VECKONUMMER(Datum As Date) As Integer'© 2002 Alla rättigheter XL-Dennis
Dim lnDatum As Long
lnDatum = DateSerial(Year(Datum - Weekday(Datum - 1) + 4), 1, 3)
VECKONUMMER = Int((Datum - lnDatum + Weekday(lnDatum) + 5) / 7)
End
Read More, Sources
- Back to ISO-8601, Swedes, Standards, Related.
200805301024