To calculate Greatest Common Divisor (GCD) in Excel is very straightforward. Excel has a built in function to calculate the greatest common divisor of two or more integers. The function called GCD.


=GCD(number1, [number2], …)


  1. Start with =GCD(
  2. Type or select cells or range that includes integers B6:E6
  3. Type ) to close the function and press Enter to complete the formula


The GCD function does exactly what its name refers, returns the greatest common divisor of specified numbers. Its 1st argument is mandatory and others are optional. The function can get up to 255 numbers as arguments.


Alternatively, you can choose to use range references for adjacent cells.


Please note that the GCD function only works with integers. The negative numbers causes #NUM! error. Also, if an argument is equal or greater than 2^53, the function returns #NUM! error as well.

Also see article how to calculate Least Common Multiple in Excel.