Skip to content
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.

  1. The largest tile that fits both wall dimensions exactly:

    =GCD(B2, C2)

    Result30

  2. Reduce 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…