Its converts a decimal number to its binary (base-2) equivalent using two’s complement notation.
Syntax
DEC2BIN(number; [places])
Arguments
- number (required)
- Decimal integer to convert (range: -512 to +511)
- Non-integers are truncated (decimal places ignored)
- Negative values return 10-digit two’s complement binary
- places (optional)
- Minimum number of binary digits to display
- Adds leading zeros for positive numbers
- Has no effect on negative numbers (always 10 digits)
- Decimal places are truncated if specified
Background
For complete details on two’s complement and number system conversions, refer to the « Number Systems » introduction section.
Examples
=DEC2BIN(1) // Returns « 1 »
=DEC2BIN(9) // Returns « 1001 »
=DEC2BIN(10) // Returns « 00001010 »

Key Features
- Handles both positive and negative decimal integers
- Negative numbers always return 10-digit two’s complement results
- Automatic truncation of fractional values
- Optional padding for positive numbers only
Common Use Cases
- Digital logic design
- Computer engineering
- Bitmask operations
- Low-level data processing
Error Conditions
- Returns #NUM! if:
- Number < -512
- Number > 511
- Places < required digits for positive numbers
- Returns #VALUE! for non-numeric inputs