ID EN
#Math

GCD

Excel Functions

Get the greatest common divisor of numbers

Syntax

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

Arguments

Parameter Description
number1 The first number.
number2 [optional] The second number.

Return Value

The largest positive integer that divides the numbers evenly

Details

The GCD function returns the greatest common divisor of two or more integers. The greatest common divisor is the largest positive integer that divides the numbers without a remainder. In other words, the largest number that goes into all numbers evenly. The GCD function takes one or more arguments called number1, number2, number3, etc. All numeric values are expected to be integers. Numbers with decimal values will be truncated to integers before a result is calculated. Each argument can be a hardcoded constant, a cell reference, or a range that contains multiple values. The GCD function can accept up to 255 arguments total. To return the greatest common divisor of the numbers 60 and 36: GCD returns the number 12, since 12 is the largest factor that goes into both numbers evenly. To get th

Examples

Examples

To return the greatest common divisor of the numbers 60 and 36:

EXCEL
=GCD(60,36) // returns 12
Examples

GCD returns the number 12, since 12 is the largest factor that goes into both numbers evenly. To get the greatest common divisor of 12, 16, 48:

EXCEL
=GCD(12,16,48) // returns 4
Examples

In the example workbook shown above, the formula in F5 is:

EXCEL
=GCD(B5:D5)

See Also

LCM