0
votes

Users are entering date ranges into an Excel spreadsheet. These date ranges span multiple months. What I'd like is for a field to display how many full months are represented in the date range.

For example:

User enters 8/25/2014 and 12/19/2014

Calculated field = 3

The full months represent September, October, and November. August and December are only partial months.

1

1 Answers

4
votes

Assuming start date in A2 and end date in B2 use this formula for the number of full months

=DATEDIF(EOMONTH(A2-1,0)+1,B2+1,"m")

That will give you 3 for your example - if you change the start date to 8/1/2014 (or the end date to 12/31/2014) you will get 4 (or if you do both you'll get 5)