Performing Integer Divisions

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


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, 2021, and Excel in Microsoft 365.

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

Changing AutoFormatting Rules

The AutoFormat feature of Word can be configured to make changes to a variety of conditions in your document. Here's how ...

Discover More

Calculating Time Differences between Two Machines

Want to know how much of a time difference there is between your machine and a different machine? This tip provides some ...

Discover More

Moving Table Rows Quickly

One of the most esoteric shortcuts available in Word is one that allows you to move table rows, either within a table or ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!

More ExcelTips (ribbon)

Using the IRR Function

When working with finances, you often need to know the rate of return on a given investment. The most common type of ...

Discover More

Using the CONCATENATE Worksheet Function

The process of combining string (text) values to make a new string is called concatenation. Excel provides the ...

Discover More

Using COUNTIF with Colors

Excel allows you to easily format cells with different fonts, borders, and colors. If you want to count the number of ...

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 three more than 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.