Documentation/Calc Functions/DOLLARDE

    From The Document Foundation Wiki
    Other languages:

    Function name:

    DOLLARDE

    Category:

    Financial Analysis

    Summary:

    Converts a value in a fractional dollar representation into the corresponding value in decimal representation.

    Fractional dollar representations are sometimes used when quoting security prices to the nearest fraction of a dollar (for example, rounding to the nearest 1/8, 1/16, or 1/32 part of a dollar). A value expressed in a fractional dollar representation has an integer part, a decimal separator, and a fraction part. However, such numbers cannot be treated mathematically as a standard decimal number.

    For example, if quoting a security price to the nearest 1/32 of a dollar using a fractional representation, the value 2.16 would be equivalent to 2 + 16/32 = 2.5 in decimal representation. Note that simply quoting a value in a fractional dollar representation is meaningless if the denominator of the fraction is not known.

    Syntax:

    DOLLARDE(Fractional dollar; Fraction)

    Returns:

    Returns a real number, which is the value given in a fractional dollar representation converted to decimal representation. Note that the returned value is not by default displayed as a currency.

    Arguments:

    Fractional dollar is a real number, or a reference to a cell containing that number, which is a value in a fractional dollar representation.

    Fraction is a positive integer, or a reference to a cell containing that integer, which is the denominator of the fraction. This value is essential to decode Fractional dollar. For example, if Fractional dollar is rounded to the nearest 1/8 of a dollar, the value of Fraction would be 8.

    • If either argument is non-numeric, then DOLLARDE reports a #VALUE! error.
    • If Fraction is a non-integer value, then DOLLARDE truncates it to an integer value.
    • If after any truncation Fraction is less than or equal to 0, then DOLLARDE reports an invalid argument error (Err:502).

    Additional details:

    • The formula for DOLLARDE is:
    [math]\displaystyle{ \text{DOLLARDE}(val_f;\:d) ~=~ \text{TRUNC}(val_f) \:+\: \left( \frac{val_f-\text{TRUNC}(val_f)}{d} \right) }[/math]
    where valf is the fractional dollar representation (Fractional dollar argument) and d is the denominator of the fraction to be used (Fraction argument).
    • The DOLLARFR function performs the reverse transformation, converting a value in decimal dollar representation to a fractional dollar representation.

    Examples:

    Formula Description Returns
    =DOLLARDE(A1; A2) where cells A1 and A2 contain the values 1.04 and 16 respectively. Here the function converts the value 1.04 in fractional dollar representation to its corresponding value in decimal dollar representation, based on a denominator of 16. The function calculates the result as 1 + 04/16 which is equal to 1.25. 1.25
    =DOLLARDE(1.0; 16) Here the function converts the value 1.0 in fractional dollar representation to its corresponding value in decimal dollar representation, based on a denominator of 16. The function calculates the result as 1 + 0/16 which is equal to 1. Note that since the first argument has no fractional component, then the exact value of the second argument is not significant to the returned value, although it must still be greater than or equal to 1. 1
    =DOLLARDE(1.1; 8.2) Here the function converts the value 1.1 in fractional dollar representation to its corresponding value in decimal dollar representation, based on a denominator of 8 (the original value 8.2 is truncated). The function calculates the result as 1 + 1/8 which is equal to 1.125. 1.125
    =DOLLARDE(−1.08; 32) Here the function converts the value -1.08 in fractional dollar representation to its corresponding value in decimal dollar representation, based on a denominator of 32. The function calculates the result as -1 - 08/32 which is equal to -1.25. −1.25
    =DOLLARDE(1.2; 16) Here the function converts the value 1.2 in fractional dollar representation to its corresponding value in decimal dollar representation, based on a denominator of 16. The function calculates the result as 1 + 20/16 which is equal to 2.25. 2.25
    =DOLLARDE(1.345; 8) Here the function converts the value 1.345 in fractional dollar representation to its corresponding value in decimal dollar representation, based on a denominator of 8. The function calculates the result as 1 + 3.45/8 which is equal to 1.43125. 1.43125

    Related LibreOffice functions:

    DOLLARFR

    TRUNC

    ODF standard:

    Section 6.12.16, part 2

    Related (or similar) Excel functions:

    DOLLARDE