No es por hacerle la tarea ni nada, sino que esto me parece un poco dificult y pues lo posteo aquí por que de pronto alguien más lo puede necesitar en algún momento.
Bajado de ejemplo de la página de AppServ
[code]Example PHP export to XLS file format.
1. Create Function for XLS 
function xlsBOF() { 
    echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);  
    return; 
} 
function xlsEOF() { 
    echo pack("ss", 0x0A, 0x00); 
    return; 
} 
function xlsWriteNumber($Row, $Col, $Value) { 
    echo pack("sssss", 0x203, 14, $Row, $Col, 0x0); 
    echo pack("d", $Value); 
    return; 
} 
function xlsWriteLabel($Row, $Col, $Value ) { 
    $L = strlen($Value); 
    echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L); 
    echo $Value; 
return; 
} 
2. Send Header to Browser in download format.
   // Query Database
    $result=mysql_db_query($dbname,"select id,prename,name,sname,grade from appdata where course='$courseid' and sec='$section'")
    // Send Header
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
    header("Content-Type: application/force-download");
    header("Content-Type: application/octet-stream");
    header("Content-Type: application/download");;
    header("Content-Disposition: attachment;filename=$courseid-$sec.xls "); // à¹