0% found this document useful (0 votes)
19 views63 pages

Microsoft 365 Excel

Uploaded by

Ishita Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views63 pages

Microsoft 365 Excel

Uploaded by

Ishita Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

Microsoft 365 Excel

New Functions in MS Excel


Formulas can now ‘Spill’

©2022 Grant Thornton Bharat LLP. All rights reserved.


Formulas can now ‘Spill’
Formulas in MS Excel can now spill automatically if the result stretches to multiple
cells (rows and columns)

• If there is no sufficient space, then it results in #SPILL! Error


• Once sufficient space is available, the spill error goes away
• Use # symbol to refer to spilled range; simply refer to the cell containing formula
spilling the result and put # to get reference of entire spilled range

* Refer to worksheet -
Spilled Arrays

©2022 Grant Thornton Bharat LLP. All rights reserved.


Sequence function

©2022 Grant Thornton Bharat LLP. All rights reserved.


Creating ‘Sequence’ of numbers
The new SEQUENCE function

• generates a range of sequential numbers and


• can spill automatically as per the required cells

Syntax:
SEQUENCE(rows, [columns], [start], [step])

– rows parameter is mandatory while columns shall be taken as 1 by default


– columns value of greater than 1 shall result in multiple columns in resultant table
– start and step also have default values of 1 each
– start is the starting no. and step indicates the stepped interval

* Refer to worksheets - Sequence Overview, Sequence for Tabular Data


©2022 Grant Thornton Bharat LLP. All rights reserved.
Sequence of ‘Dates’
Combine date related functions with Sequence

• Use DATE function to create a date with the


following parameters:
– given year input
– Sequence function for month nos.
– Day no. (based on requirement or take any no.
which exists in all months, i.e., 1 to 28)

• Subject the above created date list to


EOMONTH to get the end of each month

• One single formula creates the list of all dates


in any given year

* Refer to worksheet - Sequence of Dates


©2022 Grant Thornton Bharat LLP. All rights reserved.
Building dynamic ‘loan amortization’ schedule
Computing principal and interest component embedded in a series of instalments

• Financial functions used for loan amortization workings:


– PMT (for instalment amount)
– PPMT (for principal component)
– IPMT (for interest component)

• 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)

* Refer to worksheet - Dynamic Loan Amortization


©2022 Grant Thornton Bharat LLP. All rights reserved.
Using Sequence function for ‘period no.’

‘per’ in PPMT function taken


as B13# and B13 contains
Sequence function as
SEQUENCE(20) driven by
SEQUENCE(D5*D6)

* Refer to worksheet - Dynamic Loan Amortization


©2022 Grant Thornton Bharat LLP. All rights reserved.
Remove duplicates dynamically
using Unique function

©2022 Grant Thornton Bharat LLP. All rights reserved.


Getting ‘Unique’ records is now dynamic
UNIQUE fn returns the unique records from a given list of values

• 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: Getting unique from vertical list


UNIQUE(array, [by_column], [exactly_once])

– array is range of cells


– [by_column] is False by default. This is usually set this
to False for vertical data and True for horizontal data
– [exactly_once] is False by default. Set this to True if only
those records are needed which appear exactly once

* Refer to worksheet - Unique


©2022 Grant Thornton Bharat LLP. All rights reserved.
Dynamically sort the data using
SORT and SORTBY functions

©2022 Grant Thornton Bharat LLP. All rights reserved.


‘Sort’ the data dynamically with a formula
The data can now be sorted using the SORT function

• Arrange data in ascending or descending order


• Choose any column for sorting in case of vertical data arrangement (or) any row in case of
horizontal data arrangement

Syntax:
SORT(array, [sort_index], [sort_order], [by_col])

– array is the base data to be sorted


– sort_index is the column no. to be used for sorting (default is 1)
– sort_order should be chosen as 1 for ascending and -1 for descending (default is 1, i.e., ascending order)
– by_col should be chosen as TRUE when sorting by column and FALSE when sorting by row. Majority of the
people shall be sorting by rows as the data is usually vertically arranged (default is FALSE)

* Refer to worksheet - Sort


