Documentation/Calc Functions/LOFT.XCL

    From The Document Foundation Wiki
    This page is a translated version of the page Documentation/Calc Functions/CEILING.XCL and the translation is 10% complete.
    Outdated translations are marked like this.
    Other languages:






    Afrunder et tal til det nærmeste multiplum af en signifikant værdi.


    LOFT.XCL(Number; Significance)


    Returnerer en heltalsværdi.


    Tal (obligatorisk) er det reelle tal, som skal afrundes, eller en reference til en celle, der indeholder tallet.

    Signifikans (valgfri) er den reelle talværdi, eller en reference til en celle, der indeholder den værdi, som tallet skal afrundes til et multiplum af. Dens fortegn ignoreres.

    Hvis tallet er positivt og signifikans er negativ, returnerer den en fejlværdi.

    The signs of the Number and Significance arguments define the direction of rounding as defined in the following table.

    Sign of Number Sign of Significance Direction of rounding
    +ve (>0) +ve (>0) Up (toward +∞)
    +ve (>0) -ve (<0) N/A (error condition)
    -ve (<0) +ve (>0) Up (toward +∞)
    -ve (<0) -ve (<0) Down (toward -∞)

    Yderligere oplysninger:

    General information about Calc's ceiling functions

    Note pin.svg

    For convenience, the information in this subsection is repeated on all pages describing Calc's ceiling functions.

    General introductory information about ceiling functions can be found at Wikipedia's Floor and ceiling functions page.

    Calc provides five functions that can be used to calculate the ceiling value of a number, and these are:

    The most important of these for many users will be the AFRUND.LOFT function, which implements the requirements laid out in Section 6.17.1 of ODF 1.2, Part 2.

    Calc provides the LOFT.MATEMATIK, LOFT.PRECISE, and ISO.LOFT functions to increase interoperability with Microsoft Excel, which provides three similar functions with the same names. Calc's LOFT.PRECISE and ISO.LOFT perform identical functions.

    Microsoft Excel's AFRUND.LOFT function accepts two arguments and so is not compliant with ODF 1.2. This difference in behaviour could lead to interoperability problems but these are avoided through the provision of the LOFT.XCL function, as follows:

    • When Calc saves a spreadsheet to Excel 2007-365 (*.xlsx) format, any call to Calc's AFRUND.LOFT function is converted to a call to Excel's LOFT.MATEMATIK function, and any call to Calc's LOFT.XCL function is converted to a call to Excel's AFRUND.LOFT function.
    • When Calc opens a spreadsheet in Excel 2007-365 (*.xlsx) format, any call to Excel's AFRUND.LOFT function is converted to a call to Calc's LOFT.XCL function.


    Formula Description Returns
    =LOFT.XCL(34,5; 4,5) Rounds up 34.5 to the nearest integer multiple of 4.5. 36
    =LOFT.XCL(D1; D2) where cells D1 and D2 contain the values -45.67 and 2 respectively. Rounds up -45.67 to to the nearest integer multiple of 2. −44
    =LOFT.XCL(−45,67; −2) Rounds down -45.67 to the nearest integer multiple of 2. −46

    Beslægtede LibreOffice-funktioner:










    ODF standard:


    Tilsvarende Excel-funktioner: