Documentation/Calc Functions/MAFRUND

    From The Document Foundation Wiki
    This page is a translated version of the page Documentation/Calc Functions/MROUND and the translation is 6% complete.
    Outdated translations are marked like this.


    Funktionsnavn:

    MAFRUND

    Kategori:

    Matematisk

    Resume:

    Returnerer et tal afrundet til det nærmeste multiplum af et andet tal.

    Syntaks:

    MAFRUND(Number; Multiple)

    Returnerer:

    Returnerer tallet afrundet til det nærmeste multiplum af multiplet.

    Argumenter:

    Tallet er et reelt tal, eller en reference til en celle, der indeholder det tal, som skal afrundes til det nærmeste multiplum af multiplet.

    Multiplum er et reelt tal eller en reference til den celle, der indeholder det tal, som tallet skal afrundes til det nærmeste heltalsmultiplum af.

    • * I det tilfælde, at tallet er negativt, inddrages dets absolutte værdi i udvælgelsen af multiplum, hvorefter fortegnet multipliceres til resultatet.
    • Multiplets fortegn ignoreres.
    • I det tilfælde, at tallet er lige nær på to på hinanden følgende multipla af multiplet, dvs. ligger midt imellem, så returneres multiplet med den højeste absolutte værdi af funktionen.
    • If Multiple is equal to 0, then MAFRUND returns the value 0.

    Yderligere oplysninger:

    • En alternativ implementering kunne være multiplm * AFRUND(tal/multiplum).

    [math]\displaystyle{ \text {\lt span lang="en" dir="ltr" class="mw-content-ltr"\gt MROUND\lt /span\gt }(x, y)~=~y\times \text{\lt span lang="en" dir="ltr" class="mw-content-ltr"\gt ROUND\lt /span\gt }\left(\frac{x}{y}\right) }[/math]

    Eksempler:

    Formula Description Returns
    =MAFRUND(15,5; 3) Here the function rounds 15.5 to the nearest multiple of 3. 15
    =MAFRUND(D1; D2) where cells D1 and D2 contain the numbers 1.4 and 0.5 respectively. Here the function rounds 1.4 to the nearest multiple of 0.5. 1,5
    =MAFRUND(11; 2) Here the function rounds 11 to the nearest multiple of 2. Note that "halfway" cases are rounded away from zero. The formula =MAFRUND(11; -2) gives the same result because the negative sign of the Multiple argument is not significant. 12
    =MAFRUND(−11; 2) Here the function rounds -11 to the nearest multiple of 2. Note that "halfway" cases are rounded away from zero. The formula =MAFRUND(-11; -2) gives the same result because the negative sign of the Multiple argument is not significant. −12

    Beslægtede LibreOffice-funktioner:

    AFRUND

    ODF standard:

    Tilsvarende Excel-funktioner:

    MROUND