Round numbers


Q I'm hoping you can help me with a small difficulty I am battling to overcome. I am trying to round numbers to the nearest five cents, ie 47 cents equals 50 cents, and 41 cents equals 40 cents. Any help will be gratefully appreciated.

- Andy Ross

A If you're using Microsoft Excel, you'll probably appreciate its ROUND, CEILING and FLOOR functions. These functions will round numbers to a specified number of digits, and if you've formatted the corresponding cells in your workbook to display currencies, the output of these functions will appear as currency values. If you haven't formatted the cells to display currencies, highlight the cells, select Format-Cells, click on the Number tab, select Currency in the Category list, and 2 in the Decimal places list, then click the OK button.

To use the ROUND function, select any cell and type =ROUND(number,num_digits), where number is the number you want to round, and num_digits is the number of digits you want to round to. So, the function =ROUND(0.42,1) returns a value of $0.40, and =ROUND(0.48,1) returns a value of $0.50.

If you want to round a number up to the nearest multiple of significance, use the CEILING function. Select a cell and type in =CEILING(number,significance), where number indicates the value you want to round, and significance specifies the multiple you want to round to. The function =CEILING(0.42,0.05) returns a value of $0.45, and =CEILING(0.48,0.05) returns a value of $0.50.

If you would prefer to round a number down to the nearest multiple of significance, try the FLOOR function. Select any cell, and type in =FLOOR(number,significance). Using this function, =FLOOR(0.48,0.05) returns a value of $0.45, and =FLOOR(0.42,0.05) returns a value of $0.40.

- Belinda Taylor


Category:spreadsheet
Issue: December 1998

These Web pages are produced by Australian PC World © 1998 IDG Communications