BIN2OCT Function (OpenOffice Calc)
Translate signed binary strings to octal in Apache OpenOffice, with padding, negative sign extension and explicitly tested width conversion.
Verification status: Eight reference formulas and 7 diagnostic cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using XLSX import and GUI hard recalculation. Saved formula identities and typed results were checked. How formula examples are checked
Quick answer: =BIN2OCT("11111111") returned 377 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 with its Analysis add-in, English function names and semicolon-separated formulas.
- Checked: October 14, 2026. Eight reference formulas and the listed diagnostics were recalculated after XLSX import in 4.1.16 on Linux x86-64, Build 9816. Source and independent reference calculations were also checked.
What BIN2OCT returns
BIN2OCT decodes a binary string and returns octal text. It follows a signed ten-bit input convention, then encodes negative results into the thirty-bit convention represented by ten octal digits. Release entry.
Syntax and arguments
=BIN2OCT(BinaryNumber [; Places])
The first argument contains no more than ten 0/1 digits. Exactly ten digits with a leading 1 represent a negative value. Optional Places must convert to an integer from 1 to 10; it pads a nonnegative result with leading zeroes when necessary. A negative output remains ten octal digits.
Reproducible examples
The native column records the saved 4.1.16 results. Text-returning conversion strings are retained exactly, including leading zeroes and uppercase hexadecimal letters. OCT2DEC, IMREAL and IMAGINARY return numeric values. These integer and quarter-unit references agree exactly with the saved results; errors are checked by display rather than interpreted from a numeric zero cache.
| Formula | Native 4.1.16 result | Independent reference |
|---|---|---|
=BIN2OCT("0") |
0 |
0 |
=BIN2OCT("1") |
1 |
1 |
=BIN2OCT("10") |
2 |
2 |
=BIN2OCT("11111111") |
377 |
377 |
=BIN2OCT("111111111") |
777 |
777 |
=BIN2OCT("1000000000") |
7777777000 |
7777777000 |
=BIN2OCT("1111111111") |
7777777777 |
7777777777 |
=BIN2OCT("101010") |
52 |
52 |
Practical worksheet
=BIN2OCT("101010") returns 52: decimal 42 is 5×8+2. The padded example =BIN2OCT("1010";4) returns 0012, preserving four output characters.
The nine-digit maximum positive binary code 111111111 represents 511 and becomes 777. The ten-digit all-ones input represents −1 and becomes 7777777777. Those identical-looking repeated digits belong to different source and destination sign widths.
Advanced interpretation and checks
For nonnegative values, group binary digits from the right into threes: 101 010 corresponds to octal 5 2. For a negative ten-bit value, decode the sign first. The input 1000000000 is −512, and the output 7777777000 represents 2^30−512 in octal.
The helper truncates the numeric Places conversion toward zero, as illustrated by the 4.9 diagnostic. Prefer an intentional integer width so the formatting requirement is explicit.
Octal output is text even when it consists only of decimal-looking digits. Ordinary decimal arithmetic on 52 would treat it as fifty-two, not the original decimal forty-two.
Boundaries and troubleshooting
A too-small Places value rejects a positive result rather than dropping high digits. Negative results retain their ten-digit encoding, while invalid Places values such as 11 still fail. Invalid binary digits are errors. The empty string is decoded as zero; check missing-data meaning before accepting that output as a measured zero.
These additional formulas were recalculated through the same import path. Error displays are retained as errors, even when an ODS numeric attribute stores zero.
| Formula | Observed result or error |
|---|---|
=BIN2OCT("1010";4) |
0012 |
=BIN2OCT("111111111";2) |
Err:502 |
=BIN2OCT("1111111111";1) |
7777777777 |
=BIN2OCT("1111111111";11) |
Err:502 |
=BIN2OCT("2") |
Err:502 |
=BIN2OCT("") |
0 |
=BIN2OCT("1010";4.9) |
0012 |
Other spreadsheet implementations
The BIN2OCT guide for Gnumeric documents that product’s own syntax and tested behavior. A shared function name does not guarantee the same argument conversion, text parsing, branch or precision rules.
Official evidence and checking scope
- Function-specific release entry
- Conversion or strict complex parser
- Signed positional decoder
- Width conversion
The saved ODS retained every tested formula identity. 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.