The Excel GCD Function

Related Function:
LCM Function

Function Description

The Excel GCD function returns the greatest common divisor of two or more supplied integers.

The syntax of the function is:

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

Where the number arguments are up to 255 numeric values for which you want to calculate the greatest common divisor.

If any of the supplied numbers are decimals, these values are truncated to integers.


GCD Function Examples

The following spreadsheet shows four examples of the Excel Gcd Function.

 Formulas:
  A
1 =GCD( 1, 5 )
2 =GCD( 15, 10, 25 )
3 =GCD( 0, 8, 12 )
4 =GCD( 7, 2 )
 Results:
  A
1 1
2 5
3 4
4 1

Further details and examples of the Excel Gcd function are provided on the Microsoft Office website.


GCD Function Errors

If you get an error from the Excel Gcd function this is likely to be one of the following:

Common Errors
#NUM! - Occurs if any of the supplied number arguments are less than zero.
#VALUE! - Occurs if any of the supplied number arguments are non-numeric.