GCD function

GCD returns the greatest common divisor of two or more positive integers, the largest number that divides all arguments without remainder.

=GCD(number1, ...)

Generate a GCD formula

Describe what you need. The generator will reach for GCD where GCD is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How GCD reads its arguments
number1requiredGCD
ArgumentRequiredDescription
number1RequiredA positive integer; if negative, GCD returns an error. Required and acts as the first value.
...RepeatingAdditional positive integers to include in the GCD calculation; at least one required, up to 255 arguments supported.

Returns

A positive integer representing the largest number that divides all input numbers evenly.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Find the GCD of an agent's ticket closure times

Days to Close
6
6
=GCD(6, 6)

Result: 6

Alice's tickets close in 6 and 6 days respectively. The GCD is 6, showing her tickets consistently follow a 6-day resolution cycle, helping identify her standard service level agreement window.

2. Find the common factor in all ticket closure times

Days to Close
6
9
6
12
9
=GCD(6, 9, 6, 12, 9)

Result: 3

Across all tickets, GCD(6,9,6,12,9) = 3, revealing that every ticket closes in a multiple of 3 days. This identifies a hidden 3-day processing cycle in the support workflow, useful for capacity planning.

3. Calculate the GCD of ticket priority levels

Priority
2
3
2
4
3
=GCD(2, 3, 2, 4, 3)

Result: 1

Priority levels 2, 3, 2, 4, 3 share no common factor—their GCD is 1. This indicates the priority system uses independent numeric levels rather than multiples, confirming no hidden grouping or scaling pattern.

Common errors

Which GCD error are you seeing?
GCD returned an error#VALUE!
Ensure all arguments are positive integers. Use INT(), ROUND(), or TRUNC() to convert decimals. Use VALUE() to convert text-stored numbers.
#NUM!
Use ABS() to convert negative numbers to positive: =GCD(ABS(A1), ABS(A2)). Remove any zero values or filter them out before calling GCD.
#REF!
Verify all cell references are valid and have not been deleted. Correct the range or re-enter the formula with live cells.
ErrorWhy it happensHow to fix it
#VALUE!GCD receives a non-numeric argument (text, dates, or logical values) or a decimal number in a spreadsheet that requires integers.Ensure all arguments are positive integers. Use INT(), ROUND(), or TRUNC() to convert decimals. Use VALUE() to convert text-stored numbers.
#NUM!GCD receives a negative number or zero, as the function requires positive integers only.Use ABS() to convert negative numbers to positive: =GCD(ABS(A1), ABS(A2)). Remove any zero values or filter them out before calling GCD.
#REF!A cell reference in the formula points to a deleted column or invalid range, breaking the argument link.Verify all cell references are valid and have not been deleted. Correct the range or re-enter the formula with live cells.

Tips and when to use something else

  • GCD only accepts positive integers; use ABS() on negative values and ROUND() on decimals before passing them to GCD.
  • Combine GCD with MOD to check if numbers share common factors: if MOD(A, GCD(A,B)) = 0, then A and B share divisors.
  • Use PRODUCT to multiply divisors if you need to scale or factor values instead of finding their common divisor.
  • GCD reveals hidden cycles in time-series data—a GCD of 3 days in ticket times suggests a 3-day workflow rhythm worth investigating.

Frequently asked questions

Why is the GCD of my ticket IDs always 1?
Sequential ticket IDs (1008, 1009, 1010...) have no common factor other than 1, so their GCD is always 1. To find patterns, apply GCD to data attributes like closure times or priority levels, not unique identifiers.
Can I use GCD with decimal numbers like 2.5 and 3.5?
No; GCD requires positive integers. Use ROUND(2.5) and ROUND(3.5) first to convert decimals, or use INT() to truncate. This converts your data to integers that GCD can process.
How does GCD help analyze ticket workflow patterns?
If your tickets close in 6, 9, 12, and 15 days, their GCD is 3, revealing a hidden 3-day cycle. This pattern often reflects sprint cycles, batch processing windows, or SLA tiers and helps with capacity planning.
What should I use instead of GCD to find the least common multiple?
There is no LCM function in most spreadsheet tools, but you can calculate it as: LCM(A,B) = (A×B) ÷ GCD(A,B). Use PRODUCT to multiply and GCD to find the divisor, then divide the result.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17