©2022 Grant Thornton Bharat LLP. All rights reserved.
‘Sortby’ offers sorting based on another array
Alternate method to sort the data

• Sort data in ascending or descending order


• Sorting is done based on another array

Syntax:
SORTBY(array, by_array1, [sort_order1], [by_array2, sort_order2],…)

– array is the base data to be sorted


– by_array is the array or range to sort on
– sort_order should be chosen as 1 for ascending and -1 for descending (default is 1, i.e., ascending order)

* Refer to worksheet - Sortby


©2022 Grant Thornton Bharat LLP. All rights reserved.
‘Filter’ the data with a formula
instead of conventional auto /
advanced filter

©2022 Grant Thornton Bharat LLP. All rights reserved.


Filter data based on given set of conditions
FILTER function filters a range of data based on given criteria & extracts matching records

• 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

©2022 Grant Thornton Bharat LLP. All rights reserved.


Combine Filter, Sort and Unique functions
Multiple functions may be combined to get the desired data

• Filter to get the filtered records based on given set of conditions

• Sort the filtered data

• Get unique records

Use the above in any combination based on requirement

* Refer to worksheets - Filter+Sort, Filter+Unique


©2022 Grant Thornton Bharat LLP. All rights reserved.
Conditional median using FILTER function
Conditional functions exist in MS Excel for limited calculations only

• Default conditional functions available in Excel:


– Countifs
– Averageifs
– Sumifs
– Minifs
– Maxifs

• In order to compute other metrics, e.g. Conditional Median


– use FILTER function to get relevant data based on specified conditions; and
– apply the base function (i.e. MEDIAN)

* Refer to worksheet - Conditional Median


©2022 Grant Thornton Bharat LLP. All rights reserved.
Choose relevant columns or rows
from an array

©2022 Grant Thornton Bharat LLP. All rights reserved.


Get relevant columns using CHOOSECOLS
Returns the specified columns from an array

• CHOOSECOLS function allows the specified list of columns to be returned


• Either give the column no.s to be returned as manual hardcoded inputs or use an Excel
function to get it, e.g., XMATCH (as discussed in subsequent slides)

Syntax:
CHOOSECOLS(array,col_num1,[col_num2],…)

– array is the base data containing the columns to be returned


– col_num1 is the first column to be returned
– col_num2 is the second/additional columns to be returned (optional, as this is based on requirement)

* Refer to worksheet - Choosecols


©2022 Grant Thornton Bharat LLP. All rights reserved.
Get relevant rows using CHOOSEROWS
Returns the specified rows from an array

• CHOOSEROWS function allows the specified list of rows to be returned


• Either give the column no.s to be returned as manual hardcoded inputs or use an Excel function to
get it, e.g., XMATCH (as discussed in subsequent slides)

Syntax:
CHOOSEROWS(array,row_num1,[row_num2],…)

– array is the base data containing the rows to be returned


– row_num1 is the first row to be returned
– row_num2 is the second/additional rows to be returned (optional, as this is based on requirement)

* Refer to worksheet - Chooserows


©2022 Grant Thornton Bharat LLP. All rights reserved.
Return relative position of an item
in an array using XMATCH
function

©2022 Grant Thornton Bharat LLP. All rights reserved.


XMATCH to find the position of an item in a list
XMATCH is a new function based on its precursor MATCH function but a lot better!

• 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])

– lookup_value is the value to search for


– Lookup_array is the array or range to search
– [match_mode] can be 0, -1, 1 or 2 depending on requirement of exact / approximate / wild card match
– [search_mode] helps to perform a search starting at the first item or the last item as specified
* Refer to worksheet - Xmatch
©2022 Grant Thornton Bharat LLP. All rights reserved.
Filter, Choosecols & Xmatch – Great combo!
Choose the selected columns from a filtered list using this combo

• Step 1 – Use FILTER function to filter overall data

• 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

Use CHOOSEROWS function in case selected rows are required

* Refer to worksheet - Filter+Choosecols+Xmatch


©2022 Grant Thornton Bharat LLP. All rights reserved.
‘XLOOKUP’: Say bye-bye to the
conventional lookup functions

