SlideShare a Scribd company logo
MS Excel
Day 1 - Introduction
Versions of Excel…
Limits of Excel…
For more of Excel Specifications & limits:
https://support.microsoft.com/en-gb/office/excel-specifications-and-limits-
1672b34d-7043-467e-8e27-269d656771c3
Interface of Excel…
Excel 2010 interface: File tab with
backstage view. Customize Ribbon and
more
Excel 2007 interface: Colourful Office
button with dropdown box . Tabs and
commands on Ribbon introduced.
Interface of Excel…
Excel 2013 interface: File tab with
numerous templates in backstage view and
more data analysis options . Flash fill, quick
analysis and more
Interface of Excel…
Customizing the Interface…
Paste & Paste Special…
Formatting in Excel…
ETL step 1 is correct Formatting to
respective Variables in the dataset.
Number Format commands are present in
‘Home’ tab.
Data Fill…
 Put the mouse pointer over the bottom right-hand corner of the cell
until it's a black plus sign.
 Click and hold the left mouse button, and drag the plus sign over the
cells you want to fill.
 And the series is filled in for you automatically using the AutoFill
feature.
 The Fill Series tool can readily handle any list of days, months, or
years and take them all in stride.
 Filling can be used for:
 Copying
 Sequences
 Dates
Fill Series Dialogue box…
 The Series dialog box contains loads of options but most of them are automatically selected
because the value in cell A1 is a date. Let’s take a look:
 I want to fill my dates down column A, so I need ‘Columns’ selected.
 Excel has detected that I’m using Dates because I have a date in cell A1.
 It has also assumed I want to increase my series by days, as opposed to weekdays, months or
years.
 And the step value is one day at a time.
 All I need to do is enter the Stop value, which is the last date in my series.
Flash Fill…
 Excel Flash Fill is a special tool that analyzes the information you are
entering and automatically fills data when it identifies a pattern.
Justify Fill…
 An interesting tool within Excel is the Fill Justify. It allows you to select text
from several rows and merge them in to one cell.
Keyboard Shortcuts…
Keyboard Shortcuts…
Keyboard Shortcuts…
For more Shortcuts:
https://support.microsoft.com/en-gb/office/keyboard-shortcuts-in-excel-
1798d9d5-842a-42b8-9c99-9b7213f0040f
MS Excel
Day 2 – Referencing, Named Ranges &
Functions
Cell Referencing…
 A cell reference refers to a cell or a range of cells on a worksheet and can be
used in a formula so that Microsoft Office Excel can find the values or data
that you want that formula to calculate.
One Time $A$3 Absolute
Second Time A$3 Mixed: Row fixed
Third Time $A3 Mixed: Column fixed
Fourth Time A3 Relative
 A relative cell reference refers to cells in relation to the cell that contains the
formula. When the formula is moved, it references new cells based on their
location relative to the formula. A relative cell reference is the default type of
Excel cell reference.
 A relative cell reference does not use any dollar sign ($) before the column
address or the row address. When a formula is copied or dragged to another cell
or range, relative cell reference changes accordingly.
 An absolute cell reference always refers to a specific cell or range of cells,
regardless of where the formula is located in the worksheet, even when the
formula is copied to any other cell in the worksheet. The row and column
references do not change after copying the formula because the reference is to an
actual cell address.
 An absolute reference uses two dollar signs ($) in its address: one for the column
letter and one for the row number.
 A mixed cell reference is an Excel cell reference that uses an absolute column or
row reference, but not both. Only one of the address parts is absolute.
 A mixed cell reference uses a dollar sign ($) either before the column address or
before the row address. It is a combination of relative and absolute references
(mixed reference type in excel).
Cell Referencing…
Cell Referencing…
Name Range…
 When we write formulas/functions, we need to select a range of cells. However, doing
this can be time consuming and error prone.
 Excel allows us to use a cell or a range of cells by its name. E.g. Sum(Basic) sounds
much easier compared to sum(H2:H101).
 However to do this, first we would need to name the range H2:H10 as Basic.
 You can name a single cell, group of cells, Cell ranges (Row/s, Column/s). A Table (data
matrix) can also be named.
Top 5 benefits of using names in Excel
 Excel names make formulas easier to make and read.
 Excel names allow creating expandable formulas.
 Excel names make formulas easier to re-use.
 Named ranges simplify navigation.
 Named ranges allow creating dynamic drop-down lists.
Name Range…
Rules for creating Name Range…
When creating a name in Excel, there are a few rules to remember:
 An Excel name should be under 255 characters long.
 Excel names cannot contain spaces and most punctuation characters.
 A name must begin with a letter, underscore (_), or backslash (). If a name
begins with anything else, Excel will throw an error.
 Excel names are case-insensitive. For example, "Apples", "apples" and
"APPLES" will be treated as the same name.
 You cannot name ranges like cell references. That is, you can't give the name
"A1" or "AA1" to a range.
 You can use a single letter to name a range like "a", "b", "D", etc. except for
the letters "r" "R", "c", and "C" (these characters are used as shortcuts for
selecting a row or column for the currently selected cell when you type them
in the NameBox).
Functions…
 A function in Excel is a preset formula, that helps perform mathematical,
statistical and logical operations.
 Once you are familiar with the function you want to use, all you have to do is
enter an equal sign (=) in the cell, followed by the name of the function and
the cell range it applies to.
Different types of functions are:
 Text / string functions
 Logical functions
 Math functions
 Statistical functions
 Lookup and reference functions
 Financial functions
 Date functions
 Time functions
Function Description
=AND Returns TRUE or FALSE based on two or more conditions
=AVERAGE Calculates the average (arithmetic mean)
=AVERAGEIF Calculates the average of a range based on a TRUE or FALSE condition
=AVERAGEIFS Calculates the average of a range based on one or more TRUE/FALSE conditions
=CONCAT Links together the content of multiple cells
=COUNT Counts cells with numbers in a range
=COUNTA Counts all cells in a range that has values, both numbers and letters
=COUNTBLANK Counts blank cells in a range
=COUNTIF Counts cells as specified
=COUNTIFS Counts cells in a range based on one or more TRUE or FALSE condition
=IF Returns values based on a TRUE or FALSE condition
=IFS Returns values based on one or more TRUE or FALSE conditions
=LEFT Returns values from the left side of a cell
=LOWER Reformats content to lowercase
=MAX Returns the highest value in a range
=MEDIAN Returns the middle value in the data
=MIN Returns the lowest value in a range
=MODE Finds the number seen most times. The function always returns a single number
=NPV The NPV function is used to calculate the Net Present Value (NPV)
=OR Returns TRUE or FALSE based on two or more conditions
=RAND Generates a random number
=RIGHT Returns values from the right side of a cell
=STDEV.P Calculates the Standard Deviation (Std) for the entire population
=STDEV.S Calculates the Standard Deviation (Std) for a sample
=SUM Adds together numbers in a range
=SUMIF Calculates the sum of values in a range based on a TRUE or FALSE condition
=SUMIFS Calculates the sum of a range based on one or more TRUE or FALSE condition
=TRIM Removes irregular spacing, leaving one space between each value
=VLOOKUP Allows vertical searches for values in a table
=XOR Returns TRUE or FALSE based on two or more conditions
In the same manner, other required functions can be
used for various calculations.
You can use the functions as per your objective.
Function Argument box, without and with
formula in the cell
CTRL+A OR SHIFT + f3
Keyboard shortcut to open Function
Argument box, with formula in the cell
Creating a Function…
Count Function…
SYNTAX OF FUNCTIONS
COUNT =COUNT(VALUE1,VALUE2,…)
COUNTA =COUNTA(VALUE1,VALUE2,…)
COUNTBLANK =COUNTBLANK(RANGE)
COUNTIF =COUNTIF(RANGE,CRITERIA)
COUNT ONLY
CELLS THAT
CONTAINS
NUMBER.
COUNTA
CELLS THAT
ARE NOT
EMPTY.
COUNTBLANK
CELLS THAT
ARE EMPTY.
COUNTIF
CELLS WITH
SPECIFIC
CONDITION
Sumif Function…
SYNTAX OF SUMIF
=SUMIF(RANGE,CRITERIA,SUM_RANGE)
RANGE-
Range of cells on which conditions are applied.
CRITERIA-
Condition that defines which cell or cells will be added.
SUM RANGE-
Actual cells to sum.
NOTE:-
If sum range is not used then range is used for sum.
The absolute value of a number
ABS
The average or arithmetic mean for a group of numbers
AVERAGE
The number of cell locations in a range that contain a numeric character
COUNT
The number of cell locations in a range that contain a text or numeric character
COUNTA
The highest numeric value in a group of numbers
MAX
The lowest numeric value in a group of numbers
MIN
Returns the serial number of the current date and time
NOW
Returns the serial number of today's date
TODAY
Returns the serial number of a particular date
DATE
Returns the year fraction representing the number of whole days between
start_date and end_date
YEARFRAC
Use this function to return the number of days between two dates.
DAYS
Returns the number of whole workdays between two dates using parameters to
indicate which and how many days are weekend days
NETWORKDAYS.INTL
Statistical & Date Functions…
Arithmetic & Logical Functions…
ROUNDS a number to a specified number of digits
ROUND
Returns an aggregate list of database , ignores errors and blanks
AGGREGATE
Check whether condition is met, TRUE if met, FALSE, if not
IF
To check more than one conditions, all should met then TRUE
otherwise FALSE
AND
To check more than one conditions, any one should met then TRUE
otherwise FALSE
OR
Returns addition of the range as per conditions specified
SUMIFS
Returns count of the range as per conditions specified
COUNTIFS
MS Excel
Day 3 –Logical Functions, Math & Trig Functions
Logical Functions
 The Logical button functions are based on the logic. Also, the logical operators are used.
 These are, the Less than (<), Greater than (>), Equal To (=) and the Not Equal To (<>) etc.
 Additionally, are the Less Than Equal To (<=) and the Greater Than Equal To (>=).
 Notably, the Equal To Less Than (=<) or the Equal To Greater Than (=>) is an invalid operator.
 Hence, use of the “Equal To operator” before the “Less or Greater Than”, shouldn’t
be done.
 AND function checks for arguments whether TRUE or not.
 FALSE function returns with false for the logical values.
 IF checks whether a condition is TRUE or FALSE and returns the answer accordingly.
 IFERROR helps users to hide the result errors. These are errors might be from other
functions. Also, we could temporarily provide with our own results in place of the errors.
 IFNA displays the value specified by user, if the result of function is #N/A.
 NOT function changes the result to True with False and False with True.
 OR helps users to with a result, checking whether argument is True or False.
 TRUE function displays with a logical value True.
 XOR shows with a logical ‘Exclusive Or’ for all the provided arguments.
Logical Functions
If Function…
SYNTAX OF IF
=IF(LOGICAL TEXT, VALUE IF TRUE, VALUE IF FALSE)
IN COLUMN B DIFFERENT
CONDITIONS ARE USED AND
BASED ON THIS, IN COLUMN C
DIFFERENT RESULTS ARE SHOWN.
LOGICAL TEXT-
Any value or expression that can be evaluated to
TRUE or FALSE.
VALUE IF TRUE-
Value that is returned if logical text is TRUE.
VALUE IF FALSE-
Value that is returned if logical text is FALSE.
Math & Trig Functions…
The Math Trig button has currently seventy four functions
Usage Of Math/Stat And Logical Together…
 A function may also be "nested" (or embedded) inside of
an IF-THEN function.
 This enables you to carry out complex calculations and
then contrast the real outcomes with what was
anticipated.
 Consider a spreadsheet with five pupils' grades listed in
column B for the purposes of this example.
 You could use the AVERAGE function to aver these scores.
Cell C2 may yield "Excellent!" or "Needs Work" depending
on the results of the class average. This is how the IF-
THEN code would be entered:
 =IF(AVERAGE(B2:B6)>85,"Excellent!","Needs Work")
Nested If…
 An IF function inside another IF function is
known as a stacked IF function. When we
need to deal with greater than two
conditions, nested if statements become
useful.
 Let's imagine that we want to create a
Formula that verifies the day of the week.
 If it's a Saturday, remember to "party
well,"
 if it's a Sunday, remember to "take
some time to rest,"
 and if it's any day of the week from
Monday to Friday, remember to cross
everything off your to-do list.
 The formula for the flowchart is as follows
 =IF(B1=”Sunday”,”time to
rest”,IF(B1=”Saturday”,”party well”,”to do
list”))
it's a Saturday
party well it's a Sunday
take some time
to rest
If it's any day of
the week
remember to
cross everything
off your to-do list
If Error…
 You can indicate what should happen
if a formula or cell reference returns
an error by using the IFERROR
function.
 The IFERROR syntax:
 =IFERROR(value, value_if_error)
 value is the argument that's true and
is verified. It generally includes a
formula or a cell reference.
 The ‘value’ that is to be returned in
the event of an error is
value_if_error. #N/A, #REF!, #DIV/0!,
#VALUE!, #NUM!, #NAME?, and #NULL!
were assessed as error types.
MS Excel
Day 4 – Lookup Functions
Lookup Functions…
Notably, the functions often used, are the VLookUp, Hyperlink, Index and the Match.
 ADDRESS function makes a cell reference as text, given stated row and column numbers.
 AREAS function shows the number of areas in a reference. Especially, An area is a range of
adjoining cells or a single cell.
 CHOOSE function selects a value from a list of values, based on an index number.
 COLUMN function displays the column number of a reference.
 COLUMNS function shows the number of columns in an array or reference.
 FORMULATEXT function displays a formula as a string.
 GETPIVOTDATA function extracts data stored in a PivotTable.
 HLOOKUP function sees for a value in top row of a table, and shows value in the same
column
 INDEX function shows a value at the intersection of a precise row and column, in a
specified range.
Lookup Functions…
 INDIRECT function displays the reference stated by a text string.
 LOOKUP function sees up a value, either from a one-row or one-column range or from
an array.
 MATCH shows comparative position, of an item in an array, that matches a specified
value in a specified order.
 OFFSET function displays a reference to a range, from a given reference of Row &
Columns.
 ROW function shows the row number of a reference.
 ROWS function displays the number of rows in a reference or array.
 RTD function fetches real-time data from a program that supports the COM automation.
 TRANSPOSE function changes a vertical range of cells to a horizontal range, or vice
versa.
 VLOOKUP function sees for a value in the leftmost column of a table. And then returns
a value in the same row, from a specified column.
Lookup Functions…
Vlookup Function…
 VLOOKUP stands for Vertical Lookup(Search)
 V‐lookup is a function that searches for a value (lookup value) in
the leftmost column of a given database (table array)and returns a
value in the same row from a column you specify.
 Application of Look up functions
 Fetch the values of a column from some other file or sheet based
on a common field.
 Merge two datasets
 Compare 2 files
However, VLOOKUP() has been known to give
error prone results.
•You should have minimum 2 different data tables/files (Master data and
Source data)
•Master data and Source data should have at least one common column
(same data and format)
•Common Column in the Source data should be placed as ‘Left most column’
within the dataset.
To apply it correctly, ensure following
conditions are met by your data and files
All these conditions must be taken care of
before and while applying the function.
 Lookup_value is the value to be found in the first column of the table. It is the value that you are looking for.
Lookup_value can be a value, a reference or a text string.
 Table_array is the table of information in which data is looked up. It is the source database. Use a reference to a
range or a range name.
 Col_index_num is the column number in table_array from which the matching value must be returned.
 Range_lookup is a logical value that specifies whether you want VLOOKUP to find an exact match or an
approximate match. If Range Lookup is set as FALSE or 0, VLOOKUP will find an exact match. If exact match is not
found, the error value #N/A is returned. If it is set to TRUE or non‐zero, it finds the nearest value that is less than
lookup value
Vlookup Function…
Syntax=vlookup(lookup_value, table_array,
col_index_num, range_lookup)
VLOOKUP( lookup_value, table_array, col_index_num, [range_lookup] )
Master Table: Where we want to fetch the data == where
VLOOKUP() is applied.
Source table: From where we source the desired data ==
selected in ‘Table_array’ argument. Always fix it or name
it.
Vlookup Function…
Hlookup Function…
•H‐lookup function searches for a value in the top most row of a table, and then returns a value in the same
column from a row you specify.
H‐lookup works the same way as V‐lookup. However, in this case we need to specify the row index number instead
of the column index number
Perquisites to be checked will remain same as Vlookup().
Syntax=hlookup(lookup_value, table_array,
row_index_num, range_lookup)
Match Function…
•The MATCH function searches for a specified item in a range of cells, and then
returns the relative cell position of that item in the source table range.
MATCH(lookup_value, lookup_array, [match_type])
• Lookup_value is the value to be found in the first column of the table. It is the
value that you are looking for. Lookup_value can be a value, a reference or a
text string.
•Lookup_array is the table of information in which data is looked up. It is the
source database. The range of cells being searched
•Col_index_num is the column number in table_array from which the
matching value must be returned.
•match_type is a logical value that specifies whether you want to find an exact
match or an approximate match. (Optional) The number -1, 0, or 1
Here, formula result ‘5’ is the cell position of ‘Units’ Column headers.
Vlookup with Match…
Match identifies the ‘Col_index_num’ of Vlookup(), thus creating a Dynamic lookup. Easy to
merge the tables with one common column and same spelling of headers.
 We have a database where our lookup value is in the middle and we need to search towards the left, we
would have to move the column to the left most corner before we use vlookup.
INDEX(array,[MATCH(lookup_value,lookup_array,[match_type])],[Match(lookup_value,
lookup_array,[match_type])])
 Index function when used along with match helps us search for the data even if the lookup value is not
present on the left-most column.
 Definitions for the arguments remain same
 INDEX() output is Cell Value written inside the cell, MATCH() will guide towards the correct Cell position
