The GCD function in Excel is used to find the greatest common divisor of two or more integers. The greatest common divisor is the largest integer that divides both numbers without leaving a remainder.
Syntax
GCD(number1, [number2], ...)
number1, number2, ...
: These are the numbers or cell references containing the integers for which you want to find the greatest common divisor.
Example
Suppose you have two integers and you want to find their greatest common divisor.
Data
Let's say we have the following integers:
- Number 1: 24
- Number 2: 36
Steps
Enter the numbers in cells A1 and A2.
Use the GCD function to find the greatest common divisor. In cell B1, enter the following formula:
=GCD(A1, A2)
Press Enter.
Result
The formula returns 12
, indicating that the greatest common divisor of 24 and 36 is 12.
Explanation of the Formula
A1
contains the first integer, which is 24.A2
contains the second integer, which is 36.
Another Example with Multiple Integers
Suppose you have a list of integers and you want to find their greatest common divisor.
Data
Let's say we have the following integers in cells A1:A5:
A |
---|
24 |
36 |
60 |
72 |
84 |
Steps
Enter the numbers in cells A1
.Use the GCD function to find the greatest common divisor. In cell B1, enter the following formula:
=GCD(A1:A5)
Press Enter.
Result
The formula returns 12
, indicating that the greatest common divisor of 24, 36, 60, 72, and 84 is 12.
Explanation of the Formula
A1:A5
contains the range of integers.
The GCD function in Excel is useful for finding common divisors of multiple integers, which is particularly useful in various mathematical and engineering calculations.