Average days by type and year

PaulDaunno

New Member
Joined
Nov 8, 2019
Messages
2
TypeDaysYear
34122017
34242017
65112017
66442018
34232018
66132018
34442019
6582019
66312019

<tbody>
</tbody>


I want the average days by type, by year. So for example, in 2017, the average days for type 34 is 18. The average days for type 65 is 11.

I also want the average days by year for more than 1 type. So for example, in 2018, the average for type 34 and type 66 is 26.66.

What formulas would I use to accomplish this?

Thanks,
-Paul
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Re: Help Needed - Average days by type and year

Are you able to use Power Query aka Get&Transform?

TypeDaysYearTypeYearDaysAvgYearDaysAvg
34​
12​
2017​
34​
2017​
18​
2018​
26.66666667​
34​
24​
2017​
65​
2017​
11​
65​
11​
2017​
66​
2018​
28.5​
66​
44​
2018​
34​
2018​
23​
34​
23​
2018​
34​
2019​
44​
66​
13​
2018​
65​
2019​
8​
34​
44​
2019​
66​
2019​
31​
65​
8​
2019​
66​
31​
2019​
 
Upvote 0
Re: Help Needed - Average days by type and year

Try this


Book1
ABCDEF
1TypeDaysYearYear
234122017201826.667
334242017
465112017
566442018
634232018
766132018
834442019
96582019
1066312019
Sheet1
Cell Formulas
RangeFormula
F2=SUMPRODUCT((C2:C10=E2)*((A2:A10=34)+(A2:A10=66))*(B2:B10))/SUMPRODUCT((C2:C10=E2)*((A2:A10=34)+(A2:A10=66)))
 
Upvote 0
Re: Help Needed - Average days by type and year

Welcome to the forum!

You can also create a pivot table

2c3bce9cdc6b1ba689e6238a6d2ded6c.jpg
 
Upvote 0
Re: Help Needed - Average days by type and year

Im glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,211
Members
448,554
Latest member
Gleisner2

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