Documentation/Calc Functions/STØRSTE.FÆLLES.DIVISOR

From The Document Foundation Wiki
Jump to navigation Jump to search
This page is a translated version of the page Documentation/Calc Functions/GCD and the translation is 5% complete.
Outdated translations are marked like this.
Other languages:
English • ‎Nederlands • ‎dansk • ‎español

Template:Documentation/Calc Functions/Func Page Links/da






Funktionen giver den største fælles divisor af to eller flere positive heltal.


STØRSTE.FÆLLES.DIVISOR(Integer 1 [; Integer 2 [; … [; Integer 255]]])


Returnerer et heltal, som er dem største fælles divisor af to eller flere positive heltal, der er opgivet som inddata.


Heltal 1, heltal 2, … , heltal 255 er heltal, referencer til celler eller celleområder med heltal, hvis største fælles divisor skal beregnes.

  • Hvis noget argument er negativt, returnerer funktionen en fejlværdi.
  • Hvis noget argument ikke er et heltal, returnerer funktionen en heltals største fælles divisor. For eksempel vil STØRSTE.FÆLLES.DIVISOR(2,5:5) returnere 1, mens STØRSTE.FÆLLES.DIVISOR(8;2,2) returnerer 2.

Note that although STØRSTE.FÆLLES.DIVISOR can accept up to 255 arguments, each argument could specify a range of cells. This means that the number of positive integers processed could be many more than 255.

The following conditions (including errors) may be encountered:

  • If any argument is a string in quotation marks, or a reference to a single cell that contains a string rather than a positive integer, then STØRSTE.FÆLLES.DIVISOR reports a #VALUE! error.
  • Text and empty cells within a data range are ignored.
  • If any value is negative, then STØRSTE.FÆLLES.DIVISOR reports an invalid argument error (Err:502).
  • If any value is not an integer, that value is truncated to its floor value.
  • If after any truncation all supplied values are equal to 0, then STØRSTE.FÆLLES.DIVISOR returns the value 0.

Yderligere oplysninger:

Hvis der er givet to positIve heltal, er a*b=MINDSTE.FÆLLES.MULTIPLUM(a;b)*STØRSTE.FÆLLES.DIVISOR(a;b)

  • For two positive integers i and j, the following relationship holds:

[math]\displaystyle{ i\times j~=~\text {LCM}(i, j) \times \text{GCD}(i, j) }[/math]

MINDSTE.FÆLLES.MULTIPLUM(i, j) is the least common multiple of i and j (see MINDSTE.FÆLLES.MULTIPLUM).
  • The greatest common divisor (STØRSTE.FÆLLES.DIVISOR) is sometimes referred to as the greatest common factor (GCF) or the highest common factor (HCF).


Template:Calc-Formula/da Template:Calc-Description/da Template:Calc-Returns/da
=STØRSTE.FÆLLES.DIVISOR(16; 32; 24; 40) Here the function returns 8, because that is the largest positive integer that can divide 16, 24, 32, and 40 without a remainder. 8
=STØRSTE.FÆLLES.DIVISOR(B1:B3), where cells B1, B2, and B3 contain the numbers 9, 12, and 6 respectively. Here the function returns 3, because that is the largest positive integer that can divide 6, 9, and 12 without a remainder. The formula =STØRSTE.FÆLLES.DIVISOR(B1; B2; B3) would give the same result. 3
=STØRSTE.FÆLLES.DIVISOR(3,2; 5,6) The two argument values are truncated to 3 and 5 respectively. Here the function returns 1, because that is the largest positive integer that can divide 3 and 5 without a remainder. 1
=STØRSTE.FÆLLES.DIVISOR({2; 4; 6; 8}) Here the function returns 2, because that is the largest positive integer that can divide 2, 4, 6, and 8 without a remainder. 2

Beslægtede LibreOffice-funktioner:



ODF standard:

Tilsvarende Excel-funktioner: