Performing Integer Divisions

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


Greg needs to perform some integer divisions. It seems that Excel provides three functions that can be helpful: INT, TRUNC, and QUOTIENT. He's unclear, though, as to how these functions differ and which would be best for his purposes.

First, let's look at what the functions do. The INT function supposedly gives the integer portion of a value, though this doesn't exactly mean what you may think. What the function does is to return a rounded integer value, where the rounding is always toward the left on a number line. So, consider the following two formulas:

=INT(8/3)
=INT(-8/3)

The difference between the two, of course, is that the dividend in the first is positive and in the second is negative. The result of the first formula is 2, and the result of the second is -3. This is because, again, INT always rounds toward the left on a number line.

The TRUNC function, on the other hand, always returns the integer portion of a value. So, it does no rounding; it simply chops off (truncates) everything after the decimal point. When both dividend and divisor are positive or negative values, TRUNC returns the same thing as INT. When the dividend and divisor have different signs, then they provide different results because TRUNC does no rounding, just "chopping."

Finally, the QUOTIENT function returns the same thing as the TRUNC function. The difference between the two is that TRUNC does the division to derive the parameter necessary for the truncation, and QUOTIENT uses two parameters, being the dividend and divisor. The following provide the same result and illustrate the difference in specifying values for the functions:

=TRUNC(8/3)
=QUOTIENT(8,3)

There is one other thing that should be mentioned about the TRUNC function—it includes an option second parameter that allows you to indicate how many decimal places you want in the results. The default is 0, meaning it will return an integer value, as has been done in this tip so far. So, for integer division it is only suitable if you either leave off the second parameter or explicitly indicate that you want 0 digits after the decimal point:

=TRUNC(8/3)
=TRUNC(8/3,0)

So, which should you use? The determining factor will be the nature of the data you are working with. If you are going to be using mixed negative and positive numbers—where the result of the division will be negative—then you are best to go with either TRUNC or QUOTIENT. If your data is all positive, then it doesn't really matter which one you use.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13264) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

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

Converting UTC Times to Local Times

Dates and times are often standardized on UTC time, which is analogous to GMT times. How to convert such times to your ...

Discover More

Formatting Footnote Reference Marks

The reference marks that appear for footnotes in a document are normally just superscripted digits. If you want to change ...

Discover More

Selecting a Bookmark in a Macro

Bookmarks can be very handy in a document. Word provides a VBA command you can use to easily select any of those bookmarks.

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)

Understanding the LET Function

The LET function provides an easy way to define and use variables within a formula. This tip shows you how you can start ...

Discover More

Using a Week Number as One Criterion in a Formula

The SUMIFS function can be quite powerful in conditionally summing information based on criteria you specify. This tip ...

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 2 + 2?

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.