Averaging the difference between two dates and separating them into categories

Bpc1284

New Member
Joined
Jun 14, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a table that will produce the average difference between start dates and completion dates for projects therefore giving average completion time in days for projects. I would also like this to be separated by the category of project it is which is located in column E of my sheet. I have used an AVERAGE(FILTER(DAYS( function but this only provides the average completion time for all categories of projects combined. I believe an AVERAGEIFS is what I need to use but I can’t figure it out.

My current formula is
=AVERAGE(FILTER(DAYS($G$2:$G$100000,$C$2:$C$10000), $G$2:$G$10000<>””))

Start dates are in column C, Completion dates are in column G, and criteria I want to categorize by is in column E.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Welcome to the forum!

try this:


Excel Formula:
=AVERAGE(FILTER(($G$3:$G$100000-$C$3:$C$100000),($e$3:$e$100000=E3)))

Book1
ABCDEFG
1
2StartProject TypeEnd
32023-09-01A2024-03-10
42023-01-01B2024-01-10
52023-04-01A2024-05-10
62023-04-01B2024-01-10
72023-04-01C2024-03-10
82023-01-01D2024-03-10
92023-04-01B2024-05-10
102023-04-01B2024-01-10
112023-09-01A2024-03-10
12
13A262.3333333
14B336.75
15C344
16D434
Sheet1
Cell Formulas
RangeFormula
A13:A16A13=UNIQUE(E3:E11)
B13:B16B13=AVERAGE(FILTER(($G$3:$G$11-$C$3:$C$11),($E$3:$E$11=A13)))
Dynamic array formulas.
 
Upvote 0
Thank you for the quick reply! When I try your solution I end up with a large negative number. Possibly because it does not remove rows below that have not been filled out yet? Is there any way to make provisions to not include the empty rows as well as the rows with a start date but no completed date?
 
Upvote 0
Thank you for the quick reply! When I try your solution I end up with a large negative number. Possibly because it does not remove rows below that have not been filled out yet? Is there any way to make provisions to not include the empty rows as well as the rows with a start date but no completed date?
It only filters records with column E equal to the target project type, that is what you asked. :).

This will filter out records with blank end dates:

Excel Formula:
=AVERAGE(FILTER(($G$3:$G$10000-$C$3:$C$10000),(($E$3:$E$10000=A22)*($G$3:$G$10000>0))))

Book1
ABCDEFG
1
2StartProject TypeEnd
32023-09-01A2024-03-10
42023-01-01B2024-01-10
52023-04-01A2024-05-10
62023-04-01B2024-01-10
72023-04-01C2024-03-10
82023-01-01D2024-03-10
92023-04-01B2024-05-10
102023-04-01B2024-01-10
112023-09-01A2024-03-10
122023-04-01D
132023-04-01B
142023-01-01B
152023-04-01A
162023-04-01B
172023-09-01A
18
19
20
21
22A262.333333
23B336.75
24C344
25D434
26
Sheet1
Cell Formulas
RangeFormula
A22:A25A22=UNIQUE(E3:E11)
B22:B25B22=AVERAGE(FILTER(($G$3:$G$17-$C$3:$C$17),(($E$3:$E$17=A22)*($G$3:$G$17>0))))
Dynamic array formulas.
 
Upvote 1
Solution

Forum statistics

Threads
1,223,886
Messages
6,175,194
Members
452,616
Latest member
intern444

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