11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 10: Miscellaneous Calculations 289<br />

In practice, INT and TRUNC return different results only when using negative numbers. For example,<br />

the following formula returns –14.0:<br />

=TRUNC(–14.2)<br />

The next formula returns –15.0 because –14.3 is rounded down to the next lower integer:<br />

=INT(–14.2)<br />

The TRUNC function takes an additional (optional) argument that’s useful for truncating decimal<br />

values. For example, the formula that follows returns 54.33 (the value truncated to two decimal<br />

places):<br />

=TRUNC(54.3333333,2)<br />

Rounding to an even or odd integer<br />

The ODD and EVEN functions are provided for situations in which you need to round a number<br />

up to the nearest odd or even integer. These functions take a single argument and return an integer<br />

value. The EVEN function rounds its argument up to the nearest even integer. The ODD function<br />

rounds its argument up to the nearest odd integer. Table 10-2 shows some examples of<br />

these functions.<br />

Table 10-2: Results Using the EVEN and ODD Functions<br />

Number EVEN Function ODD Function<br />

–3.6 –4 –5<br />

–3.0 –4 –3<br />

–2.4 –4 –3<br />

–1.8 –2 –3<br />

–1.2 –2 –3<br />

–0.6 –2 –1<br />

0.0 0 1<br />

0.6 2 1<br />

1.2 2 3<br />

1.8 2 3<br />

2.4 4 3<br />

3.0 4 3<br />

3.6 4 5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!