Contact

LibreOffice Calc · Data management · Beginner

Sort Whole Records and Filter a Data Range in LibreOffice Calc

Sort complete Calc records by two keys, use AutoFilter and an AND filter, and reconcile visible totals without losing row identity.

Documentation-qualified; native workflow and save/reopen checks pending · Editorial standards

A safe sort moves every field belonging to an order together. Filtering then hides orders that do not match; it is not a deletion step. This exercise verifies both record identity and totals.

Build the test list

Use an ODS workbook with a sheet named Orders. Enter A1:E7 exactly:

Order Region Product Amount Status
1001 East Cable 120 Open
1002 West Adapter 85 Closed
1003 East Stand 160 Open
1004 North Cable 95 Open
1005 West Hub 140 Closed
1006 North Adapter 70 Open

Below the filtered record rows, put =SUM(D2:D7) in G10 and =SUBTOTAL(9;D2:D7) in G11. Both initially return 670. Keep these controls below row 7: filters hide whole rows, including cells beside the table. Being outside columns A:E is not enough. See Applying Filters. Use Calc’s semicolon argument separator, or your configured equivalent. Keep a saved copy of the unsorted table.

The directions use the standard menu bar, Calc Guide 26.2 (February 2026), and Help labeled 26.8 checked on 19 October 2026. Expected rows and sums were independently calculated; native UI and save/reopen execution remain untested.

Sort Region, then Amount

  1. Select A1:E7, including every field. Choose Data → Sort.
  2. On Sort Criteria, enable the column-label/header setting and choose Top to Bottom (Sort Rows).
  3. Set the first key to Region, Ascending; the second to Amount, Descending. Leave other keys unused. On Options, do not enable custom sort order or copy-to-output for this exercise.
  4. Apply the sort. Confirm this complete result, not only the first column:
Order Region Product Amount Status
1003 East Stand 160 Open
1001 East Cable 120 Open
1004 North Cable 95 Open
1006 North Adapter 70 Open
1005 West Hub 140 Closed
1002 West Adapter 85 Closed

Both totals remain 670. Sorting only Region or Amount can leave the same total while attaching values to the wrong order. Undo immediately if any five-field row differs. Sorting Data explains why explicit selection matters; Sort Criteria documents the keys and direction.

Show just East orders

Select A1:E7 and choose Data → AutoFilter. Open Region’s arrow and select only East; apply the selection. Expected visible orders: 1003 and 1001. G10 stays 670; G11 becomes 280. A filter-sensitive SUBTOTAL answers a different question from SUM.

Click within the filtered records and choose Data → More Filters → Reset Filter. All six orders should return and G11 should be 670. The command-specific Reset Filter help gives this menu path. Removing arrows is not the same check as confirming every record is visible.

Combine criteria with Standard Filter

Select A1:E7 and choose Data → More Filters → Standard Filter. Set the first condition to Region = East, the connector to AND, and the second to Amount >= 150. Under Options, enable Range contains column labels; leave regular expressions and copying results to another range off. Apply.

Only 1003, East, Stand, 160, Open should remain. G10 = 670; G11 = 160. Reopen the filter and change 150 to 170. No data records should match and G11 should be 0. Reset the filter to recover all six rows. The filtering guide and filter options distinguish these controls.

For a change test, after resetting, locate order 1001 and change its Amount to 180. Reapply Region = East AND Amount >= 150. Now 1003 and 1001 match: visible total 340, all-row total 730. Reset, restore order 1001 to 120, and verify 670 again.

Keep the result maintainable

For a repeated report, define a database range and inspect its boundaries before sorting or filtering. A newly appended row needs to belong to the operated range. Sheet-based reusable criteria belong in the separate advanced-filter workflow; this example intentionally keeps the two conditions in the dialog.

Save the unfiltered result as ODS, close and reopen it. Confirm six IDs, the sorted order above, and both totals at 670. Sorting by Order ascending restores the original sequence for this fixture; in real data, add a stable sequence field before the first sort if original order matters.

Common failures

  • Amount sorts alphabetically: inspect numeric types; use convert numbers stored as text before sorting.
  • Header moves into the records: undo and correct the header setting.
  • An old criterion still hides rows: reset all filters before a new experiment.
  • Editing filtered data: do not assume any paste, delete, or bulk edit affects visible cells only. This exercise performs its edits after resetting filters.

Related functions: SUM and SUBTOTAL.