OpenOffice.org OpenOffice - 3.3 Základní průvodce Strana 190

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 434
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 189
All three of these functions require the single argument of number—the cell or
number to be rounded. Used with only this argument, all three functions round to the
nearest whole number, so that 46.5 would round to 47 with ROUND or ROUNDUP
and 46 with ROUNDDOWN. However, if you use the optional count argument, you
can specify the number of decimal places to include. For instance, if number was set
to 1, then 48.65 would round to 48.7 with ROUND or ROUNDUP and to 48.6 with
ROUNDDOWN.
As an alternative to ROUNDDOWN when working with decimals, you can use TRUNC
(short for truncate). It takes exactly the same arguments as ROUNDDOWN, so which
function you use is a matter of choice. If you aren't working with decimals, you might
choose to use INT (short for integer), which takes only the number argument.
Another option is the ODD and EVEN pair of functions. ODD rounds up to the nearest
odd number if what is entered in the number argument is a positive number, and
rounds down if it is a negative number, while EVEN does the same for an even
number.
Options are the CEILING and FLOOR functions. As you can guess from the names,
CEILING rounds up and FLOOR rounds down. For both functions, the number that
they round to is determined by the closest multiple of the number that you enter as
the significance argument. For instance, if your business insurance is billed by the
work week, the fact that you were only open three days one week would be irrelevant
to your costs; you would still be charged for an entire week, and therefore might
want to use CEILING in your monthly expenses.
Conversely, if you are building customized computers and completed 4.5 in a day,
your client would only be interested in the number ready to ship, so you might use
FLOOR in a report of your progress. If cell E1 contains the value 46.7,
=CEILING(E1;7) will return the value 49.
Besides number and significance, both CEILING and FLOOR include an optional
argument called mode, which takes a value of 0 or 1. If mode is set to 0, and both the
number and the significance are negative numbers, then the result of either function
is rounded up; if it is set to 1, and both the number and the significance are negative
numbers, then the results are rounded down. In other words, if the number is -11 and
the significance is -5, then the result is -10 when the mode is set to 0, but -15 when
set to 1.
However, if you are exchanging spreadsheets between Calc and MS Excel, remember
that the mode argument is not supported by Excel. If you want the answers to be
consistent between the two spreadsheets, set the mode in Calc to -1.
A function somewhat similar to CEILING and FLOOR is MROUND. Like CEILING
AND FLOOR, MROUND requires two arguments, although, somewhat confusingly,
the second one is called multiple rather than significance, even though the two are
identical. The difference between MROUND and CEILING and FLOOR is that
MROUND rounds up or down using symmetric arithmetic rounding. For example, if
the number is 77 and the multiple is 5, then MROUND gives a result of 75. However,
if the multiple is changed to 7, then MROUND's result becomes 77.
Once you become familiar with Calc’s long, undifferentiated list of functions, you can
start to decide which is most useful for your purposes.
However, one last point is worth mentioning: If you are working with more than two
decimal places, don't be surprised if you don’t see the same number of decimal places
on the spreadsheet as you do on the function wizard. If you don’t, the reason is that
Tools > Options > OpenOffice.org Calc > Calculate > Decimal Places defaults
190 OpenOffice.org 3.3 Calc Guide
Zobrazit stránku 189
1 2 ... 185 186 187 188 189 190 191 192 193 194 195 ... 433 434

Komentáře k této Příručce

Žádné komentáře