Sign in

Blog · How-to guides

Data analysis in LibreOffice Calc from a sales export

Build customer and monthly sales summaries in LibreOffice Calc from invoice rows. Use exact formulas, reconcile credits and totals, and export a checked CSV for follow-up analysis.

The short answerFor data analysis in LibreOffice Calc, start with a sales export containing invoice ID, date, customer and net amount. Confirm dates and amounts are recognized correctly, summarize customers and periods with SUMIFS or a pivot table, and reconcile the result to the source total. Export the relevant sheet as CSV when moving the checked rows to another analysis workflow.

Data analysis in LibreOffice Calc starts with clean transaction rows, then a summary that ties back to the sales export. For a customer-by-month comparison, use real dates, signed net sales and a stable customer identifier. The method below keeps credit notes visible and checks the result before exporting a CSV.

Start with the sales rows you already have

The example is an illustrative US office-supplies distributor reviewing January and February 2026. Use one row per posted invoice or credit note. The invoice ID must identify that document uniquely; if the source contains invoice lines, use a document-and-line key instead.

Put the following fields on a sheet named Sales, with headers in row 1 and records in rows 2 through 9. Column B must contain date values, even though the table displays written dates. Column D contains numbers without embedded currency text.

Invoice ID (A) Invoice date (B) Customer (C) Net sales (USD) (D)
INV-1001 January 5, 2026 Atlas 6,000
INV-1002 January 12, 2026 Beacon 4,000
CR-1001 January 20, 2026 Atlas -500
INV-1003 January 28, 2026 Cedar 2,500
INV-1004 February 3, 2026 Atlas 7,000
INV-1005 February 10, 2026 Beacon 4,500
INV-1006 February 18, 2026 Cedar 3,000
CR-1002 February 24, 2026 Cedar -500

Net sales exclude sales tax and include the signed credit notes. Keep a separate currency field in a real export and select USD before adding rows. If customer names vary, resolve them to customer IDs before summarizing; an organization and its abbreviated name should not become separate customers.

Import and verify the cell types

Open the CSV through File > Open and review the delimiter, text delimiter and column formats in the import preview. LibreOffice's CSV instructions explain how to set these options and choose a format for each column.

Preserve identifiers as text, especially when they contain leading zeros. Use the date format that matches the export rather than assuming the computer's locale will interpret every date correctly. After import, inspect a known date and a negative amount.

These checks should return 8 for the example's eight records:

=COUNT(Sales.B2:B9)
=COUNT(Sales.D2:D9)

A lower result means at least one expected date or amount is not numeric. That does not identify every possible problem, but it is a useful stop before aggregation. Do not turn missing sales amounts into zero simply to make the check pass.

Build the customer-by-month summary

On a second sheet named Summary, place Customer in A1. Set B1 to =DATE(2026;1;1) and C1 to =DATE(2026;2;1), formatting both as month and year. Put Atlas, Beacon and Cedar in A2:A4.

In B2, enter this formula and fill down through B4, then across to C4:

=SUMIFS(Sales.$D$2:$D$9;Sales.$C$2:$C$9;$A2;Sales.$B$2:$B$9;">="&B$1;Sales.$B$2:$B$9;"<"&DATE(YEAR(B$1);MONTH(B$1)+1;1))

The formula sums net sales only when customer, start date and next-month boundary all match. LibreOffice documents SUMIFS as a sum with multiple criteria. These formulas use Calc's documented semicolon argument separator; use the separator configured in your installation.

The next-month boundary avoids hard-coding the last day of each month. The locked source ranges stay fixed when copied; $A2 keeps the customer column fixed and B$1 keeps the month-header row fixed.

Customer January 2026 (USD) February 2026 (USD) Total (USD)
Atlas 5,500 7,000 12,500
Beacon 4,000 4,500 8,500
Cedar 2,500 2,500 5,000
Total 12,000 14,000 26,000

In D2 use =SUM(B2:C2) and fill through D4. In B5 use =SUM(B2:B4) and fill through D5. Atlas's January result is 6,000 - 500 = 5,500; Cedar's February result is 3,000 - 500 = 2,500.

Monthly growth is (14,000 - 12,000) / 12,000 = 16.7%, rounded to one decimal place. In a separate cell, use:

=(C5-B5)/B5

Format it as a percentage. If the starting month's sales are zero, report the dollar movement and explain that a conventional growth percentage is undefined.

Prove that the summaries include the right records

The summary should pass several checks before anyone interprets the growth.

Check Formula or calculation Expected result
Source sales total =SUM(Sales.D2:D9) 26,000 USD
Summary minus source =Summary.D5-SUM(Sales.D2:D9) 0 USD
Credit-note count =COUNTIF(Sales.D2:D9;"<0") 2
Positive sales plus credits 27,000 + (-1,000) 26,000 USD

The source-to-summary equality proves that these selected records were allocated to the table. It does not prove the original export is complete: also tie the source total to the sales register or ledger for the same period and scope.

On the Sales sheet, =COUNTIF($A$2:$A$9;A2) filled down should return 1 for each unique document in this example. Investigate repeats before removing anything: repeated invoice IDs can be legitimate when the source has separate line items. For the accounting treatment behind signed transactions, see credit notes and returns in revenue measures.

Use a pivot table when the category list changes often

First label Sales E1 Month. Enter =DATE(YEAR(B2);MONTH(B2);1) in E2 and fill through E9, then select Sales.A1:E9. Choose Insert > Pivot Table, then Current selection. Add customer to Row Fields, Month to Column Fields and net sales to Data Fields. Set the data calculation to Sum; LibreOffice's pivot-table guide explains the layout and calculation settings.

Check the pivot result against the same $26,000 source control total, and refresh it after changing the source. For presenting the checked comparison, use the guide to data analysis graphs and charts.

Where it goes wrong

  • Imported text amounts. The table can look correct while sums omit records. Check cell types before accepting the total.
  • Positive credit notes. Credits with the wrong sign inflate sales. Preserve the source's documented sign convention.
  • Incomplete ranges. New rows outside the formula or pivot source disappear from summaries. Recheck the source boundary after each export.
  • Wrong exported sheet. CSV contains the current sheet, not every workbook tab. Choose transaction rows for detailed follow-up or the summary for period-level review.

These are observed sales results. Generalizing them to customers outside the export requires a separate sampling argument, covered in inferential data analysis.

Do this on your own file in Covirage

Save the intended sheet through File > Save As > Text CSV, keep the working workbook separately and reopen the CSV to check dates, signs and totals. Upload that CSV to Covirage: it maps the columns, its tools compute and check the figures, and the external AI model explains the result with every figure traced to its rows. Create a free Covirage account and bring a sample of your own sales export.

See file-based spreadsheet analysis with Covirage for the supporting workflow.

Covirage is not affiliated with LibreOffice or The Document Foundation.

Questions people ask

Can LibreOffice Calc summarize sales by customer and month?

Yes. Use SUMIFS with customer and date conditions, or create a pivot table with customers as row fields, months as column fields and sales as the summed data field. Both approaches need consistent dates and numeric sales amounts.

Why does my sales formula ignore some amounts?

Amounts imported as text may not participate in numerical sums as expected. Inspect the import settings, decimal separators and currency symbols, then correct the source column. Compare the numeric cell count with the number of expected transaction records.

Does exporting CSV preserve the workbook?

CSV exports the current sheet as text values and does not preserve the full workbook's formulas, formatting or other sheets. Keep the working workbook separately, choose the intended sheet and reopen the CSV to confirm its contents.