Formula to determine number of months between two dates

Mldeuser

Well-known Member
Joined
Dec 27, 2008
Messages
573
Office Version
  1. 365
Platform
  1. Windows
Hello

I am trying to write a formula that will first determine the the date in cell A4 is greater than the date on cell E14 and less than the date in cell F14. If true I would like it to calculate the number of months between the two dates.

Date is cell A4 = 10/31/20
Date in cell E14 = 10/01/20
Date in cell F14 = 12/31/20

In this case it would need to return 1, next month when the date in cell A4 changes to 11/30/20 then return 2 and so on. otherwise return 0.

Thank you
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
How about
Excel Formula:
=IF(AND(A4>E14,A4<F14),MONTH(A4)-MONTH(E14)+1,0)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

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