I'm trying to sort my data for a mail merge but the report it's run doesn't produce the data as expected.

I've attached a spreadsheet with an example of the sheet in its current state and what I need it to look like.

Any help with this would be appreciated.

Thanks,
Liam