Excel 2007 Pivot Table.
Calculated field, extended source data.
http://www.mediafire.com/file/1qyewt...07_06_09b.xlsx
Excel 2003 will not play this file,
nor be able to use the new 2007 features,
but you can probably glean the method from the pictures.