Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Establishing a FLOOR and CEILING.

Establishing a FLOOR and CEILING

Written by Allen Wyatt (last updated June 4, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Chances are good that you know how to use the primary rounding functions in Excel: ROUND, ROUNDUP, and ROUNDDOWN. There are two other similar functions you can use, as well: FLOOR and CEILING. The FLOOR function allows you to round down (toward zero) while the CEILING function rounds up (away from zero). Unlike other rounding functions, however, FLOOR and CEILING work with multiples of numbers. For instance, consider the following formula:

=FLOOR(27,12)

This formula will return a value of 24. Why? Because 24 is the largest multiple of 12 between 27 and 0. The CEILING function works similarly, as follows:

=CEILING(27,12)

This formula returns 36, since that is the next multiple of 12 away from zero, but larger than 27.

Both FLOOR and CEILING, as you can tell, require two arguments. The first is the number to be "rounded." Actually, this is a misnomer, as there is no real rounding taking place—the number represents the starting point for determining a relationship between the multiple value (the second argument) and zero.

FLOOR and CEILING can come in handy if you are trying to figure out multiples of items. (In this way it is similar to the MROUND function.) For instance, suppose you were running your youth group candy sale, and you could only deliver candy to the kids in full boxes. Each box contained 12 candy bars. Suppose cell B3 contained an order quantity, and cell C3 contained the number of candy bars in each box (in this case, 12). You could place the following formula in cell D3 to return the number of full boxes that should be delivered:

=FLOOR(B3,C3)/C3

If the number of candy bars ordered (in cell B3) is 31, then the value returned by the formula will be 2. (2 boxes at 12 bars each is 24 bars.) Granted, this formula could also be easily constructed using the INT or TRUNC functions (Excel very often provides multiple ways to accomplish the same tasks). You could use the CEILING function in place of the FLOOR function in this example if you wanted to "round up" to the next full box above what is required for the candy order:

=CEILING(B3,C3)/C3

Using the same scenario, this formula would return 3 (3 boxes, or 36 candy bars).

When using FLOOR and CEILING, remember that the sign of the arguments must match. If one argument is positive and the other negative, Excel returns an error value of #NUM!.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12334) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Establishing a FLOOR and CEILING.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Jumping to a Relative Line Number

As you navigate through a document, you may have a need to move forward or backward a specific number of lines. This is ...

Discover More

Altering the Displayed Format of Numbers to the Nearest 100

Want information in a worksheet to be formatted and displayed as rounded to a power of ten? You may be out of luck, ...

Discover More

Printing Gridlines by Default

When you print a worksheet, Excel allows you to also print handy gridlines for the worksheet. If you want to include the ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Using the TRUNC Worksheet Function

Want to chop off everything after a certain point in a number? The TRUNC function can help with this need.

Discover More

Returning Item Codes Instead of Item Names

The data validation capabilities of Excel are really handy when you want to limit what is put into a cell. However, you ...

Discover More

Returning the MODE of a Range

The MODE function is used to determine the most frequently recurring value in a range. This tip explains how to use the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 + 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.