How to use the INT function
The INT function removes the decimal part from positive numbers and returns the whole number (integer) except negative values are rounded down to the nearest integer.
Table of Contents
- Introduction
- INT function Syntax
- INT function example
- INT function alternative
- Convert boolean values to their numerical equivalents
- Split string and remove decimals
- INT function and IF function
- Split date from a date and time value
- Split time from a date and time value
- Extract the hour from a time value
- Get Excel *.xlsx file
1. Introduction
What is an integer?
An integer is a whole number that can be positive, negative, or zero. Integers do not include fractions or decimal values. Some examples of integers are ...0, 2, -7, 365, -88.
The set of integers is represented mathematically by the symbol ℤ or Z. The integers are evenly spaced on the number line, with consecutive integers having an absolute difference of 1.
Integers have a fundamental role in mathematics and have applications across many fields, including counting, indexing, and as quantified measures. Many basic arithmetic operations like addition, subtraction, multiplication, and division (except division by zero) can be performed on integers while still resulting in integer values.
1. INT Function Syntax
INT(number)
number | Required. The number you want to convert to an integer. |
Boolean values are converted into their equivalent integer. TRUE is 1 and FALSE is 0, see section 5 below for more.
3. INT Function Example
The image above demonstrates the INT function, the arguments are in cells B3:B10 and the results are in cells D3:D10.
Formula in cell D3:
- Cell B3 contains 1.9 and the INT function removes the decimal part.
- Cell B4 contains numerical value 2 and the INT function returns 2 in cell D4.
- Cell B7 contains a text string : "A", the INT function returns a #VALUE! error.
- Cell B8 contains a text string : "#DIV/0!", the INT function returns a #DIV/0! error.
- Cell B9 contains boolean value TRUE, the INT function returns 1 which is the numerical equivalent.
- Cell B10 contains -6,9, the INT function returns -7. This shows that the INT function does not remove decimals if the number is negative, it simply rounds the number down to its nearest integer.
4. INT Function alternative
This example shows an alternative to the INT function. The formula in cell C3 removes the decimal part by subtracting a number based on the MOD function.
Formula in cell C3:
The MOD function returns the remainder after a number is divided by divisor.
Function syntax: MOD(number, divisor)
The MOD function returns the decimal part if the second argument is equal to 1.
4.1 Explaining formula
Step 1 - Calculate remainder
The MOD function returns the remainder after a number is divided by a divisor.
MOD(number, divisor)
MOD(B3,1)
becomes
MOD(1.9, 1)
and returns 0.9
Step 2 - Subtract the number
The minus sign lets you subtract numbers in an Excel formula.
B3-MOD(B3,1)
becomes
1.9 -0.9 equals 1.
5. INT function - convert boolean values to their numerical equivalents
The image above demonstrates how the INT function converts a boolean value to its corresponding number.
- TRUE - 1
- FALSE - 0 (zero)
This can be useful if an Excel function doesn't allow boolean values. Right now I can only think of the MMULT function that requires numerical values and not the boolean equivalents.
Formula in cell C3:
This can be used in the MMULT function or SUMPRODUCT function to convert boolean values to numerical equivalents. These functions require numerical values to work, however, there are more ways to convert boolean values:
TRUE + 0 equals 1.
FALSE + 0 equals 0 (zero).
TRUE * 1 equals 1.
FALSE * 1 equals 0 (zero).
The examples above demonstrates how to convert boolean values to their numerical equivalents using addition and multiplication.
6. INT function - split string and remove decimals
This example shows how to split a string containing numerical values based on a comma as a delimiting value.
The argument is in cell B3 and the result is an array in cell D3 that spills to cells below as far as needed. The string is: 1.2, -4.1, 9.9, -10.9
Formula in cell D3:
This formula works only in Excel 365 as the TEXTSPLIT function is a relative new function. The returned array is: {1;-5;9;-11}, these values are integers. No decimal values are left.
Explaining formula
Step 1 - Split values into an array
The TEXTSPLIT function lets you split a string into an array across columns and rows based on delimiting characters.
TEXTSPLIT(Input_Text, col_delimiter, [row_delimiter], [Ignore_Empty])
TEXTSPLIT(B3,,",")
becomes
TEXTSPLIT("1.2, -4.1, 9.9, -10.9",,",")
and returns
{"1.2";" -4.1";" 9.9";" -10.9"}.
Step 2 - Remove decimals
Note that the INT function also converts the text values to numbers automatically.
INT(TEXTSPLIT(B3,,","))
becomes
INT({"1.2"; " -4.1"; " 9.9"; " -10.9"})
and returns {1; -5; 9; -11}. The double quotes are gone indicating they are now numbers and not text.
7. INT function and IF function
This formula checks if the value on the same row in column B is a text value and returns "Text" if so. If not then the formula returns the integer of the numerical value.
Formula in cell C3:
Cell range B3:B7 contains the arguments and cells C3:C7 contains the result.
- Cell B3 and B4 contains numerical values 1.9 and 3.4 respectively. The results are 1 and 3 displayed in cells C3 and C4.
- Cell B5 contains "A" which is a text string, the formula returns "Text" in cell C5.
- Cell B6 contains a boolean value and cell C6 returns the numerical equivalent.
- Cell B7 contains -6.9 and cell C7 returns -7.
7.1 Explaining formula
Step 1 - Check if the value is a text value
The ISTEXT function returns TRUE if the value is a text value.
ISTEXT(value)
ISTEXT(B3)
becomes
ISTEXT(1.9)
and returns FALSE. 1.9 is not a text value.
Step 2 - Evaluate IF function
The IF function returns one value if the logical test is TRUE and another value if the logical test is FALSE.
IF(logical_test, [value_if_true], [value_if_false])
IF(ISTEXT(B3),"Text", INT(B3))
becomes
IF(FALSE,"Text", INT(B3))
Step 3 - Evaluate the INT function
INT(B3)
becomes
INT(1.9)
and returns 1.
8. Split date from a date and time value
The INT function removes the decimals from a number which is useful while manipulating Excel dates. An Excel date and time value has two parts. The integer is the date and the decimal is the time.
Remove the decimal and the date is left, remove the integer and the time is left. This is demonstrated in the image above. Date 5/11/2025 1:45 PM corresponds to the numerical value 45788.57292. If we remove the decimals then the remaining part is the integer value which represents the date.
Formula in cell D3:
INT(45788.57292) returns 45788.
9. Split time from a date and time value
This example shows how to extract time from an Excel date and time value using the INT function. The date and time value is specified in cell B3 and the result is in cell D3. The result contains only the time part of the value in cell B3.
Formula in cell D3:
The integer part of an Excel date and time value represents the date and the decimals part represents the time. The formula in cell D3 subtracts the original value with its integer part which results in only the decimal part.
Explaining formula
Step 1 - Remove decimals
INT(45788.572916667)
returns 45788.
Step 2 - Calculate decimals
B3-INT(B3)
becomes
45788.572916667 - 45788
and returns 0.572916667
10. Extract the hour from a time value
The HOUR function lets you calculate the hour value based on an Excel date (and time value), however, you can perform the same calculation using the INT function.
An hour in Excel represents 1/24 since one day or 24 hours is equal to 1.
Formula in cell D3:
If we multiply the time value with 24 and the calculates the integer part using the INT function we get the hour from the source Excel time value specified in cell B3.
Explaining formula
Step 1 - Calculate hours
B3*24
becomes
0.572916666664241*24
and returns
13.7499999999418
Step 2 - Remove decimals
INT(B3*24)
becomes
INT(13.7499999999418)
and returns 13.
Useful links
INT function - Microsoft
INT Function in Excel
'INT' function examples
Question: I need to calculate how many hours a machine is utilized in a company with a night and day […]
This article demonstrates Excel formulas that calculate complete weeks between two given dates and weeks and days between two given […]
This article describes how to build a calendar showing all days in a chosen month with corresponding scheduled events. What's […]
Functions in 'Math and trigonometry' category
The INT function function is one of 61 functions in the 'Math and trigonometry' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form