©2022 Grant Thornton Bharat LLP. All rights reserved.


XLOOKUP: New age lookup function
XLOOKUP function is a modern replacement of old lookup functions like Vlookup, Hlookup

• Can work with both vertical and horizontal data


• Can be used to find the last match instead of the first match
• Can look to left and above the lookup value (removing basic limitations of Vlookup & Hlookup)
• Supports wild card characters
• Can return a range of values also instead of just one value
* Refer to worksheet - Xlookup
Syntax:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

– lookup_value is the value to search for


– Lookup_array is the array or range to search
– Return_array is the array or range to return
– Where a valid match is not found, the [if_not_found] text you supply is returned
– [match_mode] can be 0, -1, 1 or 2 depending on requirement of exact / approximate / wild card match
– [search_mode] helps to perform a search starting at the first item or the last item as specified

©2022 Grant Thornton Bharat LLP. All rights reserved.


XLOOKUP in ‘cross tabulated data’
Nested XLOOKUP function to do a 2-way lookup

• One XLOOKUP function looks for one of the values and generates the return array for the
second XLOOKUP function

• Nested XLOOKUP may be avoided with suitable combination of


– CHOOSECOLS
– XLOOKUP and
– XMATCH

* Refer to worksheet - Xlookup


©2022 Grant Thornton Bharat LLP. All rights reserved.
XLOOKUP in ‘cross tabulated data’ …cont’d

* Refer to worksheet - Xlookup


©2022 Grant Thornton Bharat LLP. All rights reserved.
New age text-oriented functions

©2022 Grant Thornton Bharat LLP. All rights reserved.


TEXTBEFORE & TEXTAFTER to extract text
Conventional functions vs. New age text-based functions

• 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

• Newly added functions in M-365 are far more flexible


– TEXTBEFORE function allows getting the text that's before the specified delimiting characters
– TEXTAFTER function allows getting the text that’s after the specified delimiting characters
– Also allows extracting the text before or after the 'LAST' occurrence of delimiter (with instance no. input as -1)

* Refer to worksheet - Textbefore & Textafter


©2022 Grant Thornton Bharat LLP. All rights reserved.
Split text using delimiters via TEXTSPLIT fn
No more manual splitting of text!

• Conventional options to split text from a cell to multiple columns


– Date Text to Columns
– Flash Fill (Ctrl E)
– Static approach as resultant data is not connected to source data; hence automatic data update isn’t possible

• Newly added TEXTSPLIT function offers dynamic result


– Allows splitting the text from a cell to both row and column based on specified delimiters
– Allows working with multiple delimiters at the same time
– Dynamic result as resultant data is connected to source data

* Refer to worksheet - Textsplit


©2022 Grant Thornton Bharat LLP. All rights reserved.
Assign names to calculation
results inside a formula using
LET function

©2022 Grant Thornton Bharat LLP. All rights reserved.


Define variables in formulae
Simply complex workings using LET function * Refer to worksheet - Let

• 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

©2022 Grant Thornton Bharat LLP. All rights reserved.


Vertically or horizontally
stack arrays

©2022 Grant Thornton Bharat LLP. All rights reserved.


VSTACK overview
Append arrays vertically to return a larger array

• VSTACK returns the array formed by appending each of the array arguments in a row-wise fashion

• The resulting array will have the following dimensions:


– Rows: The combined count of all the rows from each of the array arguments
– Columns: The maximum of the column count from each of the array arguments

Syntax:

=VSTACK(array1,[array2],...)

* Refer to worksheet - Vstack and Hstack


©2022 Grant Thornton Bharat LLP. All rights reserved.
HSTACK overview
Append arrays horizontally to return a larger array

• HSTACK returns the array formed by appending each of the array arguments in a column-wise fashion

• The resulting array will have the following dimensions:


– Rows: The maximum of the row count from each of the array arguments
– Columns: The combined count of all the columns from each of the array arguments

Syntax:

=HSTACK(array1,[array2],...)

* Refer to worksheet - Vstack and Hstack


©2022 Grant Thornton Bharat LLP. All rights reserved.
Application of VSTACK and HSTACK
Creating a pivoted (conditional) count including totals

