← All guides

COUNT can return a different total in LibreOffice than in Excel

When a range you pass to COUNT contains a logical (TRUE/FALSE) cell, LibreOffice Calc counts that cell as a number and Excel does not, so the identical =COUNT(range) returns a number one larger in LibreOffice. Nothing errors; the total is just quietly off.

The surprise

A boolean sitting in a referenced range is excluded from COUNT in Excel but included in LibreOffice. Every numeric cell still counts in both; only the treatment of the boolean cell differs, which is enough to shift a total by one.

A minimal example

Fill a column like this: A1=10, A2="hello" (text), A3 blank, A4=TRUE, A5=20, A6 blank.

FormulaExcel, desktop (documented)Google Sheets (executed 2026-08-29)LibreOffice Calc 25.8.7.3 (executed)
=COUNT(A1:A6)223
=COUNT(A1:A1) with A1=TRUE001

In the first row Excel counts only A1 and A5 (the two real numbers); LibreOffice also counts A4, the boolean. In the second row the range is a single boolean cell: Excel counts zero numbers, LibreOffice counts one. The Excel figures are the documented-expected values recorded in our test corpus; the LibreOffice figures are what our harness actually computed by recalculating the workbook in LibreOffice Calc 25.8.7.3. Google Sheets was executed too — Drive import, 2026-08-29 — and it agrees with Excel exactly: 2 and 0. Excel for the web — a separate application from desktop Excel, and the third engine we execute — returned 2 and 0 too when we recalculated the corpus on OneDrive on 2026-09-01. LibreOffice is the only one of the four columns that counts the boolean, and the documented figures are now backed by a measurement in a Microsoft engine as well.

Why it happens

Microsoft's COUNT documentation draws a deliberate line between arguments you type and values you reference: "Logical values and text representations of numbers that you type directly into the list of arguments are counted," while logical values, text, and blanks inside a referenced range are ignored. So =COUNT(1,TRUE) is 2 in Excel (the typed TRUE counts), but a TRUE living in a cell that a range points at does not. LibreOffice does not make that distinction for a boolean cell: it treats the cell's underlying value as the number 1 and counts it. See Microsoft's COUNT function reference.

How to migrate safely

The gap is in how each engine types a boolean cell, so the durable fix is structural: keep TRUE/FALSE flags out of any numeric range that COUNT scans. Put flags in their own column, and when you genuinely want to count them use a criterion every engine agrees on:

=COUNTIF(B1:B6,TRUE) to count the flags, and =COUNT(A1:A6) over a column that holds only numbers.

If mixing is unavoidable, re-verify every COUNT total after moving the workbook, because the difference is silent. A single stray boolean in a scanned range is enough to make a headline number disagree between the two apps.

Check before you migrate

A note on which Excel this is. The Excel column in the tables above is Microsoft’s documented behaviour for desktop Excel, as recorded in our test corpus — we do not run desktop Excel, and no value in that column is a measurement. Excel for the web is a different application with its own calculation engine, and that one we do run (recalculated on OneDrive, 2026-09-01). Its measured results are published on each function’s own page rather than in these guide tables. Because we have no desktop run to compare against, a disagreement between an Excel-web measurement and the documented column is genuinely ambiguous: it may mean the web engine diverges from the desktop one, or that the documentation is wrong about both. We do not claim to know which.