Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • How to use Excel TRANSPOSE Function
  • How to create dynamic named range with OFFSET in Excel
  • How to calculate two-way lookup VLOOKUP in Excel Table
  • How to use Excel INDIRECT Function
  • Extract all partial matches in Excel

Data Analysis Examples

  • How to sum a total in multiple Excel tables
  • How To Perform and Interpret Regression Analysis in Excel
  • Excel Pie Chart
  • How to Create Area Chart in Excel
  • How To Sort One Column or Multiple Columns in Excel

Data Validation Examples

  • Excel Data validation unique values only
  • Excel Data validation with conditional list
  • Excel Data validation require unique number
  • Excel Data validation number multiple 100
  • Excel Data validation must begin with

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:   Excel Rank race results Example

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:   Basic numeric sort formula in Excel

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:   Excel Get number at place value Example

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:

Excel Get decimal part of a number Example

Next Post:

Excel Get number at place value Example

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
  • UPPER function: Description, Usage, Syntax, Examples and Explanation
  • How to display conditional message with REPT function in Excel
  • Manipulating text strings using Left, Mid, Right, Len, Substitute in Excel
  • Two ways to Compare Text in Excel
  • Add line break based on OS in Excel
  • Dynamic date list in Excel
  • Basic timesheet formula with breaks in Excel
  • Get days, hours, and minutes between dates in Excel
  • Convert text to date in Excel
  • How to calculate Day of the Year in Excel
  • Calculate periods for annuity in Excel
  • COUPDAYSNC function: Description, Usage, Syntax, Examples and Explanation
  • ODDFYIELD function: Description, Usage, Syntax, Examples and Explanation
  • Example of Future value of annuity in Excel
  • DOLLARFR function: Description, Usage, Syntax, Examples and Explanation
© 2022 xlsoffice . All Right Reserved. | Teal Smiles