Go Back

Learn How to Use the Excel GCD Function

GCD function stands for Greatest Common Divisor. this function allows us to get the greatest divisor which is common for two or more numbers. It is the largest integer that can divide all the given numbers of a database without reminders. In this tutorial, we will learn how to use the GCD function in Excel.

Figure 1: Example of How to Use the GCD Function in Excel

The purpose of GCD function

The main purpose of this function is to extract the biggest common number. This is the number which can divide all the numbers provided as arguments.

Syntax

=GCD ( number, [number 2],…)

  • [Number 1]
    Required. This is the first number that we want find the divisor for.
  • [Number 2…]
    Optional. This is the argument for the subsequent numbers. Excel truncates the numbers if they are not integers.

How the GCD Function Works

The table has two numbers 66 and 99 in column A and B. To extract the biggest divisor number by using GCD, we need to apply the formula,

=GCD(A2:C2)

Figure 2: The GCD Function in action

The result shows 33. Other numbers like 3 and 11 can divide these two numbers. But, 33 is the largest number which can divide the numbers.

Example

The following datasets contains numbers in column A, B and C. To find the greatest common divisor for each row:

  • We need to go to cell D2 and click on it with the mouse.
  • Next, we need to click on Formulas>Insert Function. In the search box type GCD and click Go.

Figure 3: Example of the Insert Function Window

  • From the select a function box, we need to select GCD and press Ok.
  • Then, we need to choose the cells containing the numbers for the arguments Number1, Number2 and Number3. These will be the numbers 10, 20 and 30.

Figure 4: Example of Setting the Parameters of the GCD Function

  • Lastly, Clicking Ok will give the results. Next we need to drag the formula using the fill handle from cells D2 to D5..

Figure 5: Example of Applying the GCD function to the Dataset

The outcome will be 10. Here 10 is the biggest common number which can divide all three numbers.

The GCD function in Excel is not very common and few people use it while working on excel. But the formula is very effective.

Notes

  • The GCD function can take 255 numbers as arguments.
  • The GCD function returns a #VALUE error if the arguments provided are not valid numbers.

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

Hello I'm trying to make a fretboard fraction calculator. Here's what I have so far: On The left ore the open string tunings expressed as fractions I have a 3/2 being added to each of the open strings (by multiplying each integer) and then using the the GCD function to reduce the fraction. So 3/2 + 5/4 = 15/8. Or 3/2 + 4/3 =2/1. So far everything is working fine. But In these fractions the numerator is always larger than, but cannot be more than twice the denominator. So if 3/2+7/4 =21/8. I simply need to multiply the denominator by 2. 3/2+7/2=21/8, 8*2=16 =21/16. How can I get excel to double the denominator ONLY if the numerator is twice as much and leave it alone if it is not. 3/2+5/4=15/8 good *2=15/16= bad. I need to have the result in the same excel boxes not different ones. Thanks for any possible help -Matt
Solved by F. H. in 15 mins
Hello. About a year ago I made a Just intonation fretboard ratio (pitch) calculator with the help of Excel chat and a very helpful woman named Chandra and it works great. On The left ore the open string tunings expressed as ratios in dark red. Each of the open strings is added to the bright red ratios on the lower column by multiplying each integer and then using the GCD function to reduce the fraction. So 3/2 + 9/8 = 27/16. Or 5/4 + 16/15 = 4/3 . In these fractions, the numerator is always larger than, but cannot be more than twice the denominator. The results are displayed n the intersecting boxes So far so good. Here's my problem: I'd like to insert a row underneath each ratio that displays each ratio value in cents. I usually use a scientific calculator and calculate each ratio with: log(n/p)*3986.3 = For example to display the cents values for the ratios 3/2 and 11/8. I use a base 10 log log(3/2)*3986.3 = 701.9 cents log(11/8)*3986.3 = 551.3 cents 3 2 701.9 11 8 551.3
Solved by D. J. in 12 mins

Leave a Comment

avatar