Microsoft 365 Excel
Microsoft 365 Excel
* Refer to worksheet -
Spilled Arrays
Syntax:
SEQUENCE(rows, [columns], [start], [step])
• Though PMT is independent of instalment no., PPMT and IPMT values vary based on instalment no.
• Use Sequence function to get a dynamic list of instalment no.s (feed as per in functions)
• A dynamic way of getting unique records as against static method of ‘Remove Duplicates’ option
• Get distinct records from a column or a row or even a table
Syntax:
SORT(array, [sort_index], [sort_order], [by_col])
Syntax:
SORTBY(array, by_array1, [sort_order1], [by_array2, sort_order2],…)
• No need to use auto filter or advanced filter to get the data based on specified conditions
• The new function can filter the records by providing reference to the base data and hence
provides complete flexibility to get updated results in case of any change in the base data
* Refer to worksheet - Filter
Syntax:
FILTER (array, include, [if_empty]) Tips for providing multiple conditions
– array is the base data to be filtered – Use * operator for AND condition. The multiple
conditions to be checked and fulfilled can be
– include is the condition provided for filtering data
provided as (Condition1)*(Condition2)*….
– if_empty is the value to be shown when no results are
– Use + operator for OR condition
available. This is an optional parameter. FILTER fn shall
return #CALC! error if no record matches the specified – Depending on requirement, use * or +
condition and if_empty value has not been provided operators and carefully use brackets
Syntax:
CHOOSECOLS(array,col_num1,[col_num2],…)
Syntax:
CHOOSEROWS(array,row_num1,[row_num2],…)
• XMATCH searches for a specified item in an array and returns the item's relative position
• Capable of doing the following:
– look for an approximate match
– look for an exact match
– wildcard character match (* and ?)
– search first to last or last to first
Syntax:
XMATCH(lookup_value, lookup_array, [match_mode], [search_mode])
• Step 2 – Use XMATCH function to get position no. of required columns to extract
• Step 3 – Feed the above position no.s in CHOOSECOLS function to get required columns
• One XLOOKUP function looks for one of the values and generates the return array for the
second XLOOKUP function
• Erstwhile text-based functions including LEFT, RIGHT and MID offer limited options to extract text
– Important to provide no. of characters to be extracted (unless we just need 1 character)
– Multiple instances of delimiter pose issue
• Many a times, we may need to refer to some working multiple times in a formula
– Leads to repetition of workings within the formula
– Makes the formula lengthy and complex
– Becomes difficult to interpret the formula
Multiple names and name
– May impact processing of formula as well values may be assigned
based on requirement
• LET function allows to get rid of above issues
1 2 3
=LET(name, name_value, calculation, …….)
Variable name Value of the Final calculation
to be assigned defined variable to show result
• VSTACK returns the array formed by appending each of the array arguments in a row-wise fashion
Syntax:
=VSTACK(array1,[array2],...)
• HSTACK returns the array formed by appending each of the array arguments in a column-wise fashion
Syntax:
=HSTACK(array1,[array2],...)
• Say the base data includes records of employees including name, department, salary, etc.
Syntax:
=TOCOL(array, [ignore], [scan_by_column])
Syntax:
=TOROW(array, [ignore], [scan_by_column])
• One function wraps the data by columns while other one does it by rows
Syntax
=RANDARRAY([rows],[columns],[min],[max],[integer])
– All parameters are optional, as this function shall create a random no. between 0 and 1 if nothing is provided
– Specify the other parameters based on requirement
– [integer] parameter may be given as TRUE if an integer is required else FALSE to get a fractional no. (default is
assumed as FALSE by this function)
Convert cells with currency pairs, e.g., USD/INR to this data type to get
currency conversion rates
Convert cells with company names or tickets, e.g., MSFT to this data
type to get stock related data points like last share price, 52 week
high/low, beta, exchange info, market cap, shares outstanding, etc.
Convert cells with countries / regions / cities, e.g., India, New Delhi,
Paris, etc. to this data type to get statistics like population, area, etc.
• Simply provide the stock ticker or currency pair to return historical data
• Excel will dynamically create the appropriate-sized array range when you press Enter
• Option available to provide inputs for desired columns to see in result including their sequence of
appearance in the final output
(Disclaimer: The information provided in Excel may be delayed and should not be used for real time trading purposes)
• Extract a defined no. of rows or columns from an array as specified by the user from the start or end
• Returns a #CALC! error to indicate an empty array when either rows or columns is 0
Syntax
=TAKE(array, rows, [columns])
– Positive input for rows/columns shall return the array from the start
– Negative input for rows/columns shall return the array from the end
• Excludes a specified number of rows or columns from the start or end of an array
• Returns a #CALC! error to indicate an empty array when either rows or columns is 0
Syntax
=DROP(array, rows, [columns])
– Positive input for rows/columns shall drop the array from the start
– Negative input for rows/columns shall drop the array from the end
• If rows isn’t provided, the default value is the number of rows in the array argument
• If columns isn’t provided, the default value is the number of columns in the array argument
• Returns a #VALUE error when rows / columns argument is less than rows / columns in original array
Syntax
=Expand(array, rows, [columns], [pad_with])
• Could be used to simply combine values in different cells together in a single cell without having
to provide any additional input
• In the strict format, the vertical data and horizontal data shall be shown differently
Syntax
=ARRAYTOTEXT(array, [format])
• Complex logics may be embedded in reusable LAMBDA functions to assist the end user
• We may store the lambda in name manager with a friendly name to reuse this in Excel
• Suggested to test lambda output with some sample input values and modify the logic, if needed
Step 2: Create a Lambda in a cell in Excel. By default, it shall return #CALC! error but you may test it by passing
sample inputs at the end of LAMBDA function
Step 3: Add the lambda to Name Manager so that it becomes a reusable function in that excel file
GrowthRate(Previous_Value, Current_Value)
TerminalValue(cash_flow, g, k)
FYEndDate(BaseDate,FYEndMonthNum)
FYEndDate_D(base_date,[month_num])
A variety of lambda helper functions have been included to work better with dynamic arrays
BYCOL Apply a lambda function to each column and return an array of results
BYROW Apply a lambda function to each row and return an array of results
* Refer to worksheets - Bycol & Byrow, Byrow (Case 2), Map, Scan, Reduce
©2022 Grant Thornton Bharat LLP. All rights reserved.
Thank you for your attention