GCD Function

Excel Functions › Math & Trig

All versions Math & Trig

The Excel GCD function returns the greatest common divisor — the largest whole number that divides every supplied value with no remainder.


Quick answer:
=GCD(24,36) = 12

Syntax

=GCD(number1, [number2], ...)
ArgumentDescription
number1RequiredThe first value. Non-integers are truncated to integers; negatives are not allowed.
number2, ...OptionalUp to 254 additional values. GCD finds the largest divisor common to all of them.

How to use it

GCD (greatest common divisor, sometimes called the highest common factor) finds the biggest number that divides every argument evenly.

=GCD(24,36) // = 12
=GCD(8,12,20) // = 4
=GCD(7,13) // coprime = 1

The most common practical use is reducing fractions to lowest terms: divide numerator and denominator by their GCD. GCD is the natural counterpart to LCM (least common multiple).

Coprime check: if GCD of two numbers is 1, they share no common factor — they are coprime. Useful for simplifying ratios and spotting fractions already in lowest terms.

Try it: interactive demo

Live demo

Pick a GCD example to see the formula and its result.

Result:

Practice workbook

📊
Download the free GCD practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What is the greatest common divisor?
The largest whole number that divides all the supplied values exactly. =GCD(24,36) = 12 because 12 is the biggest number dividing both 24 and 36.
Can GCD take more than two numbers?
Yes — up to 255 arguments. =GCD(8,12,20) = 4, the largest number dividing all three.
How does GCD help reduce a fraction?
Divide the numerator and denominator by their GCD. For 24/36, the GCD is 12, so the fraction reduces to 2/3.
What does GCD return for numbers with no common factor?
1. Any two numbers always share the divisor 1, so coprime numbers like 7 and 13 give =GCD(7,13) = 1.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: LCM · MOD · QUOTIENT · FACT · INT