DATEDIF returns incorrect count

kasmith1017

New Member
Joined
Sep 26, 2016
Messages
10
Hi everyone,

I am putting in a column to proof out that I have the correct balance for my prepaid item based on the number of months remaining based on the end date of the item and the current month end. I have my current month end date (7/31/17) in cell Z4, and the contract end date in cell F11. In a new cell I've put the formula below:

=DATEDIF(Z4,F11,"m")

When I do this, the result that returns is a 1, not a 2 as expected. All others worked out OK but this one. Can someone please help me out? I'm thinking maybe it has to do with the number of days in each month. Basically I want to get the number of months between these two dates so if there's a better formula I can use that will not cause this issue please let me know. Thank you in advance!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try the following


Excel 2010
BCDEFGH
1Datedif Months
231-Jul-1731-Aug-1730-Sep-1731-Oct-1730-Nov-1731-Dec-1731-Jan-18
3123456
4
6c
Cell Formulas
RangeFormula
C3=DATEDIF($B$2+1,C2+1,"m")
 
Last edited:
Upvote 0
If you are always going from the end of one month to the end of the other month, why not just subtract the two month values...

=MONTH(F11)-MONTH(Z4)
 
Upvote 0
If you are always going from the end of one month to the end of the other month, why not just subtract the two month values...

=MONTH(F11)-MONTH(Z4)

Great question! Just figured if there was a way I could get the number of months without dividing by 30 days I would do that, but clearly that's not working out. Thank you all for the help! :)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top