Related Function:

The GCD function returns the greatest common divisor of two or more supplied integers. The greatest common divisor is the largest integer that divides both number1 and number2 without a remainder.

Syntax

=GCD(num_1,[num_2], … )

Arguments

Argument Description
num_1,
[num_2], …
num_1 is required, subsequent numbers are optional. 1 to 255 values. If any value is not an integer, it is truncated

Examples

  A B C
1 Formula Result Notes
2 =GCD(1,5) 1 Greatest common divisor of 1 and 5
3 =GCD(24,36,48) 12 Greatest common divisor of 24, 36 and 48
4 =GCD(15,10,25) 5 Greatest common divisor of 10, 15 and 25
5 =GCD(8,0,12) 4 Greatest common divisor of 0, 8 and 12
6 =GCD(4,8,12) 4 Greatest common divisor of 4, 8 and 12
7 =GCD(2,7) 2 Greatest common divisor of 2 and 7

Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if any argument is nonnumeric
#NUM! Occurs if any argument is less than zero