Bug DATEDIF sous Excel 2007

Salut le forum

La fonction DATEDIF utilisée

=DATEDIF(I16;G16;"Y")&SI(DATEDIF(I16;G16;"Y")>1;" ans, ";" an, ")&DATEDIF(I16;G16;"YM") &" mois et "&DATEDIF(I16;G16;"MD")&SI(DATEDIF(I16;G16;"MD")>1;" jours";" jour")

Résultats sous Excel 2007

2012-01-10        2011-01-10        1 an, 0 mois et 0 jour
2012-01-10        2011-01-11        0 an, 11 mois et 143 jours
2012-01-10        2011-01-12        0 an, 11 mois et 142 jours

Résultats sous Excel 2003

2012-01-10        2011-01-10        1 an, 0 mois et 0 jour
2012-01-10        2011-01-11        0 an, 11 mois et 30 jours
2012-01-10        2011-01-12        0 an, 11 mois et 29 jours

Le problème semble être lié à l'installation du SP2 (Service Pack 2)

Mytå

Re le forum

Information trouvé sur

You might want to reconsider using the DATEDIF function. It is an

undocumented (and, thus, probably an unsupported) Excel function which

appears to be broken in XL2007 at Service Pack 2. Someone recently posted

this message as part of a newsgroup question...

=DATEDIF(DATE(2009,6,27),DATE(2012,1,5),"md")

In 2007, this gives me 122. This happens all the way up to the point

where the second date is 1/26/2012 and then it hits zero at 1/27/2012.

In 2002, however, it gives me the correct answer of 9.

An informal survey of fellow MVPs shows the above formula works correctly in

the initial release of XL2007 and its SP1, but does not work correctly in

SP2; hence, it appears to be broken at that level. The problem is that the

extent of the breakage is unknown (and probably indeterminable). In

addition, I would say, being an undocumented (and, thus, probably and

unsupported) function, the odds of Microsoft spending the time to search

down and fix whatever broke is slim. This would seem to mean that DATEDIF

cannot be counted on to work correctly from XL2007 SP2 onward. And even if

Microsoft did fix the problem in a subsequent Service Pack, any of your

users who remained at SP2 would be subjected to incorrect result.

Rick (MVP - Excel)

Mytå

Bonsoir,

Pas de problème sous Excel 2007 SP2 (Version Entreprise)

A+

Benead

Rechercher des sujets similaires à "bug datedif 2007"