Contact

GCD in Excel: Common Divisors, Equal Groups and Reduced Ratios

Math and trigonometry Intermediate Microsoft Excel

Use Excel GCD with integer controls, zero and truncation cases, equal-group models and the documented magnitude limit.

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

Quick answer: GCD returns the greatest common divisor of the supplied nonnegative integers. =GCD(42,70) gives the independently expected value 14. Fourteen is the largest integer that divides both inputs without a remainder.

Availability and version history

  • Introduced: First introduction version is not established by the official history reviewed.
  • Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
  • Checked: October 14, 2026; official GCD reference. Documentation and independently calculated examples; no native Excel execution or broader platform certification.

Syntax and Microsoft input limits

=GCD(number1,[number2],...)

The first argument is required; Microsoft documents 1–255 values and truncates noninteger inputs. Negative arguments produce #NUM!, nonnumeric arguments produce #VALUE!, and a parameter at least 2^53 produces #NUM! according to the dedicated reference.

These limits concern accepted inputs. They do not prove that every accepted mathematical integer operation has been natively tested here. Use whole, nonnegative counts for the practical models rather than treating silent truncation as an input-validation method.

Example 1: inspect divisibility directly

=GCD(42,70)
=42/14
=70/14

Expected results are 14, 3 and 5. Both original values are exact multiples of 14. A candidate divisor that works for only one input cannot be a common divisor.

For three inputs, =GCD(42,70,98) also gives 14. Adding 15 instead, as in GCD(42,70,15), reduces the common divisor to 1. Including another constraint cannot increase the set of common divisors.

Example 2: check the documented truncation and zero cases

=GCD(42.9,70.8)
=GCD(42,0)
=GCD(42,1)

Expected results are 14, 42 and 1. Positive fractional inputs become 42 and 70. Zero is divisible by every nonzero integer, so pairing it with 42 does not impose a smaller divisor. One forces the common divisor to one.

The all-zero configuration is not established by the dedicated example reviewed here. Keep it separate from the one-zero control instead of inventing a positive maximum divisor for two mathematical zeros.

Advanced example: make the largest number of equal groups

A fictional stock has 42 red units and 70 blue units. Divide all units into the greatest possible number of identical groups, with each group receiving whole quantities of both colors.

=GCD(42,70)

Expected number of groups: 14. Each group gets 3 red and 5 blue units. This interpretation seeks the number of groups. A question about the greatest common group size in two independent single-color batches has a different physical meaning even though the same divisor is useful.

No allocation or suitability decision is made by the function. The example assumes identical units within each color and requires all stock to be used.

Advanced example: reduce a ratio without changing its value

With A2=84 and B2=126, enter:

=A2/GCD(A2,B2)
=B2/GCD(A2,B2)

Expected reduced components are 2 and 3, since the shared divisor is 42. Their ratio 2/3 agrees with 84/126. Reducing components preserves the exact rational model; formatting the original division to two decimals would instead display only an approximation.

For positive integers a and b, the identity GCD(a,b)×LCM(a,b)=a×b gives another small-case check. With 42 and 70, 14×210=2940. See LCM for the matching-multiple question.

Errors and practical checks

GCD(−1,7) and GCD(2^53,1) are documented invalid-domain controls. Do not remove signs with ABS automatically unless the intended model truly ignores them. The direct function page does not establish every imported-text or array-coercion case; those remain separate from the integer examples above.

References and verification

Worked inputs are fictional. Decimal answers are independently calculated mathematical expectations rounded to nine places, not captured native results. Extreme magnitudes, complete coercion matrices and cross-version numerical accuracy remain untested.