# How to Use GCD Function in Google Sheets

The GCD function in Google Sheets is a function that computes and extracts the greatest common divisor of the integers.

In Math, the `GCD` function helps you quickly compute and find the largest common divisor without leaving any remainder.

Here are the rules of using the `GCD` function in Google Sheets:

• The function only requires two arguments. The first value represents the number or set of numbers to find the greatest divisor. While the second value is an optional argument for the additional numbers where its conditions need to be considered to find its greatest common divisor.
• If the number is a non-integer, the function truncates the number.

Here is a real-to-life scenario of this function.

We will be using the `GCD` function to solve the mathematical problem involving a set of integers and non-integers. A fruit vendor needs to divide the remaining fruits by the number of boxes left. The remaining fruits are as follows:

 Fruit Pieces Apples 55 Oranges 80 Pears 90 Peach 105

The question now is, what is their greatest common divisor that the vendor of the fruits for the vendor to know how many fruits he can put in a box?

With the `GCD` function, solving the problem becomes easier. The function automatically computes the greatest common factor of the numbers before it extracts the greatest common divisor.

Though the `GCD` function is one of the least used functions in Google Sheets, it helps a lot in our everyday life. We have manually used this function in some instances without noticing it.

Before we solve the sample problem, let us first learn how the fundamentals of the `GCD` function.

## The Anatomy of the GCD Function

The way we write the `GCD` function is as follows:

=CGD(value1,value2)

Let’s dissect the parts of the function and learn the terms and their specific usage.

• = the equal sign informs Google Sheets that we will be working on a specific function. This will always be the start of every function in Google Sheets.
• GCD() is our `GCD` function. The returning value of the function is the greatest common divisor.
• value1 refers to the value for which to calculate the inverse tangent.
• value2 is an optional argument that refers to the additional values or ranges that have conditions to be met to find the greatest common denominator.

## A Real Example of Using GCD Function

Since we already have an overview of the function and know how to write it, we will now apply it in Google Sheets.

Using the real-to-life example above, we will now compute the greatest common divisor of the given numbers.

To get the result in cell F2, we need to execute the GCD formula:

=CGD(value1,value2)

In the picture below, cell F2 shows the returning value of the `GCD` function.

You can follow through with the following steps by making a copy of the sample spreadsheet above. Click the link below.

If you already have created a copy of the sample spreadsheet above, we can now proceed in writing the `GCD` function!

## How to Use GCD Function in Google Sheets

1. First, you need to open a spreadsheet and input all the given data there. Here’s the data that you should input:
 Vehicle Units Luxury Cars 76 Motorhomes 36 Motorcycles 33 EVs 89

Your sheet should now look like this.

1. Next, after you input the data, we will start writing the function in the Result cell, which is the F2. Start writing the function with the ‘=‘ sign. There are some instances that the spreadsheet will suggest a function. To cancel the suggested function, all you need to do is click the ‘x‘ icon in the bottom right part of the popup, like what is shown below.

If the sheet doesn’t show a popup screen, you can press the “BACKSPACE” key on your keyboard to cancel the suggested function.

1. Once you clear the field, we will now add the `GCD` function, which is the GSD().’ However, when writing the function, we must only write up until the open ‘(‘ parenthesis. This is because we will be adding the values after. We can only add the close ‘)‘ parenthesis after all the value and optional values are added.

4. The next step is typing the values. In our example, we have four values, Luxury Cars, Motorhomes, Motorcycles, and EVs. We will now substitute the numbers as the function’s value. Since we have multiple values, we will break each value by putting a comma ‘,‘ after each value. This way, the function will not interpret it as one number.

After you input all the values, we will add the closing ‘)‘ parenthesis to tell the function that we have successfully added the specific range of values.

1. Lastly, to generate a `GCD` or gross common divisor, we will now press the ‘Enter’ key. Here is the returning value of the `GCD` function in Google Sheets.

## Summary

The `GCD` function has only two arguments with values that you must not substitute with non-numerical characters. Adding symbols, and alphanumeric numbers as the function’s values will lead to an error message, and if the value is a non-integer, the function will automatically truncate it. The detailed tutorial shows how quickly you can generate the returning value of the numbers. That’s how easy to use the `GCD` function in Google Sheets.

You can now start and apply the `GCD` function in Google Sheets in solving mathematical questions such as the example stated above. You can also check our site for other Google Sheets functions that you may find necessary as a student or professional.

Also, don’t forget to subscribe to our newsletter to be notified when we upload new How-To articles like this.

Our goal this year is to create lots of rich, bite-sized tutorials for Google Sheets users like you. If you liked this one, you'd love what we are working on! Readers receive ✨ early access ✨ to new content.

## How to Create Tree Map Chart in Google Sheets

Creating a tree map chart in Google Sheets lets you illustrate a set of data into a data…

## How To Use KURT Function in Google Sheets

The KURT function in Google Sheets is used for computing the kurtosis of a dataset, which is one…

## How to Use REGEXREPLACE Function in Google Sheets

The REGEXREPLACE function in Google Sheets is useful if you want to replace a part of a text…

## How to Fix ‘#DIV/0!’ Error in Google Sheets

The #DIV/0! error in Google Sheets appears when the formula divides a number with zero or any denominator…