Microsoft KB Archive/24720

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 13:50, 21 July 2020 by X010 (talk | contribs) (Text replacement - """ to """)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

XL: Rounding a Number to a Set Limit

ID: Q24720



The information in this article applies to:


  • Microsoft Excel for Windows, versions 3.0, 3.0a, 4.0, 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Excel 97 for Windows
  • Microsoft Excel for the Macintosh, versions 1.0, 1.03, 1.04, 1.06, 1.5, 1.5a, 2.20, 2.2a, 3.0, 4.0, 5.0, 5.0a
  • Microsoft Excel 98 Macintosh Edition





SUMMARY

To round a number to a set limit, use one of the following formulas.


Microsoft Excel 4.0 and Later

=CEILING(<value>,<limit>)

Where <value> is either a cell reference to the actual value to be rounded or a number to be rounded, and <limit> is the number to be rounded to.

For example, to round the number in cell A1 to the nearest .05, use the following formula:

=CEILING(A1,.05)

Microsoft Excel 3.0 and Earlier

=ROUND(<value>/<limit>,0)*<limit>

Where <value> is either a cell reference to the actual value to be rounded or a number to be rounded, and <limit> is the number to be rounded to.

For example, to round the number in cell A1 to the nearest .05, use the following formula:

=ROUND(A1/.05,0)*.05



REFERENCES

For more information about the ROUND and CEILING functions, see the appropriate source below.

If you are using Microsoft Excel for Windows 95, version 7.0, click the Index tab in Help, type the following text


   ROUND

    -or-

   CEILING 



and then double-click the selected text to go to the ROUND topic.

If you are using Microsoft Excel 5.0, click the Search button in Help, and type:


   ROUND

    -or-

   CEILING 



"Microsoft Excel Function Reference," version 4.0, page 364

"Microsoft Excel Function Reference" version 3.0, 200-201

"Microsoft Excel Functions and Macros" version 2.2, 75-76


Additional query words: fraction integer how to nearest

Keywords          : 
Version           : MACINTOSH:1.x,2.x,3.0,4.0,5.0,5.0a; WINDOWS:3.x,4.0,5.0,5.0c,7.0
Platform          : MACINTOSH WINDOWS 
Issue type        : kbhowto 

Last Reviewed: March 11, 1999