INT
Round a number down to the nearest integer. Negative numbers go further from zero, not towards it.
Syntax
INT(number) | Argument | Required | Description |
|---|---|---|
number | Required | The number to round down. |
Examples
Every example below was executed against VisiGrid engine 0.54.0 — not
transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.
| Formula | Result | Notes |
|---|---|---|
=INT(4.7) | 4 | |
=INT(-4.3) | -5 | Down means towards negative infinity, so -4.3 becomes -5 rather than -4. |
=INT(7/2) | 3 | Whole-number division — how many complete 2s fit in 7. |
=INT(NOW())=TODAY() | TRUE | Dropping the fraction from a date-time leaves the date. |
Down, not towards zero
For positive numbers INT simply drops the decimals. For negative numbers it
does not: INT(-4.3) is -5, because -5 is the next whole number below
-4.3. That is the mathematical floor, and it is what Excel does too.
If what you want is to discard the fraction whatever the sign, TRUNC does that:
=TRUNC(-4.3) → -4
Splitting a date from its time
A date-time in a spreadsheet is a day count with the time of day as its
fraction. INT takes the day:
=INT(NOW())
and subtracting that from the original leaves only the time:
=NOW()-INT(NOW())
This is how to group timestamped rows by day, or to compare a timestamp with a plain date without the time getting in the way.
Excel compatibility
Matches Excel, including rounding negative numbers down rather than towards zero.