How to Use GCD Function in Google Sheets

How to Use GCD Function in Google Sheets - Sheetaki
How to Use GCD Function in Google Sheets – Sheetaki

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:


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.

How to Use GCD Function in Google Sheets

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


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

How to Use GCD Function in Google Sheets

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:



Luxury Cars








Your sheet should now look like this.

Sheetaki - GCD Function - Sample

  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 that 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. 

Cancel Suggested Function - Google Sheet - Sheetaki

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 values and optional values are added. 

Google Sheet - Greatest Common Divisor
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.

Sheetaki - Greatest Common Divisor

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.

Sheetaki - Google Sheet Function


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. 

Get emails from us about Google Sheets.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like