Average Span of Dates, by Individual Month

gexexcel

New Member
Joined
Dec 1, 2015
Messages
2
Good afternoon,

I've been playing with some formulae like COUNTA() and TODAY() for days :confused: and I was hoping one of you might be able to propose a simple solution!

I have a database of landmark dates for multiple installation projects. Example:

ABCD
LocationQuotedOrderedDelivered
1060211/02/201511/05/201511/09/2015
454211/08/201511/12/201511/15/2015
23512/19/201512/25/201612/27/2016
828101/26/201601/29/2016
522201/21/2016

<tbody>
</tbody>


What I want to do is create a scorecard showing how long the average span was for each month, I need a formula for the cells with red text. Example:

MeasureNovDecJan
Time to Order Avg (Column C - Column B)3.5 days6 days3 days
Time to Deliver Avg (Column D - Column C)3 days2 daysX days

<tbody>
</tbody>

As indicated in the first table, there won't always be data in each cell while work is in process. If it's possible to ignore those with blank data that would be ideal, but if not perhaps assume all blanks are TODAY()? Also perhaps we can throw in a condition to omit holidays / weekends?

Win7, Excel 2010

Thanks in advance for any help, let me know if you need more info!

gexexcel
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi gexexcel,

One way of doing it is by adding some additional columns like this:
ZIYMZWP.png



Calculating the time span between two dates:
Cell D2 has formula =DATE(YEAR(C2),MONTH(C2),1)
Cell E2 has formula =NETWORKDAYS(B2,C2,HolidayTable)

Cell D2 has formula =DATE(YEAR(F2),MONTH(F2),1)
Cell E2 has formula =NETWORKDAYS(C2,F2,HolidayTable)

Calculating the average time according to the month of service:
Cell L2 has formula =IFERROR(AVERAGEIF($D2:$D11,L$1,$E2:$E11),0)
Cell L3 has formula =IFERROR(AVERAGEIF($G2:$G11,L$1,$H2:$H11),0)

The formula NETOWRKDAYS calculates difference between 2 dates excluding weekends and holidays (holidays need to be defined in a range or table, in the example above I just created a table for easy reference); the formula counts the initial date as the first day so it will give you 4 days from 11/2/15 to 11/5/15, if you don't like this just add a -1 to the end of the formula.

The AVERAGEIF calculates the average of a given range only if a condition is met in the range, in this case I'm using the header (Nov-15) as a date (11/1/15), this is the condition, so it will only average the working days where the "Month-Year" matches the Measure date.

I've uploaded the working file above if you want to review the formulas, this is the link -> https://drive.google.com/file/d/0B1t6R5UwL0-2ZGNjX2k5QnJfdnM/view?usp=sharing

Cheers,

Angel
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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