Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to calculate average last N values in a table in Excel
  • Understanding Anova in Excel
  • How to create running total in an Excel Table
  • Conditional Formatting New Rule with Formulas in Excel
  • Conditional Formatting Data bars Examples in Excel

References

  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel VLOOKUP Function
  • How to get last column number in range in Excel
  • How to use Excel MATCH Function
  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions

Data Validations

  • Excel Data validation must begin with
  • Excel Data validation require unique number
  • Excel Data validation don’t exceed total
  • Data validation must not exist in list
  • Excel Data validation date in next 30 days

Excel Get integer part of a number Example

by

This tutorials shows how to Get integer part of a number  in Excel.

To remove the decimal part of a number and return only the integer portion, you can use the TRUNC function to slice off the decimal.

Formula

=TRUNC(number)

Explanation

In the example, cell C6 contains this formula:

=TRUNC(B6)

The TRUNC function simply truncates (i.e. removes) numbers; it doesn’t not round at all.

How this formula works

With TRUNC, no rounding takes place. The TRUNC function simply slices off the decimal part of the number with default settings.

Worked Example:   How to randomly assign people to groups in Excel

TRUNC actually takes an optional second argument to specify the precision of truncation, but when you don’t supply this optional argument, it is assumed to be zero, and truncation happens at the decimal.

What about INT or ROUND?

You might wonder if you can use the INT or ROUND functions instead.

Worked Example:   Excel Data validation whole percentage only

The behavior of INT is identical to TRUNC (with default settings) for positive numbers — the INT function will round a number down to the next integer and then return only the integer portion of the number.

However, for negative numbers, the rounding that INT does is a bit strange.

This is because INT rounds negative numbers down away from zero, no matter what the decimal value. See the last 2 examples in the screen above for an example.

Worked Example:   Use of INT and TRUNC function in Excel

Because of this behavior, TRUNC is a better option if you just want the integer portion of a number.

As you would expect, the ROUND function rounds numbers down. If you want to round to the nearest integer, (positive or negative) just use:

=ROUND(number,0)

But be aware that the integer value may be different than the number you started with due to rounding.

Post navigation

Previous Post:

Number and Text Filters Examples in Excel

Next Post:

Convert date string to date time in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • How to return blank in place of #DIV/0! error in Excel
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • IF with wildcards in Excel
  • How to use Excel FALSE Function
  • NOT function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Get first Monday before any date in Excel
  • Get work hours between dates in Excel
  • MINUTE function: Description, Usage, Syntax, Examples and Explanation
  • DATEDIF function: Description, Usage, Syntax, Examples and Explanation
  • Assign points based on late time in Excel

Grouping

  • Running count group by n size in Excel
  • Map inputs to arbitrary values in Excel
  • How to randomly assign data to groups in Excel
  • Map text to numbers in Excel
  • Group times into 3 hour buckets in Excel

General

  • Convert column number to letter in Excel
  • How to generate random number weighted probability in Excel
  • Excel Autofill Cell Ranges, Copy, Paste
  • Flash Fill in Excel
  • Create dynamic workbook reference to another workbook in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning