Skip to main content

Excel BIN2HEX Function

The BIN2HEX function converts a binary number to a hexadecimal number.

bin2hex function 1


Syntax

=BIN2HEX (number, [places])


Arguments

  • Number (required): The binary number you want to convert to the hexadecimal equivalent.
  • Places (optional): The number of characters to represent the hexadecimal number.
    BIN2HEX pads the result with leading zeros to the specified number of places when necessary.
    If omitted, the minimum number of characters required is used.

Return value

The BIN2HEX function returns a numeric value.


Function notes

  1. Number and places, the two arguments in the BIN2HEX function, should be supplied as numeric values.
  2. If the supplied number argument is negative, the BIN2HEX function returns a 10-character hexadecimal number regardless of the places argument.
  3. If the supplied places argument is not an integer, it will be truncated.
  4. The #NUM! error value occurs if:
    • the supplied number argument is not recognized as a binary number or a numeric value.
    • the supplied number argument contains more than 10 characters.
    • the minimum number of characters required is greater than the supplied places argument.
    • the supplied places argument < 0 or > 10.
  5. The #VALUE! error value occurs if the supplied places argument is non-numeric.

Examples

Supposing, you want to convert the binary numbers in the table below to hexadecimal numbers. Please do as follows.

1. Copy the formula below into cell E5.

=BIN2HEX (C5)

2. Then drag the fill handle down to the cells you want to apply this formula too. The results are as the following screenshot shows.

bin2hex function 2

Notes:

  1. In the formula of Cell E5, the places argument is omitted and defaults to the minimum number of characters.
  2. We can directly input values in the two arguments in the formula. For example, the formula in cell E5 can be changed to:

    =BIN2HEX(1)

  3. If we need to set the places argument as 4, please copy the formula below into cell E5.

    =BIN2HEX (C5, 4)

    Then drag the fill handle down to the cells you want to apply this formula too. The results are as the following screenshot shows.

    bin2hex function 3

    We can see that when the supplied number argument is negative, BIN2HEX function always returns a 10-character result, ignoring the places argument.

Relative Functions:

  • Excel EVEN Function
    The EVEN function rounds numbers away from zero to the nearest even integer.

  • Excel EXP Function
    The EXP function returns the result of the constant e raised to the nth power.


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations