I think SUMIF would be better myself given we're returning numerics... (hence the suggested re-title)
=SUMIF(Data!$A:$A,$C2,Data!$B:$B)
this will return 0 for no matches whereas you would require an Error handler for the VLOOKUP should the codes not exist on data sheet...
Using SUMIF we're also making assumption of single match or if dupe matches return aggregation thereof.
Bookmarks