Share via


WorksheetFunction.GammaLn Method

Returns the natural logarithm of the gamma function, Γ(x).

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

Syntax

'Declaration
Function GammaLn ( _
    Arg1 As Double _
) As Double
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Double
Dim returnValue As Double

returnValue = instance.GammaLn(Arg1)
double GammaLn(
    double Arg1
)

Parameters

  • Arg1
    Type: System.Double

    X - the value for which you want to calculate GAMMALN.

Return Value

Type: System.Double

Remarks

Important

This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. This function is still available for compatibility with earlier versions of Excel. However, if backward compatibility is not required, you should consider using the new functions from now on, because they more accurately describe their functionality. For more information about the new function, see the GammaLn_Precise(Double) method.

If x is nonnumeric, GammaLn returns the #VALUE! error value.

If x ≤ 0, GammaLn returns the #NUM! error value.

The number e raised to the GAMMALN(i) power, where i is an integer, returns the same result as (i - 1)!.

GammaLn is calculated as follows:

Figure 1: Equation for the GammaLn method

Equation for the GammaLn method

Where:

Figure 2: Equation

Equation

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace