Need to Combine 3 Formulas that have AverageIF in to one big one.

Cow086

New Member
Joined
Feb 2, 2023
Messages
5
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
Hi,
I have an averageif formula for 3 separate departments that my boss now wants me to have the 3 departments combined. So i want to take the 3 formulas and make it into one. Ive tried a few different ways and keep getting errors. Please help. The 3 formulas are as follows:
=IFERROR(AVERAGEIFS('Chrun Data'!$Z:$Z,'Chrun Data'!$U:$U,'Tenure Summary All'!D$115,'Chrun Data'!$X:$X,"No",'Chrun Data'!$Q:$Q,'Tenure Summary All'!$B14,'Chrun Data'!$P:$P,'Tenure Summary All'!$A14),"-")

=IFERROR(AVERAGEIFS('Chrun Data'!$Z:$Z,'Chrun Data'!$U:$U,'Tenure Summary All'!D$115,'Chrun Data'!$X:$X,"No",'Chrun Data'!$Q:$Q,'Tenure Summary All'!$B15,'Chrun Data'!$P:$P,'Tenure Summary All'!$A15),"-")

=IFERROR(AVERAGEIFS('Chrun Data'!$Z:$Z,'Chrun Data'!$U:$U,'Tenure Summary All'!D$115,'Chrun Data'!$X:$X,"No",'Chrun Data'!$Q:$Q,'Tenure Summary All'!$B17,'Chrun Data'!$P:$P,'Tenure Summary All'!$A17),"-")

The three departments are represented by the

'Chrun Data'!$Q:$Q,'Tenure Summary All'!$B15,
'Chrun Data'!$Q:$Q,'Tenure Summary All'!$B14,
'Chrun Data'!$Q:$Q,'Tenure Summary All'!$B17,

I am needing to do with with alot of formulas since the sheets that i have built im going to need to combine these departments alot.


Please advise

Excel Newbie
Cow086
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi and welcome to MrExcel board!

Excel Formula:
=SUMIFS('Chrun Data'!$Z:$Z,'Chrun Data'!$U:$U,'Tenure Summary All'!D$115,'Chrun Data'!$X:$X,"No",
'Chrun Data'!$Q:$Q,'Tenure Summary All'!$B15,'Chrun Data'!$P:$P,'Tenure Summary All'!$A15)/
SUMPRODUCT(('Chrun Data'!$U:$U='Tenure Summary All'!D$115)*('Chrun Data'!$X:$X="No")*
(('Chrun Data'!$Q:$Q='Tenure Summary All'!$B15)+('Chrun Data'!$Q:$Q='Tenure Summary All'!$B14)+('Chrun Data'!$Q:$Q='Tenure Summary All'!$B17))*
('Chrun Data'!$P:$P='Tenure Summary All'!$A15))

It would be easier to understand if you used named ranges for each column, for example.
As sumproduct is an array formula, it is recommended that you do not use the entire column P:P, use only a range, for example P2:P3000
Excel Formula:
=SUMIFS(col_z, col_u,'Tenure Summary All'!D$115,col_x,"No",
col_q,'Tenure Summary All'!$B15, col_p,'Tenure Summary All'!$A15) /
SUMPRODUCT((col_u='Tenure Summary All'!D$115)*(col_x="No")*
((col_q='Tenure Summary All'!$B15)+(col_q='Tenure Summary All'!$B14)+(col_q='Tenure Summary All'!$B17))*
(col_p='Tenure Summary All'!$A15))
 
Last edited:
Upvote 0
Thank you, Ive heard of using named ranges to make things easier to read and have never used them before ill have to try it
 
Upvote 0
Sorry, I missed adding the amounts in the first part of the formula, so it should be like this:

VBA Code:
=SUMPRODUCT(('Chrun Data'!$Z:$Z)*
('Chrun Data'!$U:$U='Tenure Summary All'!D$115)*
('Chrun Data'!$X:$X="No")*
(('Chrun Data'!$Q:$Q='Tenure Summary All'!$B15) + ('Chrun Data'!$Q:$Q='Tenure Summary All'!$B14) + ('Chrun Data'!$Q:$Q='Tenure Summary All'!$B17)) *
('Chrun Data'!$P:$P='Tenure Summary All'!$A15)) /
SUMPRODUCT(('Chrun Data'!$U:$U='Tenure Summary All'!D$115)*('Chrun Data'!$X:$X="No")*
(('Chrun Data'!$Q:$Q='Tenure Summary All'!$B15)+('Chrun Data'!$Q:$Q='Tenure Summary All'!$B14)+('Chrun Data'!$Q:$Q='Tenure Summary All'!$B17))*
('Chrun Data'!$P:$P='Tenure Summary All'!$A15))

With Named range:
VBA Code:
=SUMPRODUCT((col_z)*
(col_u='Tenure Summary All'!D$115)*
(col_x="No")*
((col_q='Tenure Summary All'!$B15) + (col_q='Tenure Summary All'!$B14) + (col_q='Tenure Summary All'!$B17)) *
(col_p='Tenure Summary All'!$A15)) /
SUMPRODUCT((col_u='Tenure Summary All'!D$115)*(col_x="No")*
((col_q='Tenure Summary All'!$B15)+(col_q='Tenure Summary All'!$B14)+(col_q='Tenure Summary All'!$B17))*
(col_p='Tenure Summary All'!$A15))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,440
Messages
6,124,882
Members
449,193
Latest member
PurplePlop

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