Time between two dates

Sweedler

Board Regular
Joined
Nov 13, 2020
Messages
114
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
Hello

I have a start date and an end date in column A and B respectively. Figuring out the number of days between them is easy enough, but I need to know which months the days fall in.

For example: START DATE: 18-JAN -- END DATE: 7-MAR

There are 49 days between those dates, but there are 13 days in Jan, 29 in Feb and 7 days in Mar. Does anyone know an easy way to calculate this. Or a complicated way, it doesn't matter.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Is this what you are looking for? Check this and revert -

Book1
ABCDEF
1StartEndDays
218-Jan7-Mar4913297
Sheet1
Cell Formulas
RangeFormula
C2C2=B2-A2
D2D2=IF(B2>EOMONTH(A2,0),EOMONTH(A2,0)-A2,B2-A2)
E2E2=IF(D2<C2,EOMONTH(A2,1)-EOMONTH(A2,0),0)
F2F2=IF(SUM(D2:E2)<C2,B2-EOMONTH(A2,1),0)
 
Upvote 0
Solution
Is this what you are looking for? Check this and revert -

Book1
ABCDEF
1StartEndDays
218-Jan7-Mar4913297
Sheet1
Cell Formulas
RangeFormula
C2C2=B2-A2
D2D2=IF(B2>EOMONTH(A2,0),EOMONTH(A2,0)-A2,B2-A2)
E2E2=IF(D2<C2,EOMONTH(A2,1)-EOMONTH(A2,0),0)
F2F2=IF(SUM(D2:E2)<C2,B2-EOMONTH(A2,1),0)
Hello

I am having trouble making this work. Plus, I also need it to take only workdays into account
 
Upvote 0
Hello

I realize that I neglected to mention WORKDAYS in my original post, but it is a necessity.
 
Upvote 0
You are welcome. Glad we could help!
 
Upvote 0

Forum statistics

Threads
1,215,077
Messages
6,122,992
Members
449,094
Latest member
masterms

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