Documentation/Calc Functions/GCD EXCEL2003

From The Document Foundation Wiki
Jump to: navigation, search

Other languages:

Function name:

GCD_EXCEL2003

Category:

Mathematical

Summary:

The result is the greatest common divisor of a list of numbers.

Syntax:

GCD_EXCEL2003(Number 1 [; Number 2 [; … [; Number 255]]])

Returns:

Returns an integer which is the greatest common divisor of two or more integers passed as input. In case one of the arguments are non-integers then, the function returns non-integer positive real values.

Arguments:

Number 1, Number 2, … , Number 255 are numbers, references to cells or to cell ranges of numbers.

  • If any argument is negative, the function returns an error value.
  • If any argument is non-integer, the function returns non-integer values. For e.g. GCD_EXCEL2003(8;2.2) is 8.88178419700125E-16 while GCD_EXCEL2003(2.5;5) is 2.5.

Additional details:

If given two numbers, a*b=LCM(a;b)*GCD(a;b)

Note pin.svg

The functions whose names end with _ADD or _EXCEL2003 return the same results as the corresponding Microsoft Excel 2003 functions without the suffix. Use the functions without suffix to get results based on international standards.


Examples:

Formula Description Returns
=GCD_EXCEL2003(16;32;24) the largest number that can divide 16, 24 and 32 without a remainder 8
=GCD_EXCEL2003(B1:B3) ,where cells B1, B2, B3 contain 9, 12, 9 the largest number that can divide 9, 12 and 9 without a remainder 3
=GCD_EXCEL2003(-16;32;24) function returns an error value since one of the arguments is negative Err:502

Related LibreOffice functions:

GCD

LCM

ODF standard:

None

Equivalent Excel functions:

GCD