in the dataset or data matrix.
 NO Prerequisites need to be checked before applying this combo.
Index with Match…
 To pull the extension from column B based on the office number in D2? With this regular Vlookup formula:
 =VLOOKUP($D$2,$A$2:$B$7,2,FALSE)
 And it will work nicely as long as your users enter a valid number in D2. But what if a user inputs some number
that does not exist?
 # N/A Error will appear.
 In the above formula in the value argument of IFERROR, and put another Vlookup in the value_if_error
argument.
 =IFERROR(VLOOKUP($D$2,$A$2:$B$7,2,FALSE),”Not Found”)
Vlookup with Iferror…
Nested Vlookup…
Assuming the lookup value is in cell A2 in the current sheet, and the lookup range is A2:B5 in 3
different worksheets (North, South and West), the following formula works a treat:
=IFERROR(VLOOKUP(A2,North!$A$2:$B$5,2,FALSE),
IFERROR(VLOOKUP(A2,South!$A$2:$B$5,2,FALSE),
IFERROR(VLOOKUP(A2,West!$A$2:$B$5,2,FALSE),"Not found")))
Indirect Function…
 The INDIRECT function in Excel returns a cell reference from a text string. It has two
arguments, the first is required and the second is optional:
 INDIRECT(ref_text, [a1])
 ref_text - is a cell reference, or a reference to a cell in the form of a text string, or a
named range.
 a1 - is a logical value that specifies what type of reference is contained in the ref_text
argument:
 If TRUE or omitted, ref_text is interpreted as an A1-style cell reference.
 If FALSE, ref_text is treated as a R1C1 reference.
 You can switch between the two reference types via File > Options > Formulas > R1C1
check box.
Offset Function…
 The OFFSET function in Excel returns a cell or range of cells that is a given number of
rows and columns from a given cell or range.
 The syntax of the OFFSET function is as follows:
 OFFSET(reference, rows, cols, [height], [width])
 The first 3 arguments are required and the last 2 are optional. All of the arguments can
be references to other cells or results returned by other formulas.
 Reference - a cell or a range of adjacent cells from which you base the offset. You can
think of it as the starting point.
 Rows - The number of rows to move from the starting point, up or down. If rows is a
positive number, the formula moves below the starting reference, in case of a negative
number it goes above the starting reference.
 Cols - The number of columns you want the formula to move from the starting point. As
well as rows, cols can be positive (to the right of the starting reference) or negative (to
the left of the starting reference).
 Height - the number of rows to return.
 Width - the number of columns to return.
 Both the height and width arguments must always be positive numbers.
Offset Function…
MS Excel
Day 5 – Combination of Functions &
Data Validation
Combination of Functions…
 =VLOOKUP(G4,CHOOSE(IF(H2="Unit
Test",1,IF(H2="Midterm",2,3)),$A$3:$E$7,$A$1
1:$E$15,$A$19:$E$23),MATCH(H3,$A$2:$E$2,0
),0)
 This formula uses the CHOOSE function to
make sure the right table is referred to. Let’s
analyze the CHOOSE part of the formula:
 CHOOSE(IF(H2=”Unit
Test”,1,IF(H2=”Midterm”,2,3)),$A$3:$E$7,$A$
11:$E$15,$A$19:$E$23)
 The first argument of the formula
is IF(H2=”Unit Test”,1,IF(H2=”Midterm”,2,3)),
which checks the cell H2 and see what level of
exam is being referred to. If it’s Unit Test, it
returns $A$3:$E$7, which has the scores for
Unit Test. If it’s Midterm, it
returns $A$11:$E$15, else it
returns $A$19:$E$23.
 Excel's wildcard symbols come in handy in a
variety of circumstances.
 When searching for a value in a list and there
isn't a precise match, partial look-up is necessary.
 For instance, let's say you have the data set
below and you want to search for the business
ABC in a list, but the list contains ABC Ltd rather
than ABC. Since there is no precise match in
column A, you cannot use ABC as the lookup
value.
 Additionally, approximate match produces
inaccurate results and necessitates sorting the
list in increasing order.
 To find the match, you can use a wildcard
character within the VLOOKUP method.
 =VLOOKUP("*"&C2&"*",$A$2:$A$8,1,FALSE)
Combination of Functions…
Case Sensitive Vlookup…
Note: In all Excel versions other than Excel 365, this only works as an array
formula, so remember to press Ctrl + Shift + Enter to complete it correctly. In
Excel 365, due to support for dynamic arrays, it also works as a regular formula.
How this formula works:
 The core part that does the trick is the CHOOSE formula with nested
EXACT:
 CHOOSE({1,2}, EXACT(F2, A2:A7), B2:B7)
 Here, the EXACT function compares the value in F2 against each value in
A2:A7 and returns TRUE if they are exactly the same including the letter
case, FALSE otherwise:
 {FALSE;FALSE;FALSE;TRUE;FALSE;FALSE}
 For the index_num argument of CHOOSE, we use the array constant {1,2}.
As the result, the function combines the logical values from the above
array and the values from C2:C7 into a two-dimensional array like this:
 {FALSE,155;FALSE,186;FALSE,90;TRUE,54;FALSE,159;FALSE,28}
 The VLOOKUP function takes it from there and searches for the lookup
value (which is TRUE) in the 1st column of the 2-dimensional array
(represented by the logical values) and returns a match from the 2nd
column, which is the price we are looking for:
 VLOOKUP(TRUE,
{FALSE,155;FALSE,186;FALSE,90;TRUE,54;FALSE,159;FALSE,28}, 2, 0)
Data Validation…
 Suppose you do not want the user to enter a
non text value in a cell or you want to restrict
data entry to certain values. You may use Data
Validation for these.
 Data Validation is a process which restricts the
users from entering invalid data for individual
cells or cell ranges.
 Error pop-up box indicates correct value to be
entered.
 It limits the data entry to a particular type,
such as whole numbers, decimal numbers or
text and sets limit on valid entries.
Note:- If you do not enter a title or text, the title defaults to "Microsoft Excel" and the
message to "The value you entered is not valid. A user has restricted values that can
be entered into this cell."
Data Validation Rules…
 Setting Data Validation Rules
 Select the cells for which you want to create a
validation rule.
 On the Data tab, in the Data Tools group, click Data
Validation to open the Data Validation dialog box.
 Activate the Settings tab.
 From the Allow list, select a data validation option.
 From the Data list, select the operator you want.
Then complete the remaining entries.
 Enter the Input Message if required in Input Message
tab.
 Enter the error message if required in Error Alert tab.
 Click OK to set the validation rule and close the
dialog box.
Data Validation List…
Creating a Drop down List
 A list is an effective form of data validation where the user
is allowed to select an option from a drop‐down list which is
built‐in to the cell.
 The data source may be written manually by the user or
selected from the same sheet.
Steps are as follows:
 Select a blank cell
 Select Data Tab
 Select Data Validation from Data Tool group
 Select List
 In Source, select the cell with values, or type the data with
comm
Tip: If the source is from a different sheet, create a ‘named
range’ for all the values and use the name in the Source field for
Data Validation.
Note:- If you are working on MS Office 2007, you need to copy
paste list in the same sheet as dropdown list. In this old version,
DV is not equipped to reference cell range from another sheet.
MS Excel
Day 6 – Date Function & Text
Function
Date & Time Function…
 DATE function shows the number that denotes the date in Microsoft Excel Date-Time
Code.
 DATEVALUE function changes a date, in the form of text to a number, that denotes the
date.
 DAY function shows the day of the month, a number from One (1) to Thirty One (31).
 DAYS function shows the number of days among the two dates.
 DAYS360 function shows the number of days between two dates, based on a year i.e.
(360-day).
 EDATE displays the serial number of date, before or after start date, i.e. the
marked number of months.
 EOMONTH shows the serial number of last day of month, before or after a
stated number of months.
 HOUR function shows the hour as a number, from Zero (0) to Twenty Three (23) i.e.
(12:00 A.M.) to (11:00 P.M.).
 ISOWEEKNUM function displays the ISO Week number in the year for a specified date.
 MINUTE function shows the minute, a number from Zero (0) to Fifty Nine (59).
Date & Time Function…
 MONTH function displays the month, a number from One (1) for January to Twelve (12) for
December.
 NETWORKDAYS function shows the number of entire workdays among two dates.
 NETWORKDAYS.INTL shows the number of entire workdays among two dates with custom weekend
limits.
 NOW function displays the current date and time, formatted as a date and time.
 SECOND function shows the second, a number from Zero (0) to Fifty Nine (59).
 TIME function changes specified numbers i.e. Hours, Minutes, and Seconds to an Excel serial number,
formatted with a time format.
 TIMEVALUE function changes a text time to an Excel serial number for a time.
 TODAY function shows the current date formatted as a date.
 WEEKDAY displays a number, recognizing day of the week of a date, from One (1) to Seven (7).
 WEEKNUM function shows the week number in the year.
 WORKDAY function displays the serial number of the date, before or after a specified number
of workdays.
 WORKDAY.INTL shows the serial number of the date, before or after a stated number of workdays
with custom weekend limits.
 YEAR function displays the year of a date.
 YEARFRAC function shows the year fraction, illustrating the number of entire days, among start date
and end date.
Date & Time Function…
DateDif Function…
SYNTAX OF DATEDIF
=DATEDIF(START_DATE,END_DATE,
”INTERVAL”)
“ D ” - D AY S
“ M ” - M O N T H S
“ Y ” - Y E A R S
“ Y M ” - M O N T H S O V E R Y E A R
“ M D ” - D AY S O V E R M O N T H
START DATE-
Date from which u want to calculate difference.
END DATE-
Date up to which u want to calculate difference.
INTERVAL-
Form in which u want to calculate difference.
Text Functions…
 BAHTTEXT function helps to converts a number to text i.e. BAHT.
 CHAR function displays the character from the character set, stated by the code number.
 CLEAN function eliminates all the non-printable characters from the texts.
 CODE function shows a numeric code for initial character in a text string, in the character set.
 CONCATENATE function combines multiple text strings into one text string.
 DOLLAR function converts a number to text by using the Currency Format.
 EXACT returns True or False by checking whether two text strings are same or not.
 FIND function returns the foremost position of one text string within another. Notably, this FIND
function is Case-Sensitive function.
 FIXED function shows text result with or without commas, by rounding a number to stated number of
decimals.
 LEFT function shows specified number of characters from the starting from the Left Hand Side of a
text string.
 LEN function displays the numbers of characters in a text string.
 LOWER function changes all the letters in a text string to lowercase.
 MID function shows characters from the middle of text string, provided with a initial position and
length.
 NUMBERVALUE function changes text to number in a locale-independent manner.
Text Functions…
 PROPER changes the first letter in each word to “UPPERCASE”, and all other letters to
“lowercase”.
 REPLACE function with a different text string in a part of text string.
 REPT function helps to repeat a certain text provided number of times.
 RIGHT function shows specified number of characters from the starting from the Right Hand
Side of a text string.
 SEARCH shows the number of the character from left to right, at which a specific character
gets first found.
 SUBSTITUTE function replaces existing text with new text in a text string.
 “T” function checks whether a value is text, and returns text, or blank text, if it is or isn’t.
 TEXT function changes a value to text in a stated number format.
 TRIM function eliminates all the spaces except for single spaces between words, from a text
string.
 UNICHAR function shows the Unicode character referenced by the provided numeric value.
 UNICODE function displays the number (Code Point) corresponding to the initial character of
the text.
 UPPER functions changes a text string to all uppercase letters.
 VALUE function changes a text string that denotes a number to a number.
Text Functions…
Text Function…
SYNTAX OF FUNCTIONS
1. LOWER FUNCTION
=LOWER(TEXT)
2. UPPER FUNCTION
=UPPER(TEXT)
3. PROPER FUNCTION
=PROPER(TEXT)
LOWER
TO CONVERT
TEXT FROM
CAPITAL TO
SMALL.
UPPER
TO CONVERT
TEXT FROM
SMALL TO
CAPITAL.
PROPER
TO CAPITALISED
EACH WORD OF
TEXT.
Text Functions…
SYNTAX OF FUNCTIONS
1. LEFT FUNCTION
=LEFT(TEXT,NUM_CHARS)
2. RIGHT FUNCTION
=RIGHT(TEXT,NUM_CHARS)
3. MID FUNCTION
=MID(TEXT,STARTNUM,NUM_CHAR)
LEFT
RETURN
SPECIFIED NO.
OF CHARACTER
FROM START OF
TEXT.
RIGHT
RETURN
SPECIFIED NO.
OF CHRACTER
FROM END OF
TEXT.
MID
RETURN
CHARACTER FROM
MIDDLE OF
TEXT,GIVEN A
STARTING
POSITION.
Other Functions…
NOW RETURNS CURRENT DATE AND TIME.
TODAY RETURNS CURRENT DATE ONLY.
MOD RETURNS THE REMAINDER AFTER A NO.
IS DIVIDED BY A DIVISOR.
LEN RETURNS THE NO. OF CHARACTERS IN A
TEXT STRING.
SUM ADD ALL THE NUMBERS.
MS Excel
Day 7 – Data Cleaning, Data
Formatting, Filtering & Sorting
Number Formatting…
Customer Number Formatting…
Number Formatting shortcuts…
Creating Table in Excel…
Removing a table in Excel…
Below are the steps to remove the Excel table formatting:
 Select any cell in the Excel table.
 Click the Design tab (this is a contextual tab and only appears when you click
any cell in the table)
 In Table Styles, click on the More icon (the one at the bottom of the small
scrollbar.
 Click on the Clear option.
Table Design Tab…
Filtering in Excel…
The filter in excel helps display relevant data by
eliminating the irrelevant entries temporarily
from the view.
The data is filtered as per the given criteria.
The purpose of filtering is to focus on the
crucial areas of a dataset.
Keyboard shortcuts
• SHIFT+CTRL+L
• ALT+D+F+F
Filtering in Excel…
Sorting in Excel…
TO SORT IN ALPHABETICAL ORDER:
Select a cell in the column you want to sort (In this
example, we choose a cell in column Q).
Click the Sort & Filter command in the Editing group on
the Home tab.
Select Sort A to Z. Now the information in the Category
column is organized in alphabetical order.
TO SORT FROM SMALLEST TO LARGEST:
Select a cell in the column you want to sort (In this
example, we choose a cell in column Q).
Click the Sort & Filter command in the Editing group on
the Home tab.
Select From Smallest to Largest. Now the information is
organized from the smallest to largest amount.
Sorting Date & Number…
Custom Sort…
MS Excel
Day 8 – Conditional formatting &
Data Visualisation
Conditional Formatting…
Conditional Formatting…
Custom Conditional Formatting…
Data Tab in Excel…
Text to Column (Data Split)…
Text to Column (Data Split)…
Bar Chart…
Formatting the Charts…
Formatting the Charts…
Formatting the Charts…
Column & Line Chart…
Scatter Plot…
Combo & Pie Chart…
Gantt Chart…
Steps of Gantt Chart…
Steps of Gantt Chart…
Steps of Gantt Chart…
Water Fall Chart…
MS Excel
Day 9 – Data Summarization: Pivot
Pivot…
Click here
to open
 A Pivot Table is an interactive worksheet based table that quickly summarizes
large amounts of data using the format and calculation methods you
choose.
 It is called a Pivot Table because you can rotate its row and column headings
around the core data area to give you different views of the source data.
 As source data changes, you can update a pivot table. It resides on a
worksheet thus; you can integrate a Pivot Table into a larger worksheet model
using standard formulas.
 A PivotTable is a powerful tool to calculate, summarize, and analyze data that
lets you see comparisons, patterns, and trends in data. Which can be present
in an Excel workbook or imported from an external database such as Microsoft
Access or SQL Server and 98 more sources
 PivotTables work a little bit differently depending on what platform you are
using to run Excel.
Tip: Pivot table options and features differ from version to version. Basic functions will be
available with all versions. Advanced features like Recommended Pivot tables, Power Pivot was
introduced with 2013 version.
Click here
to open
Pivot Reports…
The data on which a PivotTable is
based is called the Source Data.
Each column represents a field or category
of information, which you can assign to
different parts of the PivotTable to
determine how the data is arranged.
You can add four types of fields, The
fields are explained in the following
tables.
Sample Pivot reports…
Unique_Advisor_Id Sum of AUM Average of Units
1000103 245350.67 2256.07
1000373 284189.18 2140.27
1000474 68185.38 674.90
1000541 61997.18 1070.29
1000973 120859.32 1885.18
1001058 281424.73 3762.53
1001478 41411.28 3445.20
1001667 395481.61 3034.54
1001726 402228.92 3714.59
1002143 782189.49 4799.98
Grand Total 2683317.74 2954.04
Unique_Advisor_Id Count of Unique_Investment_Id
1000103 6
1000373 10
1000474 5
1000541 4
1000973 6
1001058 6
1001478 1
1001667 9
1001726 10
1002143 13
Grand Total 70
category Average of category_return_10years Average of rating
Allocation - 50% to 70% Equity 7.13 4
Allocation - 70% to 85% Equity 7.46 5
Diversified Emerging Mkts 2.3 3
Emerging Markets Bond 3.95 3
Foreign Large Blend 3.65 3
Global Real Estate 4.33 2
High Yield Bond 5.06 3
Intermediate Core Bond 3.4 3
Large Blend 11.28 3
Large Growth 14.19 3
Large Value 8.64 2
Mid-Cap Growth 12.76 1
Multialternative 2.31 2
Muni New York Long 3.56 1
Muni Pennsylvania 3.52 2
Muni Single State Long 3.26 1
Small Blend 8.48 2
Small Value 6.39 3
Tactical Allocation 4.26 3
Technology 16.17 5
World Allocation 4.61 3
World Large Stock 7.53 2
fund_mean_annual_return_10years Count of category
0-0.5 15
0.5-1 12
1-1.5 6
1.5-2 1
Grand Total 34
Charts in Pivot…
 Sometimes it's hard to see the big picture when your raw data hasn’t been
summarized. Your first instinct may be to create a PivotTable, but not
everyone can look at numbers in a table and quickly see what's going on.
PivotCharts are a great way to add data visualizations to your data.
 A pivot chart is the visual representation of a pivot table in Excel. Pivot
charts and pivot tables are connected with each other.
 A ‘pivot chart’ adds value and category series by dragging the field name
onto axes instead of choosing the chart wizard. A 'normal' chart is usually
based on a range of data in row and columns.
 Source data of standard charts are linked directly to worksheet cells, while
PivotCharts are based on their associated PivotTable's data source. Unlike a
standard chart, you cannot change the chart data range in a PivotChart's
‘Select Data Source’ dialog box.
 Keep it simple, avoid 3D graphs
Slicer in Pivot…
 Slicers in Excel are software filters used along with
excel tables or pivot tables over a large amount of
data.
 It is used for filtering out the data plus it helps with an
easy understanding of the information being extracted
and displayed on the screen.
 Add slicer to your report by
 Go to Insert tab > Slicer.
 In the Insert Slicers dialog box, select the check
boxes for the fields you want to display, then
select OK.
 A slicer will be created for every field that you
selected. Clicking any of the slicer buttons will
automatically apply that filter to the linked table
or PivotTable.
Tip: Slicer was introduced in 2010, then enhanced in 2013 with introducing
‘Timeline’.
When adding Slicer In Dashboard, you need to ‘Report Connections’ to connect
multiple reports to one slicer or timeline.
Interestingly, this option in 2010, was called ‘Pivot table connections’.
Slicer to be added in standard excel report
Slicer to be added in Pivot report
Multiple Pivot Connections using Slicer…
 STEP 1: Create 2 Pivot Tables by clicking in your data set and selecting Insert >
Pivot Table > New Worksheet/Existing Worksheet
 STEP 2: Click in Pivot Table #1 and insert a MONTH Slicer by going to PivotTable
Tools > Analyze/Options > Insert Slicer > Any Column > OK
 STEP 3: Click in Pivot Table #2 and insert a YEAR Slicer by going to PivotTable Tools
> Analyze/Options > Insert Slicer > Any other Column > OK
 STEP 4: Right Click on Slicer #1 and go to Report Connections(Excel 2013, 2016,
2019 & Office 365)/PivotTable Connections (Excel 2010)
> “check” the PivotTable2 box and press OK
 STEP 5: Right Click on Slicer #2 and go to Report Connections(Excel 2013, 2016,
2019 & Office 365)/PivotTable Connections (Excel 2010)
> “check” the PivotTable1 box and press OK
 Now as you select each Slicer’s items, both Pivot Tables will change!
