I tried with Reference as the primary sort (so 1. Reference 2. Date 3. Source Code) and now it exports to excel. Thanks