Share via


WorksheetFunction.Complex Method

Converts real and imaginary coefficients into a complex number of the form x + yi or x + yj.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function Complex ( _
    Arg1 As Object, _
    Arg2 As Object, _
    Arg3 As Object _
) As String
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Object
Dim Arg2 As Object
Dim Arg3 As Object
Dim returnValue As String

returnValue = instance.Complex(Arg1, Arg2, _
    Arg3)
string Complex(
    Object Arg1,
    Object Arg2,
    Object Arg3
)

Parameters

  • Arg1
    Type: System.Object

    The real coefficient of the complex number.

  • Arg2
    Type: System.Object

    The imaginary coefficient of the complex number.

  • Arg3
    Type: System.Object

    The suffix for the imaginary component of the complex number. If omitted, suffix is assumed to be "i".

Return Value

Type: System.String

Remarks

All complex number functions accept "i" and "j" for suffix, but neither "I" nor "J". Using uppercase generates an error. All functions that accept two or more complex numbers require that all suffixes match.

If Arg1 is nonnumeric, Complex generates an error.

If Arg2 is nonnumeric, Complex generates an error.

If Arg3 is neither "i" nor "j", Complex generates an error.

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace