How to use the HEX2OCT Function in Excel

In this article, we will learn about how to use the HEX2OCT function in Excel.
HEX2OCT function in excel is used to convert Hexadecimal representation of numbers of radix 16 to Octal numbers (radix = 8).
The table shown below shows you some of the most used base & their radix of Alpha - numeric characters

Base radix Alpha-Numeric Characters
Binary 2 0 - 1
Octal 8 0 - 7
Decimal 10 0 - 9
hexadecimal 16 0 - 9 & A - F
hexatridecimal 36 0 - 9 & A - Z

Hexadecimal number is representation of a number of radix 16. 10 digits starting from 0, 1, 2, 3, 4, 5, 6, 7, 8 ,9 along with 6 alphabets starting from A, B, C, D, E & F where octal number representation have 8 digits from 0, 1, 2, 3, 4, 5, 6, 7. The below table will help you understand better.

Octal Decimal hexadecimal
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
10 8 8
11 9 9
12 10 A
13 11 B
14 12 C
15 13 D
16 14 E
17 15 F

Conversion formulation is in two steps. First the number be converted to binary and then binary number is converted to get the octal value.
Let’s take an example

 

543 is converted to binary number

  1. Separate the digits
  2. Write their hexadecimal conversion upto 4 digit place by adding zeros to the left of the hexadecimal number
  3. Combine all the converted hexadecimal to get the hexadecimal number.
5 4 3
101 100 11
0101 0100 0011
543 ( hexa ) = 010101000011( binary)

010101000011 is converted to hexadecimal

  1. Make the set of 3 digits starting from the last digit.
  2. Complete the last set by adding zeros in the front of the value.
  3. Now convert all the set value to hexadecimal and combine them to get the whole value.
010101000011
010 101 000 011
2 5 0 3
543 ( hexadecimal ) = 2503 ( octal )

The HEX2OCT function converts the Hexadecimal number of radix 16 to the Octal number of radix 8.
Syntax:

=HEX2OCT ( number, [places] )

Number : Hexadecimal number which returns the 8 character Octal number.
[Places] : [optional] number where result expressed upto the number.

The input value to the function cannot contain more than 10 characters ( 10 bits ). Where first number returns the sign of the number (positive or negative) & Other 9 returns the value after the sign.

To get a negative number, input number must have 10 characters starting with first bit as it represents the negative sign. The negative number is calculated using two's complement notation. Any less than 10 characters, the function considers default 0s in front.

Now let’s get more understanding of the function via using them in some examples.

Here we have some Hexadecimal values in Hexadecimal Column. We need to convert these Hexadecimal numbers to Octal value.

Use the formula in Hexadecimal column:

=HEX2OCT (A2)

A2 : number provided to the function as cell reference or text in quotes

Values to the HEX2OCT function is provided as cell reference.

The HEX2OCT representation of 2 of base 16 (hexadecimal) is 2 of base 8 (decimal).

216= 28

Now copy the formula to other cells using the Ctrl + D shortcut key.

As you can see here the HEX2OCT function returns the result of the input values.

Notes:

  1. Numbers can be given as argument to the function directly with quotes or cell reference in excel.
  2. The function doesn’t consider the [places] number in case of a negative decimal number.
  3. If the input Hexadecimal number is negative it cannot be less than 1FFFFFFF and if the number is positive it cannot be greater than FFE0000000 .
  4. If the input [places] number is not an integer, it is truncated by the function.
  5. The function returns the Octal value for the max value of 3777777777 & minimum value upto 4000000000(only integers).
  6. The function returns the #NUM! Error
    1. If the input Hexadecimal number is less than 1FFFFFFF or greater than FFE0000000 .
    2. If the input number [places] is zero or negative.
    3. If the input number [places] is not sufficient for the resulting positive Octal number.
  7. The function returns the #VALUE! Error
    1. If the input [places] number is text or non-numeric.

Hope you understood how to use HEX2OCT function and referring cell in Excel. Explore more articles on Excel mathematical conversion functions here. Please feel free to state your query or feedback for the above article.

Related Articles:

How to use the DEC2BIN Function in Excel

How to use the BIN2OCT Function in Excel

How to use the BIN2HEX Function in Excel

How to use the DEC2OCT Function in Excel

How to use the DEC2HEX Function in Excel

How to use the OCT2BIN Function in Excel

How to use the OCT2DEC Function in Excel

How to use the OCT2HEX Function in Excel

How to use the HEX2BIN Function in Excel

How to use the HEX2OCT Function in Excel

How to use the HEX2DEC Function in Excel

Popular Articles:

If with wildcards

Vlookup by date

Join first and last name in excel

Count cells which match either A or B

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Visit Us On TwitterVisit Us On FacebookVisit Us On Youtube