Assume Article & Quantity are in column A and Column B, Code and Article are in columns E & F, Code and Quantity are in columns I & J.
Add a VLOOKUP formula in column G
=VLOOKUP(F2,$A$2:$B$4,2,FALSE)
and fill down.
in column J (this is is the answer column) add a SUMIF Formula:
=SUMIF($E$2:$E$7,I2,$G$2:$G$7)
and fill down
(your row numbers in the formulas will be different)