This function returns the largest positive integer that divides all specified numbers without a remainder.
Syntax
GCD(number1; [number2]; …)
Arguments
- number1 (required) – First integer value
- number2,… (optional) – Additional integers (up to 255 total values in modern Excel)
Key Features:
- Truncates decimal values to integers
- Requires all arguments ≥ 0 (#NUM! error if negative)
- Returns 0 if all arguments are 0
- At least one non-zero value required for meaningful result
Calculation Methods:
- Prime Factorization

- Euclidean Algorithm (More efficient):

Applications:
- Optimizing material cuts (construction/design)
- Fraction simplification (mathematics)
- Cryptography algorithms
- Scheduling recurring events
- Musical rhythm patterns
Error Handling:
=IFERROR(GCD(A1,B1), »Invalid input »)
Related Functions:
- LCM(): Least Common Multiple
- MOD(): Modulus/Remainder
- QUOTIENT(): Integer division