MS Excel
Day 10 – Data Summarization:
Dashboards
What is a Dashboard…?
 A dashboard is an information management tool used to track KPIs, metrics, and
key data points that are relevant to your business, department, or a specific
process. Dashboards aggregate and visualize data from multiple sources, such as
databases, locally hosted files, and web services.
 A report would only collect and show data in a single table. For example, if a
manager wants to know how the sales have grown over the last period and which
region were the most profitable, a report would not be able to answer it. It would
simply report all the relevant sales data. These reports are then used to create
that will aid in decision making.
 A dashboard, on the other hand, would instantly answer important questions such
which regions are performing better and which products should the management
focus on.
 These dashboards could be static or interactive (where the user can make
selections and change views and the data would dynamically update).
Types of Dashboard..
Dashboard
Operational
To monitor real-time or transactional data
against key metrics and KPIs
Ex. Website
performance metrics
like new users or
bounce rate
Follower count or
comments across your
social media channels
Return on ad spend to
track the effectiveness
of your digital
advertising dollars
Strategic
To summarize performance over a period of
time (month, quarter, year).
Monthly, quarterly, or
yearly fiscal
performance
Account and MRR
growth rate
Earnings before
interest, tax,
depreciation, and
amortization (otherwise
known as EBITDA)
Analytical
To investigate trends, predict outcomes, and
discover insights and establish targets based
on insights into historical data.
Annual contract value
to track the dollar
amount an average
customer contract is
worth
Measure your company
spending habits with
the Bessemer Efficiency
Score
Understand the
increase in daily active
users over a period time
Sample Dashboard…
Steps for creating Excel Dashboard…
Excel Dashboard in 8 Simple Steps
 Start with a Clean Dataset.
 Format data as a Table.
 Create the first Pivot table and Pivot Charts.
 Create Multiple Pivot table and Pivot Charts for other variables.
 Assemble the Excel dashboard.
 Add Slicers & Timelines.
 Connect Slicers to data.
 Update the Excel Dashboard.
Points to Remember in Dashboard…
 Remember, human brains are more perceptible towards images and colours rather than
numbers
 For one report, either show numbered report OR Chart/Graph, never both
 For too big report, Use conditional formatting to highlight important numbers/facts
 Always include one summary report
 Dashboard doesn’t necessarily need to be only in one sheet
 No redundant information to be on dashboard
 Identify what you want to show
 Think from user’s perspective
 Keep it interactive
 Write conclusions in the ‘Text boxes’ in the separate sheet, you can link respective
charts to them.
 Place the dashboard elements as per your storyline, add/delete more elements if
needed.
 Keep it Simple
 Practice your script before you present.
MS Excel
Day 11 – Introduction to
Power Query
What is Power Query…?
 Power Query is an excel tool used to import data from different sources, transform (change)
it as required, and return a refined dataset in the workbook.
 Every change made to the data is recorded and saved as a step.
 In future, whenever the data source is updated, the same changes are performed
automatically with the click of the “refresh” button.
 For example, an organization has 180 files containing the purchases made in the last 15
years. To consolidate and analyze these numbers, either of the following steps can be
performed:
 Open the different files and copy-paste the entire data in one worksheet. Apply the
various functions of Excel to convert the data into meaningful reports.
 Use Power Query to import data from the different files. Set up a query which consists
of making step-by-step changes to the data. Load the transformed data in a worksheet
to create reports.
 If the organization follows the pointer “a,” it will have to perform a lot of manual work.
These tasks are often tedious and repetitive.
 However, if pointer “b” is followed, the transformations are performed automatically every
time data is updated.
 This saves a lot of time and speeds up the process of consolidating excel data.
 Power Query in excel performs the extract, transform, and load operations
(ETL) on a dataset.
 All transformations (steps or changes) applied to the data are collectively
known as a query.
 Each step performed is recorded and written in a code of M language.
 By performing these transformations, the data is said to be shaped.
 The major advantage of Power Query in excel is that it is a fast and efficient
way of working on large datasets.
 Besides, it is reusable as the same query can be used again on a new dataset.
 Moreover, with just a few clicks, one can have access to cleansed and sorted
data.
 Power Query can be installed as an add-in in Excel 2010 and 2013.
 In Excel 2016 and the subsequent versions, Power Query is a built-in excel
feature.
 It can be accessed from the “get data” drop-down (in the “get and transform
data” group) of the Data tab of Excel.
What is Power Query…?
Using Power Query in Excel…
To use Power Query in Excel, the following steps need to be performed:
 Import data: Import data from the different sources. The data source can
be a text file, Excel workbook, web, pdf, and so on. With Power Query,
one can work with data from any source having any size and shape.
 Transform data: Change, sort and shape data as per the requirements.
For instance, one can delete or insert a row and/or column, replace a
missing value, delete a duplicate entry, filter a column, and so on. These
changes are recorded as a query in the sequence in which they are
applied to the data.
 Consolidate data: Consolidate or combine the data from the different
sources. Once integrated, a consolidated database can be generated. The
merging and appending of queries are carried out at this stage.
 Load data: Load the data on a worksheet once it has been transformed
and consolidated. Loading the data helps return an output in the
workbook. The output can be in the form of a table, pivot chart or a pivot
table. Prior to loading, one can preview the data to ensure it is on the
right track.
Power Query Editor…
 Power Query has its own editor where you can get the data, perform all the
steps to create queries, and then load it to the worksheet.
 To open the power query editor, you need to go to the Data Tab and in the
Get & Transform ➜ Get Data ➜ Launch Power Query Editor.
Data Sources for Power Query…
 The best part of the power query is you have the
option to get data from multiple sources and
transform that data and then load it into the
worksheet.
 When you click on the Get Data in the GET &
TRANSFORM you can see the complete list of
data sources that you can get data load into the
editor.
Different Data Sources…
 From Table/Range: With this option, you can load data into the power query
editor directly from the active worksheet.
 From Workbook: From a different workbook that you have on your computer.
You just need to locate that file using an open dialog box and it will get data
from that file automatically.
 From Text/CSV: Get data from a text file or a comma-separated file and then
you can load it into the worksheet.
 From Folder: It takes all the files from the folder and load data from them
into the power query editor.
 From Web: With this option, you get data from a web address, imagine you
have a File that is stored on the web or you have a web page from where you
need to get the data.
Loading Data in Power Query…
 You will be loading data directly from the worksheet, so you need to open the file first and then
follow the below steps:
 First, apply an Excel table to the data (Even if you don’t do it Excel will do it for you before
loading data into PQ editor).
 Now, select a cell from the table and click on the “From Table/Range” (Data Tab Get & Transform).
 Once you click on the button, Excel confirms the range of data to apply an Excel table to it.
 At this point, you have the data into the power query editor, and it looks something like the image.
Loading Data in Power Query…
Here you can see:
 In the Formula bar, PQ has generated the M code for the table you have just loaded into
the editor.
 On the left side of the editor, you have the queries pane where you have the list of the
queries.
 On the right side, in the query settings, you have the section called “Applied Steps” where
you have all the steps listed. Note: You must be thinking that you haven’t performed any
“Changed Type” but there’s a step called “Changed Type” is there. Let me tell you
the SMARTNESS of POWER QUERY when you load data into the editor it checks and applies
the correct data types for all the columns automatically.
Power Query Editor…
Ribbon…
1. Ribbon
Let’s look at all the available tabs:
 File: From the file tab, you can load the data, discard the editor, and open
the query settings.
 Home: In the HOME Tab, you have options to manage the loaded data, like,
delete and move columns and rows.
 Transform: This tab has all the options which you need to transform and
clean the data, like merge columns, transpose, etc.
 Add Column: Here you have the option to add new columns to the data you
have in the power editor.
 View: From this tab, you can make changes to the view for the power query
editor and data loaded.
Applied Steps…
2. Applied Steps
 On the right side of the editor, you have a query setting pane which includes the name of the query and all the
applied steps in a sequence.
 When you right-click on a step you have a list of options that you can perform, like, rename, delete, edit, move
up or down, etc. and when you click on a step, the editor will take you to the transformation done on that step.
 Look at the image where you have the total five steps applied and when I click on the 4th step it takes me to
step four’s transformation where the columns name hasn’t changed.
Queries…
3. Queries
 The queries pane on the left side lists all the queries you have in the workbook right
now. It’s basically one place where you can manage all the queries.
 When you right-click on a query name you can see all the options that you can use
(copy, delete, duplicate, etc.)
 You can also create a new query by simply right click on the blank space on the queries
pane and then select the option for the data source.
Formula Bar…
4. Formula Bar
 As I said, whenever you apply a step in the editor it generates M code for that
step, and you can see that code in the formula bar. You can simply click on
the formula bar to edit the code.
 Once you learn to use M code you can also create step by writing the code
and simply clicking on the “FX” button to enter a custom step.
Data Preview…
5. Data Preview
 The data preview area looks like an Excel worksheet but there’s a little different than a normal worksheet
where you can edit a cell or data directly. When you load data into the editor (we will do it in a while) it
shows all the columns with the headers with the columns name and then rows with data.
 At the top of each column, you can see the data type of the data in the column. When you load data into the
editor the power query applies the right data type (almost every time) to each column automatically.
 You can click on the top left button on the column header to change the data type applied to the column. It
has a list of all the data types from where you can.
 And on the left side of the column header there you have the filter button which you
can use to filter values from the column.
 Note: When you filter values from a column, the power query takes it as one step and
lists it in the applied steps.
 If you right-click on the header of the column you can see that there is a menu that
includes a list of the options which you can use to transform the data and use any of
the options and PQ stores it as a step in the applied steps.
Data Preview…
MS Excel
Day 12 – Data Manipulations using
Power Query
Key Data manipulations in PQ…
 1. Replace Values
 2. Sort Data
 3. Remove Columns
 4. Split Column
 5. Rename a Column
 6. Duplicate Column
 7. Transpose Column or Row
 8. Replace/Remove Errors
 9. Change Data Type
 10. Add Column from Examples
 11. Change Case
 12. Trim and Clean
 13. Add Prefix/Suffix
 14. Extract Values
 15. Only Date or Time
 16. Combine Date and Time
 17. Rounding Numbers
 18. Calculations
 19. Group by
 20. Remove Negative Values
Replace Values…
 You have a list of values, and you want to replace a value or some values with something else. Well, with the
help of the power query you can create a query and replaces those values, in no time.
 In the below list, you need to replace my name “Puneet” with “Punit”.
 First, edit the list in the power query editor.
 After that, in the power query editor, go to “Transform Tab” and click “Replace Values”.
 Now, in “Value to Find”, enter “Puneet” and in “Replace With” enter “Punit” and after that, click OK.
 Once you click OK all the values get replaced with the new values and now, click on “Close and Load” to load
data in the worksheet.
Sort Data…
 Just like normal sorting, you can sort data by using power query and I’m using the same
name list which you have used in the above example.
 First, load data in the power query editor.
 In the Home tab, you have two sorting buttons (Ascending and Descending).
 Click on any of these buttons to sort.
Remove Negative Values…
 Just right click on a column and go to transform option and then click on “Absolute
value”.
 This instantly removes all the negative signs from the values.
Remove Columns…
 Let’s say you got data from somewhere and you need to delete some columns
from it. The thing is, you have to delete those columns every time you add
new data, right? But, power query can take care of this.
 Select the column or multiple columns that you want to delete.
 Now, right-click and select “Remove”.
 Quick Tip: There’s also an option to “Remove Other Columns” where you can
delete all the unselected columns.
Split Columns…
 Just like the text to column option, you have “Split Column” in power query.
 Select the column and go to the Home Tab ➜ Transform ➜ Split Column ➜ By Delimiter.
 Select the custom from the drop-down and enter “-” into it.
 Now, here you have three different options to split a column.
 Left-most Delimiter
 Right-most Delimiter
 Each occurrence of the delimiter
 If you have only one delimiter in a cell, all three will work in the same way, but if you have more
than one delimiter then you have to choose accordingly.
Rename & Duplicate a Column…
 You can simply rename a column by right click and then click on the
“Rename”.
 Quick Tip: Let say you have a query for renaming a column and someone else
rename it by mistake. You can restore that name just with a click.
 In Power Query, there is a simple option to create a duplicate column. All you
need to do is right-click on the column for which you want to create a
duplicate column and then click on “Duplicate Column”.
Transpose Column or Row…
 In the power query, transposing is a cup of cake. Yes, just one click.
 Once you load data into the power query editor, you just need to select the
column(s) or row(s).
 Go to Transform Tab ➜ Table ➜ Transpose.
Change Data Type…
 You have data in a column but it’s not in the right format. So, every time you need to
change its format.
 First, edit data into the power query editor.
 After that, select the column and go to the Transform Tab.
 Now, from data type select the “Date” as a type.
Replace/Remove Errors…
 Normally for replacing or removing errors in Excel you can use find and
replace option or a VBA code. But in power query, it’s a whole lot easier. Look
at the below column where you have some errors and you can remove as well
as replace them.
 When you right-click on the column, you’ll have both of the options.
 Replace Errors
 Remove Errors
Add Column from Examples…
 In the power query, there is an option to add a sample column which is not actually a sample related to the
current column.
 Imagine you need day names from a date column. Instead of using a formula or any other option, you can use,
you can use the “Add Column from Examples”.
 Here’s how to do this:
 Right-click on a column and click on “Add Column from Examples”.
 Here you’ll get a blank column. Click on the first cell of the column to get the list of values you can insert.
 Select “Day of Week Name from Date” and click OK.
Change Case…
 You have the following options for changing the case of text in power query.
 Lower Case
 Upper Case
 Capitalize Each Word
 You can do it by right click on a column and select any of the above three options. Or,
go to the Transform Tab ➜ Text Column ➜ Format.
Trim & Clean…
 To clear data or delete unwanted spaces you can use TRIM and CLEAN options
in power query. Steps are simple:
 Right-click on a column or select all the columns if you have multiple
columns.
 Go to Transform Tab ➜ Text Column ➜ Format.
 TRIM: To remove trailing and leading whitespaces from a cell.
 CLEAN: To remove non-printable characters from a cell.
Add Prefix/Suffix…
 So you have a list of values and from this list, you want to add a Prefix/Suffix
in each cell. In Excel, you can use the concatenate method but in power
query, there is a simple to use option for both.
 First, select the column where you need to add Prefix/Suffix.
 Then, go to the Transform Tab ➜ Text Column ➜ Format ➜ Add Prefix/ Add
Suffix.
 Once you click on one of the options, you’ll get a dialog box to enter text.
 And after entering the text, click OK.
Extract Values…
 If you are a formula savvy, then I’m sure you agree with me that extracting
text or number from a cell requires to combine different functions.
 But power query has solved a lot of these things in a good way. You have
seven ways to extract values from a cell.
Only Date or Time…
 It happens a lot of times that you have date and time, both in a single cell,
but needs one of them.
 Select the column where you have the date and time combined.
 If you want:
 Date: Right Click ➜ Transform ➜ Date Only.
 Time: Right Click ➜ Transform ➜ Time Only.
