Collect weight and quantity from list

barissh

Board Regular
Joined
Aug 10, 2006
Messages
94
I have a list such as herebelow format. Each GID line shows quantity and MEA shows weight. I need a macro to get total of each quantity and weight. As you see quantity and wegiht are not in a specific digit but variable.

LIST:
GID;1;190;BI;
MEA;KGM;20750.50;
GID;2;1000;BI;
MEA;KGM;22400;
GID;3;10;BI;
MEA;KGM;2450;

TOTAL:
GID = 1200 ( 190 + 1000 + 10 )
MEA = 45600,50 ( 20750.50 + 22400 + 2450 )
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I have a list such as herebelow format. Each GID line shows quantity and MEA shows weight. I need a macro to get total of each quantity and weight. As you see quantity and wegiht are not in a specific digit but variable.

LIST:
GID;1;190;BI;
MEA;KGM;20750.50;
GID;2;1000;BI;
MEA;KGM;22400;
GID;3;10;BI;
MEA;KGM;2450;

TOTAL:
GID = 1200 ( 190 + 1000 + 10 )
MEA = 45600,50 ( 20750.50 + 22400 + 2450 )
Is the data in separate columns like this:

Book1
ABCD
2GID1190BI
3MEAKGM20750.5_
4GID21000BI
5MEAKGM22400_
6GID310BI
7MEAKGM2450_
Sheet1

If so, then:

Book1
ABCDEFG
2GID1190BI_GID1200
3MEAKGM20750.5__MEA45600.5
4GID21000BI___
5MEAKGM22400____
6GID310BI___
7MEAKGM2450____
Sheet1

This formula entered in G2 and copied down:

=SUMIF(A$2:A$7,F2,C$2:C$7)
 
Upvote 0
Dear Valko,

Thanks for your suggestion but I should solve this problem without converting text to columns.
 
Upvote 0
See if this helps.

Excel Workbook
ABCD
2GID;1;190;BI;GID1200
3MEA;KGM;20750.50;MEA45600.5
4GID;2;1000;BI;
5MEA;KGM;22400;
6GID;3;10;BI;
7MEA;KGM;2450;
Sum
 
Upvote 0

Forum statistics

Threads
1,215,234
Messages
6,123,773
Members
449,123
Latest member
StorageQueen24

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