Finance

Charts

Statistics

Macros

Search

How to use the DEC2BIN() function in Excel

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

  1. Handles both positive and negative decimal integers
  2. Negative numbers always return 10-digit two’s complement results
  3. Automatic truncation of fractional values
  4. 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
0 0 votes
Évaluation de l'article
S’abonner
Notification pour
guest
0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
Online comments
Show all comments
Facebook
Twitter
LinkedIn
WhatsApp
Email
Print
0
We’d love to hear your thoughts — please leave a commentx