# 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
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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)
``````

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)
``````
Regards
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

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))
``````

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)
``````

Saurabh...
0
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
0
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
0
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...
0
Author Commented:
Sorry - my mistake!! This worked fine. Thank you !!!!
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.