Function ISOWeekNum(d1 As Date) As Integer 'Daniel Maher Dim Jan03 As Long Jan03 = DateSerial(Year(d1 - Weekday(d1 - 1) + 4), 1, 3) ISOWeekNum = Int((d1 - Jan03 + Weekday(Jan03) + 5) / 7) End Function
-- René Delcourt
Bonjour,
J'ai essayé d'adapter la formule de Christophe Péjout mais j'ai une erreur 439
Function ISOWeekNum(d1 As Date) As Integer
'Daniel Maher
Dim Jan03 As Long
Jan03 = DateSerial(Year(d1 - Weekday(d1 - 1) + 4), 1, 3)
ISOWeekNum = Int((d1 - Jan03 + Weekday(Jan03) + 5) / 7)
End Function
--
René Delcourt
Bonjour,
J'ai essayé d'adapter la formule de Christophe Péjout mais j'ai une erreur 439
Function ISOWeekNum(d1 As Date) As Integer 'Daniel Maher Dim Jan03 As Long Jan03 = DateSerial(Year(d1 - Weekday(d1 - 1) + 4), 1, 3) ISOWeekNum = Int((d1 - Jan03 + Weekday(Jan03) + 5) / 7) End Function
-- René Delcourt
Bonjour,
J'ai essayé d'adapter la formule de Christophe Péjout mais j'ai une erreur 439
A mon avis, ce n'est pas ISO. Voir : http://www.cpearson.com/Excel/Weeknum.htm
"René Delcourt" a écrit dans le message de news:
OK, j'ai trouvé cette fonction :
Function ISOWeekNum(d1 As Date) As Integer 'Daniel Maher Dim Jan03 As Long Jan03 = DateSerial(Year(d1 - Weekday(d1 - 1) + 4), 1, 3) ISOWeekNum = Int((d1 - Jan03 + Weekday(Jan03) + 5) / 7) End Function
-- René Delcourt
Bonjour,
J'ai essayé d'adapter la formule de Christophe Péjout mais j'ai une erreur 439
A mon avis, ce n'est pas ISO.
Voir : http://www.cpearson.com/Excel/Weeknum.htm
"René Delcourt" <rde@intras.ch> a écrit dans le message de news:
8BC9488F-4227-489C-A356-A0A069B96C6C@microsoft.com...
OK, j'ai trouvé cette fonction :
Function ISOWeekNum(d1 As Date) As Integer
'Daniel Maher
Dim Jan03 As Long
Jan03 = DateSerial(Year(d1 - Weekday(d1 - 1) + 4), 1, 3)
ISOWeekNum = Int((d1 - Jan03 + Weekday(Jan03) + 5) / 7)
End Function
--
René Delcourt
Bonjour,
J'ai essayé d'adapter la formule de Christophe Péjout mais j'ai une
erreur 439
A mon avis, ce n'est pas ISO. Voir : http://www.cpearson.com/Excel/Weeknum.htm
"René Delcourt" a écrit dans le message de news:
OK, j'ai trouvé cette fonction :
Function ISOWeekNum(d1 As Date) As Integer 'Daniel Maher Dim Jan03 As Long Jan03 = DateSerial(Year(d1 - Weekday(d1 - 1) + 4), 1, 3) ISOWeekNum = Int((d1 - Jan03 + Weekday(Jan03) + 5) / 7) End Function
-- René Delcourt
Bonjour,
J'ai essayé d'adapter la formule de Christophe Péjout mais j'ai une erreur 439
Si, si... Il y a aussi ça : Function NUMSEM_ISO(cel As Range) 'AV If Day(cel) = 2 And Month(cel) = 1 And Year(cel) Mod 400 = 101 Then NUMSEM_ISO = 52: Exit Function NUMSEM_ISO = IIf(Weekday(cel) = 2 And Month(ladate) = 12 And Day(cel) > 28, 1, DatePart("ww", cel, 2, 2)) End Function
Et il y a aussi toutes les possibilités à partir des fonctions de feuille et la fonction Evaluate
AV
|A mon avis, ce n'est pas ISO.
Si, si...
Il y a aussi ça :
Function NUMSEM_ISO(cel As Range) 'AV
If Day(cel) = 2 And Month(cel) = 1 And Year(cel) Mod 400 = 101 Then NUMSEM_ISO =
52: Exit Function
NUMSEM_ISO = IIf(Weekday(cel) = 2 And Month(ladate) = 12 And Day(cel) > 28, 1,
DatePart("ww", cel, 2, 2))
End Function
Et il y a aussi toutes les possibilités à partir des fonctions de feuille et la
fonction Evaluate
Si, si... Il y a aussi ça : Function NUMSEM_ISO(cel As Range) 'AV If Day(cel) = 2 And Month(cel) = 1 And Year(cel) Mod 400 = 101 Then NUMSEM_ISO = 52: Exit Function NUMSEM_ISO = IIf(Weekday(cel) = 2 And Month(ladate) = 12 And Day(cel) > 28, 1, DatePart("ww", cel, 2, 2)) End Function
Et il y a aussi toutes les possibilités à partir des fonctions de feuille et la fonction Evaluate