Difference Between Dates in Months with a Maximuim number

reneev

Board Regular
Joined
Apr 26, 2017
Messages
53
So I have to calculate the number of months between two dates. I have that formula (=DATEDIF(F3,$D$1,"m")+1). However, I need to put a caveat in there that says if the number is more than 11, keep it at 11.

This number is being used to average a sum and the number of months to average is either the actual number of months between the two dates or a maximum of 11.

Can anyone help?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
MIN is short for Minimum, and it just finds the minimum value of a set of numbers. So if your DATEDIF formula returns a value of 7, then MIN(11, 7) will return 7. But if your DATEDIF formula returns 13, then MIN(11, 13) will return 11. So that's just a convenient way to set a cap for your values.

I'm glad this worked for you! :cool:
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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