← Back to all guides
Technology · 4 min READ

How to Build a Two-Way Pivot Table in LibreOffice Calc

How to Build a Two-Way Pivot Table in LibreOffice Calc guide illustration

Turn a shipment list into a warehouse-by-product report. Choose Sum for units and check a single intersection as well as both sets of totals.

Quick note

Follow these steps at your own pace. Check product terms and prices directly with providers before purchasing.

Quick answer

Select the shipment records and choose Insert → Pivot Table. Use Current selection. Put Warehouse in Row Fields, Product in Column Fields, and Units in Data Fields. Choose Sum for Units. Each intersection shows how many units of one product shipped from one warehouse, even when those shipments occurred on different rows.

Start with five shipments

Enter this example in cells A1:C6. Give every column a unique heading, repeat the warehouse and product on every shipment, and enter units as plain numbers. Keep title rows, merged labels and subtotals outside the source range. If an existing report includes a total beneath the transactions, selecting it would feed the same units into the calculation twice.

WarehouseProductUnits
NorthBoxes12
NorthTape3
SouthBoxes5
NorthBoxes8
SouthTape7

Set up both sides of the report

  1. Select A1:C6, including the header. Choose Insert → Pivot Table. In Select Source, choose Current selection and click OK.
  2. In the layout dialog, drag Warehouse into Row Fields and Product into Column Fields. These choices determine which labels run down the left and across the top.
  3. Drag Units into Data Fields. Read the calculation on the field button. If it says Count, double-click it, select Sum, and confirm. Leave Filters empty for this example so all five shipments contribute.
  4. Expand Options and enable the totals row and totals column. Expand Source and Destination, choose New sheet under Destination, and click OK. The report gets its own sheet with room to grow.

Check one intersection before trusting the total

Start with North and Boxes. That combination appears twice, so the result should be 20 (12 + 8). A result of 2 means the report counted shipments. If switching the calculation still leaves an unexpected figure, check whether the amount field contains text.

WarehouseBoxesTapeTotal units
North20323
South5712
Total units251035

The two warehouses account for 23 + 12 = 35 units. The two products also account for 25 + 10 = 35. An incorrectly labeled shipment can leave the grand total unchanged, which is why the North/Boxes check matters. If your source was imported twice, preview suspected duplicate records in Calc before removing anything. Two different shipments with matching labels can both be valid.

Change the layout or add a shipment

To read products down the left, right-click inside the pivot, choose Properties and swap the two label fields. Keep Units in Data Fields. The headings move, but the totals should still agree. To see how much each product contributed, show each cell as a percentage of total units. When tomorrow’s shipments arrive, check the source range and refresh the pivot table. For a shared report maintained in a browser, our Google Sheets sales pivot guide shows the steps in that app.

LibreOffice’s guide to creating pivot tables · Pivot layout and destination options

SHARE THIS GUIDE

Know someone who could use this?

DISCUSSION

Comments

Read or join the discussion.