Link to home
Start Free TrialLog in
Avatar of Euro5
Euro5Flag for United States of America

asked on

Formula identify group and average weight

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
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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...
Avatar of Euro5

ASKER

@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
Avatar of Euro5

ASKER

@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
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...
Avatar of Euro5

ASKER

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