Contact

BIN2DEC Function (OpenOffice Calc)

Engineering Intermediate OpenOffice Calc

Learn the BIN2DEC function in Apache OpenOffice Calc: Converts a binary number to a decimal number.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Availability and version history

  • Introduced: Documented by Apache OpenOffice 4.1.16; original introduction not established.
  • Availability: Supported in Apache OpenOffice 4.1.16, verified against its function registry. This identifies a supported release, not a final working version.
  • Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
  • Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.

BIN2DEC reads binary digit text and returns a decimal numeric value. The input is limited to ten characters. A ten-character string starting with 1 is interpreted as signed two’s complement; shorter strings are nonnegative even when their first character is 1. The length is therefore part of the numeric meaning.

Syntax and arguments

=BIN2DEC(binary_text)

One binary digit string is required. Use only 0 and 1, normally in a quoted literal or a text cell. There is no places or signedness argument. The source helper accepts an empty string as zero, rejects more than ten characters, and does not accept a minus sign, spaces, a decimal point or a 0b prefix. Quoted text preserves the exact input characters. The examples use English names and semicolon separators.

Reproducible reference cases

Formula Reference result
=BIN2DEC("1010") 10
=BIN2DEC("00001010") 10
=BIN2DEC("11111111") 255
=BIN2DEC("111111111") 511
=BIN2DEC("1111111111") -1
=BIN2DEC("1000000000") -512
=BIN2DEC("0111111111") 511
=BIN2DEC("") 0
=BIN2DEC("2") ERROR
=BIN2DEC("-1") ERROR
=BIN2DEC(" 10") ERROR
=BIN2DEC("00000000000") ERROR

The first formula preserves the original example and expected result. Its historical comparable LibreOffice 25.2 check was not an OpenOffice native test. New results are independently checked mathematical/source expectations. Quotation marks identify returned text; ERROR denotes the source’s invalid-argument path without claiming an observed localized worksheet message.

Practical worksheet: decode a signed ten-bit sample file

Create headers Binary_text and Decimal_value in A1:B1. Enter the text strings 1111111110,1111111111,0000000000,0000000001 and 0000001010 in A2:A6. Enter them as text, not as decimal numbers with coincidentally similar digits. In B2 enter =BIN2DEC(A2) and fill down. Results are -2,-1,0,1 and 10.

In C2 enter =DEC2BIN(B2;10) and fill down. The five original ten-character patterns are recovered. This checks the stored input and the shared signed convention. It does not certify an external file import or a device’s representation without checking that device’s specification.

Advanced interpretation and checks

Read the positional value. For 1010, ordinary binary weights give 18+04+12+01=10. For 1111111110 the unsigned weighted sum is 1022; the ten-bit sign rule subtracts 1024 to produce -2. This explains why a general decimal parser cannot replace BIN2DEC.

Distinguish length and signedness. Eight ones return 255, nine ones return 511, and ten ones return -1. A leading zero can make an otherwise short positive pattern ten characters long without making it negative: 0111111111 still gives 511. Eleven characters are invalid even if the extra character is zero.

Handle an explicitly unsigned ten-bit protocol. If the external definition says every ten-bit pattern is unsigned, the signed result can be adjusted as =IF(B2<0;B2+1024;B2). For 1000000000 this gives 512; for 1111111111 it gives 1023. Apply this only after confirming that the protocol is unsigned. It is a separate interpretation step, not BIN2DEC’s default.

Errors, limits and troubleshooting

The helper rejects characters other than binary digits and strings longer than ten characters. Whitespace is not trimmed, and a minus sign is not the syntax for a negative binary input. Use the full signed ten-bit pattern for a negative result. Source-derived error expectations are reported generically here because no new native error display was captured.

An empty string returns zero in this implementation. If an empty input means missing data rather than a measured zero, validate it before conversion. Do not assume an empty-string fixture certifies every missing-cell, formula-empty or imported-null path in the worksheet engine.

The numeric result no longer retains leading zeros or the original text length. Keep the input text when exact reconstruction, audit or fixed-width export matters. DEC2BIN with an explicit width can reconstruct a chosen representation, but an unpadded round trip will normalize many different positive strings to the same short output. All accepted ten-bit values are small exact integers; general huge binary strings and unusual Unicode characters are outside this function’s tested reference domain.

Documentation and verification

See the Apache OpenOffice BIN2DEC reference, 4.1.16 Analysis callbacks and signed bounds, signed text decoder, decimal encoder, and optional width conversion. Official source snapshots were retrieved October 13, 2026 and re-read for this guide; no fresh retrieval or native execution is implied. Original introduction and final functioning version remain unestablished, separate from the pinned 4.1.16 support. No screenshots, native workbooks or cross-product compatibility claims were created for these controls.