Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. 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.
by Allen Wyatt
(last updated May 14, 2016)
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:
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:
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:
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:
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, and 2016. You can find a version of this tip for the older menu interface of Excel here: Establishing a FLOOR and CEILING.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
Indirect references can be very helpful in formulas, but getting your head around how they work can sometimes be ...Discover More
The process of combining string (text) values to make a new string is called concatenation. Excel provides the ...Discover More
Need to figure out the least common multiple of a range of values? It is a snap when you use the LCM function, described ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.