sum the average count days based on conditions

Imran Azam

Board Regular
Joined
Mar 15, 2011
Messages
103
Hi All

Hope everyone is well

I have the below data and i am trying to answer the question : what is the overall average length of days for open status for each manager ALi and MAX.

[TABLE="width: 100"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Manager[/TD]
[TD]Start Date[/TD]
[TD]End Date[/TD]
[TD]status[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Ali[/TD]
[TD]15/02/2019[/TD]
[TD]17/02/2019[/TD]
[TD]Open[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Ali[/TD]
[TD]18/02/2019[/TD]
[TD]19/02/2019[/TD]
[TD]Closed[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Ali[/TD]
[TD]19/02/2019[/TD]
[TD]21/02/2019[/TD]
[TD]Closed[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Ali[/TD]
[TD]19/02/2019[/TD]
[TD]19/02/2019[/TD]
[TD]Open[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Ali[/TD]
[TD]18/02/2019[/TD]
[TD]25/02/2019[/TD]
[TD]Open[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Ali[/TD]
[TD]20/02/2019[/TD]
[TD]20/02/2019[/TD]
[TD]Open[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Max[/TD]
[TD]05/02/2019[/TD]
[TD]07/02/2019[/TD]
[TD]Closed[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]Max[/TD]
[TD]04/02/2019[/TD]
[TD]12/02/2019[/TD]
[TD]Open[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]Max[/TD]
[TD]14/02/2019[/TD]
[TD]14/02/2019[/TD]
[TD]Closed[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]Max[/TD]
[TD]12/02/2019[/TD]
[TD]20/02/2019[/TD]
[TD]Closed[/TD]
[/TR]
</tbody>[/TABLE]

i would like to return something like Ali: 9 days Max: 8 days

I think the date difference between start and end date for each row news to be done first, and then condition the manager name and open status and then do the average sum. This is the logic i want to apply but cant seem to get it into a formula

Can this be done if so how?

thank you for any help provided
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
This should do it,


Book1
ABCDE
1ManagerStart DateEnd DatestatusDays
2Ali15/02/201917/02/2019Open2
3Ali18/02/201919/02/2019Closed1
4Ali19/02/201921/02/2019Closed2
5Ali19/02/201919/02/2019Open0
6Ali18/02/201925/02/2019Open7
7Ali20/02/201920/02/2019Open0
8Max05/02/201907/02/2019Closed2
9Max04/02/201912/02/2019Open8
10Max14/02/201914/02/2019Closed0
11Max12/02/201920/02/2019Closed8
12
13Ali2.25
14Max8
Sheet1
Cell Formulas
RangeFormula
E2=C2-B2
E3=C3-B3
E4=C4-B4
E5=C5-B5
E6=C6-B6
E7=C7-B7
E8=C8-B8
E9=C9-B9
E10=C10-B10
E11=C11-B11
B13=AVERAGEIFS($E$2:$E$11,$A$2:$A$11,A13,$D$2:$D$11,"Open")
B14=AVERAGEIFS($E$2:$E$11,$A$2:$A$11,A14,$D$2:$D$11,"Open")
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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