Forum Discussion

François_Soucy's avatar
François_Soucy
Copper Contributor
Oct 15, 2021

calculer le nombre de mois entre 2 dates dans Excel office 365

J'essaye de savoir combien de mois il y a entre 2 dates dans Excel pour office 365 et tout ce qu'on me propose c'est d'utiliser une vieille fonction qui n'apparait pas dans les fonctions de Excel: Dateif().

 

Cette fonction est mal documenté et ne fonctionne pas. Elle donne toujours l'erreur #nom?.

 

Comment faire pour simplement calculer le nombre de mois entre 2 dates... C'est quelque chose de standard non ? Ca devrait être simple non ?

 

Merci

 

5 Replies

    • mathetes's avatar
      mathetes
      Silver Contributor

      Riny_van_Eekelen  wrote just deduct the start date from the end date and divide the result be 30.4167 (that is, the approximate average number of days per month in any given year).

       

      "approximate"!!??-- how many more decimal places would you need, my friend, before it's the precise average? [smiley face]

      • Riny_van_Eekelen's avatar
        Riny_van_Eekelen
        Platinum Contributor

        mathetes Haha! As you know, one month may be 28, 29, 30 or 31 days, but never 30,4167. That's why I used the word "approximate". But it's good enough to the "how many months" calculation. 

  • mathetes's avatar
    mathetes
    Silver Contributor

    François_Soucy 

     

    YOu're right that it's poorly documented. But it does work:

     

    =DATEDIF(earlier_date,later_date,"m") 

     

    It returns #NUM if the dates are reversed. So have the earlier of the two dates first in the function.

     

Resources