Google Sheets
GCD function in Google Sheets
Returns the greatest common divisor of one or more integers.
=GCD(value1, [value2, ...])GCD syntax and parameters
Two arguments, one required.
- value1anyRequired
The first value or range whose factors to consider in a calculation to find the greatest common divisor.
- value2anyRepeating
[ OPTIONAL ] - Additional values or ranges whose factors to consider to find the greatest common divisor.
GCD examples
Formulas you'll actually reuse.
The largest tile that fits both wall dimensions exactly:
=GCD(B2, C2)Result
30Reduce a ratio — 1920:1080 becomes 16:9:
=B2 / GCD(B2, C2) & ":" & C2 / GCD(B2, C2)Result
"16:9"
GCD in Excel
Same name — your formula ports as-is.
Try GCD in the playground
Edit the example — nothing to install.
Preloaded with the GCD formula from Example 1 — change anything and watch it respond.
Loading the editor…
Related functions
More ways Google Sheets gets this done.
- ABSReturns the absolute value of a number.MathExcel
- ACOSReturns the inverse cosine of a value, in radians.MathExcel
- ACOSHReturns the inverse hyperbolic cosine of a number.MathExcel
- ACOTReturns the inverse cotangent of a value, in radians. .MathExcel
- ACOTHReturns the inverse hyperbolic cotangent of a value, in radians. Must not be between -1 and 1, inclusive..MathExcel
- ASINReturns the inverse sine of a value, in radians.MathExcel