# How to Use INT Function in Excel (8 Suitable Examples)

Get FREE Advanced Excel Exercises with Solutions!

When you have a decimal number in your dataset, you can use the INT function in Excel to get the nearest integer. Basically, we will discuss in this article how to use the INT function, starting from the eight practical examples, including the basics of the VBA code with proper explanations. So that you may adjust the formula for your uses.

## Excel INT Function: Syntax & Arguments

Firstly, you’ll see the syntax and argument of the function. If you insert the function after entering the equal sign (=), you’ll see the following figure.

Summary

A decimal number can be represented as an integer using the INT function which rounds it down to the lowest integer portion. As the function reduces the number to the nearest integer; as a result, negative numbers become even more negative.

Syntax

=INT (number) Return Value

The rounded integer portion of a decimal number.

Arguments

Argument Required or Optional Value
number required The real number from which you want to get an integer

## How to Use INT Function in Excel: 8 Practical Examples

Here, we will describe 8 suitable examples of how to use the INT function in Excel using the Microsoft 365 version. In addition, for your better understanding, I’m going to use some sample dataset.

Below, we have attached a quick review of our examples.

INT Function in Excel (Quick View) ### Example 1: Using INT Function for Positive Numbers

Actually, it’s a quite simple task to get the nearest integer from a given positive or negative decimal integer number.

For example, the INT function rounds down the weight from 50.78 kg to 50 kg.

So, just use the following formula.

• For this, select a blank cell and insert the formula after entering an equal sign (=).
`=INT(C5)` • Finally, press ENTER.

So, you will get the positive integer number which will round toward zero. •  If you want to use the same formula for other cells, you may use the Fill Handle Tool. Lastly, you will see all the rounded weights. ### Example 2: Use of INT Function for Negative Numbers

The INT function reduces the number to the nearest integer. So that negative numbers become more negative (more away from 0). That’s why the function rounds 0.52 to 0 but rounds -0.52 to -1.

Besides, if you have negative numbers, in the following case, the temperature, you can also use the INT function.

• First, select the cell D5 then write the following formula.
`=INT(C5)`
• Subsequently, press ENTER. • Now, you can drag the Fill Handle icon to AutoFill the corresponding data in the rest of the cells D6:D11.

As a result, you will see all the rounded temperatures. ### Example 3: Applying INT Function to Get Decimal Value

If you wish to get the only decimal value, you may also use the INT function in Excel. In that case, you have to insert the following formula.

• First, select the cell D5 then write the following formula.
`=C5-INT(C5)`

As the INT(C5) rounds down to the nearest integer number, you have to subtract this output from the decimal number.

• Subsequently, press ENTER. • Now, you can drag the Fill Handle icon to AutoFill the corresponding data in the rest of the cells D6:D11.

As a result, you will see all the decimal values. ### Example 4: Using INT Function for Serial Number of Decimal Value

Assuming that, the birth date along with birth time is given, you need to get the birth date excluding the time.

As you know Excel stores dates as serial numbers, the time will be a decimal number included with the integer serial number. For example, 37115.52 refers to 12:24 on 8/12/2001.

So, how can you convert this?

It’s a simple process. Additionally, you may use the Format Cells ( just press CTRL+1) or the VALUE function. Here, we’re going to use the VALUE function.

• So, select the cell D5 then write the following formula.
`=VALUE(C5)`
• Then, press ENTER. • Now, use the Fill Handle icon for the rest of cells.
• Then, use the INT formula with the serial number as the argument in the E5 cell.
=INT(D5)
• After that, press ENTER.

As a result, you will get only the Birth Date. • Similarly, you can drag the Fill Handle icon to AutoFill the corresponding data in the rest of the cells E6:E11.

Lastly, you will see all the birth dates. ### Example 5: Using INT Function to Split Date-Time in Excel

If you want to split date-time into separate dates and times using formula, you can use the INT function.

• Just insert the formula used in the earlier method to get the birth date.
`=INT(C5)`
• Now, press ENTER. • Now, use the Fill Handle icon for the rest of cells D6:D11.
• Then, use the following formula to get birth time.
`=C5-INT(C5)`
• Then, press ENTER. • Similarly, you can drag the Fill Handle icon to AutoFill the corresponding data in the rest of the cells E6:E11.

Lastly, you will see all the birth times. ### Example 6: Calculate the Number of Years between Two Dates

More importantly, you can calculate the number of years between two dates using the INT function.

For example, you can determine the age in years from the birth date.

Furthermore, for this, you have to use the YEARFRAC function which estimates the proportion of the year between two dates by the number of complete days.

Again, the TODAY function will be used to get the current date.

Then, the INT function rounds down the number of years to the nearest integer. Now, see the steps.

Steps:

• Firstly, write the following formula in the D5 cell.
`=INT(YEARFRAC(C5,TODAY()))`
• Secondly, press ENTER. • Then, you can drag the Fill Handle icon to AutoFill the corresponding data in the rest of the cells D6:D11.

Lastly, you will see all the ages in years. ### Example 7: INT Function with IF Function

Here, the IF function is the most popular function to make logical statements in Excel.

Also, you can utilize the INT function with the IF function.

Let’s imagine, you have thousands of data. Among them, some are integer data while some are floating data. Now, you have to identify whether the data are integers or not.

In such a situation, you can use the following formula.