Combine Date & Time…
 Now you know how to separate date and time. But the next you need to know
how to combine them.
 First, select the date column and click on the “Date Only” option.
 After that, select both columns (Date and Time) and go to the transform tab
and from the “Date and Time Column” Group go to Date and click “Combine
Date and Time”.
Rounding Numbers…
 Here are the following options which you have for rounding numbers.
 Round Down: To round down a number.
 Round Up: To round up a number.
 Round: You can choose up to how my decimals you can round.
 Here are the following options which you have for rounding numbers.
 Round Down: To round down a number.
 Round Up: To round up a number.
 Round: You can choose up to how my decimals you can round.
 Note: When you select the “Round” option you need to enter the number of
decimals to round.
Calculations…
 There are options that you can use to perform calculations (a lot of). You can
find all these options on the Transform Tab (in Number Column group).
 Basic
 Statistics
 Scientific
 Trigonometry
 Rounding
 Information
 To perform any of this calculation you need to select the column and then the
option.
Group by…
 Let’s say you have a large data set and you want to create a summary table.
 In the Transform tab, click on the ‘Group by“ button and you’ll get a dialog box.
 Now, from this dialog box select the column with which you want to group and after
that, add a name, select the operation, and the column where you have values.
 In the end, click OK.
 Note: There are also some advanced options in the “Group by” option which you can
use to create a multi-level group table.
Load Data Back to Worksheet…
 Once you transform your data, you can load it to the worksheet and use it for further
analysis. On the home tab there is a button called “Close and Load” when you click on
it you get a drop-down which has options further:
 Close and Load
 Close and Load To
 Once you click on the button, it will show the following options:
 Select how you want to view this data in your worksheet.
 Just select the table option and new worksheet and don’t tick mark the data model and
click OK.
 The moment you click OK, it adds a new worksheet with the data.
Auto Refresh a Query…
 When you create a query, you can make it auto-refresh (you can set a timer).
 On the Data tab, click on “Queries & Connections” and you’ll get the Queries
and Connection pane on the right side of the window.
 Now, right-click on the query and tick mark “Refresh every” and enter the
minutes.
Functions & Formulas in PQ…
 Just like you can use functions and formulas in Excel worksheet, the power query has its own
list of functions that you can use. The basics of function and formulas in power query are the
same as Excel’s worksheet functions.
 In PQ, you need to add a new custom column to add a function or a formula. Let’s take an
example: In the data (already in the PQ editor) you have the first name and last name
 Imagine you need to merge both names and create a column for the full name. In this case, you
can enter a simple formula to concatenate names from both columns.
 First, go to the Add Column tab and click on the “Custom Column”.
 Now in the custom column dialog box, enter the name of the new column “Full Name” or
anything you want to name the new column.
 The custom column formula is the place where you need to enter the formula. So enter the
below formula in it: [First Name]&" "&[Last Name]
 When you enter a formula in the “custom column formula”, PQ verify the formula that you have
entered and shows a message “No syntax error have been detected” and if there’s an error it
will show an error message based on the type of the error.
 Once you enter the formula and that formula doesn’t have any errors in it, simply press OK.
 Now you have a new column at the end of the data which has values from two columns (first
name and the last name).
Functions & Formulas in PQ…
Edit Query in PQ…
 If you want to make some changes in the query which is already in your workbook you can simply edit it and then make
those changes. On the Data tab, there’s a button named Queries and Connections.
 When you click on this button, it opens a pane on the right side that lists all the queries that you have in the current
workbook.
 You can right-click on the query name and select edit and you will get it in the power query editor to edit.
 When you edit a query, you can see that all the steps which you have performed earlier are listed in the “Applied
Steps” that you can also edit or you can perform new steps.
 And once you are done with your changes you can simply click on the “Close & Load” button.
Export & Import Connections…
 If you have a connection which you have used for a query and now you
want to share that connection with someone else, you can export that
connection as an odc file.
 On the query table, there’s a button called “Export Connection” and
when you click on it, it allows you to save that query’s connection in
your system.
 And if you want to import a connection that is shared by someone
else, you can simply go to the Data tab and in the Get &
Transform click on the existing connections.
 And then click on the “Browse for More” button from where you can
locate the connection file which has been shared with you and import
it to your workbook.
Power Query Language (M Code)…
 As I mentioned earlier that for every step you performed in power query it generates a code (at the backend) which is
called M Code. On the Home tab, there is a button called “Advanced Editor” which you can use to see the code.
 And when you click on the advanced editor it will show you the code editor and that code looks something like the
image.
 M is a case sensitive language and like all the other languages it uses variables and expressions. The basic structure of
code looks like below where the code starts with the LET expression.
 In this code, we have two variables and the values defined to them. In the end, to get the value, IN expression has been
used. Now when you click OK it will return the value assigned to the variable “Variablename” in the result.
MS Excel
Day 13 – VBA & Macros
Introduction
What is VBA Macro…?
 A VBA Macro is nothing but a line of code to instruct
Excel to do a specific task.
 Once we write the code in VBA, we can execute the
same task at any time in the workbook.
 The macro code can eliminate repetitive, boring tasks
and automate the process.
 VBA Visual Basic for Applications is the Microsoft
programming language for Microsoft products like Excel,
Word, and PowerPoint.
 It will do all the programming we wish to do in the VBE
(Visual Basic Editor).
 It is the platform to write our code of tasks to execute in
Excel.
 To start with VBA coding in Excel, you need to record a
Macro.
 VBA coding is available under the Developer tab in excel.
Record a Macro…
 Under the “Developer” tab, click on Record Macro.
 As soon as you click on the “Record Macro,” Excel asks
you to give a name to your Macro.
 Give a proper name to the Macro. It should not
contain any space characters or special characters.
For example, you can give underscore (_) as the word
separator and then click on “OK” to start the
recording.
 From now onwards, the macro recorder keeps
recording all your activities in the Excel sheet.
 Firstly, we will select cell A1.
 Now, we will type “Welcome to VBA” in the A1 cell.
 Now, we will stop recording under the “Developer”
tab.
 So, Excel stops recording the activities we do in
Excel.
 Now, let us see how Excel recorded the activities.
Under the “Developer” tab, click on “Visual Basic.”
 As soon as you click on “Visual Basic,” we will
see the window as in image.
 Double click on “Modules.”
 Now, we will see the code on the right-hand
side.
 Macro code started with the word SUB.
 All the macro has two parts: the “Head” and the
“Tail” because every macro has a name
 In between the head and tail of the macro,
excel recorded all the activities.
 The first thing we did after starting recording
the macro was we selected cell A1, and Excel
recorded it as Range (“A1”). Select.
 The second activity was when we entered the
value “Welcome to VBA.” When we selected it,
it became an active cell, so Excel recorded the
activity as ActiveCell.FormulaR1C1 =
“Welcome to VBA.”
 Note: R1C1 is row 1, column 1.
Record a Macro…
 A third activity is after typing the word “Welcome to VBA,”
we press the “Enter” key, and Excel selects the A2 cell.
 Like this, the Macro recorder recorded all our activities in
the Excel sheet. Now, delete the word in cell A1.
 After deleting the word, go to VBE, where our code is once
again. Click on the “Run” button to enter the same text
value to cell A1.
 Note: The shortcut key to run the code is F5.
 So the macro is executed, and we get the same value
again. Like this, we can automate our daily routine work to
save time and eliminate boring daily tasks.
Record a Macro…
How to Save a Macro Excel..?
 One must save the Excel workbook containing macro code as “Macro-Enabled
Workbook.”
 Then, click “Save As” and select the file’s extension as “Macro-Enabled
Workbook.
Relative Reference in Macro…
 We have two options to refer a cell in excel VBA Absolute references and Relative
references.
 Default Excel records macro in Absolute mode.
 We select a cell “A1”, turn on “Use Relative Reference” and record a macro to
type some text in cells B2:B4.
 Since we turn on the “Relative reference” option. Macro considers the number of
rows and number of columns from active cells.
 In our example, we select cell A1 and start type B2 which is to move one column
and one row from A1 (Active cell).
 Step 1: Open Excel and Select Cell “A1”.
 Step 2: Go to “Developer” Tab >> Press “Use Relative References” >> Click
“Record Macro” .
 Step 3: Enter the Macro name “relativeReference” and Press “OK”.
 Step 4: Type “Australia” in cell B2
 Step 5: Type “Brazil” in cell B3
 Step 6: Type “Mexico” in cell B4
Relative Reference in Macro…
 Step 7: Select cell B5 and Press “Stop Recording”
 Step 8: You just delete the contents in cells B2:B4, Select Cell B1.
 Step 9: Go to View >> Macros >> View Macros – to popup Macro dialog box
[keyboard shortcut – Alt+F8].
 Step 10: Select Macro from list (eg. relativeReference) and Press “Run”.
 Output: The active cell is B1 and run the macro. So, the outputs (C2:C4) are
placed one row and one column from the active cell B1.
MS Excel
Day 14 – Working with VBA
What is VBA used for..?
In Excel, you can use VBA for different things. Here are a few:
 Enter Data: You can enter data in a cell, range of cells. You can
also copy and paste data from one section to another.
 Task Automation: You can automate tasks that want you to spend a
lot of time. The best example I can give is using a macro to create a
pivot table.
 Create a Custom Excel Function: With VBA, you can also create a
Custom User Defined Function and use it in the worksheet.
 Create Add-Ins: In Excel, you can convert your VBA codes into add-ins
and share them with others as well.
 Integrate with other Microsoft Applications: You can also integrate
Excel with other Microsoft applications. Like, you can enter data into
a text file.
Excel Programming Fundamentals…
A procedure in VBA is a set of codes or a single line of code that performs a
specific activity.
 SUB: Sub procedure can perform actions but doesn’t return a value (but you
can use an object to get that value).
 Function: With the help of the Function procedure, you create your function,
which you can use in the worksheet or the other SUB and FUNCTION
procedures
You need variables and constants to use values in the code multiple times.
 Variable: A Variable can store a value, it has a name, you need to define its
data type, and you can change the value it stores. As the name suggests,
“VARIABLE” has no fixed value. It is like a storage box that is stored in the
system.
 Constant: A constant also can store a value, but you can’t change the value
during the execution of the code.
Variables and Constants
Dim in VBA…
VBA DIM statement stands for “declare” that you must use when you need to
declare a variable. When you use it, it tells VBA that you are declaring a specific
name as a variable as assigning a specific data type to it. It can be used to
declare the following:
 Basic Variables
 Variants
 Objects
 Array
Use DIM Statement in VBA
 Type the keyword “Dim” at the start.
 After that, enter the name of the variable that you want to use.
 Next, you need to use the word “as” and you’ll get an instant list of data
types.
 In the end, choose the data type that you want to assign to the variable.
Data Types…
 You need to declare the data type for VARIABLES and CONSTANTS.
 When you specify the data type for a variable or a constant, it ensures the
validity of your data.
 If you omit the data type, VBA applies the Variant data type to your variable (it’s
the most flexible), VBA won’t guess what the data type should be.
Events in Excel…
Whenever you do something in Excel, that’s an event: enter a value in a cell, insert a
new worksheet, or insert a chart. Below is the classification of events based on the
objects:
 Application Events: These are events that are associated with the Excel
application itself.
 Workbook Events: These are events that are associated with the actions that
happen in a workbook.
 Worksheet Events: These events are associated with the action that happens in a
worksheet.
 Chart Events: These events are associated with the chart sheets (which are
different from worksheets).
 Userform Events: These events are associated with the action that happens with a
user form.
 OnTime Events: OnTime events are those which can trigger code at a particular
point in time.
 OnKey Events: OnKey events are those which can trigger code when a particular
key is pressed.
Range…
The range object is the most common and popular way to refer to a range in your VBA codes. You need to refer to the cell
address, let me tell you the syntax.
Worksheets(“Sheet1”).Range(“A1”)
Just like any other programming language, you can also write codes to test conditions in
VBA. It allows you to do it in two different ways.
 IF THEN ELSE: It’s an IF statement that you can use to test a condition and then run a
line of code if that condition is TRUE. You can also write nesting conditions with it
 SELECT CASE: In the select case, you can specify a condition and then different cases
for outcomes to test to run different lines of code to run. It’s a little more structured than
the IF statement.
Conditions…
VBA Loops…
You can write codes that can repeat and re-repeat an action in VBA, and there are multiple ways that
you can use to write code like this.
 For Next: The best fit for using For Next is when you want to repeat a set of actions a fixed number
of times.
 For Each Next: It’s perfect to use when you want to loop through a group of objects from a
collection of objects.
 Do While Loop: The simple idea behind the Do While Loop is to perform an activity while a condition
is true.
 Do Until Loop: In the Do Until, VBA runs a loop and continues to run it if the condition is FALSE.
Input and Message Box…
 Input Box: The input Box is a function that shows an input box to the user and
collects a response.
 Message Box: Message Box helps you show a message to the user but, you
have an option to add buttons to the message box to get the response of the
user.
Excel has no luck when it comes to programming errors, and you have to deal
with them, no matter what.
 Syntax Errors: It’s like typos that you do while writing codes, but VBA can help
you by pointing out these errors.
 Compile Errors: It comes when you write code to perform an activity, but that
activity is not valid.
 Runtime Errors: A RUNTIME error occurs at the time of executing the code. It
stops the code and shows you the error dialog box.
 Logical Error: It’s not an error but a mistake while writing code and sometimes
can give you nuts while finding and correcting them.
Errors…
Select Case Statement…
Various If Statements..
 IF THEN is the simplest form of an IF statement. All we need to do is specify a
condition to check and if that condition is TRUE it will perform a task. But, if that
condition is FALSE it will do nothing and skip the line instantly.
 IF condition Then statement[s] End If
 You can use the IF-Then-Else statement where you want to perform a specific task
if a condition is TRUE and a different task if a condition is FALSE.
 IF Condition Then Statement[s] Else Statement[s] End If
 IF-Then-Elseif-Else is the most useful and important type of IF which will help
you to write advanced condition statements. In this type, you can specify the
second condition after evaluating your first condition.
 IF Condition Then Statement[s] Elseif Condition Then Statement[s] Else
Statement[s] End If
MS Excel
Day 15 – Power Pivot
Power Pivot…
 Introduced to Excel 2010 and 2013 as an add-on, but now native to the application,
Power Pivot is part of Microsoft's business intelligence stack capable of (but not
limited to) big data analytics work without specialty infrastructure or software.
 According to Microsoft, "Power Pivot enables you to import millions of rows of data
from multiple data sources into a single Excel workbook, create relationships
between heterogeneous data, create calculated columns and measures using
formulas, build PivotTables and PivotCharts, and further analyze the data so that you
can make timely business decisions without requiring IT assistance."
 Power Pivot was created in direct response to the big data demands of contemporary
business intelligence needs, which prior generations of Excel—given their 1,048,576
row limit or processing speed shortcomings—struggled to cope with.
 Power Pivot is expressed by Microsoft using DAX (Data Analysis Expressions), which is
a collection of functions, operators, and constants usable in a formula or expression
to calculate/return one or more values.
Pivot vs Power Pivot…
Power Languages…
What’s the problem with Normal Pivot.?
 Historically Pivot Tables only allow the user to use a single source data table.
 If the data are split in different tables, then it has been historically hard to
use in a Pivot Table.
 The Excel user then needs to use VLOOKUP (or similar) to bring the data into
a single table before it is possible to create a Pivot Table.
 Excel can only store 1 million rows of data, so forget trying to use Pivot
Tables on really large data sets.
 Well before you hit the 1 million row limit, Excel will start performing very
poorly, particularly if you have lots of VLOOKUPs etc. Excel it is not
optimised for large database crunching work.
 Pivot tables are very good at aggregating data that exist in a suitable raw
form in the underlying table, but are terrible in reporting on anything else
that could be derived from the source data.
 So in summary, Pivot Tables are great for visualisation as long as your data is
optimised in a way to leverage the power of Pivot Tables.
What is Power Pivot.?
 Power Pivot is actually a data modelling tool.
 Take data from one or more sources and combine it together into a single data
source (this is called the data model).
 Enhance the underlying data so that you can create new derived concepts out of
the data. So if you have Sales $ and Cost $ in your source data, you can create
Margin $ and Margin % and make these new concepts available to a Pivot Table.
 The new concepts you build in Power Pivot are infinitely reusable in your Pivot
Tables.
 Power Pivot compresses the source data and stores it as a database within the
Excel workbook. This means that you can store 10s (even 100s) of millions of
rows of data directly in an Excel workbook in a highly compressed and performant
way, and distribute it to other people without them needed to have access to the
source database.
 What Power Pivot does is change the source data so that you can use data that
could not previously be used, and you can get more out of data that you previously
used inside of a Pivot Table. So Power Pivot is actually your source data on
steroids.
How it works with Power Pivot.?
 Import millions of rows of data from multiple data sources
 Fast calculations and analysis
 Virtually Unlimited Support of Data Sources
 Security and Management
 Data Analysis Expressions (DAX)
Raw Data Power Query Power Pivot
Excel pivot
reports/chart
s/grid
Power view
Power map
How to enable Power Pivot.?
 Go to File > Options > Add-Ins.
 In the Manage box, click COM Add-ins>
Go.
 Check the Microsoft Office Power Pivot
box, and then click OK. If you have
other versions of the Power Pivot add-
in installed, those versions are also
listed in the COM Add-ins list.

More Related Content

PPTX
Functions and formulas of ms excel
PPTX
Useful Excel Functions & Formula Used everywhere.pptx
PPTX
Excel basics for everyday use part three
PDF
functionsandformulas-131221213835-phpapp01.pdf
PPT
Excel11
PPTX
MIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSAL
PPTX
Excel Function Training
PPTX
Excel basics for everyday use-the more advanced stuff
Functions and formulas of ms excel
Useful Excel Functions & Formula Used everywhere.pptx
Excel basics for everyday use part three
functionsandformulas-131221213835-phpapp01.pdf
Excel11
MIRCROSOFT EXCEL- brief and useful for beginners by RISHABH BANSAL
Excel Function Training
Excel basics for everyday use-the more advanced stuff

