Engineering All versions ◉ 17 views

=BIN2HEX()

Converts a binary number to hexadecimal.

Applies To: Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016
=BIN2HEX(number, [places])
Hover argument names in the table for details.
Output typeNumber/Text
Popularity45 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground Dedicated file for this function — safe & lightweight · sample data + live formulas
Share:

⬇ Download Sample Workbook

A dedicated .xlsx for =BIN2HEX() 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)
Download BIN2HEX.xlsx ~ 8–12 KB · No macros

⇪ Share

Send this function to friends

Quiz this function

%d questions — syntax, example & errors — test yourself!

◧ Arguments

ArgumentTypeRequiredDescription
number Text Required The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number 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, BIN2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).

▣ Examples

Converts binary 11111011 to hexadecimal with 4 characters =BIN2HEX(11111011, 4)
Result: 00FB
Converts binary 1110 to hexadecimal =BIN2HEX(1110)
Result: E
Converts binary 1111111111 to hexadecimal =BIN2HEX(1111111111)
Result: FFFFFFFFFF

§ Remarks

  • If number is not a valid binary number, or if number contains more than 10 characters (10 bits), BIN2HEX returns the #NUM! error value.
  • If number is negative, BIN2HEX ignores places and returns a 10-character hexadecimal number.
  • If BIN2HEX requires more than places characters, it returns the #NUM! error value.
  • If places is not an integer, it is truncated.
  • If places is nonnumeric, BIN2HEX returns the #VALUE! error value.
  • If places is negative, BIN2HEX returns the #NUM! error value.

✦ Tips

  • If number is negative, BIN2HEX ignores places and returns a 10-character hexadecimal number.
  • If places is not an integer, it is truncated.

⚠ Common Errors

#NUM! If number is not a valid binary number, or if number contains more than 10 characters (10 bits), BIN2HEX returns the #NUM! error value. If BIN2HEX requires more than places characters, it returns the #NUM! error value. If places is negative, BIN2HEX returns the #NUM! error value.
Fix: places between 1 and 10
#VALUE! If places is nonnumeric, BIN2HEX returns the #VALUE! error value.
Fix: برای 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!

✍️ Add comment / question

captcha
🔒 Your comment will be published after review.