To expand on what mariosM_3CX has said, the CDR files are written after the call is finished. It is a simple comma separated file that contains the basic information about a call including who the participants were, start and end times, duration, and all the legs of the call. It's NEAR real-time data.
You can capture real-time data using the 3CX Call Control API and listening to all the events, but that's a pretty verbose (complicated) approach to getting the data.
The CDR files, and the API are the only supported ways of getting call data.
The 3rd approach is to pull the data directly from the 3CX PostgreSQL database. This is not supported, and highly discouraged by 3CX support. The primary concern (I believe) is that accessing the database directly could adversely impact the operations of 3CX. And indeed I've seen this in our test environments. If you are not very careful, you can inadvertently place a lock on tables while you access the data and THAT wold be a very bad thing on a production server.
You might consider looking at our 3CX Exporter add-on. Exporter can automatically process the CDR files and place the data into a MySQL or SQL server database (the free Express edition works fine). Once the data is in SQL, then you can easily process the data from Excel.
If you want to go the API approach, look at our 3CX Monitor add-on which collects all of the events and writes the data to a database.
And as a lost-resort option, if you simply can't get the data you need any other way, you can pull the data directly out of the 3CX PostgreSQL database using our Exporter add-on. Exporter utilizes a very carefully crafted read-only connection to the 3CX database and synchronizes the data with MySQL or SQL server. Once the data is in SQL you can do whatever you want without impacting 3CX. Happily, Exporter has been in use for about 7 years with no reported issues. But this is not supported by 3CX.