add,sum & split items into last two columns based on headers

leap out

Active Member
Joined
Dec 4, 2020
Messages
271
Office Version
  1. 2016
  2. 2010
hello experts !

I'm truly appreciate if any body provide me macro with this complicated project . so what I want match columns B,C,D together for sheet SUMMARY with the others sheets into column B, if they are completely matched then should add or summing if they are repeated across sheets into last two columns based on headers (BUYING,SELLING) for sheet summary , because I will insert three columns (BUYING,SELLING,NET) in sheet SUMMARY every time . as to values to brings them from the others sheets depend on headers BUYING,SELLING after matching.

as to the higlighted rows are new items . they are not existed in sheet summary with comparison the others sheets so should add them for each classification . this case is extremely complicated . it depends on matching column A across sheets with column A in sheet summary . if the item is matched in column A for all sheets with column A in sheet summary then should add into classification and sort it . if this case is impossible achieve by vba just ignore it and I will add manually.
note: when add new items from the others sheets should split into column B,C,D always contains four items then should split as the rest of items have already been existed .


SUM & ADD.xlsm
ABCDEFGHI
1CLASSIFICATIONGOODSMARKMANFACTUREREFRS.NBUYINGSELLINGNET
2OIL-AS110W40 208LCASSURE1RS10
310W40 208LENIITRE1RS10
45W30 208LQ8EURE1RS10
510W40 208LQ8EURE1RS10
6S.AG000
7OIL-AS210W40 12x1LQ8EURM1RC10
810W40 12x1LCASSURM1RC10
910W40 12x1LENIITRM1RC10
1015W40 12x1LCASSURM1RC10
11S.AG000
12MS-OIL15W30 12x1LQ8EURRM1CV10
1310W40 4x4LQ8EURRM1CV10
1410W40 4x4LCASSURRM1CV10
1510W40 4x4LENIITRRM1CV10
165W40 4x4LQ8EURRM1CV10
175W40 4x4LCASSURRM1CV10
185W40 4x4LENIITRRM1CV10
1920W50 4x4LQ8EURRM1CV10
2020W50 4x4LCASSURRM1CV10
2120W50 4x4LENIITRRM1CV10
225W30 4x4LQ8EURRM1CV10
23S.AG000
summary
Cell Formulas
RangeFormula
G23:I23,G11:I11,G6:I6G6=SUM(G2:G5)
I12:I22,I7:I10,I2:I5I2=G2-H2



SUM & ADD.xlsm
ABC
1CLASSIFICATIONGOODSBUYING
2MS-OIL15W40 4x4L Q8 EU200
3OIL-AS110W40 208L CAS SU100
4OIL-AS110W40 208L ENI IT200
5OIL-AS210W40 12x1L CAS SU300
6OIL-AS15W30 208L Q8 EU30
7OIL-AS210W40 12x1L Q8 EU50
8OIL-AS110W40 15x1L Q8 EU70
9OIL-AS210W40 12x1L ENI IT55
10OIL-AS215W40 12x1L CAS SU76
11MS-OIL15W30 12x1L Q8 EU80
12MS-OIL110W40 4x4L Q8 EU90
13MS-OIL110W40 4x4L CAS SU10
14MS-OIL110W40 4x4L ENI IT20
15MS-OIL110W40 4x6L ENI IT25
16MS-OIL15W40 4x4L CAS SU120
17MS-OIL15W40 4x4L ENI IT110
18MS-OIL120W50 4x4L Q8 EU10
19MS-OIL120W50 4x4L CAS SU15
20MS-OIL120W50 4x4L ENI IT5
21MS-OIL15W30 4x4L Q8 EU20
22OIL-AS215W40 15x1L CAS SU25
sheet1



SUM & ADD.xlsm
ABC
1CLASSIFICATIONGOODSBUYING
2MS-OIL15W40 4x4L Q8 EU200
3OIL-AS110W40 208L CAS SU100
4OIL-AS110W40 208L ENI IT200
5OIL-AS210W40 12x1L CAS SU300
6OIL-AS15W30 208L Q8 EU30
7OIL-AS210W40 12x1L Q8 EU50
8OIL-AS210W40 12x1L ENI IT70
9OIL-AS215W40 12x1L CAS SU55
10OIL-AS215W40 15x1L CAS SU76
sheet2



SUM & ADD.xlsm
ABC
1CLASSIFICATIONGOODSSELLING
2MS-OIL15W40 4x4L Q8 EU10
3OIL-AS110W40 208L CAS SU20
4OIL-AS110W40 208L ENI IT20
5OIL-AS210W40 12x1L CAS SU5
6OIL-AS15W30 208L Q8 EU20
7OIL-AS210W40 12x1L Q8 EU10
sheet3


SUM & ADD.xlsm
ABC
1CLASSIFICATIONGOODSSELLING
2MS-OIL15W40 4x4L Q8 EU10
3OIL-AS110W40 208L CAS SU20
sheet4



the result in sheet SUMMARY
SUM & ADD.xlsm
ABCDEFGHI
1CLASSIFICATIONGOODSMARKMANFACTUREREFRS.NBUYINGSELLEINGNET
2OIL-AS110W40 15x1L Q8 EU7070
310W40 208LCASSURE1RS120040160
410W40 208LENIITRE1RS140020380
55W30 208LQ8EURE1RS1602040
610W40 208LQ8EURE1RS10
7S.AG73080650
8OIL-AS210W40 12x1LQ8EURM1RC11001090
910W40 12x1LCASSURM1RC16005595
1010W40 12x1LENIITRM1RC1125125
1115W40 12x1LCASSURM1RC1131131
1215W40 15x1LCASSU101101
13S.AG1057151042
14MS-OIL15W30 12x1LQ8EURRM1CV18080
1510W40 4x4LQ8EURRM1CV19090
1610W40 4x4LCASSURRM1CV11010
1710W40 4x4LENIITRRM1CV12020
1810W40 4x6L ENIIT2525
195W40 4x4LQ8EURRM1CV120020180
205W40 4x4LCASSURRM1CV1120120
215W40 4x4LENIITRRM1CV1110110
2220W50 4x4LQ8EURRM1CV11010
2320W50 4x4LCASSURRM1CV11515
2420W50 4x4LENIITRRM1CV155
255W30 4x4LQ8EURRM1CV12020
26S.AG70520685
summary
Cell Formulas
RangeFormula
G13:I13,G7:I7G7=SUM(G2:G6)
I14:I25,I8:I12,I2:I6I2=G2-H2
G26:I26G26=SUM(G14:G25)

thanks in advance
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

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