Similar to MS Excel Overall Power Point Presentatio (20)

PPTX
Basic course of MS Excel 2010 basics Chapter -02
PPT
Excel Chapter 2
PPT
Excel intermediate
DOCX
PowerPoint presentation on Microsoft Excel.docx
PPTX
MIS 226: Chapter 2
PPTX
TSL_25_07_2024_exceltraining-190602234542.pptx
PPTX
Excel_Breif_Overview.pptx
PDF
INTRODUCTION OF MS-EXCEL.pdf
PPTX
Excel training
PPTX
Excel Overview.pptx
PPTX
Data management and excel appication.pptx
PDF
Excel formulas-manual
PDF
ITB - UNIT 4.pdf
PDF
Microsoft Excel 365 Formulas BarCharts QuickStudy 1st Edition Curtis Frye
PPTX
Excellence with excel
PPTX
Basic excel training
PPTX
Lesson 27 - Excel Lesson 13.pptx
PDF
Excel presentation
PPTX
Microsoft Excel Core Points Training.pptx
PDF
Excel
Basic course of MS Excel 2010 basics Chapter -02
Excel Chapter 2
Excel intermediate
PowerPoint presentation on Microsoft Excel.docx
MIS 226: Chapter 2
TSL_25_07_2024_exceltraining-190602234542.pptx
Excel_Breif_Overview.pptx
INTRODUCTION OF MS-EXCEL.pdf
Excel training
Excel Overview.pptx
Data management and excel appication.pptx
Excel formulas-manual
ITB - UNIT 4.pdf
Microsoft Excel 365 Formulas BarCharts QuickStudy 1st Edition Curtis Frye
Excellence with excel
Basic excel training
Lesson 27 - Excel Lesson 13.pptx
Excel presentation
Microsoft Excel Core Points Training.pptx
Excel
Ad

Recently uploaded (20)

PPTX
master seminar digital applications in india
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Trump Administration's workforce development strategy
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Lesson notes of climatology university.
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
01-Introduction-to-Information-Management.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
master seminar digital applications in india
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
O5-L3 Freight Transport Ops (International) V1.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
A systematic review of self-coping strategies used by university students to ...
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Trump Administration's workforce development strategy
Final Presentation General Medicine 03-08-2024.pptx
Lesson notes of climatology university.
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
01-Introduction-to-Information-Management.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Cell Structure & Organelles in detailed.
2.FourierTransform-ShortQuestionswithAnswers.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Orientation - ARALprogram of Deped to the Parents.pptx
Anesthesia in Laparoscopic Surgery in India
STATICS OF THE RIGID BODIES Hibbelers.pdf
Ad

