GCD function
The GCD (Greatest Common Divisor) function in Excel is used to calculate the largest positive integer that divides two or more numbers without leaving a remainder. This function is often used in mathematics and number theory to find common factors between numbers.
Syntax
=GCD(number1, number2, ...)
Parameters
number1, number2, ...: These are the numbers for which you want to find the greatest common divisor. You can enter up to 255 numbers as arguments.
Return Value
The function returns a number that is the greatest common divisor of the provided numbers.
Example 1: Find the GCD of Two Numbers
To find the greatest common divisor of 12 and 18:
=GCD(12, 18)
Result: 6
Explanation: The divisors of 12 are 1, 2, 3, 4, 6, and 12; the divisors of 18 are 1, 2, 3, 6, 9, and 18. The greatest common divisor between 12 and 18 is 6.
Example 2: Find the GCD of More Than Two Numbers
To find the GCD of 24, 36, and 60:
=GCD(24, 36, 60)
Result: 12
Explanation: The divisors of 24 are 1, 2, 3, 4, 6, 8, 12, 24; the divisors of 36 are 1, 2, 3, 4, 6, 9, 12, 18, 36; and the divisors of 60 are 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60. The greatest common divisor is 12.
Example 3: GCD with Negative Numbers
The GCD function will ignore the sign of the numbers. So for -12 and 18:
=GCD(-12, 18)
Result: 6
Explanation: The function returns the same result as if the numbers were positive because the greatest common divisor is based on absolute values.
Key Points
- GCD is useful for simplifying fractions, finding common denominators, or reducing ratios.
- Excel’s GCD function only works with numeric values and can take multiple arguments (up to 255).
- If you use GCD with more than two numbers, it finds the GCD of all the numbers in the list.
Example in Fraction Simplification
You can use GCD to simplify fractions. For example, if you have the fraction 48/72, you can simplify it by dividing both the numerator and the denominator by the GCD of 48 and 72.
To find the GCD of 48 and 72:
=GCD(48, 72)
Result: 24
Now divide the numerator and denominator by 24:
- Numerator: 48 ÷ 24 = 2
- Denominator: 72 ÷ 24 = 3
So the simplified fraction is 2/3.
Excel Versions
The GCD function is available in all versions of Excel starting from Excel 2007.
This function is useful in many applications such as number theory, data analysis, and simplifying ratios in Excel.