# Excel-macro to group by column & sum value

Solved/Closed
Joe - Dec 9, 2011 at 12:23 PM
Joe - Dec 10, 2011 at 10:19 AM
I was searching your web site for an example of how to group two columns and sum two different columns. I found an example under the question "Excel - Macro to group by column & sum value" but this only summed one column. Is there a way to have it sum two columns? Thanks, Joe
This is my example
Item Qty Length \$ Sold
A 1 100 \$50
A 1 100 \$50
B 2 200 \$120
B 1 100 \$30
B 5 100 \$150
C 4 200 \$600
C 2 100 \$150
C 1 200 \$150
C 3 100 \$225
Basically I want to group by Column A (i.e. Item) and Column C (i.e. length) and also wants to add total of quantity and \$ Sold for each change in lengths for an item. In this case, the result on new sheet would be as below:
Item Qty Length \$ Sold
A 2 100 \$100
B 2 200 \$120
B 6 100 \$180
C 5 200 \$750
C 5 100 \$375

venkat1926
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
810
Dec 9, 2011 at 10:30 PM