Works: Using INT to Find Integer and Real Parts of Numbers (91076)



The information in this article applies to:

  • Microsoft Works 2.0
  • Microsoft Works 2.0a
  • Microsoft Works 3.0
  • Microsoft Works 4.5
  • Microsoft Works 4.5a
  • Microsoft Works for Windows 95, version 4.0
  • Microsoft Works for Windows 95, version 4.0 4.0a
  • Microsoft Money 2000 Business and Personal

This article was previously published under Q91076

SUMMARY

In the examples below, X and N are numbers or a reference to a cell containing a number. This article describes how to use the INT function to return the following values:

  • Integer Portion of a Number

  • Fractional (Real) Portion of a Number

  • Truncate to a certain number of decimal places

MORE INFORMATION

The following are several ways you can apply the INT function to extract portions of a number:

To find the integer portion of a number, X:

=INT(X)

For example, =INT(13.35) returns 13.

To find the fraction portion of X to N decimal places:

=INT(X*10^N)/10^N-INT(X)

For example, if N is 3, 10^N is 1000.

For example, X=13.35 and N=3, the formula returns 0.35.

To truncate X beyond the Nth decimal place:

=INT(X*10^N)/10^N

For example X=13.35342 and N=2, the function returns 13.35

To truncate the integer portion of X by N digits:

=INT(X/10^N)*10^N

For example, X=13542.243 and N=2, the function returns 13500.

NOTE: Fractional portions of the results will appear rounded if the column is not wide enough to display all the digits.

Modification Type:MajorLast Reviewed:11/15/2004
Keywords:kbinfo KB91076