It sounds like you need a pivot table, if you can attach a sample workbook, I'll have a look