Math & Trig

GCD Function in Excel

Returns the greatest common divisor.

Syntax

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

Arguments

  • number1 (required): First number
  • number2 (optional): Additional numbers

Examples

  • =GCD(24, 36) - GCD of 24 and 36 - Result: 12

GCD in reporting workflows

  • Use absolute references when copying formulas across rows.
  • For conditional totals see [SUMIF](/functions/sumif/) and [SUMIFS](/functions/sumifs/).
  • Filtered lists may need [SUBTOTAL](/functions/subtotal/) instead of SUM on visible cells only.

Common errors

  • #NUM! if any number < 0

Use cases

  • Fraction simplification
  • Number theory
  • Mathematics

Frequently asked questions

  • What is GCD in Excel? GCD finds the Greatest Common Divisor - the largest number that divides all given numbers evenly. GCD(24,36)=12 because 12 is the largest number that divides both 24 and 36 without remainder.
  • How do I simplify fractions with GCD? Divide both numerator and denominator by their GCD. For 24/36: GCD(24,36)=12, so 24/36 = (24/12)/(36/12) = 2/3. Formula: =A1/GCD(A1,B1) & "/" & B1/GCD(A1,B1).
  • Can GCD work with more than two numbers? Yes! GCD accepts up to 255 numbers: =GCD(12, 18, 24, 30) returns 6. It finds the largest number that divides ALL given numbers evenly. Useful for finding common factors across multiple values.

Editorial review

  • Reviewed by Excel.Directory Editorial Team. Updated May 2026.