# GCD

The GCD formula returns the greatest common divisor of two or more integers. It is often used in mathematical calculations to find the highest number that divides evenly into two or more numbers. The GCD formula is part of the Math functions in Google Sheets.

## Usage

Use the `GCD` formula with the syntax shown below, it has 2 required parameters:

Parameters:
1. value1 (required):
The first value or range of cells containing numbers for which you want to find the GCD. Non-numeric values are ignored.
2. value2 (required):
The second value or range of cells containing numbers for which you want to find the GCD. Non-numeric values are ignored.

## Examples

Here are a few example use cases that explain how to use the `GCD` formula in Google Sheets.

### Finding the GCD of two numbers

To find the greatest common divisor of two numbers, use the GCD formula with the two values as arguments. For example, to find the GCD of 12 and 18, use the formula =GCD(12, 18), which returns 6.

### Calculating the GCD of multiple numbers

To find the greatest common divisor of more than two numbers, use the GCD formula with a range of cells containing the numbers as the argument. For example, to find the GCD of 12, 18, and 24, use the formula =GCD(A1:A3), where cells A1 to A3 contain the values 12, 18, and 24.

### Checking if numbers are coprime

Two numbers are coprime if their only common divisor is 1. To check if two numbers are coprime, use the GCD formula with the two numbers as arguments. If the GCD is 1, the numbers are coprime. For example, to check if 12 and 35 are coprime, use the formula =IF(GCD(12,35)=1,"Coprime","Not Coprime").

## Common Mistakes

`GCD` not working? Here are some common mistakes people make when using the `GCD` Google Sheets Formula:

### Incorrect number of arguments

The GCD formula requires two arguments, make sure you have provided both values in the correct order.

### Non-integer values

The GCD formula only works with integers, make sure you have provided integer values or use the ROUND function to convert decimal values to integers.

### Negative values

The GCD formula only works with positive integers, make sure you have provided positive integer values or use the ABS function to convert negative values to positive.

The following functions are similar to `GCD` or are often used with it in a formula:

• `LCM`

The `LCM` function in Google Sheets calculates the least common multiple (LCM) of two or more numbers. The LCM is the smallest positive integer that is a multiple of every number in the input set. This function is commonly used in mathematical computations and in finding the lowest common denominator when adding or subtracting fractions.

• `MOD`

The `MOD` function returns the remainder of a division operation. It takes two numeric inputs: the dividend and divisor. The result will be the remainder after the dividend has been divided by the divisor. This function is often used in financial and accounting calculations.

• `INT`

The `INT` formula rounds a given value down to the nearest integer. This formula is often used to simplify large numbers or to convert decimal values to integers. The formula takes a single parameter, the value to be rounded down. If the value is already an integer, the formula will return the same value. If the value is a decimal, the formula will round down to the nearest integer.

• `SUM`

The `SUM` function in Google Sheets adds up a range of numbers. This function is most commonly used to sum the values in a range of cells.

You can learn more about the `GCD` Google Sheets function on Google Support.