TRUNC
Supported, behaves as documentedCategory: Math and trigonometry · Last tested 2026-07-04
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel | Yes | Not yet | n/a |
| Google Sheets | Yes | Not yet | n/a |
| LibreOffice Calc | Yes | Yes (24.2.7.2, 2026-07-04) | Supported, behaves as documented |
Executed test cases
LibreOffice Calc 24.2.7.2 (tested 2026-07-04)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =TRUNC(8.9) | Positive fractional number truncates its decimal part (same result as INT here) | 8 | 8 | Matched |
| =TRUNC(-8.9) | Documented classic divergence from INT: TRUNC simply removes the fractional part with no rounding, i.e. truncates TOWARD zero | -8 | -8 Per Microsoft's TRUNC function docs, TRUNC(-8.9) = -8 (fractional part discarded, toward zero), whereas INT(-8.9) = -9 (rounds down, away from zero) -- see the paired INT_negative_rounds_toward_negative_infinity case in INT.json |
Matched |
| =TRUNC(3.14159,2) | num_digits=2 keeps two decimal places, discarding the rest without rounding | 3.14 | 3.14 3.14159 truncated (not rounded) at 2 decimals is 3.14; if it were ROUND instead, 3.14159 would still round to 3.14 here, but TRUNC(3.145,2) vs ROUND(3.145,2) would diverge -- this case isolates the num_digits mechanic, not the rounding-vs-truncating distinction |
Matched |
| =TRUNC(12345,-2) | Negative num_digits truncates digits to the LEFT of the decimal point | 12300 | 12300 Negative num_digits zeroes out the last 2 digits of the integer part without any rounding |
Matched |
Docs & syntax
- Excel: official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation