Saturday, 16 November 2019

Excel ROUNDDOWN Function


A built-in Math/ Trig function, ROUNDOWN function can be used as a worksheet function.

Purpose
To round a number down, toward zero

Syntax
=ROUNDDOWN(number, num_digits)

Arguments
  • Number.REQUIRED.Any real number that you want to round down.
  • Num_digits.REQUIRED. The number of digits to which you want to round down the number.
If Num_Digits is:
  • Zero (0). The number is rounded down to the nearest integer.
  • Greater Than Zero (>0). The number is rounded down to the specified number of places in the right of decimal point.
  • Less than zero (<0). The number is rounded down to the specified number of places in left of the decimal point.

Return Type
Number

Remarks
ROUNDDOWN behaves like ROUND. The only different is ROUNDDOWN always rounds a number down.

Excel Round Function


Round function is a built in excel function categorized as Math/ Trig Function. It can be used as a worksheet function in excel and VBA.

Purpose
To return a number rounded to the specified number of places

Syntax
=ROUND(Number, Num_Digits)

Arguments
  • Number.REQUIRED. The number that you want to round
  • Num_Digits. REQUIRED. The number of digits to which you want to round the number argument
If Num_Digits is:
  • Zero (0). The number is rounded to the nearest integer.
  • Greater Than Zero (>0). The number is rounded to the specified number of places in the right of decimal point.
  • Less than zero (<0). The number is rounded to the specified number of places in left of the decimal point.


Return Type
Number

Remarks
  • To always round up (away from zero), use the ROUNDUP function
  • To always round down (toward zero), use the ROUNDDOWN function
  • If a number is already rounded to the given number of places, no rounding occurs

Tuesday, 5 November 2019

Excel INT Function


Excel INT Function
An excel function that returns the integer part of the decimal number by rounding down to the integer. It can be used as a worksheet function or a VBA function. The function is categorized as math and trig function in excel.
For example: INT(10.8) will return 10 and INT(-10.8) will return -11.
So, we can say, negative numbers become more negative as INT function rounds down.

Syntax
=INT(Number)

Argument
Number. REQUIRED. Any positive or negative decimal digit from which integer is required

Purpose
Get the integer part of a decimal number by rounding down

INT function returns the integer part of the decimal digit by rounding down. However, if you only want the exact the integer part of both negative and positive numbers, it is good to use TRUNC Function.

Remarks
Excel provides a number of functions for rounding:
  • To round normally, use the ROUND function.
  • To round to the nearest multiple, use the MROUND function.
  • To round down to the nearest specified place, use the ROUNDDOWN function.
  • To round down to the nearest specified multiple, use the FLOOR function.
  • To round up to the nearest specified place, use the ROUNDUP function.
  • To round up to the nearest specified multiple, use the CEILING function.
  • To round down and return an integer only, use the INT function.
  • To truncate decimal places, use the TRUNC function.

Source:
https://exceljet.net/excel-functions/excel-int-function

Excel TRUNCFunction


Excel TRUNC Function
Introduced in Excel 2007, TRUNC function is a built-in excel function that can be used as a worksheet function. It is categorized as Math and Trigonometry Function that does not round off the number. It is advised to use TRUNC function to obtain the integer value of the given decimal number.
For Example:=TRUNC(10.2) or =TRUNC(10.2,0) will return 10, =TRUNC(10.2,1) will return 10.2

Syntax
=TRUNC(Number, Num_Digits)

Arguments
  • Number. REQUIRED. Any positive or negative number that is required to truncate.
  • Num_Digit. Optional. Could be a positive, negative digit, or zero. If this parameter is omitted, trunk function will assume 0.
-A positive value that is greater than zero specifies the number of digits to the right of the decimal point.
-equal to zero (or left blank) specifies to truncate to the nearest integer.
- A negative value less than zero specifies digits to the left of the decimal point.

Purpose
To truncate a number to a given precision

Return Value
A truncated number

Remarks
  • The function does not rounds off the number, just returns the output integer/ and non-integer depending upon the input.
  • The difference between INT and TRUNC is that INT returns on integer value by rounding off to the nearest integer but Trunc does not rounds off the number and return the integer and non-integer output depending upon the input.
  • TRUNC and INT are similar functions because they both return the integer part of a number. The difference is that TRUNC merely truncates a number, but INT rounds off a number. However, for positive numbers and when trunk uses 0 as the num_digit, both functions return the same value. With negative numbers, results will be different.

