Contact

TRUNC Function (LibreOffice Calc)

Math Beginner LibreOffice Calc LibreOffice 3.0

The TRUNC function in LibreOffice Calc removes the fractional part of a number without rounding. It truncates toward zero, unlike INT which always rounds down. Learn syntax, examples, common errors, and best practices.

Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked

The **TRUNC** function removes the fractional part of a number in LibreOffice Calc. Unlike `INT`, which always rounds **down** toward negative infinity, `TRUNC` always rounds **toward zero**. This makes TRUNC ideal for extracting integer components, cleaning numeric data, and performing calculations where rounding must not occur.

What the TRUNC Function Does

  • Removes the decimal portion of a number
  • Always rounds toward zero
  • Works with positive and negative numbers
  • Can truncate to a specified number of decimal places
  • Useful for integer extraction, data cleaning, and non‑rounding math

It is designed to be precise, predictable, and universally compatible.

Syntax

TRUNC(number; [digits])

Arguments

  • number:
    The numeric value to truncate.

  • digits (optional):
    The number of decimal places to keep.

    • Positive values keep decimals
    • Zero removes all decimals
    • Negative values truncate to tens, hundreds, etc.

Basic Examples

Remove decimals from a positive number

=TRUNC(5.9)

Returns 5.

Remove decimals from a negative number (toward zero)

=TRUNC(-3.9)

Returns -3.

TRUNC with a cell reference

=TRUNC(A1)

Removes the fractional part of A1.

TRUNC to a specific number of decimal places

=TRUNC(12.3456; 2)

Returns 12.34.

Advanced Examples

TRUNC with negative digits (truncate to tens)

=TRUNC(123.45; -1)

Returns 120.

TRUNC with negative digits (truncate to hundreds)

=TRUNC(987.65; -2)

Returns 900.

Extract the integer part of a number

=TRUNC(12.75)

Returns 12.

TRUNC vs INT comparison

=TRUNC(-5.8)

Returns -5.

=INT(-5.8)

Returns -6.

TRUNC for date/time values

=TRUNC(A1)

Removes the time portion, leaving only the date.

TRUNC in financial modeling

=TRUNC(A1 * 12)

Converts annual values to whole‑month equivalents without rounding.

TRUNC for binning and grouping

=TRUNC(A1 / 10)

Groups values into buckets of 10.

Common Errors and Fixes

TRUNC returns 0 unexpectedly

Possible causes:

  • Input value is between -1 and 1
  • Number is stored as text
  • Cell is empty

Fix:
Convert text to numbers using:
Data → Text to Columns → OK

TRUNC returns unexpected results with negative digits

Cause:

  • Negative digits truncate to tens, hundreds, etc., not decimals.

Example:
TRUNC(456; -1) → 450

Err:502 — Invalid argument

Occurs when:

  • The argument is non‑numeric text
  • A formula returns an error passed into TRUNC

Fix:
Wrap the expression with IFERROR:
IFERROR(TRUNC(A1); 0)

Best Practices

  • Use TRUNC when you need to remove decimals without rounding
  • Use INT when you need rounding down (toward negative infinity)
  • Use ROUND, ROUNDDOWN, or ROUNDUP for controlled rounding
  • Use TRUNC for data cleaning and integer extraction
  • Use TRUNC with negative digits for coarse grouping
TRUNC is perfect for “cutting off” decimals cleanly, especially when rounding would distort results.
  • Use INT to round down instead of toward zero
  • Use ROUND, ROUNDDOWN, or ROUNDUP for precision rounding
  • Use FLOOR and CEILING for significance‑based rounding
  • Use MOD with TRUNC for grouping and indexing

By mastering TRUNC and its combinations with other math functions, you can build precise, non‑rounding numeric models in LibreOffice Calc that behave consistently across all data scenarios.


Reproducible example (tested in LibreOffice Calc)

This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.

=TRUNC(12.79)

Expected result: 12.

Drop digits after the decimal separator without rounding.

If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.