Contact

BASE Function (OpenOffice Calc)

Text Intermediate OpenOffice Calc

Format unsigned integers as base 2–36 text with OpenOffice BASE, using native padding and fractional-input examples plus clear column-label and precision cautions.

Verification status: Eight reference formulas and 8 diagnostic cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using generated native ODF and GUI hard recalculation. Saved formula identities and typed results were checked; the load warning is described below. How formula examples are checked

Quick answer: =BASE(42;16) returned 2A in the tested Apache OpenOffice 4.1.16 build.

Availability and version history

  • Introduced: First release not established; documented by OpenOffice.org 3.3.
  • Supported in: Apache OpenOffice 4.1.16; this identifies a verified release, not a final supported version.
  • Scope: Desktop Calc, English function names and semicolon-separated formulas.
  • Checked: October 14, 2026. Eight reference formulas and the listed diagnostics were recalculated from generated native ODF in 4.1.16 on Linux x86-64, Build 9816. Source and independent reference calculations were also checked.

What BASE returns

BASE writes a nonnegative integer using the digits of a chosen positional base. It returns text, with 0–9 followed by uppercase A–Z for digit values 10–35. The optional minimum length inserts leading zeroes; it does not change the value or impose a maximum width. Release entry.

Syntax and arguments

=BASE(Number; Radix [; MinimumLength])

Number and Radix are required; MinimumLength is optional. The core routine approximately floors all three numeric arguments. After conversion, Number must be nonnegative and Radix must be from 2 to 36. The default minimum length is 1, and an explicit zero is also treated as 1. Negative widths and unsupported radices are invalid. The implementation has a finite output-length limit.

Reproducible examples

The native column records the saved 4.1.16 results. BASE text results are retained exactly, including leading zeroes.

Formula Native 4.1.16 result Independent reference
=BASE(0;2) 0 0
=BASE(42;2) 101010 101010
=BASE(42;8) 52 52
=BASE(42;16) 2A 2A
=BASE(35;36) Z Z
=BASE(255;16;4) 00FF 00FF
=BASE(64;8;1) 100 100
=BASE(12345;10) 12345 12345

Practical worksheet

For an inventory code, put numeric 255 in A2 and enter =BASE(A2;16;4) in B2. The text result is 00FF. Keep the original identifier in A2 and export the formatted column as text when leading zeroes are significant. If the identifier is larger than four hexadecimal digits, BASE keeps the extra digits rather than truncating them.

To add a readable prefix, ="PART-"&BASE(A2;16;4) gives PART-00FF. This formats an existing identifier; it does not guarantee uniqueness. Two records with the same number produce the same code.

Advanced interpretation and checks

A small-integer round trip can check the chosen radix: =DECIMAL(BASE(255;16;4);16) returns 255. Zero padding disappears when the text is read as a number. A fraction discarded during BASE conversion cannot be recovered by this round trip.

Base 26 here uses 0–9 and A–P. Thus BASE(1;26) is 1, BASE(10;26) is A, and BASE(26;26) is 10. These are not spreadsheet column labels A through Z, AA and so on. Use a column-address method when that is the actual requirement.

For a binary-position illustration, =BASE(2^5;2;8) gives 00100000. Work with suitably small exact integers. A floating-point input can already have lost low digits before BASE starts, and the source has a separate large-number conversion path; this guide does not establish arbitrary-precision encoding.

Boundaries and troubleshooting

The native fractional case =BASE(42.9;2.9;6.9) returns 101010. Fractions are converted, not rejected merely for being fractional. If your application requires whole-number input, perform that validation separately. Width 2 still returns all six digits of 42 in binary, and width 0 is valid. Negative values, negative widths and radices outside the accepted interval yield invalid-argument errors.

These additional formulas were recalculated from the same generated ODF input. H5 is a deliberately empty cell where referenced. Error displays are retained as errors, even when an ODS numeric attribute stores zero.

Formula Observed result or error
=BASE(42;2;2) 101010
=BASE(42;2;0) 101010
=BASE(-1;2) Err:502
=BASE(42;1) Err:502
=BASE(42;37) Err:502
=BASE(42.9;2.9;6.9) 101010
=BASE(42;2;-1) Err:502
=BASE(H5;2) 0

Official evidence and checking scope

The generated ODF input produced the informational load warning “Not all attributes could be read.” After it was acknowledged, the sheet was hard-recalculated and saved separately. Every formula identity, input label and tested result was reconciled, including repeated spaces represented with ODF text elements. This does not certify every style attribute. The separately prepared XLSX input was not executed. A deliberately stale SUM cache changed from 999999 to 3, and an uncached SUM returned 7 after hard recalculation. Native evidence covers the eight reference formulas and listed diagnostics only. Other explanatory compositions are independent mathematical checks; other releases, locales and extreme-value behavior were not established by this run.