Boas.<br>Obrigado pela dica, penso que a função aggregate() resolve mas não consigo utilizar.<br><br>Tenho um ficheiro CSV e o que pretendo é em cada linha somar as vendas totais por SEMANA.<br><br>Tenho os dados seguintes  mas apenas com as colunas DATA e QTD:<br>


 <table cellpadding="0" cellspacing="0" border="0" width="201"><colgroup><col style="width:48pt" width="64">
 <col style="width:55pt" width="73">
 <col style="width:48pt" width="64">
 </colgroup><tbody><tr style="height:15.0pt" height="20">
  <td style="height:15pt;width:48pt;text-align:center" height="20" width="64"><b>SEMANA</b></td>
  <td style="width:55pt;text-align:center" width="73"><b>DATA</b></td>
  <td style="width:48pt;text-align:center" width="64"><b>QTD</b></td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">45</td>
  <td class="xl63" align="right">05-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">46</td>
  <td class="xl63" align="right">11-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">46</td>
  <td class="xl63" align="right">11-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">46</td>
  <td class="xl63" align="right">11-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">46</td>
  <td class="xl63" align="right">11-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">46</td>
  <td class="xl63" align="right">11-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">46</td>
  <td class="xl63" align="right">11-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">47</td>
  <td class="xl63" align="right">20-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">48</td>
  <td class="xl63" align="right">26-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">48</td>
  <td class="xl63" align="right">27-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
</tbody></table><br><br>E o que pretendo é somar as quantidades em cada dia de forma a ficar igualmente com as colunas DATA e QTD: <br>
 <table cellpadding="0" cellspacing="0" border="0" width="201"><colgroup><col style="width:48pt" width="64">
 <col style="width:55pt" width="73">
 <col style="width:48pt" width="64">
 </colgroup><tbody><tr style="height:15.0pt" height="20">
  <td style="height:15pt;width:48pt;text-align:center" height="20" width="64"><b>SEMANA</b></td>
  <td style="width:55pt;text-align:center" width="73"><b>DATA</b></td>
  <td style="width:48pt;text-align:center" width="64"><b>QTD</b></td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">45</td>
  <td class="xl65" align="right">05-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">46</td>
  <td class="xl65" align="right">11-11-2003</td>
  <td style="text-align:center">6</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">47</td>
  <td class="xl65" align="right">20-11-2003</td>
  <td style="text-align:center">1</td>
 </tr>
 <tr style="height:15.0pt" height="20">
  <td style="height:15pt;text-align:center" height="20">48</td>
  <td class="xl65" align="right">26-11-2003</td>
  <td style="text-align:center">2</td>
 </tr>
</tbody></table><br><br>Acrescentei a coluna SEMANA apenas para o exemplo porque é o que pretendo ter em consideração, até porque se não der para fazer de forma automática terei de fazer isto manualmente e somar para as mais de 5 000 linhas...<br>

<br>Podem dar uma ajuda? E depois é suposto exportar esta agregação para um 
ficheiro? Como? Já procurei no google mas ainda não consegui fazer no 
meu caso em particular.<br><br>Obrigado.<br>Cumps.<br>