PlanMaker GAMMALN: Log Gamma, Factorials and Stable Products
GAMMALN returns the natural logarithm of the gamma function for positive inputs. Build reproducible log-domain products, factorial checks and combination examples.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
GAMMALN returns the natural logarithm of the gamma function for positive inputs. Build reproducible log-domain products, factorial checks and combination examples.
Availability and evidence
The PlanMaker 2026 reference, 2024 reference and 2021 reference document this function. Original introduction and last-working-version endpoints remain unverified; a manual family is not a test of every build or edition.
References were retrieved on October 15, 2026. No native PlanMaker execution was performed. Examples below are independently calculated expectations, not application screenshots or native results. FreeOffice/mobile edition coverage and file transfers are not certified. English formulas use commas; verify separators and names in your installation.
Exact syntax and meaning
=GAMMALN(Number)
Number is required and must be greater than zero. The output is the natural logarithm of Γ(Number). It is not Γ of the logarithm, not a base-10 logarithm and not the logarithm of a gamma probability distribution.
The positive domain matters even where broader mathematical extensions exist. The PlanMaker reference does not license negative inputs or describe a complex-valued result. It also does not give an exact native error table for invalid inputs.
Complete logarithm worksheet
Create LogGammaControls with Input in A1, Log_gamma in B1 and Recovered_gamma in C1. Enter the numeric A values below. Fill B2 =GAMMALN(A2) and C2 =EXP(B2) down.
| Row | A: input | Independent B | Independent C |
|---|---|---|---|
| 2 | .5 | 0.5723649429 | 1.7724538509 |
| 3 | 1 | 0.0000000000 | 1.0000000000 |
| 4 | 1.5 | -0.1207822376 | 0.8862269255 |
| 5 | 2 | 0.0000000000 | 1.0000000000 |
| 6 | 3.5 | 1.2009736023 | 3.3233509704 |
| 7 | 5 | 3.1780538303 | 24.0000000000 |
In a copy change A4 from 1.5 to 2.5. B4 becomes approximately 0.2846828705, and C4 becomes 1.3293403882. At 1.5 the logarithm is negative because gamma is between zero and one; that does not mean the gamma value itself is negative.
At inputs 1 and 2, gamma equals one, so its natural logarithm is zero. Formatting those cells as percentages changes their display, not the logarithm’s definition.
Advanced: recover a factorial logarithm
To calculate ln(5!), use =GAMMALN(6), whose expected value is 4.7874917428. The one-unit offset follows Γ(n+1)=n!, as given by the gamma recurrence. =GAMMALN(5) instead gives ln(4!).
For n=100, =GAMMALN(101) has independent expectation 363.7393755556. This illustrates representing a large product by its logarithm; it is not an assertion that a particular PlanMaker build can safely evaluate every larger input or exponentiate every resulting log.
Advanced: combine products without forming them first
The log of a product is a sum of logs. For the moderate example Γ(5)Γ(4)/Γ(3), use =GAMMALN(5)+GAMMALN(4)-GAMMALN(3). The result is ln(72), approximately 4.2766661190. Applying EXP to this moderate log gives 72.
This formulation avoids first multiplying 24 by 6. It is useful when a model naturally accumulates multiplicative factors. Subtracting nearly equal large logarithms can still lose relative precision, so “use logs” is not a blanket guarantee of accurate final differences.
Advanced: a log-domain combination calculation
For choosing 3 items from 10, the formula =EXP(GAMMALN(11)-GAMMALN(4)-GAMMALN(8)) has mathematical expectation 120. The terms represent ln(10!), ln(3!) and ln(7!), respectively. A change to choosing 4 uses =EXP(GAMMALN(11)-GAMMALN(5)-GAMMALN(7)), with expected value 210.
This checks the factorial indexing in a familiar finite problem. It is not a promise of exact integer output for large combinations; a floating-point evaluation can be close to an integer without being exactly that integer. Use an appropriate combinatorial function when it matches the required domain and validate its own range.
Advanced: check a difference recurrence
On LogGammaControls fill D2 =GAMMALN(A2+1)-B2 down and E2 =LN(A2) down. Both represent ln(x) by the gamma recurrence, so their exact mathematical difference is zero. For x=0.5 the expectation is -0.6931471806; for x=5 it is 1.6094379124.
Errors and precision limits
Zero and negative inputs are outside the documented positive domain; exact native errors, text coercion, blanks and overflow thresholds remain unverified. Do not replace GAMMALN(x) with LN(x), and do not round intermediate log values before combining them. The printed table rounds independent calculations to ten decimal places for readability.
If EXP of a result fails, that does not by itself imply GAMMALN failed: converting back may recreate a magnitude too large for the numeric representation. Keep the logarithmic quantity if that is what the downstream calculation requires, and test the exact installation separately.