I used a "helper" column : column I in "Sales" but this can be any column you choose and can be hidden
in I2 in "Sales"
=SUMPRODUCT((Compensation!$A$2:$E$169=$A2)*(MONTH($B$2:$B$169)=11)*(Compensation!$D$2:$D$169))
copy down
The highlighted value (11 for November) is the month and would be better if you placed it in a cell: it appears compensation can vary with date.
In "Summary"
in D2
=SUMPRODUCT((Sales!$D$2:$D$15=Summary!A2)*(Sales!$I$2:$I$15))
OR
=SUMIFS(Sales!$I:$I,Sales!$D:$D,Summary!A2)
Copy down
I note you multiple Product ID entries with the same date/same value: very confusing !?
Bookmarks