Forum Discussion

qdanazumi's avatar
qdanazumi
Copper Contributor
Aug 11, 2022
Solved

calculating months between two dates with rounding

I have been trying to look for the number between these two months while rounding to the next month if the day passes the 15th

  • qdanazumi 

    With dates in A3 and B3:

     

    =(12*YEAR(B3)+MONTH(B3)+(DAY(B3)>15))-(12*YEAR(A3)+MONTH(A3)+(DAY(A3)>15))

17 Replies

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    qdanazumi 

    Calculate the difference between two dates

    Use the DATEDIF function when you want to calculate the difference between two dates. First put a start date in a cell, and an end date in another. Then type a formula like one of the following.

     

    You can download an example workbook with all of the examples in this article.

    You can follow along, or create your own formulas.

     

      • qdanazumi's avatar
        qdanazumi
        Copper Contributor

        NikolinoDE The formula didn't end up working, unfortunately. 

         07/01/22 08/20/23

        I know that because 8/31/23 is past the 15th of the month I would round it to the next month so I'm pretty much looking for the total number of months between 7/1/22 and 9/1/23. I know the total number of months is 14. What formula should I use to figure that out?

         

Resources