Seems like a simple pivot table should be able to do this (https://www.excel-easy.com/data-****...ot-tables.html ):

1) Select the source table in sheet 2 -> Insert -> Pivot table -> choose desired pivot table options.
2) Select item code as the row labels, date as the column labels, and sum of sales as the value field.
3) Select the column labels -> Pivot table tools -> Options -> group selection -> group by month.

Will that work for you?