Name

MROUND

Synopsis

You can use MROUND (an Analysis ToolPak function) to round a numeric value to the closest multiple of the specified value. For example, if you always want the value to be an even number you would specify a 2 for the Multiple argument and all values will be rounded to even numbers.

To Calculate

=MROUND(Number, Multiple)

The Number and Multiple arguments are required for this function.

Number

Specifies the numeric value that you want to round.

Multiple

Specifies a numeric value that represents the multiple you want to round the value of the Number argument to.

Note

The signs on each value must be the same or the function will return an error. In other words, if the value of the Number argument is positive the value of the Multiple argument must also be positive.

Example

As you can see in Figure 14-15, Excel provides several functions for rounding a numeric value. The function that you use is based solely on the results that you want to achieve. As shown in the example, use MROUND when you want to round to a specific integer value. To eliminate errors, IF is used to check the sign of the value. If it is negative, a value of -2 is specified for the Multiple argument; whereas, if the value is positive, a value of 2 is specified. ROUND, ROUNDUP, and ROUNDDOWN allow you to round a numeric value to a specific number of decimal places.

Use MROUND to round to a specific integer value and ROUND, ROUNDUP, and ROUNDDOWN to round decimal places

Figure 14-15. Use MROUND to round to a specific ...

Get Excel 2000 in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.