If Date Earlier than another Date THEN Count Number of Months

sophia1313

New Member
Joined
May 20, 2013
Messages
9
I am waving the white flag. I need help with an issue in Excel 2007. I have a date in Column S. It is formatted as MM/DD/YYYY (e.g., 7/1/2013). It is being pulled into Column S from another tab using a VLOOKUP. There is another date in Column AE. It is formatted as YYYY-MM (e.g., 2013-03). It too is being pulled in from yet a different tab. Then finally there is a number in Column AF for number of months. I need to determine if the date in AE3 occurs earlier than date in S3. If it does occur earlier then I need to count the number of months between the date in AE3 and the fixed date of 12/31/2013 in (AI3), which is the project end date. I need to do this all in one cell. Thank you!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
<s3,datedif(ae3,ai3,"m"),"")"< html=""></s3,datedif(ae3,ai3,"m"),"")"<>maybe

=IF(AE3 < S3,DATEDIF(AE3,AI3,"m"),"")

please note that there are spaces around the < sign so it shows up<s3,datedif(ae3,ai3,"m"),"")<s3,datedif(ae3,ai3,"m"),"")[ code]<="" html=""></s3,datedif(ae3,ai3,"m"),"")<s3,datedif(ae3,ai3,"m"),"")[>
 
Last edited:
Upvote 0
Thank you for the article the solution. I still struggled in understanding it, in the end I used the formula as provided without overthinking it and it worked! Maybe I will give it a few hours and try to figure out exaclty why it worked some other time. Right now I am just happy it did work. :) Thank you.
 
Upvote 0
Okay Weazel, this worked and I understand it! Simple. Like me. ;) If not for you guys and the < explanation I would still be trying to figure this out. Thank you!
 
Upvote 0

Forum statistics

Threads
1,216,561
Messages
6,131,409
Members
449,651
Latest member
Jacobs22

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