This should work (for 12 months - see the 12 at the end)
=SUMIF('DETAIL DATA'!$H$6:$H$13,'SALES BY CUSTOMER'!$C4,OFFSET('DETAIL DATA'!$H$6,0,MATCH('SALES BY CUSTOMER'!$D$1,'DETAIL DATA'!$H$1:$AI$1,0)-1,COUNTA('DETAIL DATA'!$H$6:$H$13),12))
But for some reason it's not working properly, and its getting too late here (1:50 am) for me to think my way through this. If no1 else picks this up, I will take another look later today.
Bookmarks