The Excel GCD function returns the greatest common divisor of two or more integers. The greatest common divisor is the largest integer that goes into all supplied numbers without a remainder.
Syntax
The Syntax for the GCD Formula is:
=GCD(number1,number2,…)
Function Arguments
number1 – Two or more numbers, separated by commas, or an array of numbers.
GCD Function Examples
The following spreadsheet shows four examples of the Excel Gcd Function.
Formulas:
Results:
Notes:
- The GCD function can accept up to 255 numbers as arguments.
- If any argument is nonnumeric, GCD returns the #VALUE! error value.
- If any argument is less than zero, GCD returns the #NUM! error value.
- One divides any value evenly.
- A prime number has only itself and one as even divisors.
- If a parameter to GCD is >=2^53, GCD returns the #NUM! error value.