Source

Wednesday, 2 October 2019

Excel Match Function


Excel Match function is categorized under excel lookup and reference functions. It is used to fetch the value in an array and returns the position of the value within the array. For example, we need to match the value of 5 in a range comprising(1, 5, 6, 8, 9). The function will return 2, as 5 is the 2nd item in the given range.
It is a built-in excel function and can be used as a worksheet function.

Syntax
=match (lookup_value, lookup_array, [match_type])

Arguments
  • Lookup_value. REQUIRED. Value that we want to look up. Numeric/ text/ logical value/ cell reference. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.
  • Lookup_array. REQUIRED. Data array to search in.
  • Match_type. OPTIONAL. Can be set to 1, 0, and -1. By default, match function takes 1 as match type.

Match_type:
  • 1 It returns the largest value that is less than or equals to the lookup value. It requires sorting of lookup array in ascending order, from smallest to largest; a to z.
  • 0 Finds the first value in the array that exactly matches with the lookup value. No sorting is required.
  • -1 returns the smallest value that is greater than or equals to the lookup value. Lookup array should be sorted in descending order; from largest to smallest; z to a.


Purpose
To find the relative position of lookup_value in a row, column, table or an array. For partial matches, wildcard characters are used.

Return Type
Integer

Return Value
Position of the lookup_value.

Remarks
  • If match function does not find a match, it returns #N/A error.
  • Match Function is not case-sensitive.
  • If match_type = 0 and lookup_value is a text value, you can use wildcards in the lookup_value.
  1. * is used to match any sequence of characters
  2. ? is used to match any single character
  • Use wildcards when match_type is set to 0.
  • If lookup_value has several occurrences in the lookup_array, it returns the position of the first value.
  • In financial analysis, match function is used in combination with other functions to lookup and return the values in the column. Commonly it is used with the INDEX function, generally called INDEX MATCH combination. Match returns a position, to fetch the value, learn using Index and Match together.

Sources:

Excel Choose Function


It is a built-in lookup/ reference function that is used to get the value using a giving position or index. Also, it can be used as a worksheet function and a VBA function in excel.

Syntax
=CHOOSE(index_num, value1, [value2], …)

Arguments
  • Index_num. REQUIRED. The position number in the list of values to return. A number between 1 and 254, or a formula or reference to a cell containing a number between 1 and 254. Limit of 29 in EXCEL 2003.
  • Value, Value2… Value1 is required, subsequent values are optional. A value can be a number, a cell reference, a defined name, a formula/function, or a text value. 1 to 254 value arguments from which Choose selects the a value or an action to perform based on index_num.

Purpose
To get a value from a list based on position

Return Value
The value at the given position

Return Type
string, numeric, date, etc.

Remarks
  • If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value.
  • If index_num is a fraction, it is truncated to the lowest integer before being used.
  • If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on.
  • If index_num is an array, every value is evaluated when CHOOSE is evaluated.
  • The value arguments to CHOOSE can be range references as well as single values.
So, to get the value from the list using position, we use CHOOSE function. However, to get the position of a value in a row/ column/ table, use MATCH Function. Choose can handle up to 254 values but INDEX, or INDEX with MATCH are better approaches for large value sets.

Sources

Sunday, 29 September 2019

Excel EOMONTH Function


A built-in excel time/date function, EOMONTH is used to calculate the last date of the month, n months in future of past. The result is a serial date value. It is worksheet function and can be entered as a part of other excel formulas. The function is good to fetch the due dates, expiration dates and other dates that need to land on the last date of the month.

Purpose
To find the last date of the month. Last date of the same month, previous months or future months

Syntax
=EOMONTH(start_date, month)

Arguments
  • Start_date.REQUIRED. Starting date for reference
  • Month. REQURED.Number of months to be added in the start date. Value could be 0, +ve or –ve.

Return Type
Date 

Return Value
Serial date value

Remarks
  • If a decimal value is provided for months, the EOMONTH function will only add the integer portion to start_date.
  • The EOMONTH function returns a serial date value, the way excel stores dates internally
  • #NUM! error occurs when
  1. Start_date is not a valid excel date
  2. The supplied start_date plus the value of “months” argument is not a valid excel date.
  • #VALUE error occurs when any of the supplied arguments is non-numeric.