MS Excel Overall Power Point Presentatio

  • 1. MS Excel Day 1 - Introduction
  • 3. Limits of Excel… For more of Excel Specifications & limits: https://support.microsoft.com/en-gb/office/excel-specifications-and-limits- 1672b34d-7043-467e-8e27-269d656771c3
  • 4. Interface of Excel… Excel 2010 interface: File tab with backstage view. Customize Ribbon and more Excel 2007 interface: Colourful Office button with dropdown box . Tabs and commands on Ribbon introduced.
  • 5. Interface of Excel… Excel 2013 interface: File tab with numerous templates in backstage view and more data analysis options . Flash fill, quick analysis and more
  • 8. Paste & Paste Special…
  • 9. Formatting in Excel… ETL step 1 is correct Formatting to respective Variables in the dataset. Number Format commands are present in ‘Home’ tab.
  • 10. Data Fill…  Put the mouse pointer over the bottom right-hand corner of the cell until it's a black plus sign.  Click and hold the left mouse button, and drag the plus sign over the cells you want to fill.  And the series is filled in for you automatically using the AutoFill feature.  The Fill Series tool can readily handle any list of days, months, or years and take them all in stride.  Filling can be used for:  Copying  Sequences  Dates
  • 11. Fill Series Dialogue box…  The Series dialog box contains loads of options but most of them are automatically selected because the value in cell A1 is a date. Let’s take a look:  I want to fill my dates down column A, so I need ‘Columns’ selected.  Excel has detected that I’m using Dates because I have a date in cell A1.  It has also assumed I want to increase my series by days, as opposed to weekdays, months or years.  And the step value is one day at a time.  All I need to do is enter the Stop value, which is the last date in my series.
  • 12. Flash Fill…  Excel Flash Fill is a special tool that analyzes the information you are entering and automatically fills data when it identifies a pattern.
  • 13. Justify Fill…  An interesting tool within Excel is the Fill Justify. It allows you to select text from several rows and merge them in to one cell.
  • 16. Keyboard Shortcuts… For more Shortcuts: https://support.microsoft.com/en-gb/office/keyboard-shortcuts-in-excel- 1798d9d5-842a-42b8-9c99-9b7213f0040f
  • 17. MS Excel Day 2 – Referencing, Named Ranges & Functions
  • 18. Cell Referencing…  A cell reference refers to a cell or a range of cells on a worksheet and can be used in a formula so that Microsoft Office Excel can find the values or data that you want that formula to calculate. One Time $A$3 Absolute Second Time A$3 Mixed: Row fixed Third Time $A3 Mixed: Column fixed Fourth Time A3 Relative
  • 19.  A relative cell reference refers to cells in relation to the cell that contains the formula. When the formula is moved, it references new cells based on their location relative to the formula. A relative cell reference is the default type of Excel cell reference.  A relative cell reference does not use any dollar sign ($) before the column address or the row address. When a formula is copied or dragged to another cell or range, relative cell reference changes accordingly.  An absolute cell reference always refers to a specific cell or range of cells, regardless of where the formula is located in the worksheet, even when the formula is copied to any other cell in the worksheet. The row and column references do not change after copying the formula because the reference is to an actual cell address.  An absolute reference uses two dollar signs ($) in its address: one for the column letter and one for the row number.  A mixed cell reference is an Excel cell reference that uses an absolute column or row reference, but not both. Only one of the address parts is absolute.  A mixed cell reference uses a dollar sign ($) either before the column address or before the row address. It is a combination of relative and absolute references (mixed reference type in excel). Cell Referencing…
  • 21. Name Range…  When we write formulas/functions, we need to select a range of cells. However, doing this can be time consuming and error prone.  Excel allows us to use a cell or a range of cells by its name. E.g. Sum(Basic) sounds much easier compared to sum(H2:H101).  However to do this, first we would need to name the range H2:H10 as Basic.  You can name a single cell, group of cells, Cell ranges (Row/s, Column/s). A Table (data matrix) can also be named. Top 5 benefits of using names in Excel  Excel names make formulas easier to make and read.  Excel names allow creating expandable formulas.  Excel names make formulas easier to re-use.  Named ranges simplify navigation.  Named ranges allow creating dynamic drop-down lists.
  • 23. Rules for creating Name Range… When creating a name in Excel, there are a few rules to remember:  An Excel name should be under 255 characters long.  Excel names cannot contain spaces and most punctuation characters.  A name must begin with a letter, underscore (_), or backslash (). If a name begins with anything else, Excel will throw an error.  Excel names are case-insensitive. For example, "Apples", "apples" and "APPLES" will be treated as the same name.  You cannot name ranges like cell references. That is, you can't give the name "A1" or "AA1" to a range.  You can use a single letter to name a range like "a", "b", "D", etc. except for the letters "r" "R", "c", and "C" (these characters are used as shortcuts for selecting a row or column for the currently selected cell when you type them in the NameBox).
  • 24. Functions…  A function in Excel is a preset formula, that helps perform mathematical, statistical and logical operations.  Once you are familiar with the function you want to use, all you have to do is enter an equal sign (=) in the cell, followed by the name of the function and the cell range it applies to. Different types of functions are:  Text / string functions  Logical functions  Math functions  Statistical functions  Lookup and reference functions  Financial functions  Date functions  Time functions
  • 25. Function Description =AND Returns TRUE or FALSE based on two or more conditions =AVERAGE Calculates the average (arithmetic mean) =AVERAGEIF Calculates the average of a range based on a TRUE or FALSE condition =AVERAGEIFS Calculates the average of a range based on one or more TRUE/FALSE conditions =CONCAT Links together the content of multiple cells =COUNT Counts cells with numbers in a range =COUNTA Counts all cells in a range that has values, both numbers and letters =COUNTBLANK Counts blank cells in a range =COUNTIF Counts cells as specified =COUNTIFS Counts cells in a range based on one or more TRUE or FALSE condition =IF Returns values based on a TRUE or FALSE condition =IFS Returns values based on one or more TRUE or FALSE conditions =LEFT Returns values from the left side of a cell =LOWER Reformats content to lowercase =MAX Returns the highest value in a range =MEDIAN Returns the middle value in the data =MIN Returns the lowest value in a range =MODE Finds the number seen most times. The function always returns a single number =NPV The NPV function is used to calculate the Net Present Value (NPV) =OR Returns TRUE or FALSE based on two or more conditions =RAND Generates a random number =RIGHT Returns values from the right side of a cell =STDEV.P Calculates the Standard Deviation (Std) for the entire population =STDEV.S Calculates the Standard Deviation (Std) for a sample =SUM Adds together numbers in a range =SUMIF Calculates the sum of values in a range based on a TRUE or FALSE condition =SUMIFS Calculates the sum of a range based on one or more TRUE or FALSE condition =TRIM Removes irregular spacing, leaving one space between each value =VLOOKUP Allows vertical searches for values in a table =XOR Returns TRUE or FALSE based on two or more conditions
  • 26. In the same manner, other required functions can be used for various calculations. You can use the functions as per your objective. Function Argument box, without and with formula in the cell CTRL+A OR SHIFT + f3 Keyboard shortcut to open Function Argument box, with formula in the cell Creating a Function…
  • 27. Count Function… SYNTAX OF FUNCTIONS COUNT =COUNT(VALUE1,VALUE2,…) COUNTA =COUNTA(VALUE1,VALUE2,…) COUNTBLANK =COUNTBLANK(RANGE) COUNTIF =COUNTIF(RANGE,CRITERIA) COUNT ONLY CELLS THAT CONTAINS NUMBER. COUNTA CELLS THAT ARE NOT EMPTY. COUNTBLANK CELLS THAT ARE EMPTY. COUNTIF CELLS WITH SPECIFIC CONDITION
  • 28. Sumif Function… SYNTAX OF SUMIF =SUMIF(RANGE,CRITERIA,SUM_RANGE) RANGE- Range of cells on which conditions are applied. CRITERIA- Condition that defines which cell or cells will be added. SUM RANGE- Actual cells to sum. NOTE:- If sum range is not used then range is used for sum.
  • 29. The absolute value of a number ABS The average or arithmetic mean for a group of numbers AVERAGE The number of cell locations in a range that contain a numeric character COUNT The number of cell locations in a range that contain a text or numeric character COUNTA The highest numeric value in a group of numbers MAX The lowest numeric value in a group of numbers MIN Returns the serial number of the current date and time NOW Returns the serial number of today's date TODAY Returns the serial number of a particular date DATE Returns the year fraction representing the number of whole days between start_date and end_date YEARFRAC Use this function to return the number of days between two dates. DAYS Returns the number of whole workdays between two dates using parameters to indicate which and how many days are weekend days NETWORKDAYS.INTL Statistical & Date Functions…
  • 30. Arithmetic & Logical Functions… ROUNDS a number to a specified number of digits ROUND Returns an aggregate list of database , ignores errors and blanks AGGREGATE Check whether condition is met, TRUE if met, FALSE, if not IF To check more than one conditions, all should met then TRUE otherwise FALSE AND To check more than one conditions, any one should met then TRUE otherwise FALSE OR Returns addition of the range as per conditions specified SUMIFS Returns count of the range as per conditions specified COUNTIFS
  • 31. MS Excel Day 3 –Logical Functions, Math & Trig Functions
  • 32. Logical Functions  The Logical button functions are based on the logic. Also, the logical operators are used.  These are, the Less than (<), Greater than (>), Equal To (=) and the Not Equal To (<>) etc.  Additionally, are the Less Than Equal To (<=) and the Greater Than Equal To (>=).  Notably, the Equal To Less Than (=<) or the Equal To Greater Than (=>) is an invalid operator.  Hence, use of the “Equal To operator” before the “Less or Greater Than”, shouldn’t be done.
  • 33.  AND function checks for arguments whether TRUE or not.  FALSE function returns with false for the logical values.  IF checks whether a condition is TRUE or FALSE and returns the answer accordingly.  IFERROR helps users to hide the result errors. These are errors might be from other functions. Also, we could temporarily provide with our own results in place of the errors.  IFNA displays the value specified by user, if the result of function is #N/A.  NOT function changes the result to True with False and False with True.  OR helps users to with a result, checking whether argument is True or False.  TRUE function displays with a logical value True.  XOR shows with a logical ‘Exclusive Or’ for all the provided arguments. Logical Functions
  • 34. If Function… SYNTAX OF IF =IF(LOGICAL TEXT, VALUE IF TRUE, VALUE IF FALSE) IN COLUMN B DIFFERENT CONDITIONS ARE USED AND BASED ON THIS, IN COLUMN C DIFFERENT RESULTS ARE SHOWN. LOGICAL TEXT- Any value or expression that can be evaluated to TRUE or FALSE. VALUE IF TRUE- Value that is returned if logical text is TRUE. VALUE IF FALSE- Value that is returned if logical text is FALSE.
  • 35. Math & Trig Functions… The Math Trig button has currently seventy four functions
  • 36. Usage Of Math/Stat And Logical Together…  A function may also be "nested" (or embedded) inside of an IF-THEN function.  This enables you to carry out complex calculations and then contrast the real outcomes with what was anticipated.  Consider a spreadsheet with five pupils' grades listed in column B for the purposes of this example.  You could use the AVERAGE function to aver these scores. Cell C2 may yield "Excellent!" or "Needs Work" depending on the results of the class average. This is how the IF- THEN code would be entered:  =IF(AVERAGE(B2:B6)>85,"Excellent!","Needs Work")
  • 37. Nested If…  An IF function inside another IF function is known as a stacked IF function. When we need to deal with greater than two conditions, nested if statements become useful.  Let's imagine that we want to create a Formula that verifies the day of the week.  If it's a Saturday, remember to "party well,"  if it's a Sunday, remember to "take some time to rest,"  and if it's any day of the week from Monday to Friday, remember to cross everything off your to-do list.  The formula for the flowchart is as follows  =IF(B1=”Sunday”,”time to rest”,IF(B1=”Saturday”,”party well”,”to do list”)) it's a Saturday party well it's a Sunday take some time to rest If it's any day of the week remember to cross everything off your to-do list
  • 38. If Error…  You can indicate what should happen if a formula or cell reference returns an error by using the IFERROR function.  The IFERROR syntax:  =IFERROR(value, value_if_error)  value is the argument that's true and is verified. It generally includes a formula or a cell reference.  The ‘value’ that is to be returned in the event of an error is value_if_error. #N/A, #REF!, #DIV/0!, #VALUE!, #NUM!, #NAME?, and #NULL! were assessed as error types.
  • 39. MS Excel Day 4 – Lookup Functions
  • 40. Lookup Functions… Notably, the functions often used, are the VLookUp, Hyperlink, Index and the Match.
  • 41.  ADDRESS function makes a cell reference as text, given stated row and column numbers.  AREAS function shows the number of areas in a reference. Especially, An area is a range of adjoining cells or a single cell.  CHOOSE function selects a value from a list of values, based on an index number.  COLUMN function displays the column number of a reference.  COLUMNS function shows the number of columns in an array or reference.  FORMULATEXT function displays a formula as a string.  GETPIVOTDATA function extracts data stored in a PivotTable.  HLOOKUP function sees for a value in top row of a table, and shows value in the same column  INDEX function shows a value at the intersection of a precise row and column, in a specified range. Lookup Functions…
  • 42.  INDIRECT function displays the reference stated by a text string.  LOOKUP function sees up a value, either from a one-row or one-column range or from an array.  MATCH shows comparative position, of an item in an array, that matches a specified value in a specified order.  OFFSET function displays a reference to a range, from a given reference of Row & Columns.  ROW function shows the row number of a reference.  ROWS function displays the number of rows in a reference or array.  RTD function fetches real-time data from a program that supports the COM automation.  TRANSPOSE function changes a vertical range of cells to a horizontal range, or vice versa.  VLOOKUP function sees for a value in the leftmost column of a table. And then returns a value in the same row, from a specified column. Lookup Functions…
  • 43. Vlookup Function…  VLOOKUP stands for Vertical Lookup(Search)  V‐lookup is a function that searches for a value (lookup value) in the leftmost column of a given database (table array)and returns a value in the same row from a column you specify.  Application of Look up functions  Fetch the values of a column from some other file or sheet based on a common field.  Merge two datasets  Compare 2 files However, VLOOKUP() has been known to give error prone results. •You should have minimum 2 different data tables/files (Master data and Source data) •Master data and Source data should have at least one common column (same data and format) •Common Column in the Source data should be placed as ‘Left most column’ within the dataset. To apply it correctly, ensure following conditions are met by your data and files All these conditions must be taken care of before and while applying the function.
  • 44.  Lookup_value is the value to be found in the first column of the table. It is the value that you are looking for. Lookup_value can be a value, a reference or a text string.  Table_array is the table of information in which data is looked up. It is the source database. Use a reference to a range or a range name.  Col_index_num is the column number in table_array from which the matching value must be returned.  Range_lookup is a logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match. If Range Lookup is set as FALSE or 0, VLOOKUP will find an exact match. If exact match is not found, the error value #N/A is returned. If it is set to TRUE or non‐zero, it finds the nearest value that is less than lookup value Vlookup Function… Syntax=vlookup(lookup_value, table_array, col_index_num, range_lookup)
  • 45. VLOOKUP( lookup_value, table_array, col_index_num, [range_lookup] ) Master Table: Where we want to fetch the data == where VLOOKUP() is applied. Source table: From where we source the desired data == selected in ‘Table_array’ argument. Always fix it or name it. Vlookup Function…
  • 46. Hlookup Function… •H‐lookup function searches for a value in the top most row of a table, and then returns a value in the same column from a row you specify. H‐lookup works the same way as V‐lookup. However, in this case we need to specify the row index number instead of the column index number Perquisites to be checked will remain same as Vlookup(). Syntax=hlookup(lookup_value, table_array, row_index_num, range_lookup)
  • 47. Match Function… •The MATCH function searches for a specified item in a range of cells, and then returns the relative cell position of that item in the source table range. MATCH(lookup_value, lookup_array, [match_type]) • Lookup_value is the value to be found in the first column of the table. It is the value that you are looking for. Lookup_value can be a value, a reference or a text string. •Lookup_array is the table of information in which data is looked up. It is the source database. The range of cells being searched •Col_index_num is the column number in table_array from which the matching value must be returned. •match_type is a logical value that specifies whether you want to find an exact match or an approximate match. (Optional) The number -1, 0, or 1 Here, formula result ‘5’ is the cell position of ‘Units’ Column headers.
  • 48. Vlookup with Match… Match identifies the ‘Col_index_num’ of Vlookup(), thus creating a Dynamic lookup. Easy to merge the tables with one common column and same spelling of headers.
  • 49.  We have a database where our lookup value is in the middle and we need to search towards the left, we would have to move the column to the left most corner before we use vlookup. INDEX(array,[MATCH(lookup_value,lookup_array,[match_type])],[Match(lookup_value, lookup_array,[match_type])])  Index function when used along with match helps us search for the data even if the lookup value is not present on the left-most column.  Definitions for the arguments remain same  INDEX() output is Cell Value written inside the cell, MATCH() will guide towards the correct Cell position in the dataset or data matrix.  NO Prerequisites need to be checked before applying this combo. Index with Match…
  • 50.  To pull the extension from column B based on the office number in D2? With this regular Vlookup formula:  =VLOOKUP($D$2,$A$2:$B$7,2,FALSE)  And it will work nicely as long as your users enter a valid number in D2. But what if a user inputs some number that does not exist?  # N/A Error will appear.  In the above formula in the value argument of IFERROR, and put another Vlookup in the value_if_error argument.  =IFERROR(VLOOKUP($D$2,$A$2:$B$7,2,FALSE),”Not Found”) Vlookup with Iferror…
  • 51. Nested Vlookup… Assuming the lookup value is in cell A2 in the current sheet, and the lookup range is A2:B5 in 3 different worksheets (North, South and West), the following formula works a treat: =IFERROR(VLOOKUP(A2,North!$A$2:$B$5,2,FALSE), IFERROR(VLOOKUP(A2,South!$A$2:$B$5,2,FALSE), IFERROR(VLOOKUP(A2,West!$A$2:$B$5,2,FALSE),"Not found")))
  • 52. Indirect Function…  The INDIRECT function in Excel returns a cell reference from a text string. It has two arguments, the first is required and the second is optional:  INDIRECT(ref_text, [a1])  ref_text - is a cell reference, or a reference to a cell in the form of a text string, or a named range.  a1 - is a logical value that specifies what type of reference is contained in the ref_text argument:  If TRUE or omitted, ref_text is interpreted as an A1-style cell reference.  If FALSE, ref_text is treated as a R1C1 reference.  You can switch between the two reference types via File > Options > Formulas > R1C1 check box.
  • 53. Offset Function…  The OFFSET function in Excel returns a cell or range of cells that is a given number of rows and columns from a given cell or range.  The syntax of the OFFSET function is as follows:  OFFSET(reference, rows, cols, [height], [width])  The first 3 arguments are required and the last 2 are optional. All of the arguments can be references to other cells or results returned by other formulas.  Reference - a cell or a range of adjacent cells from which you base the offset. You can think of it as the starting point.  Rows - The number of rows to move from the starting point, up or down. If rows is a positive number, the formula moves below the starting reference, in case of a negative number it goes above the starting reference.  Cols - The number of columns you want the formula to move from the starting point. As well as rows, cols can be positive (to the right of the starting reference) or negative (to the left of the starting reference).  Height - the number of rows to return.  Width - the number of columns to return.  Both the height and width arguments must always be positive numbers.
  • 55. MS Excel Day 5 – Combination of Functions & Data Validation
  • 56. Combination of Functions…  =VLOOKUP(G4,CHOOSE(IF(H2="Unit Test",1,IF(H2="Midterm",2,3)),$A$3:$E$7,$A$1 1:$E$15,$A$19:$E$23),MATCH(H3,$A$2:$E$2,0 ),0)  This formula uses the CHOOSE function to make sure the right table is referred to. Let’s analyze the CHOOSE part of the formula:  CHOOSE(IF(H2=”Unit Test”,1,IF(H2=”Midterm”,2,3)),$A$3:$E$7,$A$ 11:$E$15,$A$19:$E$23)  The first argument of the formula is IF(H2=”Unit Test”,1,IF(H2=”Midterm”,2,3)), which checks the cell H2 and see what level of exam is being referred to. If it’s Unit Test, it returns $A$3:$E$7, which has the scores for Unit Test. If it’s Midterm, it returns $A$11:$E$15, else it returns $A$19:$E$23.
  • 57.  Excel's wildcard symbols come in handy in a variety of circumstances.  When searching for a value in a list and there isn't a precise match, partial look-up is necessary.  For instance, let's say you have the data set below and you want to search for the business ABC in a list, but the list contains ABC Ltd rather than ABC. Since there is no precise match in column A, you cannot use ABC as the lookup value.  Additionally, approximate match produces inaccurate results and necessitates sorting the list in increasing order.  To find the match, you can use a wildcard character within the VLOOKUP method.  =VLOOKUP("*"&C2&"*",$A$2:$A$8,1,FALSE) Combination of Functions…
  • 58. Case Sensitive Vlookup… Note: In all Excel versions other than Excel 365, this only works as an array formula, so remember to press Ctrl + Shift + Enter to complete it correctly. In Excel 365, due to support for dynamic arrays, it also works as a regular formula. How this formula works:  The core part that does the trick is the CHOOSE formula with nested EXACT:  CHOOSE({1,2}, EXACT(F2, A2:A7), B2:B7)  Here, the EXACT function compares the value in F2 against each value in A2:A7 and returns TRUE if they are exactly the same including the letter case, FALSE otherwise:  {FALSE;FALSE;FALSE;TRUE;FALSE;FALSE}  For the index_num argument of CHOOSE, we use the array constant {1,2}. As the result, the function combines the logical values from the above array and the values from C2:C7 into a two-dimensional array like this:  {FALSE,155;FALSE,186;FALSE,90;TRUE,54;FALSE,159;FALSE,28}  The VLOOKUP function takes it from there and searches for the lookup value (which is TRUE) in the 1st column of the 2-dimensional array (represented by the logical values) and returns a match from the 2nd column, which is the price we are looking for:  VLOOKUP(TRUE, {FALSE,155;FALSE,186;FALSE,90;TRUE,54;FALSE,159;FALSE,28}, 2, 0)
  • 59. Data Validation…  Suppose you do not want the user to enter a non text value in a cell or you want to restrict data entry to certain values. You may use Data Validation for these.  Data Validation is a process which restricts the users from entering invalid data for individual cells or cell ranges.  Error pop-up box indicates correct value to be entered.  It limits the data entry to a particular type, such as whole numbers, decimal numbers or text and sets limit on valid entries. Note:- If you do not enter a title or text, the title defaults to "Microsoft Excel" and the message to "The value you entered is not valid. A user has restricted values that can be entered into this cell."
  • 60. Data Validation Rules…  Setting Data Validation Rules  Select the cells for which you want to create a validation rule.  On the Data tab, in the Data Tools group, click Data Validation to open the Data Validation dialog box.  Activate the Settings tab.  From the Allow list, select a data validation option.  From the Data list, select the operator you want. Then complete the remaining entries.  Enter the Input Message if required in Input Message tab.  Enter the error message if required in Error Alert tab.  Click OK to set the validation rule and close the dialog box.
  • 61. Data Validation List… Creating a Drop down List  A list is an effective form of data validation where the user is allowed to select an option from a drop‐down list which is built‐in to the cell.  The data source may be written manually by the user or selected from the same sheet. Steps are as follows:  Select a blank cell  Select Data Tab  Select Data Validation from Data Tool group  Select List  In Source, select the cell with values, or type the data with comm Tip: If the source is from a different sheet, create a ‘named range’ for all the values and use the name in the Source field for Data Validation. Note:- If you are working on MS Office 2007, you need to copy paste list in the same sheet as dropdown list. In this old version, DV is not equipped to reference cell range from another sheet.
  • 62. MS Excel Day 6 – Date Function & Text Function
  • 63. Date & Time Function…
  • 64.  DATE function shows the number that denotes the date in Microsoft Excel Date-Time Code.  DATEVALUE function changes a date, in the form of text to a number, that denotes the date.  DAY function shows the day of the month, a number from One (1) to Thirty One (31).  DAYS function shows the number of days among the two dates.  DAYS360 function shows the number of days between two dates, based on a year i.e. (360-day).  EDATE displays the serial number of date, before or after start date, i.e. the marked number of months.  EOMONTH shows the serial number of last day of month, before or after a stated number of months.  HOUR function shows the hour as a number, from Zero (0) to Twenty Three (23) i.e. (12:00 A.M.) to (11:00 P.M.).  ISOWEEKNUM function displays the ISO Week number in the year for a specified date.  MINUTE function shows the minute, a number from Zero (0) to Fifty Nine (59). Date & Time Function…
  • 65.  MONTH function displays the month, a number from One (1) for January to Twelve (12) for December.  NETWORKDAYS function shows the number of entire workdays among two dates.  NETWORKDAYS.INTL shows the number of entire workdays among two dates with custom weekend limits.  NOW function displays the current date and time, formatted as a date and time.  SECOND function shows the second, a number from Zero (0) to Fifty Nine (59).  TIME function changes specified numbers i.e. Hours, Minutes, and Seconds to an Excel serial number, formatted with a time format.  TIMEVALUE function changes a text time to an Excel serial number for a time.  TODAY function shows the current date formatted as a date.  WEEKDAY displays a number, recognizing day of the week of a date, from One (1) to Seven (7).  WEEKNUM function shows the week number in the year.  WORKDAY function displays the serial number of the date, before or after a specified number of workdays.  WORKDAY.INTL shows the serial number of the date, before or after a stated number of workdays with custom weekend limits.  YEAR function displays the year of a date.  YEARFRAC function shows the year fraction, illustrating the number of entire days, among start date and end date. Date & Time Function…
  • 66. DateDif Function… SYNTAX OF DATEDIF =DATEDIF(START_DATE,END_DATE, ”INTERVAL”) “ D ” - D AY S “ M ” - M O N T H S “ Y ” - Y E A R S “ Y M ” - M O N T H S O V E R Y E A R “ M D ” - D AY S O V E R M O N T H START DATE- Date from which u want to calculate difference. END DATE- Date up to which u want to calculate difference. INTERVAL- Form in which u want to calculate difference.
  • 68.  BAHTTEXT function helps to converts a number to text i.e. BAHT.  CHAR function displays the character from the character set, stated by the code number.  CLEAN function eliminates all the non-printable characters from the texts.  CODE function shows a numeric code for initial character in a text string, in the character set.  CONCATENATE function combines multiple text strings into one text string.  DOLLAR function converts a number to text by using the Currency Format.  EXACT returns True or False by checking whether two text strings are same or not.  FIND function returns the foremost position of one text string within another. Notably, this FIND function is Case-Sensitive function.  FIXED function shows text result with or without commas, by rounding a number to stated number of decimals.  LEFT function shows specified number of characters from the starting from the Left Hand Side of a text string.  LEN function displays the numbers of characters in a text string.  LOWER function changes all the letters in a text string to lowercase.  MID function shows characters from the middle of text string, provided with a initial position and length.  NUMBERVALUE function changes text to number in a locale-independent manner. Text Functions…
  • 69.  PROPER changes the first letter in each word to “UPPERCASE”, and all other letters to “lowercase”.  REPLACE function with a different text string in a part of text string.  REPT function helps to repeat a certain text provided number of times.  RIGHT function shows specified number of characters from the starting from the Right Hand Side of a text string.  SEARCH shows the number of the character from left to right, at which a specific character gets first found.  SUBSTITUTE function replaces existing text with new text in a text string.  “T” function checks whether a value is text, and returns text, or blank text, if it is or isn’t.  TEXT function changes a value to text in a stated number format.  TRIM function eliminates all the spaces except for single spaces between words, from a text string.  UNICHAR function shows the Unicode character referenced by the provided numeric value.  UNICODE function displays the number (Code Point) corresponding to the initial character of the text.  UPPER functions changes a text string to all uppercase letters.  VALUE function changes a text string that denotes a number to a number. Text Functions…
  • 70. Text Function… SYNTAX OF FUNCTIONS 1. LOWER FUNCTION =LOWER(TEXT) 2. UPPER FUNCTION =UPPER(TEXT) 3. PROPER FUNCTION =PROPER(TEXT) LOWER TO CONVERT TEXT FROM CAPITAL TO SMALL. UPPER TO CONVERT TEXT FROM SMALL TO CAPITAL. PROPER TO CAPITALISED EACH WORD OF TEXT.
  • 71. Text Functions… SYNTAX OF FUNCTIONS 1. LEFT FUNCTION =LEFT(TEXT,NUM_CHARS) 2. RIGHT FUNCTION =RIGHT(TEXT,NUM_CHARS) 3. MID FUNCTION =MID(TEXT,STARTNUM,NUM_CHAR) LEFT RETURN SPECIFIED NO. OF CHARACTER FROM START OF TEXT. RIGHT RETURN SPECIFIED NO. OF CHRACTER FROM END OF TEXT. MID RETURN CHARACTER FROM MIDDLE OF TEXT,GIVEN A STARTING POSITION.
  • 72. Other Functions… NOW RETURNS CURRENT DATE AND TIME. TODAY RETURNS CURRENT DATE ONLY. MOD RETURNS THE REMAINDER AFTER A NO. IS DIVIDED BY A DIVISOR. LEN RETURNS THE NO. OF CHARACTERS IN A TEXT STRING. SUM ADD ALL THE NUMBERS.
  • 73. MS Excel Day 7 – Data Cleaning, Data Formatting, Filtering & Sorting
  • 77. Creating Table in Excel…
  • 78. Removing a table in Excel… Below are the steps to remove the Excel table formatting:  Select any cell in the Excel table.  Click the Design tab (this is a contextual tab and only appears when you click any cell in the table)  In Table Styles, click on the More icon (the one at the bottom of the small scrollbar.  Click on the Clear option.
  • 81. The filter in excel helps display relevant data by eliminating the irrelevant entries temporarily from the view. The data is filtered as per the given criteria. The purpose of filtering is to focus on the crucial areas of a dataset. Keyboard shortcuts • SHIFT+CTRL+L • ALT+D+F+F Filtering in Excel…
  • 82. Sorting in Excel… TO SORT IN ALPHABETICAL ORDER: Select a cell in the column you want to sort (In this example, we choose a cell in column Q). Click the Sort & Filter command in the Editing group on the Home tab. Select Sort A to Z. Now the information in the Category column is organized in alphabetical order. TO SORT FROM SMALLEST TO LARGEST: Select a cell in the column you want to sort (In this example, we choose a cell in column Q). Click the Sort & Filter command in the Editing group on the Home tab. Select From Smallest to Largest. Now the information is organized from the smallest to largest amount.
  • 83. Sorting Date & Number…
  • 85. MS Excel Day 8 – Conditional formatting & Data Visualisation
  • 89. Data Tab in Excel…
  • 90. Text to Column (Data Split)…
  • 91. Text to Column (Data Split)…
  • 96. Column & Line Chart…
  • 98. Combo & Pie Chart…
  • 100. Steps of Gantt Chart…
  • 101. Steps of Gantt Chart…
  • 102. Steps of Gantt Chart…
  • 104. MS Excel Day 9 – Data Summarization: Pivot
  • 105. Pivot… Click here to open  A Pivot Table is an interactive worksheet based table that quickly summarizes large amounts of data using the format and calculation methods you choose.  It is called a Pivot Table because you can rotate its row and column headings around the core data area to give you different views of the source data.  As source data changes, you can update a pivot table. It resides on a worksheet thus; you can integrate a Pivot Table into a larger worksheet model using standard formulas.  A PivotTable is a powerful tool to calculate, summarize, and analyze data that lets you see comparisons, patterns, and trends in data. Which can be present in an Excel workbook or imported from an external database such as Microsoft Access or SQL Server and 98 more sources  PivotTables work a little bit differently depending on what platform you are using to run Excel. Tip: Pivot table options and features differ from version to version. Basic functions will be available with all versions. Advanced features like Recommended Pivot tables, Power Pivot was introduced with 2013 version. Click here to open
  • 106. Pivot Reports… The data on which a PivotTable is based is called the Source Data. Each column represents a field or category of information, which you can assign to different parts of the PivotTable to determine how the data is arranged. You can add four types of fields, The fields are explained in the following tables.
  • 107. Sample Pivot reports… Unique_Advisor_Id Sum of AUM Average of Units 1000103 245350.67 2256.07 1000373 284189.18 2140.27 1000474 68185.38 674.90 1000541 61997.18 1070.29 1000973 120859.32 1885.18 1001058 281424.73 3762.53 1001478 41411.28 3445.20 1001667 395481.61 3034.54 1001726 402228.92 3714.59 1002143 782189.49 4799.98 Grand Total 2683317.74 2954.04 Unique_Advisor_Id Count of Unique_Investment_Id 1000103 6 1000373 10 1000474 5 1000541 4 1000973 6 1001058 6 1001478 1 1001667 9 1001726 10 1002143 13 Grand Total 70 category Average of category_return_10years Average of rating Allocation - 50% to 70% Equity 7.13 4 Allocation - 70% to 85% Equity 7.46 5 Diversified Emerging Mkts 2.3 3 Emerging Markets Bond 3.95 3 Foreign Large Blend 3.65 3 Global Real Estate 4.33 2 High Yield Bond 5.06 3 Intermediate Core Bond 3.4 3 Large Blend 11.28 3 Large Growth 14.19 3 Large Value 8.64 2 Mid-Cap Growth 12.76 1 Multialternative 2.31 2 Muni New York Long 3.56 1 Muni Pennsylvania 3.52 2 Muni Single State Long 3.26 1 Small Blend 8.48 2 Small Value 6.39 3 Tactical Allocation 4.26 3 Technology 16.17 5 World Allocation 4.61 3 World Large Stock 7.53 2 fund_mean_annual_return_10years Count of category 0-0.5 15 0.5-1 12 1-1.5 6 1.5-2 1 Grand Total 34
  • 108. Charts in Pivot…  Sometimes it's hard to see the big picture when your raw data hasn’t been summarized. Your first instinct may be to create a PivotTable, but not everyone can look at numbers in a table and quickly see what's going on. PivotCharts are a great way to add data visualizations to your data.  A pivot chart is the visual representation of a pivot table in Excel. Pivot charts and pivot tables are connected with each other.  A ‘pivot chart’ adds value and category series by dragging the field name onto axes instead of choosing the chart wizard. A 'normal' chart is usually based on a range of data in row and columns.  Source data of standard charts are linked directly to worksheet cells, while PivotCharts are based on their associated PivotTable's data source. Unlike a standard chart, you cannot change the chart data range in a PivotChart's ‘Select Data Source’ dialog box.  Keep it simple, avoid 3D graphs
  • 109. Slicer in Pivot…  Slicers in Excel are software filters used along with excel tables or pivot tables over a large amount of data.  It is used for filtering out the data plus it helps with an easy understanding of the information being extracted and displayed on the screen.  Add slicer to your report by  Go to Insert tab > Slicer.  In the Insert Slicers dialog box, select the check boxes for the fields you want to display, then select OK.  A slicer will be created for every field that you selected. Clicking any of the slicer buttons will automatically apply that filter to the linked table or PivotTable. Tip: Slicer was introduced in 2010, then enhanced in 2013 with introducing ‘Timeline’. When adding Slicer In Dashboard, you need to ‘Report Connections’ to connect multiple reports to one slicer or timeline. Interestingly, this option in 2010, was called ‘Pivot table connections’. Slicer to be added in standard excel report Slicer to be added in Pivot report
  • 110. Multiple Pivot Connections using Slicer…  STEP 1: Create 2 Pivot Tables by clicking in your data set and selecting Insert > Pivot Table > New Worksheet/Existing Worksheet  STEP 2: Click in Pivot Table #1 and insert a MONTH Slicer by going to PivotTable Tools > Analyze/Options > Insert Slicer > Any Column > OK  STEP 3: Click in Pivot Table #2 and insert a YEAR Slicer by going to PivotTable Tools > Analyze/Options > Insert Slicer > Any other Column > OK  STEP 4: Right Click on Slicer #1 and go to Report Connections(Excel 2013, 2016, 2019 & Office 365)/PivotTable Connections (Excel 2010) > “check” the PivotTable2 box and press OK  STEP 5: Right Click on Slicer #2 and go to Report Connections(Excel 2013, 2016, 2019 & Office 365)/PivotTable Connections (Excel 2010) > “check” the PivotTable1 box and press OK  Now as you select each Slicer’s items, both Pivot Tables will change!
  • 111. MS Excel Day 10 – Data Summarization: Dashboards
  • 112. What is a Dashboard…?  A dashboard is an information management tool used to track KPIs, metrics, and key data points that are relevant to your business, department, or a specific process. Dashboards aggregate and visualize data from multiple sources, such as databases, locally hosted files, and web services.  A report would only collect and show data in a single table. For example, if a manager wants to know how the sales have grown over the last period and which region were the most profitable, a report would not be able to answer it. It would simply report all the relevant sales data. These reports are then used to create that will aid in decision making.  A dashboard, on the other hand, would instantly answer important questions such which regions are performing better and which products should the management focus on.  These dashboards could be static or interactive (where the user can make selections and change views and the data would dynamically update).
  • 113. Types of Dashboard.. Dashboard Operational To monitor real-time or transactional data against key metrics and KPIs Ex. Website performance metrics like new users or bounce rate Follower count or comments across your social media channels Return on ad spend to track the effectiveness of your digital advertising dollars Strategic To summarize performance over a period of time (month, quarter, year). Monthly, quarterly, or yearly fiscal performance Account and MRR growth rate Earnings before interest, tax, depreciation, and amortization (otherwise known as EBITDA) Analytical To investigate trends, predict outcomes, and discover insights and establish targets based on insights into historical data. Annual contract value to track the dollar amount an average customer contract is worth Measure your company spending habits with the Bessemer Efficiency Score Understand the increase in daily active users over a period time
  • 115. Steps for creating Excel Dashboard… Excel Dashboard in 8 Simple Steps  Start with a Clean Dataset.  Format data as a Table.  Create the first Pivot table and Pivot Charts.  Create Multiple Pivot table and Pivot Charts for other variables.  Assemble the Excel dashboard.  Add Slicers & Timelines.  Connect Slicers to data.  Update the Excel Dashboard.
  • 116. Points to Remember in Dashboard…  Remember, human brains are more perceptible towards images and colours rather than numbers  For one report, either show numbered report OR Chart/Graph, never both  For too big report, Use conditional formatting to highlight important numbers/facts  Always include one summary report  Dashboard doesn’t necessarily need to be only in one sheet  No redundant information to be on dashboard  Identify what you want to show  Think from user’s perspective  Keep it interactive  Write conclusions in the ‘Text boxes’ in the separate sheet, you can link respective charts to them.  Place the dashboard elements as per your storyline, add/delete more elements if needed.  Keep it Simple  Practice your script before you present.
  • 117. MS Excel Day 11 – Introduction to Power Query
  • 118. What is Power Query…?  Power Query is an excel tool used to import data from different sources, transform (change) it as required, and return a refined dataset in the workbook.  Every change made to the data is recorded and saved as a step.  In future, whenever the data source is updated, the same changes are performed automatically with the click of the “refresh” button.  For example, an organization has 180 files containing the purchases made in the last 15 years. To consolidate and analyze these numbers, either of the following steps can be performed:  Open the different files and copy-paste the entire data in one worksheet. Apply the various functions of Excel to convert the data into meaningful reports.  Use Power Query to import data from the different files. Set up a query which consists of making step-by-step changes to the data. Load the transformed data in a worksheet to create reports.  If the organization follows the pointer “a,” it will have to perform a lot of manual work. These tasks are often tedious and repetitive.  However, if pointer “b” is followed, the transformations are performed automatically every time data is updated.  This saves a lot of time and speeds up the process of consolidating excel data.
  • 119.  Power Query in excel performs the extract, transform, and load operations (ETL) on a dataset.  All transformations (steps or changes) applied to the data are collectively known as a query.  Each step performed is recorded and written in a code of M language.  By performing these transformations, the data is said to be shaped.  The major advantage of Power Query in excel is that it is a fast and efficient way of working on large datasets.  Besides, it is reusable as the same query can be used again on a new dataset.  Moreover, with just a few clicks, one can have access to cleansed and sorted data.  Power Query can be installed as an add-in in Excel 2010 and 2013.  In Excel 2016 and the subsequent versions, Power Query is a built-in excel feature.  It can be accessed from the “get data” drop-down (in the “get and transform data” group) of the Data tab of Excel. What is Power Query…?
  • 120. Using Power Query in Excel… To use Power Query in Excel, the following steps need to be performed:  Import data: Import data from the different sources. The data source can be a text file, Excel workbook, web, pdf, and so on. With Power Query, one can work with data from any source having any size and shape.  Transform data: Change, sort and shape data as per the requirements. For instance, one can delete or insert a row and/or column, replace a missing value, delete a duplicate entry, filter a column, and so on. These changes are recorded as a query in the sequence in which they are applied to the data.  Consolidate data: Consolidate or combine the data from the different sources. Once integrated, a consolidated database can be generated. The merging and appending of queries are carried out at this stage.  Load data: Load the data on a worksheet once it has been transformed and consolidated. Loading the data helps return an output in the workbook. The output can be in the form of a table, pivot chart or a pivot table. Prior to loading, one can preview the data to ensure it is on the right track.
  • 121. Power Query Editor…  Power Query has its own editor where you can get the data, perform all the steps to create queries, and then load it to the worksheet.  To open the power query editor, you need to go to the Data Tab and in the Get & Transform ➜ Get Data ➜ Launch Power Query Editor.
  • 122. Data Sources for Power Query…  The best part of the power query is you have the option to get data from multiple sources and transform that data and then load it into the worksheet.  When you click on the Get Data in the GET & TRANSFORM you can see the complete list of data sources that you can get data load into the editor.
  • 123. Different Data Sources…  From Table/Range: With this option, you can load data into the power query editor directly from the active worksheet.  From Workbook: From a different workbook that you have on your computer. You just need to locate that file using an open dialog box and it will get data from that file automatically.  From Text/CSV: Get data from a text file or a comma-separated file and then you can load it into the worksheet.  From Folder: It takes all the files from the folder and load data from them into the power query editor.  From Web: With this option, you get data from a web address, imagine you have a File that is stored on the web or you have a web page from where you need to get the data.
  • 124. Loading Data in Power Query…  You will be loading data directly from the worksheet, so you need to open the file first and then follow the below steps:  First, apply an Excel table to the data (Even if you don’t do it Excel will do it for you before loading data into PQ editor).  Now, select a cell from the table and click on the “From Table/Range” (Data Tab Get & Transform).  Once you click on the button, Excel confirms the range of data to apply an Excel table to it.  At this point, you have the data into the power query editor, and it looks something like the image.
  • 125. Loading Data in Power Query… Here you can see:  In the Formula bar, PQ has generated the M code for the table you have just loaded into the editor.  On the left side of the editor, you have the queries pane where you have the list of the queries.  On the right side, in the query settings, you have the section called “Applied Steps” where you have all the steps listed. Note: You must be thinking that you haven’t performed any “Changed Type” but there’s a step called “Changed Type” is there. Let me tell you the SMARTNESS of POWER QUERY when you load data into the editor it checks and applies the correct data types for all the columns automatically.
  • 127. Ribbon… 1. Ribbon Let’s look at all the available tabs:  File: From the file tab, you can load the data, discard the editor, and open the query settings.  Home: In the HOME Tab, you have options to manage the loaded data, like, delete and move columns and rows.  Transform: This tab has all the options which you need to transform and clean the data, like merge columns, transpose, etc.  Add Column: Here you have the option to add new columns to the data you have in the power editor.  View: From this tab, you can make changes to the view for the power query editor and data loaded.
  • 128. Applied Steps… 2. Applied Steps  On the right side of the editor, you have a query setting pane which includes the name of the query and all the applied steps in a sequence.  When you right-click on a step you have a list of options that you can perform, like, rename, delete, edit, move up or down, etc. and when you click on a step, the editor will take you to the transformation done on that step.  Look at the image where you have the total five steps applied and when I click on the 4th step it takes me to step four’s transformation where the columns name hasn’t changed.
  • 129. Queries… 3. Queries  The queries pane on the left side lists all the queries you have in the workbook right now. It’s basically one place where you can manage all the queries.  When you right-click on a query name you can see all the options that you can use (copy, delete, duplicate, etc.)  You can also create a new query by simply right click on the blank space on the queries pane and then select the option for the data source.
  • 130. Formula Bar… 4. Formula Bar  As I said, whenever you apply a step in the editor it generates M code for that step, and you can see that code in the formula bar. You can simply click on the formula bar to edit the code.  Once you learn to use M code you can also create step by writing the code and simply clicking on the “FX” button to enter a custom step.
  • 131. Data Preview… 5. Data Preview  The data preview area looks like an Excel worksheet but there’s a little different than a normal worksheet where you can edit a cell or data directly. When you load data into the editor (we will do it in a while) it shows all the columns with the headers with the columns name and then rows with data.  At the top of each column, you can see the data type of the data in the column. When you load data into the editor the power query applies the right data type (almost every time) to each column automatically.  You can click on the top left button on the column header to change the data type applied to the column. It has a list of all the data types from where you can.
  • 132.  And on the left side of the column header there you have the filter button which you can use to filter values from the column.  Note: When you filter values from a column, the power query takes it as one step and lists it in the applied steps.  If you right-click on the header of the column you can see that there is a menu that includes a list of the options which you can use to transform the data and use any of the options and PQ stores it as a step in the applied steps. Data Preview…
  • 133. MS Excel Day 12 – Data Manipulations using Power Query
  • 134. Key Data manipulations in PQ…  1. Replace Values  2. Sort Data  3. Remove Columns  4. Split Column  5. Rename a Column  6. Duplicate Column  7. Transpose Column or Row  8. Replace/Remove Errors  9. Change Data Type  10. Add Column from Examples  11. Change Case  12. Trim and Clean  13. Add Prefix/Suffix  14. Extract Values  15. Only Date or Time  16. Combine Date and Time  17. Rounding Numbers  18. Calculations  19. Group by  20. Remove Negative Values
  • 135. Replace Values…  You have a list of values, and you want to replace a value or some values with something else. Well, with the help of the power query you can create a query and replaces those values, in no time.  In the below list, you need to replace my name “Puneet” with “Punit”.  First, edit the list in the power query editor.  After that, in the power query editor, go to “Transform Tab” and click “Replace Values”.  Now, in “Value to Find”, enter “Puneet” and in “Replace With” enter “Punit” and after that, click OK.  Once you click OK all the values get replaced with the new values and now, click on “Close and Load” to load data in the worksheet.
  • 136. Sort Data…  Just like normal sorting, you can sort data by using power query and I’m using the same name list which you have used in the above example.  First, load data in the power query editor.  In the Home tab, you have two sorting buttons (Ascending and Descending).  Click on any of these buttons to sort. Remove Negative Values…  Just right click on a column and go to transform option and then click on “Absolute value”.  This instantly removes all the negative signs from the values.
  • 137. Remove Columns…  Let’s say you got data from somewhere and you need to delete some columns from it. The thing is, you have to delete those columns every time you add new data, right? But, power query can take care of this.  Select the column or multiple columns that you want to delete.  Now, right-click and select “Remove”.  Quick Tip: There’s also an option to “Remove Other Columns” where you can delete all the unselected columns.
  • 138. Split Columns…  Just like the text to column option, you have “Split Column” in power query.  Select the column and go to the Home Tab ➜ Transform ➜ Split Column ➜ By Delimiter.  Select the custom from the drop-down and enter “-” into it.  Now, here you have three different options to split a column.  Left-most Delimiter  Right-most Delimiter  Each occurrence of the delimiter  If you have only one delimiter in a cell, all three will work in the same way, but if you have more than one delimiter then you have to choose accordingly.
  • 139. Rename & Duplicate a Column…  You can simply rename a column by right click and then click on the “Rename”.  Quick Tip: Let say you have a query for renaming a column and someone else rename it by mistake. You can restore that name just with a click.  In Power Query, there is a simple option to create a duplicate column. All you need to do is right-click on the column for which you want to create a duplicate column and then click on “Duplicate Column”.
  • 140. Transpose Column or Row…  In the power query, transposing is a cup of cake. Yes, just one click.  Once you load data into the power query editor, you just need to select the column(s) or row(s).  Go to Transform Tab ➜ Table ➜ Transpose. Change Data Type…  You have data in a column but it’s not in the right format. So, every time you need to change its format.  First, edit data into the power query editor.  After that, select the column and go to the Transform Tab.  Now, from data type select the “Date” as a type.
  • 141. Replace/Remove Errors…  Normally for replacing or removing errors in Excel you can use find and replace option or a VBA code. But in power query, it’s a whole lot easier. Look at the below column where you have some errors and you can remove as well as replace them.  When you right-click on the column, you’ll have both of the options.  Replace Errors  Remove Errors
  • 142. Add Column from Examples…  In the power query, there is an option to add a sample column which is not actually a sample related to the current column.  Imagine you need day names from a date column. Instead of using a formula or any other option, you can use, you can use the “Add Column from Examples”.  Here’s how to do this:  Right-click on a column and click on “Add Column from Examples”.  Here you’ll get a blank column. Click on the first cell of the column to get the list of values you can insert.  Select “Day of Week Name from Date” and click OK.
  • 143. Change Case…  You have the following options for changing the case of text in power query.  Lower Case  Upper Case  Capitalize Each Word  You can do it by right click on a column and select any of the above three options. Or, go to the Transform Tab ➜ Text Column ➜ Format. Trim & Clean…  To clear data or delete unwanted spaces you can use TRIM and CLEAN options in power query. Steps are simple:  Right-click on a column or select all the columns if you have multiple columns.  Go to Transform Tab ➜ Text Column ➜ Format.  TRIM: To remove trailing and leading whitespaces from a cell.  CLEAN: To remove non-printable characters from a cell.
  • 144. Add Prefix/Suffix…  So you have a list of values and from this list, you want to add a Prefix/Suffix in each cell. In Excel, you can use the concatenate method but in power query, there is a simple to use option for both.  First, select the column where you need to add Prefix/Suffix.  Then, go to the Transform Tab ➜ Text Column ➜ Format ➜ Add Prefix/ Add Suffix.  Once you click on one of the options, you’ll get a dialog box to enter text.  And after entering the text, click OK.
  • 145. Extract Values…  If you are a formula savvy, then I’m sure you agree with me that extracting text or number from a cell requires to combine different functions.  But power query has solved a lot of these things in a good way. You have seven ways to extract values from a cell. Only Date or Time…  It happens a lot of times that you have date and time, both in a single cell, but needs one of them.  Select the column where you have the date and time combined.  If you want:  Date: Right Click ➜ Transform ➜ Date Only.  Time: Right Click ➜ Transform ➜ Time Only.
  • 146. Combine Date & Time…  Now you know how to separate date and time. But the next you need to know how to combine them.  First, select the date column and click on the “Date Only” option.  After that, select both columns (Date and Time) and go to the transform tab and from the “Date and Time Column” Group go to Date and click “Combine Date and Time”.
  • 147. Rounding Numbers…  Here are the following options which you have for rounding numbers.  Round Down: To round down a number.  Round Up: To round up a number.  Round: You can choose up to how my decimals you can round.  Here are the following options which you have for rounding numbers.  Round Down: To round down a number.  Round Up: To round up a number.  Round: You can choose up to how my decimals you can round.  Note: When you select the “Round” option you need to enter the number of decimals to round.
  • 148. Calculations…  There are options that you can use to perform calculations (a lot of). You can find all these options on the Transform Tab (in Number Column group).  Basic  Statistics  Scientific  Trigonometry  Rounding  Information  To perform any of this calculation you need to select the column and then the option.
  • 149. Group by…  Let’s say you have a large data set and you want to create a summary table.  In the Transform tab, click on the ‘Group by“ button and you’ll get a dialog box.  Now, from this dialog box select the column with which you want to group and after that, add a name, select the operation, and the column where you have values.  In the end, click OK.  Note: There are also some advanced options in the “Group by” option which you can use to create a multi-level group table.
  • 150. Load Data Back to Worksheet…  Once you transform your data, you can load it to the worksheet and use it for further analysis. On the home tab there is a button called “Close and Load” when you click on it you get a drop-down which has options further:  Close and Load  Close and Load To  Once you click on the button, it will show the following options:  Select how you want to view this data in your worksheet.  Just select the table option and new worksheet and don’t tick mark the data model and click OK.  The moment you click OK, it adds a new worksheet with the data.
  • 151. Auto Refresh a Query…  When you create a query, you can make it auto-refresh (you can set a timer).  On the Data tab, click on “Queries & Connections” and you’ll get the Queries and Connection pane on the right side of the window.  Now, right-click on the query and tick mark “Refresh every” and enter the minutes.
  • 152. Functions & Formulas in PQ…  Just like you can use functions and formulas in Excel worksheet, the power query has its own list of functions that you can use. The basics of function and formulas in power query are the same as Excel’s worksheet functions.  In PQ, you need to add a new custom column to add a function or a formula. Let’s take an example: In the data (already in the PQ editor) you have the first name and last name  Imagine you need to merge both names and create a column for the full name. In this case, you can enter a simple formula to concatenate names from both columns.  First, go to the Add Column tab and click on the “Custom Column”.  Now in the custom column dialog box, enter the name of the new column “Full Name” or anything you want to name the new column.  The custom column formula is the place where you need to enter the formula. So enter the below formula in it: [First Name]&" "&[Last Name]  When you enter a formula in the “custom column formula”, PQ verify the formula that you have entered and shows a message “No syntax error have been detected” and if there’s an error it will show an error message based on the type of the error.  Once you enter the formula and that formula doesn’t have any errors in it, simply press OK.  Now you have a new column at the end of the data which has values from two columns (first name and the last name).
  • 153. Functions & Formulas in PQ…
  • 154. Edit Query in PQ…  If you want to make some changes in the query which is already in your workbook you can simply edit it and then make those changes. On the Data tab, there’s a button named Queries and Connections.  When you click on this button, it opens a pane on the right side that lists all the queries that you have in the current workbook.  You can right-click on the query name and select edit and you will get it in the power query editor to edit.  When you edit a query, you can see that all the steps which you have performed earlier are listed in the “Applied Steps” that you can also edit or you can perform new steps.  And once you are done with your changes you can simply click on the “Close & Load” button.
  • 155. Export & Import Connections…  If you have a connection which you have used for a query and now you want to share that connection with someone else, you can export that connection as an odc file.  On the query table, there’s a button called “Export Connection” and when you click on it, it allows you to save that query’s connection in your system.  And if you want to import a connection that is shared by someone else, you can simply go to the Data tab and in the Get & Transform click on the existing connections.  And then click on the “Browse for More” button from where you can locate the connection file which has been shared with you and import it to your workbook.
  • 156. Power Query Language (M Code)…  As I mentioned earlier that for every step you performed in power query it generates a code (at the backend) which is called M Code. On the Home tab, there is a button called “Advanced Editor” which you can use to see the code.  And when you click on the advanced editor it will show you the code editor and that code looks something like the image.  M is a case sensitive language and like all the other languages it uses variables and expressions. The basic structure of code looks like below where the code starts with the LET expression.  In this code, we have two variables and the values defined to them. In the end, to get the value, IN expression has been used. Now when you click OK it will return the value assigned to the variable “Variablename” in the result.
  • 157. MS Excel Day 13 – VBA & Macros Introduction
  • 158. What is VBA Macro…?  A VBA Macro is nothing but a line of code to instruct Excel to do a specific task.  Once we write the code in VBA, we can execute the same task at any time in the workbook.  The macro code can eliminate repetitive, boring tasks and automate the process.  VBA Visual Basic for Applications is the Microsoft programming language for Microsoft products like Excel, Word, and PowerPoint.  It will do all the programming we wish to do in the VBE (Visual Basic Editor).  It is the platform to write our code of tasks to execute in Excel.  To start with VBA coding in Excel, you need to record a Macro.  VBA coding is available under the Developer tab in excel.
  • 159. Record a Macro…  Under the “Developer” tab, click on Record Macro.  As soon as you click on the “Record Macro,” Excel asks you to give a name to your Macro.  Give a proper name to the Macro. It should not contain any space characters or special characters. For example, you can give underscore (_) as the word separator and then click on “OK” to start the recording.  From now onwards, the macro recorder keeps recording all your activities in the Excel sheet.  Firstly, we will select cell A1.  Now, we will type “Welcome to VBA” in the A1 cell.  Now, we will stop recording under the “Developer” tab.  So, Excel stops recording the activities we do in Excel.  Now, let us see how Excel recorded the activities. Under the “Developer” tab, click on “Visual Basic.”
  • 160.  As soon as you click on “Visual Basic,” we will see the window as in image.  Double click on “Modules.”  Now, we will see the code on the right-hand side.  Macro code started with the word SUB.  All the macro has two parts: the “Head” and the “Tail” because every macro has a name  In between the head and tail of the macro, excel recorded all the activities.  The first thing we did after starting recording the macro was we selected cell A1, and Excel recorded it as Range (“A1”). Select.  The second activity was when we entered the value “Welcome to VBA.” When we selected it, it became an active cell, so Excel recorded the activity as ActiveCell.FormulaR1C1 = “Welcome to VBA.”  Note: R1C1 is row 1, column 1. Record a Macro…
  • 161.  A third activity is after typing the word “Welcome to VBA,” we press the “Enter” key, and Excel selects the A2 cell.  Like this, the Macro recorder recorded all our activities in the Excel sheet. Now, delete the word in cell A1.  After deleting the word, go to VBE, where our code is once again. Click on the “Run” button to enter the same text value to cell A1.  Note: The shortcut key to run the code is F5.  So the macro is executed, and we get the same value again. Like this, we can automate our daily routine work to save time and eliminate boring daily tasks. Record a Macro…
  • 162. How to Save a Macro Excel..?  One must save the Excel workbook containing macro code as “Macro-Enabled Workbook.”  Then, click “Save As” and select the file’s extension as “Macro-Enabled Workbook.
  • 163. Relative Reference in Macro…  We have two options to refer a cell in excel VBA Absolute references and Relative references.  Default Excel records macro in Absolute mode.  We select a cell “A1”, turn on “Use Relative Reference” and record a macro to type some text in cells B2:B4.  Since we turn on the “Relative reference” option. Macro considers the number of rows and number of columns from active cells.  In our example, we select cell A1 and start type B2 which is to move one column and one row from A1 (Active cell).  Step 1: Open Excel and Select Cell “A1”.  Step 2: Go to “Developer” Tab >> Press “Use Relative References” >> Click “Record Macro” .  Step 3: Enter the Macro name “relativeReference” and Press “OK”.  Step 4: Type “Australia” in cell B2  Step 5: Type “Brazil” in cell B3  Step 6: Type “Mexico” in cell B4
  • 164. Relative Reference in Macro…  Step 7: Select cell B5 and Press “Stop Recording”  Step 8: You just delete the contents in cells B2:B4, Select Cell B1.  Step 9: Go to View >> Macros >> View Macros – to popup Macro dialog box [keyboard shortcut – Alt+F8].  Step 10: Select Macro from list (eg. relativeReference) and Press “Run”.  Output: The active cell is B1 and run the macro. So, the outputs (C2:C4) are placed one row and one column from the active cell B1.
  • 165. MS Excel Day 14 – Working with VBA
  • 166. What is VBA used for..? In Excel, you can use VBA for different things. Here are a few:  Enter Data: You can enter data in a cell, range of cells. You can also copy and paste data from one section to another.  Task Automation: You can automate tasks that want you to spend a lot of time. The best example I can give is using a macro to create a pivot table.  Create a Custom Excel Function: With VBA, you can also create a Custom User Defined Function and use it in the worksheet.  Create Add-Ins: In Excel, you can convert your VBA codes into add-ins and share them with others as well.  Integrate with other Microsoft Applications: You can also integrate Excel with other Microsoft applications. Like, you can enter data into a text file.
  • 167. Excel Programming Fundamentals… A procedure in VBA is a set of codes or a single line of code that performs a specific activity.  SUB: Sub procedure can perform actions but doesn’t return a value (but you can use an object to get that value).  Function: With the help of the Function procedure, you create your function, which you can use in the worksheet or the other SUB and FUNCTION procedures You need variables and constants to use values in the code multiple times.  Variable: A Variable can store a value, it has a name, you need to define its data type, and you can change the value it stores. As the name suggests, “VARIABLE” has no fixed value. It is like a storage box that is stored in the system.  Constant: A constant also can store a value, but you can’t change the value during the execution of the code. Variables and Constants
  • 168. Dim in VBA… VBA DIM statement stands for “declare” that you must use when you need to declare a variable. When you use it, it tells VBA that you are declaring a specific name as a variable as assigning a specific data type to it. It can be used to declare the following:  Basic Variables  Variants  Objects  Array Use DIM Statement in VBA  Type the keyword “Dim” at the start.  After that, enter the name of the variable that you want to use.  Next, you need to use the word “as” and you’ll get an instant list of data types.  In the end, choose the data type that you want to assign to the variable.
  • 169. Data Types…  You need to declare the data type for VARIABLES and CONSTANTS.  When you specify the data type for a variable or a constant, it ensures the validity of your data.  If you omit the data type, VBA applies the Variant data type to your variable (it’s the most flexible), VBA won’t guess what the data type should be.
  • 170. Events in Excel… Whenever you do something in Excel, that’s an event: enter a value in a cell, insert a new worksheet, or insert a chart. Below is the classification of events based on the objects:  Application Events: These are events that are associated with the Excel application itself.  Workbook Events: These are events that are associated with the actions that happen in a workbook.  Worksheet Events: These events are associated with the action that happens in a worksheet.  Chart Events: These events are associated with the chart sheets (which are different from worksheets).  Userform Events: These events are associated with the action that happens with a user form.  OnTime Events: OnTime events are those which can trigger code at a particular point in time.  OnKey Events: OnKey events are those which can trigger code when a particular key is pressed.
  • 171. Range… The range object is the most common and popular way to refer to a range in your VBA codes. You need to refer to the cell address, let me tell you the syntax. Worksheets(“Sheet1”).Range(“A1”) Just like any other programming language, you can also write codes to test conditions in VBA. It allows you to do it in two different ways.  IF THEN ELSE: It’s an IF statement that you can use to test a condition and then run a line of code if that condition is TRUE. You can also write nesting conditions with it  SELECT CASE: In the select case, you can specify a condition and then different cases for outcomes to test to run different lines of code to run. It’s a little more structured than the IF statement. Conditions…
  • 172. VBA Loops… You can write codes that can repeat and re-repeat an action in VBA, and there are multiple ways that you can use to write code like this.  For Next: The best fit for using For Next is when you want to repeat a set of actions a fixed number of times.  For Each Next: It’s perfect to use when you want to loop through a group of objects from a collection of objects.  Do While Loop: The simple idea behind the Do While Loop is to perform an activity while a condition is true.  Do Until Loop: In the Do Until, VBA runs a loop and continues to run it if the condition is FALSE.
  • 173. Input and Message Box…  Input Box: The input Box is a function that shows an input box to the user and collects a response.  Message Box: Message Box helps you show a message to the user but, you have an option to add buttons to the message box to get the response of the user. Excel has no luck when it comes to programming errors, and you have to deal with them, no matter what.  Syntax Errors: It’s like typos that you do while writing codes, but VBA can help you by pointing out these errors.  Compile Errors: It comes when you write code to perform an activity, but that activity is not valid.  Runtime Errors: A RUNTIME error occurs at the time of executing the code. It stops the code and shows you the error dialog box.  Logical Error: It’s not an error but a mistake while writing code and sometimes can give you nuts while finding and correcting them. Errors…
  • 175. Various If Statements..  IF THEN is the simplest form of an IF statement. All we need to do is specify a condition to check and if that condition is TRUE it will perform a task. But, if that condition is FALSE it will do nothing and skip the line instantly.  IF condition Then statement[s] End If  You can use the IF-Then-Else statement where you want to perform a specific task if a condition is TRUE and a different task if a condition is FALSE.  IF Condition Then Statement[s] Else Statement[s] End If  IF-Then-Elseif-Else is the most useful and important type of IF which will help you to write advanced condition statements. In this type, you can specify the second condition after evaluating your first condition.  IF Condition Then Statement[s] Elseif Condition Then Statement[s] Else Statement[s] End If
  • 176. MS Excel Day 15 – Power Pivot
  • 177. Power Pivot…  Introduced to Excel 2010 and 2013 as an add-on, but now native to the application, Power Pivot is part of Microsoft's business intelligence stack capable of (but not limited to) big data analytics work without specialty infrastructure or software.  According to Microsoft, "Power Pivot enables you to import millions of rows of data from multiple data sources into a single Excel workbook, create relationships between heterogeneous data, create calculated columns and measures using formulas, build PivotTables and PivotCharts, and further analyze the data so that you can make timely business decisions without requiring IT assistance."  Power Pivot was created in direct response to the big data demands of contemporary business intelligence needs, which prior generations of Excel—given their 1,048,576 row limit or processing speed shortcomings—struggled to cope with.  Power Pivot is expressed by Microsoft using DAX (Data Analysis Expressions), which is a collection of functions, operators, and constants usable in a formula or expression to calculate/return one or more values.
  • 178. Pivot vs Power Pivot…
  • 180. What’s the problem with Normal Pivot.?  Historically Pivot Tables only allow the user to use a single source data table.  If the data are split in different tables, then it has been historically hard to use in a Pivot Table.  The Excel user then needs to use VLOOKUP (or similar) to bring the data into a single table before it is possible to create a Pivot Table.  Excel can only store 1 million rows of data, so forget trying to use Pivot Tables on really large data sets.  Well before you hit the 1 million row limit, Excel will start performing very poorly, particularly if you have lots of VLOOKUPs etc. Excel it is not optimised for large database crunching work.  Pivot tables are very good at aggregating data that exist in a suitable raw form in the underlying table, but are terrible in reporting on anything else that could be derived from the source data.  So in summary, Pivot Tables are great for visualisation as long as your data is optimised in a way to leverage the power of Pivot Tables.
  • 181. What is Power Pivot.?  Power Pivot is actually a data modelling tool.  Take data from one or more sources and combine it together into a single data source (this is called the data model).  Enhance the underlying data so that you can create new derived concepts out of the data. So if you have Sales $ and Cost $ in your source data, you can create Margin $ and Margin % and make these new concepts available to a Pivot Table.  The new concepts you build in Power Pivot are infinitely reusable in your Pivot Tables.  Power Pivot compresses the source data and stores it as a database within the Excel workbook. This means that you can store 10s (even 100s) of millions of rows of data directly in an Excel workbook in a highly compressed and performant way, and distribute it to other people without them needed to have access to the source database.  What Power Pivot does is change the source data so that you can use data that could not previously be used, and you can get more out of data that you previously used inside of a Pivot Table. So Power Pivot is actually your source data on steroids.
  • 182. How it works with Power Pivot.?  Import millions of rows of data from multiple data sources  Fast calculations and analysis  Virtually Unlimited Support of Data Sources  Security and Management  Data Analysis Expressions (DAX) Raw Data Power Query Power Pivot Excel pivot reports/chart s/grid Power view Power map
  • 183. How to enable Power Pivot.?  Go to File > Options > Add-Ins.  In the Manage box, click COM Add-ins> Go.  Check the Microsoft Office Power Pivot box, and then click OK. If you have other versions of the Power Pivot add- in installed, those versions are also listed in the COM Add-ins list.