Engineering
All versions
◉ 36 views
=DEC2BIN()
Converts a decimal number to binary.
Applies To:
Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021 for MacExcel 2019Excel 2016
=DEC2BIN(number, [places])
Hover argument names in the table for details.
Output typeNumber/Text
Popularity20 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground
Dedicated file for this function — safe & lightweight · sample data + live formulas
⬇ Download Sample Workbook
A dedicated .xlsx for =DEC2BIN() with Persian sample data & live formulas — open in Excel and practice.
- Sheet “Sample” — data table + formula in place
- Sheet “Guide” — syntax, arguments & tips from this page
- Instant & secure (token + rate limit)
Quiz this function
%d questions — syntax, example & errors — test yourself!
◧ Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
number |
Number | Required | The decimal integer you want to convert. If number is negative, valid place values are ignored and DEC2BIN returns a 10-character (10-bit) binary number in which the most significant bit is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation. |
places |
Number | Optional | The number of characters to use. If places is omitted, DEC2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
▣ Examples
Converts decimal 9 to binary with 4 characters.
=DEC2BIN(9, 4)
Result:
1001
Converts decimal -100 to binary
=DEC2BIN(-100)
Result:
1110011100
§ Remarks
- If number < -512 or if number > 511, DEC2BIN returns the #NUM! error value.
- If number is nonnumeric, DEC2BIN returns the #VALUE! error value.
- If DEC2BIN requires more than places characters, it returns the #NUM! error value.
- If places is not an integer, it is truncated.
- If places is nonnumeric, DEC2BIN returns the #VALUE! error value.
- If places is zero or negative, DEC2BIN returns the #NUM! error value.
✦ Tips
- If places is not an integer, it is truncated.
⚠ Common Errors
#NUM!
If number < -512 or if number > 511, DEC2BIN returns the #NUM! error value. If DEC2BIN requires more than places characters, it returns the #NUM! error value. If places is zero or negative, DEC2BIN returns the #NUM! error value.
Fix: A number within the allowed range
#VALUE!
If number is nonnumeric, DEC2BIN returns the #VALUE! error value. If places is nonnumeric, DEC2BIN returns the #VALUE! error value.
Fix: برای number و places مقدار عددی وارد کنید و بررسی کنید سلولها خالی یا متنی نباشند.
💬 Comments & Q&A 0 approved
🔒 Your comment will be published after review.Share your thoughts — visible after admin approval
No comments yet — be the first!