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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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