Name

GCD

Synopsis

You can use GCD (an Analysis ToolPak function) to determine the largest number that can be evenly divided into the specified values, commonly referred to as the greatest common divisor. For example, the greatest common divisor for 18 and 24 is 6; 6 is the largest number divisible into both 18 and 24 without a remainder.

To Calculate

=GCD(Number1, Number2, ...)
Number1, Number2, ...

You can specify between 1 and 29 different numeric values for which you want to find the greatest common divisor. The values must all be positive. If any of the values are not integers, the fractional portion of the number will be truncated (i.e., 4.5 becomes 4).

Example

Figure 14-10 shows how GCD is used to determine the largest value that is divided into a series of numeric values. You will notice that when a decimal value is specified, such as 24.2 the fractional portion of the number is truncated.

GCD and LCM truncate all decimal values

Figure 14-10. GCD and LCM truncate all decimal values

Note

Use LCM to determine the smallest number that is a multiple of all of the specified numeric values.

Get Excel 2000 in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.