GCD_ADD Function (OpenOffice Calc)
Use GCD_ADD in Apache OpenOffice for common-divisor calculations, with integer-group examples, zero handling and compatibility input cautions.
Verification status: Official release source and independently calculated examples for GCD_ADD were reviewed. No new Apache OpenOffice Calc application execution is claimed for this guide; the stated version and example limits still apply. How formula examples are checked
Quick answer: =GCD_ADD(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 release not established; this name is documented in the OpenOffice.org 3.3 function appendix.
- Supported in: Apache OpenOffice 4.1.16. No final supported release has been established.
- Scope: Desktop Calc. An installed Analysis Add-In is required.
- Checked: October 14, 2026. Pinned source and independent examples checked. Apache OpenOffice was not run; LibreOffice import tests are supplementary only.
What GCD_ADD 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. The suffix distinguishes the Analysis Add-In entry from the unsuffixed GCD function. Keep that distinction when auditing an older workbook rather than changing names solely because their descriptions sound similar.
Syntax and inputs
=GCD_ADD(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_ADD(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_ADD(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_ADD(16;32;24) |
8 |
=GCD_ADD(9;12;6) |
3 |
=GCD_ADD(3;5) |
1 |
=GCD_ADD(0;12) |
12 |
=GCD_ADD(0;0) |
0 |
=GCD_ADD(18;24) |
6 |
=GCD_ADD(48;180) |
12 |
=GCD_ADD(4;6) |
2 |
=GCD_ADD(6;15;20) |
1 |
=GCD_ADD(7;11) |
1 |
=GCD_ADD(42) |
42 |
=GCD_ADD(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_ADD(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_ADD(48;180) is 12. Divide both values by 12 to get 4:15. With the quantities in A2 and B2, put =GCD_ADD(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.
Current LibreOffice uses GCD_EXCEL2003 for the corresponding compatibility function. That name change is not a reason to type the LibreOffice spelling into Apache OpenOffice. Use the documented name for the application that will recalculate the workbook.
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.