Engineering functions – D to IMC
Table of Contents
1. How to use the DEC2BIN function
The DEC2BIN function converts a decimal number to a binary number.
What is a decimal number?
The decimal system is a positional numeral system that uses 10 as the base, it requires 10 different numerals: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The dot or the decimal point represents decimal fractions which are not whole numbers.
The decimal number 520 has three positions, each with a different weight. It starts with 10^0 on the right and increases by one power on each additional position to the left.
520 = (5*10^2)+(2*10^1)+(0*10^0)
520 = 500 + 20 + 0
What is a binary number?
The binary system is a positional numeral system that uses only two digits: 0 and 1. The binary system is important in our society, many devices like computers, digital cameras, mobile phones and modern cars use binary code to store, process and communicate data. The binary numeral system makes it easy to store and transmit data using binary digits or bits.
Decimal | Binary |
0 | 0 |
1 | 1 |
2 | 10 |
3 | 11 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
8 | 1000 |
9 | 1001 |
10 | 1010 |
11 | 1011 |
12 | 1100 |
13 | 1101 |
14 | 1110 |
15 | 1111 |
16 | 10000 |
Table of Contents
1. DEC2BIN function Syntax
DEC2BIN(number, [places])
2. DEC2BIN function Arguments
number | Required. The decimal integer you want to convert. The sign bit is the most significant bit of number, the following 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation. Maximum binary values are 10 characters. |
[places] | Optional. The number of characters to use. If not entered the function uses the number of characters needed to complete the task. This argument allows you to add leading 0s (zeros). |
What is a sign bit?
The sign bit indicates whether a binary number is positive or negative, if the bit is 0 the number is positive, if the bit is 1, the number is negative.
What is a magnitude bit?
The remaining 9 bits are magnitude bits which represents the absolute value of the number. An absolute number is a number without the sign.
What is two's-complement notation?
Two’s-complement notation is used to represent negative numbers, the magnitude bits are changed from 0 to 1 and 1 to 0 and adding 1 to the result. For example:
Decimal number +9 using 10 bits is 0000001001.
Decimal number -9 using 10 bits is 1111110110 + 1 = 1111110111
3. DEC2BIN function example
The image above shows the DEC2BIN function in cells D3 an D4. It calculates the binary values based on the corresponding cells which contain different decimal numbers.
Formula in cell D3:
The first cell B3 contains 9 and cell C3 contains the places number, the DEC2BIN function returns 00001001 in cell D3, the second cell B4 contains 2 and the DEC2BIN function returns 00000010 in cell D4.
The next section describes how these values are calculated in detail.
4. How is the DEC2BIN function calculated in detail?
Follow these steps to convert from decimal to binary:
- Divide the decimal number by 2 and write down the quotient and the remainder.
- Repeat the process with the quotient until it is zero. Make sure to note each quotient and remainder as you calculate each number.
- The binary number is the remainders from bottom to top.
For example, let us convert decimal number 199 to binary.
199/2 = 99 and remainder 1
99/2 = 49 and remainder 1
49/2 = 24 and remainder 1
24/2 = 12 and remainder 0
12/2 = 6 and remainder 0
6/2 = 3 and remainder 0
3/2 = 1 and remainder 1
1/2 = 0 and remainder 1
The binary number is 11000111 counting from bottom to top.
5. DEC2BIN Function error
DEC2BIN returns the #NUM! error value if
- Less than -512 or larger than 511. See cells B3 and C3 in the image above.
- [places] is negative. See the formula next to cell C5.
- it requires more than the specified places characters. See the formula next to cell C4.
DEC2BIN returns the #VALUE! error if
- places is not a number. See the formula next to cell C7.
- The number is not a valid base 10 number. See cells B4 and C4 in the image above.
The second argument [places]is truncated if it is not an integer. For example, [places] is 4.1111111111 and the DEC2BIN function truncates it to 4. See the formula next to cell C8.
DEC2BIN ignores places and returns a 10-character binary number if the decimal number is negative.
6. How to convert large decimal numbers to binary?
The following formula converts numbers larger than 511 to their binary representation, it works only for positive decimal numbers. This is a workaround for the DEC2BIN function which has a limit of decimal numbers larger than 511.
Formula in cell C5:
This formula converts the number in cell B5 to its binary representation and returns it as a text string. Cell B5 contains 512 and the result is 1000000000
The BASE function converts a number into a text representation with a given radix (base).
Function syntax: BASE(number, radix, [min_length])
DEC2BIN function - Microsoft
Decimal to Binary converter
Decimal to Binary
2. How to use the DEC2HEX function
The DEC2HEX function converts a decimal number to a hexadecimal number.
What is a decimal number?
The decimal system is a positional numeral system that uses 10 as the base, it requires 10 different numerals: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The dot or the decimal point represents decimal fractions which are not whole numbers.
The decimal number 520 has three positions, each with a different weight. It starts with 10^0 on the right and increases by one power on each additional position to the left.
520 = (5*10^2)+(2*10^1)+(0*10^0)
520 = 500 + 20 + 0
What is a hexadecimal number?
A hexadecimal number is a number with a base of 16, for example, the decimal system uses a base of 10. This means that each digit in a hexadecimal number can have 16 possible values, from 0 to 15, however, the letters A to F are used from 10 to 15. See the hexadecimal column in the table below.
Hexadecimal numbers are often used in computers, the reason is they represent four binary digits (bits) with one hexadecimal digit. For example, the binary number 1010 is equivalent to the hexadecimal number A.
Hexadecimals make it easier to write big numbers with less digits, in other words, hexadecimals shorten binary digits considerably. For example, we can use hexadecimal to show the values of colors and MAC addresses in computers.
The following table shows the binary, decimal and hexadecimal values from 0 (zero) to 17.
Decimal | Hexadecimal |
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 8 |
9 | 9 |
10 | A |
11 | B |
12 | C |
13 | D |
14 | E |
15 | F |
16 | 10 |
17 | 11 |
Table of Contents
1. DEC2HEX function Syntax
DEC2HEX(number, [places])
2. DEC2HEX function Arguments
number | Required. The decimal integer you want to convert. |
[places] | Optional. The number of characters to use. If not entered the function uses the number of characters needed to complete the task. This argument allows you to add leading 0s (zeros). |
3. DEC2HEX function Example
The image above shows the DEC2HEX function in cells D3 an D4. It calculates the hexadecimal values based on the corresponding cells which contain different decimal numbers and [places].
Formula in cell D3:
The first cell B3 contains 9 and cell C3 contains the places number, the DEC2HEX function returns 00000009 in cell D3, the second cell B4 contains 15 and the DEC2HEX function returns 0000000F in cell D4.
The next section describes how these values are calculated in detail.
4. How is the DEC2HEX function calculated in detail?
There are different methods converting between decimal and hexadecimal, here is one way. Follow these steps to convert from decimal to hexadecimal:
- Divide the decimal number by 16 and write down the quotient and the remainder.
- Repeat the process with the quotient until it is zero. Make sure to note each quotient and remainder as you calculate each number.
- The hexadecimal number is the remainders from bottom to top.
For example, let us convert decimal number 199 to hexadecimal.
199/16 = 12 and remainder 7
12/16 = 0 and remainder 12 (B)
Decimal value 12 is hexadecimal value "B", see the conversion table above. The hexadecimal number is formed from the remainders counting from bottom to top. 199 = B7
5. DEC2HEX function not working
DEC2HEX returns the #NUM! error value if
- Number is less than -549,755,813,888 or larger than 549,755,813,887. See cells B3 and C3 in the image above.
- [places] is negative. See the formula next to cell C5.
- it requires more than the specified places characters. See the formula next to cell C6.
DEC2HEX returns the #VALUE! error if
- [places] is not a number. See the formula next to cell C7.
- The number is not a valid base 10 number. See cells B4 and C4 in the image above.
The second argument [places]is truncated if it is not an integer. For example, [places] is 4.1111111111 and the DEC2HEX function truncates it to 4. See the formula next to cell C8.
DEC2HEX ignores places and returns a 10-character hexadecimal number if the decimal number is negative.
Useful resources
DEC2HEX function - Microsoft
Decimal to Hexadecimal converter
How to convert decimal to hexadecimal
3. How to use the DEC2OCT function
The DEC2OCT function converts a decimal number to a octal number.
What is a decimal number?
The decimal system is a positional numeral system that uses 10 as the base, it requires 10 different numerals: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The dot or the decimal point represents decimal fractions which are not whole numbers.
The decimal number 520 has three positions, each with a different weight. It starts with 10^0 on the right and increases by one power on each additional position to the left.
520 = (5*10^2)+(2*10^1)+(0*10^0)
520 = 500 + 20 + 0
What is a octal number?
The octal system is a number system with a base of 8 that uses the digits 0, 1, 2, 3, 4, 5, 6 and 7. The octal system is often used in electronics because it is easy to perform a conversion between octal and binary numbers.
Decimal | Octal |
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 10 |
9 | 11 |
10 | 12 |
11 | 13 |
12 | 14 |
13 | 15 |
14 | 16 |
15 | 17 |
16 | 20 |
17 | 21 |
Table of Contents
1. DEC2OCT function Syntax
DEC2OCT(number, [places])
2. DEC2OCT function Arguments
number | Required. The decimal integer you want to convert. |
[places] | Optional. The number of characters to use. If not entered the function uses the number of characters needed to complete the task. This argument allows you to add leading 0s (zeros). |
3. DEC2OCT function Example
The image above shows the DEC2OCT function in cells D3 an D4. It calculates the octal values based on the corresponding cells which contain different decimal numbers and [places].
Formula in cell D3:
The first cell B3 contains 8 and cell C3 contains the places number, the DEC2OCT function returns 00000010 in cell D3, the second cell B4 contains 16 and the DEC2OCT function returns 00000020 in cell D4.
The next section describes how these values are calculated in detail.
4. How is the DEC2OCT function calculated in detail?
There are different methods converting between decimal and hexadecimal, here is one way. Follow these steps to convert from decimal to hexadecimal:
- Divide the decimal number by 8 and write down the quotient and the remainder.
- Repeat the process with the quotient until it is zero. Make sure to note each quotient and remainder as you calculate each number.
- The octal number is the remainders from bottom to top.
For example, let us convert decimal number 199 to octal.
199/8 = 24 and remainder 7
24/8 = 3 and remainder 0
3/8 = 0 and remainder 3
The octal number is formed from the remainders counting from bottom to top. 199 = 307
5. DEC2OCT function not working
DEC2OCT returns the #NUM! error value if
- Number is less than -549,755,813,888 or larger than 549,755,813,887. See cells B3 and C3 in the image above.
- [places] is negative. See the formula next to cell C5.
- it requires more than the specified places characters. See the formula next to cell C6.
DEC2OCT returns the #VALUE! error if
- [places] is not a number. See the formula next to cell C7.
- The number is not a valid base 10 number. See cells B4 and C4 in the image above.
The second argument [places]is truncated if it is not an integer. For example, [places] is 4.1111111111 and the DEC2OCT function truncates it to 4. See the formula next to cell C8.
DEC2OCT ignores places and returns a 10-character hexadecimal number if the decimal number is negative.
Useful resources
DEC2OCT function - Microsoft
Decimal to Octal Converter
Decimal to Octal - Cuemath
4. How to use the DELTA function
The DELTA function evaluates whether two numerical values are equal. This function is also known as the Kronecker Delta function.
What is the Kronecker Delta?
The Kronecker Delta is a mathematical function that takes two variables, usually positive whole numbers, and returns 1 if they are equal and 0 if not equal.
δij where i and j are variables. i = j returns 1, i <> j returns 0
The Kronecker delta is often used in mathematics, physics, engineering and computer science.
Table of Contents
1. DELTA Function Syntax
DELTA(number1, [number2])
2. DELTA Function Arguments
Argument | Text |
number1 | Required. |
[number2] | Optional, default value is 0 (zero). |
3. DELTA Function Example
The image above shows arguments number1 in column B, arguments number2 in column C and the result of the DELTA function in column D.
Formula in cell D3:
Row 3 contains numbers 2 and 3, DELTA function in cell D3 returns 0 (zero). 2 and 3 are not equal. Row 4 has 7 and 7, the DELTA function returns 1. 7 and 7 are equal.
Row 8 shows that negative numbers, in this case, -3 and -3 returns 1. They are equal.
4. DELTA Function not working
The DELTA function returns a #VALUE error value if number1 or [number2] is nonnumeric. The image above shows the DELTA function returning a #VALUE error in cell D3, the second argument is "A" and is non numeric which is not allowed.
The DELTA function in cell D4 also returns a #VALUE error, it has a boolean value in the first argument. You can convert boolean values to their numerical equivalents by multiplying the boolean value by 1.
5. DELTA function compared to other comparison functions/operators
The DELTA function compares only numerical values and the output is 1 or 0 (zero). It can't compare an array of values, not text values or boolean values. It is quite limited if you consider array operations.
The equal sign = is a logical operator, it is able to compare numbers, text and boolean values. It also compares a value to an array of values, or an array of values to another array of values. The downside is that it doesn't differentiate between upper and lower letters.
The output from the equal sign is a boolean value TRUE or FALSE, however, it is easy to convert the output to their numerical equivalents TRUE = 1 and FALSE = 0 (zero) by multiplying the output with 1. You can also add a zero if you prefer. It is also possible to use double negations.
The EXACT function is primarily used to compare text strings also considering upper and lower letters. However, it also works with numbers and boolean values as well. It works fine with arrays, the output is either TRUE or FALSE just like the equal sign.
The COUNTIF function is like the equal sign but on steroids. It works fine with arrays and is easy to work with, it can also check if values are smaller/larger than other values. The COUNTIF function returns the actual count meaning a whole number equal or larger than 0 (zero).
The COUNTIFS function is a more advanced than the COUNTIF function.
Useful resources
DELTA function - Microsoft
Kronecker Delta - Wolfram
Kronecker Delta - Wikipedia
5. How to use the HEX2BIN function
The HEX2BIN function converts a hexadecimal number to a binary number.
What is a hexadecimal number?
A hexadecimal number is a numeral system with a base of 16, for example, the decimal system uses a base of 10. This means that each digit in a hexadecimal number can have 16 possible values, from 0 to 15, however, the letters A to F are used from 10 to 15. See the hexadecimal column in the table below.
Hexadecimal numbers are often used in computers, the reason is they represent four binary digits (bits) with one hexadecimal digit. For example, the binary number 1010 is equivalent to the hexadecimal number A.
Hexadecimals make it easier to write big numbers with less digits, in other words, hexadecimals shorten binary digits considerably. For example, we can use hexadecimal to show the values of colors and MAC addresses in computers.
What is a binary number?
The binary system is a positional numeral system that uses only two digits: 0 and 1. The binary system is important in our society, many devices like computers, digital cameras, mobile phones and modern cars use binary code to store, process and communicate data. The binary numeral system makes it easy to store and transmit data using binary digits or bits.
Hexadecimal | Binary |
0 | 0 |
1 | 1 |
2 | 10 |
3 | 11 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
8 | 1000 |
9 | 1001 |
A | 1010 |
B | 1011 |
C | 1100 |
D | 1101 |
E | 1110 |
F | 1111 |
10 | 10000 |
Table of Contents
1. HEX2BIN Function Syntax
HEX2BIN(number, [Places])
2. HEX2BIN Arguments
number | Required. The hexadecimal number you want to convert to a decimal number. |
[Places] | Optional. How many digits to use, if omitted HEX2BIN uses the minimum number of required digits. Tip! Use [Places] for padding with leading 0's (zeros).
HEX2BIN function ignores [Places] argument if the hexadecimal is negative. |
3. HEX2BIN Function Example
The image above demonstrates the HEX2BIN function cell C3, C4, C5, and C6. It calculates the binary values based on the corresponding cells which contain different hexadecimal numbers.
Formula in cell C3:
The first cell B3 contains 1 and the HEX2BIN function returns 1 in cell D3, the second cell B4 contains F and the HEX2BIN function returns 1111 in cell D4.
4. How is hexadecimal to binary calculated?
Binary | 0 | 1 | 10 | 11 | 100 | 101 | 110 | 111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
Hexadecimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Convert every hexadecimal to a binary using the table above.
4.1 Example 1
Hexadecimal value 664 is calculated to a binary like this:
Third hexadecimal value: 6 = 0110
Second hexadecimal value: 6 = 0110
First hexadecimal value: 4 = 0100
equals
0110 0110 0100
4.2 Example 2
Hexadecimal value F9F is calculated to binary like this:
F = 1111
9 = 1001
F = 1111
equals
1111 1001 1111
5. HEX2BIN Function not working
HEX2BIN returns the #NUM! error value if
- Number is less than FFFFFFFE00 or larger than 1FF. See cells B3 and C3 in the image above.
- [places] is negative. See the formula next to cell C5.
- it requires more than the specified places characters. See the formula next to cell C6.
- The number is not a valid base 16 number. See cells B4 and C4 in the image above.
HEX2BIN returns the #VALUE! error if
- [places] is not a number. See the formula next to cell C7.
The second argument [places]is truncated if it is not an integer. For example, [places] is 4.1111111111 and the HEX2BIN function truncates it to 4. See the formula next to cell C8.
HEX2BIN ignores places and returns a 10-character binary number if the hexadecimal number is negative.
Useful links
HEX2BIN function - Microsoft
Hex to Binary converter
Hexadecimal - Wikipedia
6. How to use the HEX2DEC function
The HEX2DEC function converts a hexadecimal number to a decimal number.
What is a hexadecimal number?
A hexadecimal number is a numeral system with a base of 16, for example, the decimal system uses a base of 10. This means that each digit in a hexadecimal number can have 16 possible values, from 0 to 15, however, the letters A to F are used from 10 to 15. See the hexadecimal column in the table below.
Hexadecimal numbers are often used in computers, the reason is they represent four binary digits (bits) with one hexadecimal digit. For example, the binary number 1010 is equivalent to the hexadecimal number A.
Hexadecimals make it easier to write big numbers with less digits, in other words, hexadecimals shorten binary digits considerably. For example, we can use hexadecimal to show the values of colors and MAC addresses in computers.
What is a decimal number?
The decimal system is a positional numeral system that uses 10 as the base, it requires 10 different numerals: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The dot or the decimal point represents decimal fractions which are not whole numbers.
The decimal number 520 has three positions, each with a different weight. It starts with 10^0 on the right and increases by one power on each additional position to the left.
520 = (5*10^2)+(2*10^1)+(0*10^0)
520 = 500 + 20 + 0
Table of Contents
1. HEX2DEC Function Syntax
HEX2DEC(number)
2. HEX2DEC Arguments
number | Required. The hexadecimal number you want to convert to a decimal number. The sign bit is the most significant bit, the remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation. |
What is a sign bit?
The sign bit indicates whether the hexadecimal number is positive or negative, if the bit is 0 the number is positive, if the bit is 1, the number is negative.
What is a magnitude bit?
The remaining 39 bits are magnitude bits which represents the absolute value of the number. An absolute number is a number without the sign.
What is two's-complement notation?
Two’s-complement notation is used to represent negative numbers, the magnitude bits are changed from 0 to 1 and 1 to 0 and adding 1 to the result. For example:
Hexadecimal number 7FFFFFFFFF using 10 bits is 0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 which is a positive decimal number.
Hexadecimal number 8FFFFFFFFF using 10 bits is 1000 1111 1111 1111 1111 1111 1111 1111 1111 1111 which is a negative decimal number.
3. HEX2DEC Function Example
The image above demonstrates the HEX2DEC function cell C3, C4, C5, and C6. It calculates the decimal values based on the corresponding cells which contain different hexadecimal numbers.
Formula in cell D3:
The first cell B3 contains 1 and the HEX2DEC function returns 1 in cell C3, the second cell B4 contains F and the HEX2DEC function returns 15 in cell C4.
The third cell B5 contains FFFFFFFFFF and the HEX2DEC function returns -1 in cell C5, the fourth cell B6 contains FFFFFFFFFE and the HEX2DEC function returns -2 in cell C6.
4. How is hexadecimal to decimal calculated?
Hexadecimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
xyz
becomes
x * (16 ^ 2)
y * (16 ^ 1)
z * (16 ^ 0)
equals
x * (16 ^ 2) + y * (16 ^ 1) + z * (16 ^ 0)
4.1 Example 1
Hexadecimal value 664 is calculated to decimal like this:
Third hexadecimal value: 6*16^2 = 6*256 = 1536
Second hexadecimal value: 6*16^1 = 6*16 = 96
First hexadecimal value: 4*16^0 = 4*1 = 4
1536+96+4
equals
1636.
4.2 Example 2
Hexadecimal value F9F is calculated to decimal like this:
F = 15, see the table above. F is the third character from the right. 15*16^2 = 3840
9 is the second character from the right. 9*16^1=144
F = 15
Add the numbers: 3840 + 144 + 15 equals 3999
External links
Hexadecimal to decimal
Hexadecimal to Decimal converter
Hexadecimal to Decimal - Cuemath
7. How to use the HEX2OCT function
The HEX2OCT function converts a hexadecimal number to an octal number.
What is a hexadecimal number?
A hexadecimal number is a numeral system with a base of 16, for example, the decimal system uses a base of 10. This means that each digit in a hexadecimal number can have 16 possible values, from 0 to 15, however, the letters A to F are used from 10 to 15. See the hexadecimal column in the table below.
Hexadecimal numbers are often used in computers, the reason is they represent four binary digits (bits) with one hexadecimal digit. For example, the binary number 1010 is equivalent to the hexadecimal number A.
Hexadecimals make it easier to write big numbers with less digits, in other words, hexadecimals shorten binary digits considerably. For example, we can use hexadecimal to show the values of colors and MAC addresses in computers.
What is a octal number?
The octal system is a numeral system with a base of 8 that uses the digits 0, 1, 2, 3, 4, 5, 6 and 7. The octal system is often used in electronics because it is easy to perform a conversion between octal and binary numbers.
The following table shows the hexadecimal, octal and decimal values from 0 (zero) to 17.
Hexadecimal | Octal | Decimal |
0 | 0 | 0 |
1 | 1 | 1 |
2 | 2 | 2 |
3 | 3 | 3 |
4 | 4 | 4 |
5 | 5 | 5 |
6 | 6 | 6 |
7 | 7 | 7 |
8 | 10 | 8 |
9 | 11 | 9 |
A | 12 | 10 |
B | 13 | 11 |
C | 14 | 12 |
D | 15 | 13 |
E | 16 | 14 |
F | 17 | 15 |
10 | 20 | 16 |
11 | 21 | 17 |
Table of Contents
1. HEX2OCT Function Syntax
HEX2OCT(number, [places])
2. HEX2OCT Function Arguments
number | Required. The hexadecimal number you want to convert to an octal number. The sign bit is the most significant bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation. |
[places] | Optional. The number of digits to show, in other words, this creates leading zeros if not all digits are used. |
What is a sign bit?
The sign bit indicates whether the hexadecimal number is positive or negative, if the bit is 0 the number is positive, if the bit is 1, the number is negative.
What is a magnitude bit?
The remaining 39 bits are magnitude bits which represents the absolute value of the number. An absolute number is a number without the sign.
What is two's-complement notation?
Two’s-complement notation is used to represent negative numbers, the magnitude bits are changed from 0 to 1 and 1 to 0 and adding 1 to the result. For example:
Hexadecimal number 7FFFFFFFFF using 10 bits is 0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 which is a positive decimal number.
Hexadecimal number 8FFFFFFFFF using 10 bits is 1000 1111 1111 1111 1111 1111 1111 1111 1111 1111 which is a negative decimal number.
3. HEX2OCT Function example
The image above shows the HEX2OCT function in cell C3, it calculates the octal number based on the specified number in cell B3.
Formula in cell C3:
The first example shows the HEX2OCT function in cell C3, the argument is specified in cell B3 which is 1 in hexadecimal and it returns 1 in octal.
Cell B4 contains F in hexadecimal which the HEX2OCT function converts to 17 in the octal numeral system shown in cell C4.
The third example converts "FFFFFFFFFF" to octal, the result is shown in cell C5 which is 7777777777 in octal.
4. How is the HEX2OCT Function calculated?
There is no easy way to convert from hexadecimal to octal by manually calculating the values. You can convert from hexadecimal to 4 digit binary and then put the binary digits in groups of three. Lastly, convert from three digit binary to octal, however, it is probably easier to just convert from hexadecimal to octal using the following table:
Hexadecimal | Octal |
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 10 |
9 | 11 |
A | 12 |
B | 13 |
C | 14 |
D | 15 |
E | 16 |
F | 17 |
5. HEX2OCT Function not working
The hexadecimal argument can't contain more than 10 characters.
HEX2OCT ignores places and returns a 10-character octal number if the hexadecimal is negative.
The smallest hexadecimal value is FFE0000000 and the largest is 1FFFFFFF. Values larger or smaller than the specified range are not allowed.
HEX2OCT returns the #NUM! error value if the hexadecimal value is not valid.
HEX2OCT function returns #NUM! error value if it requires more than the places argument allows.
The places argument is truncated if not an integer.
HEX2OCT returns the #VALUE! error value if the places argument is a non-numeric value.
The HEX2OCT function returns #NUM! error if places argument is negative.
Useful links
HEX2OCT function - Microsoft
Hex to Octal converter
Hexadecimal Number System - Cuemath
More than 1300 Excel formulas
Excel categories
Leave a Reply
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form