That is handled by queries and reports.
A query can be designed to gather the data you want, sort, group, sum, etc, and output to Excel, where it could then be formatted as desired. Crucial will be collecting and storing it in the right format, as described above. These queries will not work...