21.08.2013 Views

LibreOffice 3.4 Calc Guide - The Document Foundation Wiki

LibreOffice 3.4 Calc Guide - The Document Foundation Wiki

LibreOffice 3.4 Calc Guide - The Document Foundation Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

You will appreciate this is a tedious and time consuming exercise for a sales report if you want to<br />

subtotal for more than a couple of categories.<br />

Using Data > Subtotals<br />

A more comprehensive solution is to create subtotals using Data > Subtotals from the Menu bar,<br />

which opens the Subtotals dialog. Subtotal creates totals for data arranged in an array—that is, a<br />

group of cells with labels for columns. Using the Subtotals dialog, you can select up to three<br />

arrays, then choose a statistical function to apply to them. When you click OK, <strong>Calc</strong> adds subtotal<br />

and grand total rows to the selected arrays, using the Result and Result2 cell styles to differentiate<br />

those entries. By default, matching items throughout your array will be gathered together as a<br />

single group above a subtotal.<br />

To insert subtotal values into a sheet:<br />

1) Ensure that the columns have labels (we will use our sales data example again).<br />

2) Select, or click in a single cell in the range of cells that you want to calculate subtotals for,<br />

and then choose Data > Subtotals.<br />

3) In the Subtotals dialog (Figure 231), in the Group by list, select the column by which the<br />

subtotals need to be grouped. A subtotal will be calculated for each distinct value in this<br />

column.<br />

4) In the <strong>Calc</strong>ulate subtotals for box, select the columns containing the values that you want<br />

to create subtotals for. If the contents of the selected columns change later, the subtotals<br />

are automatically recalculated.<br />

5) In the Use function box, select the function that you want to use to calculate the subtotals.<br />

6) You can create a further two Group by subtotals using the 2 nd Group and 3 rd Group tabs<br />

and repeating steps 3 to 5.<br />

7) Click OK.<br />

Figure 231: Setting up subtotals<br />

A partial view of the results using our example data is shown in Figure 232. Subtotals for Sales by<br />

Employee and Category were used.<br />

228 <strong>LibreOffice</strong> <strong>3.4</strong> <strong>Calc</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!