GCD_EXCEL2003 Function (LibreOffice Calc)
LibreOffice GCD_EXCEL2003 finds common divisors for integer quantities. See zero cases, whole-number input cautions and the 5.1 name change.
Verification status: Official release source and independent examples for GCD_EXCEL2003 were reviewed. Imported formulas that mapped to other internal functions do not verify this compatibility entry; the guide preserves that limitation. How formula examples are checked
Quick answer: =GCD_EXCEL2003(16;32;24) returns 8. It finds the largest whole-number divisor shared by every input. Use it when maintaining a workbook that specifically needs this Analysis Add-In compatibility function.
Availability and version history
- Introduced: First calculation release not established. The 5.1 source-line rename changed GCD_ADD to this compatibility name.
- Supported in: LibreOffice 26.8.1.1. No final supported release has been established.
- Scope: Desktop Calc; compatibility function, retained rather than retired.
- Checked: October 14, 2026. Pinned source and independent examples checked. This compatibility name was not natively executed; tests of other imported names are separate.
What GCD_EXCEL2003 calculates
A common divisor divides every quantity without a remainder. The greatest one gives the largest equal unit that can be taken from each quantity. If positive inputs share no factor larger than 1, the result is 1.
The function reference documents this spelling. For new documents, the release recommends the unsuffixed GCD function. The suffix refers to compatibility with older Excel workbooks; it does not mean the function has been removed.
Syntax and inputs
=GCD_EXCEL2003(Number1 [; Number2 [; …]])
Provide at least one numeric value or a reference containing numeric values. Additional values and ranges are optional. For example, place 16, 32 and 24 in B2:B4, then use =GCD_EXCEL2003(B2:B4) to obtain 8. Semicolons separate arguments in these Calc examples; a colon joins the endpoints of a range.
Use nonnegative whole numbers for ordinary counting applications. A zero has a special role: zero contributes no positive divisor restriction when other positive values are present, so GCD_EXCEL2003(0;12) returns 12; all-zero inputs return 0. Negative inputs are rejected by the release input guard.
The Help describes truncation of fractional inputs, but the pinned add-in GCD implementation retains doubles and applies a remainder loop. Do not rely on undocumented fractional behavior or assume the Help wording proves every import path truncates. If your model deliberately discards fractions, apply INT to validated nonnegative inputs first; otherwise reject them.
Reproducible examples
Enter each formula in a separate cell formatted as a number. These values follow independent integer arithmetic and the source-backed zero rules.
| Formula | Expected result |
|---|---|
=GCD_EXCEL2003(16;32;24) |
8 |
=GCD_EXCEL2003(9;12;6) |
3 |
=GCD_EXCEL2003(3;5) |
1 |
=GCD_EXCEL2003(0;12) |
12 |
=GCD_EXCEL2003(0;0) |
0 |
=GCD_EXCEL2003(18;24) |
6 |
=GCD_EXCEL2003(48;180) |
12 |
=GCD_EXCEL2003(4;6) |
2 |
=GCD_EXCEL2003(6;15;20) |
1 |
=GCD_EXCEL2003(7;11) |
1 |
=GCD_EXCEL2003(42) |
42 |
=GCD_EXCEL2003(72;108;180) |
36 |
Practical example: equal kits without leftovers
Suppose inventory contains 72 bolts, 108 washers and 180 nuts. You want the greatest possible number of identical kits, using every item. Put the quantities in B2:B4 and calculate =GCD_EXCEL2003(B2:B4) in E2. The result is 36 kits. Then enter =B2/$E$2 in C2 and fill through C4: each kit receives 2 bolts, 3 washers and 5 nuts.
This use reverses the common “largest piece size” interpretation: the divisor is the number of identical groups. Multiplying each per-kit amount by 36 reconstructs the original stock. If a stock quantity is zero, decide whether a kit without that component is allowed before using the zero convention.
Advanced example: reduce a ratio
For quantities 48 and 180, =GCD_EXCEL2003(48;180) is 12. Divide both values by 12 to get 4:15. With the quantities in A2 and B2, put =GCD_EXCEL2003(A2;B2) in C2, then use =A2/C2 and =B2/C2. Keep the numeric results in separate cells if later calculations need them; concatenate with a colon only for a display label.
The ratio 0:0 has no meaningful reduction: its divisor is zero and the subsequent division would fail. Check that at least one quantity is positive. Do not use IFERROR to turn that undefined ratio into an apparently valid zero.
Errors, compatibility and verification
Numeric-looking text is not a reliable substitute for numeric cells. First verify the stored types and range boundaries. Test empty cells, Booleans and errors in the installed application if those inputs are part of your actual workbook; the examples deliberately use explicit numeric values.
The GCD cannot exceed the largest nonzero input. The main precision risk is that a very large input may already have been rounded before the function sees it, changing which integers divide it. Keep integer counts within the reliable range of the spreadsheet representation and verify imported identifiers or counts before calculating. Formatting a decimal to show no places does not make the stored value an integer.
When moving an old OpenOffice workbook into current LibreOffice, this calculation uses GCD_EXCEL2003 rather than GCD_ADD. A UI rename is different from a changed first-introduction date. Check the stored formula and results after conversion.
The release evaluator and input guard support the calculation and restrictions above. The numerical examples are independently checked; the availability section states the actual execution scope.