Bien sur, c'est possible. Vous n'avez pas fourni votre code, je vais donc vous donner un pseudocode.
writeheader();
$team = $data[0]['team'];
$count = 0;
foreach($data as $row){
$count += 1;
//if the current row's team is different than previous than add seperator
if($row['team'] != $team){
$team = $row['team'];
writeseperator();
writetotal($count);
$count = 0;
}
writerow();
}