Counting Months between two dates

cmcreynolds

Active Member
Joined
May 21, 2015
Messages
295
I have a start date and graduation date for each student - is there a particular DAX function to count the number of months between these two dates?

Or should I utilize Month #s and Years to get the count? Or the number of days?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Okay, so this formula works - I don't have graduation data for everyone, that's why I added the IF() with Blanks

=IF([Graduation Date]<>BLANK(),(YEAR([Graduation Date])-YEAR([StartDate]))*12+MONTH([Graduation Date])-MONTH([StartDate]),BLANK())
 
Upvote 0
I used YEARFRAC(). To get the months between two dates:

= YEARFRAC(DATE(2020,9,1),TODAY(),1)*12)

...to get whole numbers wrap in INT() or ROUNDUP() depending on on if you want to count partial months or not
 
Upvote 0
I used YEARFRAC(). To get the months between two dates:

= YEARFRAC(DATE(2020,9,1),TODAY(),1)*12)

...to get whole numbers wrap in INT() or ROUNDUP() depending on on if you want to count partial months or not
Above formula outputs non zero for same month. Is this formula dependent on number of days? Is there formula that treats input in month not days; i.e. zero if dates are same month. Thanks Ahead!
 
Upvote 0

Forum statistics

Threads
1,223,693
Messages
6,173,866
Members
452,536
Latest member
Chiz511

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