INT
Rounds a number down to the nearest whole number, toward negative infinity.
INT(<number>)Returns: A whole number (a scalar).
What it does
INT returns the greatest whole number that is less than or equal to the input. For a positive number this drops the decimals. For a negative number it goes further down, so INT(-2.5) is -3. Use INT to count whole periods, such as full months elapsed, or to split a number into its whole part and remainder.
Syntax and arguments
- number: the value to convert to a whole number.
Example
The collections team groups overdue invoices by full months past due. An invoice 75 days late is in its second full month, so it falls in the "2 months" group.
Full Months Overdue = INT(Invoices[DaysPastDue] / 30)
INT of 75 divided by 30 (2.5) is 2. An invoice 29 days late is 0 full months. The grouping is simple and easy to explain to a reader.
Example: a second, different use
Separate a balance into whole dollars and cents for a check printing rule that prints the dollars and the cents on separate lines:
Whole Dollars = INT(Payments[Amount])
For a positive amount, this is the dollar part. Subtract it from the amount to get the cents, which is a common pattern for cheque or wire data.
Things to watch
- INT rounds toward negative infinity. INT(-2.5) is -3, but INT(2.5) is 2. This is the main difference from TRUNC.
- INT does not round to the nearest whole number. For that, use ROUND with a digit count of 0.
- The result is a whole number, but the type may still be shown as a decimal. Format the output if the reader needs to see no decimals.
- Dividing before INT is common. Watch for division by zero, which DIVIDE handles safely.
- For negative amounts such as credit balances, check whether you need the floor or the truncation.
In business terms
INT is used for full months or years between two dates, whole units in a batch, the dollar part of an amount, and the number of complete billing cycles. It turns a continuous measure into a count of complete periods.