• First, select the D5 cell and write the formula.
`=IF(C5>INT(C5),"Is not Integer", "Is Integer")`
• Then, press ENTER to get the result. • Now, you can drag the Fill Handle icon to AutoFill the corresponding data in the rest of the cells D6:D11.

Lastly, you will see all the numbers type. ### Example 8: Applying INT Function to Round Up Number

Here, we will use the INT function only to round up a positive number in Excel. Suppose we want to find out the actual weight and so we want to round up the values. The steps are given below.

Steps:

• Firstly, you have to select a new cell D5 where you want to keep the result.
• Secondly, you should use the formula given below in the D5 cell.
`=-INT(-C5)`

Here, the INT function will round up the negative numbers. So, we made the positive numbers into negative ones by using the Minus sign. Then, we use another Minus sign to make the final result positive.

• Thirdly, press ENTER. • Now, you can drag the Fill Handle icon to AutoFill the corresponding data in the rest of the cells D6:D11.

Lastly, you will see all the rounded weights. ## Use of VBA for INT Function in Excel

If you have a larger dataset, it is time-consuming and a little bit boring to get the required result using a formula.

Rather you can utilize the VBA code in Excel which performs the result rapidly and accurately.

Now, let’s see how you can apply the VBA code to calculate the number of minutes.

• Firstly, from the Developer tab > go to Visual Basic. • Secondly, open a module by clicking Insert > Module. • Then, copy the following code into your module.
``````Sub my_example_INT()
Range("D5").Value = Int(Range("C5"))
End Sub`````` Be careful that three things are essential to run the VBA code for using the INT function

• Input cell range: Here, you have to insert the cell of the number from which you want to get the nearest integer e.g. B5.
• Output cell range: The cell range where you want to get the output.
• Logic: The function is used e.g. INT.
• Now, save the code and go back to your worksheet.
• Then, from the Developer tab > go to Macros. • Then, run the code by clicking my_example_INT > Run. As a result, you will see the rounded weight for the C5 cell value. • Similarly, do the same for the other cells.

Lastly, you will see all the rounded weights. ## Common Errors While Using the INT Function

Common Errors When they show
#VALUE! – Occurs when a text is inserted as input
#REF! – Occurs the input is not valid

## Practice Section

Now, you can practice the explained method by yourself. ## Conclusion

This is how you can apply the INT function to get the integer number. If you have an interesting and unique method of using the INT function, please share it in the comments section below.

Thanks for being with us.

## What is ExcelDemy?

ExcelDemy Learn Excel & Excel Solutions Center provides free Excel tutorials, free support , online Excel training and Excel consultancy services for Excel professionals and businesses. Feel free to contact us with your Excel problems. Hi! I am Abdul Kader and presently working as ‘Excel & VBA Content Developer’ at Exceldemy. I publish my articles related to Microsoft Excel here. In 2019, I completed my graduation in Urban and Regional Planning from Chittagong University of Engineering and Technology. Having extreme eagerness to learn, I want to develop my skills and capabilities higher.

1. Reply Hi Abdul,

If it is unacceptable for me to ask for assistance on a problem, I apologize. Otherwise, I would love your input on the problem below.

9/1/22 3/12/18 6:16
9/1/22 13:30
9/1/22 22:43
9/1/22 10:09
4/16/21 8:44
9/1/22 13:11

(Example above)

I have a cell which contains a (reference) date (without a time).
I have a column, each cell of which contains a date & time (various dates and various times). Some of the dates in the column equal the reference date.

I want to find the MAX time, in the column, but only on the reference date. (The times on the other dates don’t matter.)

The solution I’m looking for, in the example, would be 22:43, in cell C3, which is the maximum time on the reference date of 9/1/22.

I’m pretty sure the INT function is involved but I haven’t gotten it to work yet.

Thank you very much, in advance.
Dave

• Reply Hello Dave,
Thanks for your humble appearance. But we always welcome informing us about your concerns. Now, without further delay, let’s dive into the problem.
From your example above, I’ve created a dataset. Let’s look at the image below for a better understanding. • To solve the problem, firstly, we are creating a new column named Helper Column to Get Date Only. Also, created a final output range in cell D14. • Secondly, select cell D7 and enter the following formula.
`=DATE(YEAR(B7),MONTH(B7),DAY(B7))`
This formula filters out the date only from the date and time in cell B7.
• Then, press the ENTER key. • After that, use the Fill Handle tool to get results in the remaining cells. • Thirdly, go to cell D14 and paste the formula below.
`=MAX(IF(D7:D12=D4,B7:C12))`
We used the MAX and IF functions in the formula above. Using the IF function, we inserted a logical test that checks if the dates in the D7:D12 range equals to the date in cell D4. If the result is TRUE, then it displays an array of corresponding dates and times in the B7:C12 range. Then, the MAX function gets the maximum value among them.
• As usual, press ENTER. Currently, it’s showing the time in General format. So, we’ve to change the cell formatting.
• To do this, press CTRL+1 to open the Format Cells dialog box.
• In the Number tab, select Time format as Category.
• Then, choose the formatting Type as shown in the picture below.
• Lastly, click OK. Finally, we got our desired output format. And the result is correct also. That’s all about it. If you find any difficulty regarding this example or any other problems related to Excel, feel free to contact us. You can also follow our Exceldemy blog for the most detailed solutions to any problems in Excel. Advanced Excel Exercises with Solutions PDF  