My formula looks to see if the dates in column B of Sheet2 are between the last day of the previous month and the date given on row 8, and that column C is the same Product family, and if so it adds the values in column D.

Hope this helps.

Pete