Month and Day Between (DATEDIF does not work)

DinoMania

New Member
Joined
Oct 21, 2015
Messages
5
Hello! I have been scrounging forums for an answer to my question. I have start and end dates that I need to calculate the complete full calendar month and days between both dates.

The reason datedif does not work is when the start date and end date are not full calendar months but are greater than 30 days making it appear to be a full month. EXAMPLE start date is 7/15 and the end date is 9/20. I would need the formula to give me 1 month (August) and 36 days (17 in July and 19 in September). I have over 20K rows of this with varying dates that cross over a calendar year. The reason I need the exact calender months and partial months in days is that the dollar value attributed to a month compared to days (partial months) is different.

Let me know if you know anything that would help me. Thank you!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Excel 2010
ABCDEFGHIJK
2MonthsDaysStartEndMar-18Apr-18May-18Jun-18Jul-18Aug-18Sep-18
331303130313130
413715-Jul-1820-Sep-180000173120
54101-Mar-1801-Jul-1831303130100
2dd
Cell Formulas
RangeFormula
A4=SUMPRODUCT(--($E$3:$N$3=E4:N4))
B4=SUM(E4:N4)-SUMPRODUCT(--($E$3:$N$3=E4:N4),(E4:N4))
E3=F2-E2
E4=MAX(0, MIN(EOMONTH(E$2, 0), $D4) + 1 - MAX(E$2, $C4))
E5=MAX(0, MIN(EOMONTH(E$2, 0), $D5) + 1 - MAX(E$2, $C5))



Mar-18 etc is 1-Mar-18 i.e. first day of applicable month
Copy the formula down and across as applicable.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,179
Members
452,615
Latest member
bogeys2birdies

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