Formula identify group and average weight

Euro5
Euro5 used Ask the Experts™
on
I need a formula to count the number of grouped packages then show the average weight.
The conditions for the package groups:
Where columns A, B, F, I J K L match, then count rows and average the rated weight (column G).
The result will be in column P.

The issues - the ranges will change each time, but the columns will always be the same.

Ultimately, this will be part of the VBA code.

Any help?
test.xlsx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
HI,

pls try

=SUMIFS(H:H,A:A,A2,B:B,B2,F:F,F2,I:I,I2,J:J,J2,K:K,K2,L:L,L2)/COUNTIFS(A:A,A2,B:B,B2,F:F,F2,I:I,I2,J:J,J2,K:K,K2,L:L,L2)

Open in new window


Or

=AVERAGEIFS(H:H,A:A,A2,B:B,B2,F:F,F2,I:I,I2,J:J,J2,K:K,K2,L:L,L2)

Open in new window

Regards
Top Expert 2015

Commented:
You can use this formula in row-2..

=SUMPRODUCT(($A$2:$A$170=A2)*($B$2:$B$170=B2)*($F$2:$F$170=F2)*($I$2:$I$170=I2)*($J$2:$J$170=J2)*($K$2:$K$170=K2)*($L$2:$L$170=L2)*($G$2:$G$170))/SUMPRODUCT(($A$2:$A$170=A2)*($B$2:$B$170=B2)*($F$2:$F$170=F2)*($I$2:$I$170=I2)*($J$2:$J$170=J2)*($K$2:$K$170=K2)*($L$2:$L$170=L2))

Open in new window


Or simple...

=AVERAGEIFS($G$2:$G$170,$A$2:$A$170,A2,$B$2:$B$170,B2,$C$2:$C$170,C2,$F$2:$F$170,F2,$I$2:$I$170,I2,$J$2:$J$170,J2,$K$2:$K$170,K2,$L$2:$L$170,L2)

Open in new window


Saurabh...

Author

Commented:
@Rgonzo1971 Something isn't working, for instance -
Bill_Recipient, 12/19/2014, 8691,  27 FORGE PKWY, FRANKLIN,       MA, 2038
the weight total is 135lb and there are 3 packages. Those 3 packages should result in
135/3 = 45, but I get the same weights as the rated weight in column G.
18.9
56.7
56.7
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
@Saurabh Singh Teotia Something isn't working, for instance -
Bill_Recipient, 12/19/2014, 8691,  27 FORGE PKWY, FRANKLIN,       MA, 2038
the weight total is 135lb and there are 3 packages. Those 3 packages should result in
135/3 = 45, but I get the same weights as the rated weight in column G.
18.9
56.7
56.7
Top Expert 2015

Commented:
Euro,

That is not matching because 27 FORGE PKWY   is not equal to 27 FORGE PARKWAY  so then your results are 58+58 /2 = which is 58 only...

I'm referring to row number-->10 to 12

Saurabh...

Author

Commented:
Sorry - my mistake!! This worked fine. Thank you !!!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial