Purpose

Return value

Syntax

=IMTAN(complex_num)
  • complex_num - The complex number in the form “x+yi”.

Using the IMTAN function

The Excel IMTAN function returns the tangent of a complex number. For example, given the complex number “3+4i” as input, the function returns “-0.000187346+0.999355987i”

=IMTAN("3+4i") // returns -0.000187346+0.999355987i

Explanation

In math, the tangent of a complex number is defined in terms of complex sine and cosine functions.

Complex tangent definition. - 1

In Excel, the tangent of a complex number is equivalent to the following formula.

=IMDIV(IMSIN(z),IMCOS(z)) // equivalent to IMTAN(z)

The 3D plot below visualizes the function’s real output. The horizontal XY plane represents input from the complex plane, and the vertical axis represents the function’s real output.

Real output of the complex tangent function. - 2

The output along the real axis forms the shape of the regular (circular) tangent function .

Real output of the complex tangent function highlight regular tangent. - 3

The imaginary output of the function is visualized by the 3D plot below.

Imaginary output of the complex tangent function. - 4

The output along the imaginary axis forms the shape of the hyperbolic tangent function .

Imaginary output of the complex tangent function highlight hyperbolic tangent. - 5

Purpose

Return value

Syntax

=OCT2BIN(number,[places])
  • number - The octal number you want to convert.
  • places - [optional] The number of characters to use. If omitted, the function uses the minimum number of characters necessary.

Using the OCT2BIN function

The OCT2BIN function is used to convert octal numbers (base 8) to binary numbers (base 2). This is useful when working with different number systems, especially in engineering and computer science applications.

Key features

  • Converts octal numbers to binary numbers
  • Supports optional padding with leading zeros
  • Handles both positive and negative octal numbers (using two’s-complement for negatives)
  • Returns a text string representing the binary number

To get the octal representation of a decimal number, use the DEC2OCT function.

  • Example #1 - Basic conversion
  • Example #2 - Padding with leading zeros
  • Example #3 - Negative octal numbers
  • Example #4 - Limits and range
  • Error handling

Example #1 - Basic conversion

To convert the octal number 11 to binary, use the following formula:

=OCT2BIN(11) // returns 1001 (binary)

Example #2 - Padding with leading zeros

To convert the octal number 11 to binary, padded to 10 characters, use the following formula:

=OCT2BIN(11, 10) // returns 00000001001 (binary)

Example #3 - Negative octal numbers

Excel represents negative numbers in non-decimal bases (like octal and binary) using two’s complement notation with a fixed width of 10 characters. This means that when you use OCT2BIN with a negative octal number, Excel interprets the input as a two’s complement value and returns a 10-character binary string.

For example, to represent the decimal number -3 in octal, you would use the octal number 7777777775 . This is because the most significant digit is the sign bit, and the remaining 9 digits represent the magnitude.

=DEC2OCT(-3) // returns 7777777775

Then, when we convert the octal number to binary, we get the following result:

=OCT2BIN(7777777775) // returns 1111111101

This is because the most significant bit is the sign bit, and the remaining 9 digits represent the magnitude.

Example #4 - Limits and range

The OCT2BIN function is limited to binary numbers with a maximum of 10 digits. If you try to convert an octal number that would require more than 10 binary digits, OCT2BIN returns the #NUM! error.

The table below shows what happens at the boundaries:

Screenshot showing the limits and range of the OCT2BIN function in Excel. The largest positive octal value that can be converted is 777 (decimal 511), and the smallest negative octal value is 7777777000 (decimal -512). Values outside this range return a #NUM! error. - 6

The largest positive number you can convert is octal 777 (decimal 511). The smallest negative number you can convert is octal 7777777000 (decimal -512). Any value outside this range returns a #NUM! error.

Error handling

  • If the input is outside the allowed range (e.g., 7777776777 or 1000), OCT2BIN returns the #NUM! error value.
  • If the input is non-numeric (e.g., Text), OCT2BIN returns the #NUM! error value.
  • If the input is not a valid octal number (e.g., 80), OCT2BIN returns the #NUM! error value.
  • If the input is not an integer (e.g., 10.5), OCT2BIN returns the #NUM! error value.
  • If the input is negative (e.g., -4), OCT2BIN returns the #NUM! error value.