Contact

G_DURATION Function (Gnumeric)

Financial Intermediate Gnumeric Gnumeric 1.1.6 (current name)

Use G_DURATION in Gnumeric to solve the number of compounding periods between two values. Interpret fractional periods and its unusual error guards.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =G_DURATION(0.1,1000,1210) has the reference result 2 with the inputs described below. The October 15 source/reference expectation was also observed, within floating-point precision, in the October 22 native CLI checks described below.

Availability and version history

  • Introduced: The current G_DURATION name dates to Gnumeric 1.1.6, when the earlier DURATION growth-period function was renamed and DURATION was reassigned to bond duration. The earlier growth function appears among new functions in 0.19. These are different contracts: do not substitute current DURATION for G_DURATION.
  • Documented support: Registered in Gnumeric 1.12.62, in the Financial Functions plugin. No retirement is established.
  • Native-tested version: Gnumeric 1.12.62 with GOFFICE 0.10.61, Debian 13 Linux x86-64, headless command-line calculation on October 22, 2026. This does not certify another version or graphical editor.
  • Scope and dates: English formulas are shown. Official source snapshots were retained from the October 13–14, 2026 audit. The original guide and reference calculations were checked on October 15, 2026. The separately dated native checks below add bounded execution evidence, not a newer-release claim.

What G_DURATION does

G_DURATION computes LN(fv/pv)/LN(1+rate): the number of periods needed to reach a target under constant compounding without intervening cash flows. It is different from bond duration, which is handled by DURATION and MDURATION. Gnumeric’s help identifies this operation with OpenFormula PDURATION, but that is not a claim that PDURATION is a separately accepted English name in every Gnumeric build.

The function-specific help and complete callback provide the product-specific contract.

Syntax and arguments

=G_DURATION(rate,pv,fv)
  • rate: Positive rate per modeled compounding period. Zero and negative rates are rejected.
  • pv: Nonzero starting value.
  • fv: Nonzero target value with the same sign as pv for the real-valued model. All three arguments are required.

The registration was checked alongside the callback; use the exact function name and argument order rather than assuming cross-application equivalence.

Reproducible worksheet

Put rate 10% in B2, starting value 1000 in B3 and target 1210 in B4. In B6 enter =G_DURATION(B2,B3,B4); the reference result is 2 periods. In B7 enter =B3*(1+B2)^B6; the reconstructed target is 1210. If the rate is monthly, the result counts months; if annual, it counts years.

For 8% growth from 1000 to 2000, the algebraic answer is approximately 9.006468342001 periods. The function does not round this to a whole number of credited periods. At nine whole periods the target is still slightly short, while ten whole periods exceeds it.

Formula and boundary checks

All outputs below began as source-derived independent reference results and matched the October 22 native CLI fixture within floating-point tolerance. Decimal outputs are rounded to twelve places where needed. Quoted codes remain text; numeric examples remain numbers.

Formula Expected reference result
=G_DURATION(0.1,1000,1210) 2
=G_DURATION(0.08,1000,2000) 9.006468342001
=G_DURATION(0.1,1100,1000) -1
=G_DURATION(0.1,1000,1000) 0
=G_DURATION(0.1,-1000,-1210) 2
=G_DURATION(0,1000,1210) #DIV/0!
=G_DURATION(-0.1,1000,810) #DIV/0!
=G_DURATION(0.1,0,1210) #DIV/0!
=G_DURATION(0.1,1000,0) #DIV/0!
=G_DURATION(0.1,1000,-1210) #VALUE!

Advanced application and cross-check

When growth is credited only after complete periods, a planning threshold can use =ROUNDUP(G_DURATION(8%,1000,2000),0), giving 10 for this example. Keep the unrounded result as the mathematical estimate and check the rounded horizon with a future-value formula. This distinction matters because the logarithmic solution permits fractional compounding while a product’s payment rules may not.

Equal start and target values give zero at a positive rate. A target smaller than the positive starting amount yields a negative number of periods: =G_DURATION(10%,1100,1000) is -1. That indicates extrapolation backwards under positive growth, not a future waiting time. Validate that the target represents the direction of change you intend.

Errors, boundaries and troubleshooting

The inspected guard returns #DIV/0! for rate zero or negative, and also for either endpoint equal to zero. Opposite-sign endpoints give #VALUE! because their ratio is negative. Both endpoints negative produce a positive ratio and can pass the guard, but interpreting two negative balances as ordinary investment growth needs separate consideration.

Do not apply the function to a series with contributions, withdrawals or varying rates and expect it to account for those flows. It sees only rate and endpoints. A mistakenly entered rate 8 instead of 8% means 800% per period. Also distinguish this underscore-bearing function name from the site’s hyphenated URL: the worksheet formula is G_DURATION, while this guide keeps its existing g-duration route.

The native fixtures use explicit numeric arguments, plus the stated invalid numeric boundaries. Blank/text coercions, localized formula entry and graphical display formatting remain unverified; keep missing inputs distinct from intentional zero.

XLSX export and the PDURATION name

In the tested Gnumeric 1.12.62 build, =G_DURATION(B2,B3,B4) was stored in XLSX worksheet XML as _xlfngnumeric.G_DURATION(B2,B3,B4). This is an export spelling, not a new formula to type. The released source archive, in plugins/excel/xlsx-utils.c, adds that extension prefix for functions marked unique to Gnumeric and removes it on import.

Removing all formula caches before importing that export back into the same native engine still recalculated the original result. Changing B4 from 1210 to 1331 changed B6 from approximately 2 to 3; restoring B4 restored the original results. A separate formula-change check produced approximately 4 periods for a 1464.1 target, then restored the original formula and results.

Do not rename this formula to PDURATION merely because the help associates its meaning with OpenFormula PDURATION. The explicit native name probe =PDURATION(0.1,1000,1210) returned #NAME? in this build, while G_DURATION returned approximately 2. XLSX export retained that unresolved name as _xlfn.PDURATION(...); a prefix alone does not establish a working function.

Before sharing a workbook, test recalculation in the receiving program with its own supported function names and input rules. A successful Gnumeric-to-Gnumeric round trip is not evidence that Excel, LibreOffice or another program implements the extension name, accepts the same invalid inputs, or gives matching results. Do not replace G_DURATION with current DURATION: they calculate different quantities.

Official evidence and verification limits

The original October 15 calculations were an independent reference model, not native execution. On October 22, eight isolated Gnumeric 1.12.62 command-line conversions checked the ten table examples, worksheet reconstruction, whole-period rounding and nine/ten-period values, plus the explicit PDURATION name probe. All 16 formula caches were removed before the first native import and again before reimport. Independent logarithmic and compound-growth calculations agreed within a 1e-12 relative/absolute tolerance; input and formula changes were restored. These checks used C.UTF-8 and UTC. No GUI screenshot, localized entry, blank/text coercion, extreme-value behavior or other-application compatibility is certified. The authoring-tool preview is not native evidence. Reproduce a small fixture in the target build before relying on an operational workbook.

RRI, FV.