ReferenceFunctionsEngineering Functions
DEC2BIN
DEC2BIN: Converts a decimal integer to binary text.
Summary
Optionally pads the result with leading zeros using places.
Remarks
numberis coerced to an integer and must be in[-512, 511].- Negative values are returned as 10-bit two's-complement binary strings.
placesmust be at least the output width and at most10, or#NUM!is returned.
Examples
Convert a positive integer
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
101010
Pad binary output
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
00000101
Related functions
FAQ
What limits apply to DEC2BIN?
number must be in [-512, 511], and optional places must be between output width and 10, else #NUM!.
Runtime metadata
Category
Engineering
Signature
DEC2BIN(arg1: Number, arg2…: Number)Arity
min 1, max variadic
Arguments
arg1Number · Scalar · coercion NumberLenientText
arg2Number · Scalar · coercion NumberLenientText
Caps
PURE
Source