GCD

Formulas / GCD
Calculate the greatest common divisor of multiple integers.
=GCD(number1, [number2], …)
  • number1 - required, the first number
  • number2, ... - [OPTIONAL] additional numbers

Examples

  • =GCD(60,36)

    The GCD function is used to find the greatest common divisor between two or more numbers. In this example, the GCD of 60 and 36 is found. To do this, the GCD function is used, and returns a GCD of 12.

  • =GCD(8,12,16)

    The GCD function can also be used to find the greatest common divisor between three or more numbers. To do this, the GCD function is used with three or more arguments. For example, the GCD of 8, 12, and 16 can be found using the preceding formula. This returns a GCD of 4.

  • =GCD(20,25,30)

    The GCD function can also be used to find the greatest common divisor between two or more numbers that are not consecutive. For example, the GCD of 20, 25, and 30 can be found using this formula. This returns a GCD of 5.

  • =GCD(-20,-25,-30)

    The GCD function can also be used to find the greatest common divisor between two or more negative numbers. To do this, the GCD function is used with the negative numbers instead of the positive numbers. For example, the GCD of -20, -25, and -30 can be found using this formula. This returns a GCD of 5.

Summary

The GCD function is used to calculate the greatest common divisor of two or more integers. It returns the largest integer that divides both numbers without a remainder except for 1.

  • The GCD function takes up to 255 arguments that can be hardcoded constants, cell references, or ranges that contain multiple values.
  • The GCD function works with whole numbers and returns the greatest common divisor of two or more integers.
  • To calculate the least common multiple, see the LCM function.


Frequently Asked Questions

What is the GCD function?
The GCD (greatest common divisor) function is used to find the greatest common divisor of two or more integers. It returns the largest integer that divides both number1 and number2 without a remainder except for 1.
What is the first argument of the GCD function?
The first argument is required for the GCD function.
What are the remaining arguments of the GCD function?
The remaining arguments are optional and can be numbers, text values, or integers.
What is the purpose of the GCD function?
The purpose of the GCD function is to find the greatest common divisor of two or more integers. It returns the largest integer that divides both number1 and number2 without a remainder except for 1.
Sourcetable Logo

Make Better Decisions
With Data

Analyze data, automate reports and create live dashboards
for all your business applications, without code.

Drop CSV