number is numerical value or cell reference containing the number that you want to truncate. So you can use it to truncate a number based on a given number of digits.The syntax for the TRUNC function is as follows: =TRUNC ( number, ) If you simply want to convert a decimal value to a whole number, without rounding off, you can use the TRUNC function.The TRUNC function takes a decimal value and truncates it to a given precision. Note You can quickly select an entire row by clicking its row heading or.Notice that this is the same result as the one we got from using the TRUNC function.In fact, TRUNC and INT are both quite similar functions. This means applying the function to both 10.8 and 10.2 will return the value 10.The syntax for the INT function is simple: =INT ( number)The function takes just one argument, which is the decimal number that needs to be converted to integer.So, the function INT(4.7) will return the value 4, while the function INT(2.2) will return the value 2. The INT FunctionThe INT function takes a decimal value and returns the integer part of it after rounding it down to the nearest integer. This value is optional, with a default value of 0.If you want to extract just the integer part of a number by truncating (or removing) the fractional part, you can choose to ignore the second optional argument.So, the function TRUNC(4.7) will return the value 4, while the function TRUNC(2.2) will return the value 2.The following screenshot shows how the TRUNC function works with different decimal inputs:If you would also like to round off the decimal number while removing it, there are a number of functions that Excel offers for this:Let us take a look at each of these functions one by one to understand how they round off decimal values.
![]() ![]() The ROUND FunctionThe ROUND function takes a decimal value and returns the number rounded to a given number of digits.This function is capable of rounding down or up depending on the nearest number.This means applying the function to 10.8 will return 11, while applying it to 10.2 will return 10.The syntax for the ROUND function is as follows: =ROUND ( number, num_digits) Use TRUNC if you want exactly the integer part of both negative and positive numbers.The INT function’s main job is to round down a decimal number to its nearest integer, keywords here being, ‘ rounding down’.However, if you want more control over how you round off your decimal numbers, there is an arsenal of other functions provided by Excel.Let’s take a look at some of these. Use INT when you want the integer part of a decimal number, and you have no problem if it always rounds down. So, TRUNC(10.8) returns 10, while TRUNC(-10.8) returns -10. For example, while INT(10.8) returns 10, INT(-10.8) returns -11.In other words, negative numbers become more negative when the INT function is applied to it.This does not happen in the case of the TRUNC function. Mirrorop sender registration keyThis value is optional, with a default value of 0.If you want to round the number to the nearest integer, you can set the num_digits argument to 0. num_digits is the number of digits to which you want to round.
0 Comments
Leave a Reply. |
AuthorMichael ArchivesCategories |