• Say the base data includes records of employees including name, department, salary, etc.

• Using the base data, create a summary table with 3 sections:


– Header row
– Main data
– Total row * Refer to worksheet - Vstack and Hstack

©2022 Grant Thornton Bharat LLP. All rights reserved.


Return the array as one column
or one row using TOCOL and
TOROW functions

©2022 Grant Thornton Bharat LLP. All rights reserved.


TOCOL function
Return the array as one column

• Use TOCOL function to convert array to a single column

• Options available to ignore certain type of values

Syntax:
=TOCOL(array, [ignore], [scan_by_column])

– array parameter is the array to return as a column


– ignore parameter could take any option including 0 to keep all values (default), 1 to ignore blanks, 2 to ignore
errors and 3 to ignore blanks and errors
– scan_by_column parameter could be True or False. By default, the array is scanned by row. This option decides
whether the values are required to be ordered by row or by column

* Refer to worksheet - Tocol and Torow


©2022 Grant Thornton Bharat LLP. All rights reserved.
TOROW function
Return the array as one row

• Use TOROW function to convert array to a single row

• Options available to ignore certain type of values

Syntax:
=TOROW(array, [ignore], [scan_by_column])

– array parameter is the array to return as a column


– ignore parameter could take any option including 0 to keep all values (default), 1 to ignore blanks, 2 to ignore
errors and 3 to ignore blanks and errors
– scan_by_column parameter could be True or False. By default, the array is scanned by row. This option decides
whether the values are required to be ordered by row or by column

* Refer to worksheet - Tocol and Torow


©2022 Grant Thornton Bharat LLP. All rights reserved.
Data consolidation from multiple
sheets: A comprehensive case of
Microsoft 365 functions

©2022 Grant Thornton Bharat LLP. All rights reserved.


Data consolidation from multiple sheets
Base data of a company included in different sheets to be consolidated at one single place

• Multiple worksheets contain financial data of a company split by region

• Data in different worksheets include varying no. of records

• Final data to be placed a single place ensuring:


– Remove empty records
– Sort the final data based on first column (containing dates)
* Refer to worksheet - Data consolidation
Functions used to solve the problem:

– LET (to define variables)


– VSTACK (to combine overall data from multiple sheets)
– FILTER (to filter the overall data and remove records with no values)
– SORT (to sort the data in chronological order of dates)
– CHOOSECOLS (to choose the first column for sorting)

©2022 Grant Thornton Bharat LLP. All rights reserved.


Wraps a row or a column after a
specified number of values

©2022 Grant Thornton Bharat LLP. All rights reserved.


WRAPCOLS and WRAPROWS functions
Wrap a column or a row after a specified number of values to form a new array

• Both these functions work on similar lines

• One function wraps the data by columns while other one does it by rows

Syntax (similar for both):


=WRAPCOLS(vector, wrap_count, [pad_with]) =WRAPROWS(vector, wrap_count, [pad_with])

– vector is the base data (a row or a column) to wrap


– wrap_count is the maximum number of values for each column (in case of WRAPCOLS) and for each row (in
case of WRAPROWS)
– pad_with is optional but one may provide a value with which to pad in case of no value. If not provided, the
default is #N/A

* Refer to worksheet - Wrapcols and Wraprows


©2022 Grant Thornton Bharat LLP. All rights reserved.
Return an array of random
numbers using RANDARRAY
function

©2022 Grant Thornton Bharat LLP. All rights reserved.


RANDARRAY function
Return an array of random numbers

• Specify the number of rows and columns to fill

• Give the minimum and maximum values

• Whether to return integers or decimal values

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)

* Refer to worksheet - Randarray


©2022 Grant Thornton Bharat LLP. All rights reserved.
New Data Types: Currencies,
Stocks and Geographies

©2022 Grant Thornton Bharat LLP. All rights reserved.


New Data Types
Just type text in cell and convert it to relevant data type to easily get associated data

New Data Types

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.

* Refer to worksheet - New Data Types


©2022 Grant Thornton Bharat LLP. All rights reserved.
Stockhistory function
An easy way to return historical data of stock prices or currency rates

