Moodle uses a relational database for all its data. You need to write SQL queries to get data to the format that you desire. The standard reports are configured for "average" information. SQL has been around for over 50 years, but it still requires someone who understands it. The "configurable reports" plugin, that C Behan mentions, is one of a variety of ways to create SQL. See List of SQL Contributed reports for examples.