Average Days per month

VADER73

New Member
Joined
Jul 19, 2018
Messages
6
Column A is a start date. Column B is an end date. Column C is the number of days between the date in Column A and Column B. Working out the overall average days is easy enough. I am having difficulty working out the average days by month especially since the start and end dates cross over months.

Any help would be much appreciated.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
See if this example helps (a small data sample)
Dates as dd/mm/yyyy

A
B
C
D
E
F
G
H
1
StartDate​
EndDate​
Days​
Month​
Days​
Months (count)​
Avg​
2
03/01/2019​
04/01/2019​
1​
1​
51​
3​
17​
3
06/01/2019​
15/02/2019​
40​
2​
42​
2​
21​
4
08/01/2019​
28/03/2019​
79​
3​
27​
1​
27​
5
4​
0​
0​
0​

<tbody>
</tbody>


Formula in C2 copied down
=B2-A2

Months of interest in column E

Array formula in F2 copied down
=SUM(IF(1-(($A$2:$A$4>EOMONTH(DATE(2019,E2,1),0))+(DATE(2019,E2,1)>$B$2:$B$4)),IF(B$2:B$4>EOMONTH(DATE(2019,E2,1),0),1+EOMONTH(DATE(2019,E2,1),0),$B$2:$B$4)-IF($A$2:$A$4>DATE(2019,E2,1),$A$2:$A$4,DATE(2019,E2,1))))
confirmed with Ctrl+Shift+Enter, not just Enter

Array formula in G2 copied down
=SUM(IF(1-(($A$2:$A$4>EOMONTH(DATE(2019,E2,1),0))+(DATE(2019,E2,1)>$B$2:$B$4)),1))
confirmed with Ctrl+Shift+Enter, not just Enter

Regular formula in H2 copied down
=F2/MAX(1,G2)

Hope this helps

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,791
Members
449,095
Latest member
m_smith_solihull

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