• 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

• This function may be used to get:


– Historical stock prices and related details; and
– Historical currency rates

(Disclaimer: The information provided in Excel may be delayed and should not be used for real time trading purposes)

* Refer to worksheet - New Data Types


©2022 Grant Thornton Bharat LLP. All rights reserved.
Other useful functions added in
Microsoft 365

©2022 Grant Thornton Bharat LLP. All rights reserved.


TAKE function
Take array from start or end

• 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

* Refer to worksheet - Take


©2022 Grant Thornton Bharat LLP. All rights reserved.
DROP function
Drop array from start or 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

* Refer to worksheets - Drop, Drop+Unique+Filter


©2022 Grant Thornton Bharat LLP. All rights reserved.
EXPAND function
Expand an array to the specified row and column dimensions

• 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])

– array is the array to expand


– rows is the number of rows in the expanded array. If missing, rows will not be expanded
– columns is the number of columns in the expanded array. If missing, columns will not be expanded
– pad_with is the value with which to pad (default is #N/A)

* Refer to worksheet - Expand


©2022 Grant Thornton Bharat LLP. All rights reserved.
ARRAYTOTEXT function
Return an array of text values from a given range

• Could be used to simply combine values in different cells together in a single cell without having
to provide any additional input

• Option available to get the result in concise format or strict format

• In the strict format, the vertical data and horizontal data shall be shown differently

Syntax
=ARRAYTOTEXT(array, [format])

– array argument is the array to return as text


– [format] is an optional argument and refers to the format of the returned data. It can be one of two values: 0
(which is default value) for the concise format that is easy to read; and 1 for the strict format

* Refer to worksheet - Arraytotext


©2022 Grant Thornton Bharat LLP. All rights reserved.
LAMBDA: Create reusable
customized functions

©2022 Grant Thornton Bharat LLP. All rights reserved.


LAMBDA function
Create reusable functions in Excel without VBA coding using LAMBDA function

• 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

Steps to be followed for creating reusable LAMBDA functions

Step 1: Write a normal formula in a cell and test it

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

©2022 Grant Thornton Bharat LLP. All rights reserved.


Sample LAMBDA function (Ex. 1)
Lambda to compute growth rate between previous value and current value

* Refer to worksheet - Lambda (Case 1)

GrowthRate(Previous_Value, Current_Value)

©2022 Grant Thornton Bharat LLP. All rights reserved.


Sample LAMBDA function (Ex. 2)
Lambda for Terminal Value Computation in DCF valuation using Gordon Growth Model

* Refer to worksheet - Lambda (Case 2)

TerminalValue(cash_flow, g, k)

©2022 Grant Thornton Bharat LLP. All rights reserved.


Sample LAMBDA function (Ex. 3)
Lambda to get the financial year end date corresponding to a base date
* Refer to worksheet - Lambda (Case 3)

FYEndDate(BaseDate,FYEndMonthNum)

©2022 Grant Thornton Bharat LLP. All rights reserved.


Sample LAMBDA function (Ex. 4)
Lambda to get the financial year end date corresponding to a base date and assume
December if FY end month number is not provided
* Refer to worksheet - Lambda (Case 4)

FYEndDate_D(base_date,[month_num])

©2022 Grant Thornton Bharat LLP. All rights reserved.


Sample LAMBDA function (Ex. 5)
Lambda to get nth look up value
* Refer to worksheet - Lambda (Case 5)

LookupN(LookUpVal, LookUpArray, ResultArray, Num)

©2022 Grant Thornton Bharat LLP. All rights reserved.


LAMBDA helper functions

©2022 Grant Thornton Bharat LLP. All rights reserved.


Lambda helper functions

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

MAP Apply each value in array(s) to lambda function to return result

SCAN Accumulator function to return an array containing “each” intermediate value

REDUCE Accumulator function to return the “last” accumulator value

* Refer to worksheets - Bycol & Byrow, Byrow (Case 2), Map, Scan, Reduce
©2022 Grant Thornton Bharat LLP. All rights reserved.
Thank you for your attention

You might also like