O'Reilly logo

Excel Scientific and Engineering Cookbook by David M Bourg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.8. Rounding and Truncating Numbers

Problem

Your calculations call for you to either round or truncate values in your spreadsheet.

Solution

Use one or more of the built-in functions shown in Table 7-6.

Table 7-6. Excel functions for rounding and truncating

Function

Syntax

Description

ROUND

=ROUND( n , digits )

Rounds the number n to the specified number of digits

ROUNDUP

=ROUNDUP( n , digits )

Rounds the number n up to the specified number of digits

ROUNDDOWN

=ROUNDDOWN( n , digits )

Rounds the number n down to the specified number of digits

MROUND

=MROUND( n , multiple )

Rounds the number n to the nearest multiple

CEILING

=CEILING( n , multiple )

Rounds the number n up to the nearest multiple

EVEN

=EVEN( n )

Rounds the number n to the nearest even integer

ODD

=ODD( n )

Rounds the number n to the nearest odd integer

INT

=INT( n )

Rounds the number n to the nearest integer

TRUNC

=TRUNC( n , digits )

Truncates the number n at the specified number of digits

Discussion

In Excel you can format any cell displaying a value to display that value to a specified number of decimal places. For example, you can format a cell containing the value 4.5837450 to display the number to only two decimal places (that is, 4.58). Formatting a cell to display only a certain number of decimal places does not change the underlying value; it only changes what's shown in the cell. To actually change the value, you need to use the rounding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required