title: Excel pivot table question - How to get subtotals for a row area field?
body: <p>I have the following situation in database:</p>
  
  <p><strong>Department</strong> table holds all departments in the company. </p>
  
  <p><strong>Employee</strong> table holds all employees, together with their department id and AllowedAbsenceDays field, which tells us how many days is the employee alowed to be absent in the current year.</p>
  
  <p><strong>Absence</strong> table holds all absences that occur in the company. It has employee id and date of absence, and also the reason of the absence (vacation, sick leave, personal days, and potentially more in the future...) </p>
  
  <p><a href="https://i.stack.imgur.com/i30g1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i30g1.jpg" alt="alt text"></a>
  </p>
  
  <p>I am supposed to create a report which lists all employees and shows how many days they are allowed to be absent together with how many days have they been absent (and what is the reason of absence). </p>
  
  <p>I have grouped the data by employee and by reason of absence:</p>
  
  <p><a href="https://i.stack.imgur.com/7Sej6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Sej6.jpg" alt="alt text"></a>
  </p>
  
  <p>This is what I am able to get so far, by putting the Department, Employee and Allowed Absence Days in the pivot row area, Reason in the column area and Sum of Days absent in the data area:</p>
  
  <p><a href="https://i.stack.imgur.com/n7WhD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n7WhD.jpg" alt="alt text"></a>
  </p>
  
  <p>The problem is that I am not able to get the subtotals of allowed absence days per department (which is a firm requirement). The final report should look somewhat like this (i have photoshopped this). </p>
  
  <p><a href="https://i.stack.imgur.com/3UK8j.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3UK8j.jpg" alt="alt text"></a>
  </p>
  
  <p>Is there any way to get these subtotals? Maybe I should prepare the data for the pivot table in a different way? Please note that the Grand Total column should include only the actual days of absence (not the Allowed Absence Days).</p>
  
  <p>Example workbook is available for download <a href="http://dc93.4shared.com/download/102041351/110b1e55/AbsenceReport.xlsx?tsid=20090427-131518-fc8c06d2" rel="nofollow noreferrer">here</a></p>
  
  <p>Thanks to everybody who is still reading :)</p>
  
  <p>P.S. The real case is different (in the problem domain). This is a somewhat contrived example, but the basic problem is the same.</p>