Advanced Excel
Advanced Excel
Advanced Excel
https://shortcutworld.com/Excel/win/Microsoft-Excel_2013_Shortcuts
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Ribbon tabs – the tabs are used to group similar commands together. The home tab is
used for basic commands such as formatting the data to make it more presentable,
sorting and finding specific data within the spreadsheet.
Ribbon bar – the bars are used to group similar commands together. As an example, the
Alignment ribbon bar is used to group all the commands that are used to align data
together.
worksheet ,Rows and Columns, Sheets, Workbooks
A worksheet is a collection of rows and columns
When a row and a column meet, they form a cell. Cells are used to record data.
Each cell is uniquely identified using a cell address. Columns are usually labelled with
letters while rows are usually numbers.
A workbook is a collection of worksheets. By default, a workbook has three
worksheets in Excel. You can delete or add more sheets to suit your requirements. By
default, the sheets are named Sheet1, Sheet2 and so on.
Customization Microsoft Excel Environment
Customization of ribbon
● Click on the ribbon start button
● Select options from the drop down menu. You should be able to see an Excel
Options dialog window
● Select the customize ribbon option from the left-hand side panel.
● On your right-hand side, remove the check marks from the tabs that you do not
wish to see on the ribbon. For this example, we have removed Page Layout,
Review, and View tab.
● Click on the "OK" button when you are done.
Adding custom tabs to the ribbon
You can also add your own tab, give it a custom name and assign commands to it. Let's
add a tab to the ribbon with the text Gtec
1. Right click on the ribbon and select Customize the Ribbon. The dialogue window
shown above will appear
2. Click on new tab button as illustrated in the animated image below
3. Select the newly created tab
4. Click on Rename button
5. Give it a name of GTEC
6. Select the New Group (Custom) under GTEC tab as shown in the image below
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Select another cell, and then press the F4 key to make that cell reference
absolute. You can continue to press F4 to have Excel cycle through the
different reference types.
Conditional Formatting
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Open the Conditional Formatting dialogue box (Home–> Conditional Formatting–> New
Rule) [Keyboard Shortcut – Alt + O + D].
Alt + O + D].
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Enter the following formula in the field in the ‘Edit the Rule
Description’ section:
=ISODD(ROW())
● The above formula checks all the cells and if the ROW
number of a cell is odd, then it returns TRUE. The specified
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
TRUE.
● Set the format that you want to apply to the cells that are
blank or have errors. To do this, click on the Format button.
It will open the ‘Format Cells’ dialogue box, where you can
specify the format.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Click OK.
That’s it! The alternate rows in the data set will get highlighted.
You can use the same technique in many cases. All you need to do is
use the relevant formula in the conditional formatting. Here are some
examples:
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Here are the steps to create this Search and Highlight functionality:
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Enter the following formula in the field in the ‘Edit the Rule
Description’ section:
=AND($C$2<>””,$C$2=B5)
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Set the format that you want to apply to the cells that are
blank or have errors. To do this, click on the Format button.
It will open the ‘Format Cells’ dialogue box, where you can
specify the format.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Click OK.
That’s it! Now when you enter anything in cell C2 and hit enter, it will
highlight all the matching cells.
The formula used in conditional formatting evaluates all the cells in the
dataset. Let’s say you enter Japan in cell C2. Now Excel would evaluate
the formula for each cell.
The formula would return TRUE for a cell when two conditions are met:
Hence, all the cells that contain the text Japan get highlighted.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
however, change the order by changing the order from the Manage
Rules dialogue box.
Reference link
https://trumpexcel.com/excel-conditional-formatting/
Data filters
Data filters allow us to get data that matches our desired criteria. Let's say we want to
show the results of all the students whose names start with "ja" or get scores that are
less than, greater than or equal to a certain value, we can use filters to get such data.
● Click on DATA tab on the ribbon
● Click on Sort & Filter drop down list as shown in the image below
● Click on the Name Filter
● Select text filters
● Select begins with
● You will get the following window.
● Enter "ja" and click on "OK" button
● You should be able to see only the results for Jane and James.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
statistical functions.
01 SUM Math & Trig Adds all the values in a range of cells =SUM(E4:E8)
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
07 SUMIF Math & Trig Adds all the values in a range of cells that meet =SUMIF(D4:D8,">=1000",C4:C
a specified criteria. =SUMIF(range,criteria,
[sum_range])
09 DAYS Date & Time Returns the number of days between two dates =DAYS(D4,C4)
10 NOW Date & Time Returns the current system date and time =NOW()
Numeric Functions
As the name suggests, these functions operate on numeric data. The
following table shows some of the common numeric functions.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
String functions
These functions are used to manipulate text data. The following table shows
some of the common string functions.
1 LEFT Text Returns a number of specified characters from the start (left- =LEFT("GURU99",4) Left 4 Char
hand side) of a string of "GURU9
2 RIGHT Text Returns a number of specified characters from the end (right- =RIGHT("GURU99",2) Right 2 Ch
hand side) of a string of "GURU9
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
3 MID Text Retrieves a number of characters from the middle of a string =MID("GURU99",2,3) Retrieving
from a specified start position and length. =MID (text, Characters
start_num, num_chars)
4 ISTEXT Information Returns True if the supplied parameter is Text =ISTEXT(value) value - The
to check.
5 FIND Text Returns the starting position of a text string within another =FIND("oo","Roofing",1) Find oo in
text string. This function is case-sensitive. =FIND(find_text, "Roofing",
within_text, [start_num]) is 2
6 REPLACE Text Replaces part of a string with another specified =REPLACE("Roofing",2,2,"xx") Replace "o
string. =REPLACE (old_text, start_num, num_chars, "xx"
new_text)
These functions are used to manipulate date values. The following table
shows some of the common date functions
5 YEAR Date & Time Returns the year from a date =YEAR("04/02/2015")
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
value
Function Description
The Excel Edate function returns a date that is a specified number of months
before or after a supplied start date.
Date Arguments
Note that Microsoft advises that you do not type dates directly into functions, as
Excel interprets text representations of dates differently, depending on the date
interpretation settings on your computer.
Therefore the start_date argument for the Edate function should be input as
either:
● A reference to a cell containing a date
or
● A date returned from another function or formula.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Column B of the following spreadsheet shows six examples of the Excel Edate
function.
Formulas: Results:
A B A B
Function Description
The Excel Workday function returns a date that is a supplied number of working
days (excluding weekends and holidays) ahead of a given start date.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
working days.
Note that Microsoft recommends that the start_date and [holidays] arguments
should be input as either:
● References to cells containing dates
or
● Dates returned from formulas.
If you attempt to input Excel date arguments as text, there is a risk that Excel
may misinterpret them, depending on the date system or date interpretation
settings on your computer.
Formulas:
A B C
2 Holidays: 12/25/2015
3 12/28/2015
4 01/01/2016
Results:
A B C
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
7 01/05/2016 - No Holidays
Excel EOMONTH
The Excel EOMONTH function returns the last day of the month, n months in
the past or future. You can use EDATE to calculate expiration dates, due
dates, and other dates that need to land on the last day of a month. Use a
positive value for months to get a date in the future, and a negative value to
get a date in the past.
Function Description
The Excel Days360 function returns the number of days between 2 dates, based
on a 360-day year (12 x 30 months).
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
VLOOKUP function
The VLOOKUP function is used to perform a vertical look up in the left most
column and return a value in the same row from a column that you specify.
Let's explain this in a layman's language. The home supplies budget has a
serial number column that uniquely identifies each item in the budget.
Suppose you have the item serial number, and you would like to know the
item description, you can use the VLOOKUP function. Here is how the
VLOOKUP function would work.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
HERE,
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
HLOOKUP Function
Formula
Now, if our objective is to fetch the marks of student D in Management, we can use
HLOOKUP as follows:
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The next step would be to give the table array. Table array is nothing but rows of data
in which the lookup value would be searched. Table array can be a regular range or a
named range, or even an Excel table. Here we will give row A1:F5 as the reference.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Next, we would define ‘row_index_num,’ which is the row number in the table_array
from where the value would be returned. In this case, it would be 4, as we are fetching
the value from the fourth row of the given table.
The next is range_lookup. It makes HLOOKUP search for exact or approximate value.
As we are looking out for an exact value, it would be False.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
As you can see in the screenshot above, we need to give the lookup_value first. Here, it
would be student D as we need to find his marks in Management. Now, remember that
lookup_value can be a cell reference or a text string, or it can be a numerical value as
well. In our example, it would be student name as shown below:
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
01 AND Logical Checks multiple conditions and returns true if they all =AND(1 > 0,ISNUMBER(1)) The
the conditions evaluate to true. above function returns TRUE
because both Condition is True.
02 FALSE Logical Returns the logical value FALSE. It is used to compare FALSE()
the results of a condition or function that either
returns true or false
04 IFERROR Logical Returns the expression value if no error occurs. If an =IFERROR(5/0,"Divide by zero
error occurs, it returns the error value error")
05 IFNA Logical Returns value if #N/A error does not occur. If #N/A =IFNA(D6*E6,0) N.B the above
error occurs, it returns NA value. #N/A error means a formula returns zero if both or
value if not available to a formula or function. either D6 or E6 is/are empty
06 NOT Logical Returns true if the condition is false and returns false =NOT(ISTEXT(0)) N.B. the
if condition is true above function returns true.
This is because ISTEXT(0)
returns false and NOT function
converts false to TRUE
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
true if any or all of the conditions are true. Returns N.B. the above function returns
false if all of the conditions are false true if either or both D8 and E8
admin or cashier
08 TRUE Logical Returns the logical value TRUE. It is used to compare TRUE()
the results of a condition or function that either
returns true or false
Nested IF functions
A nested IF function is an IF function within another IF function.
The formula for the above flowchart is as follows
=IF(B1="Sunday","time to rest",IF(B1="Saturday","party well","to do list"))
HERE,
● "=IF(….)" is the main if function
● "=IF(…,IF(….))" the second IF function is the nested one. It provides further
evaluation if the main IF function returned false.
What is a chart?
A chart is a visual representative of data in both columns and rows. Charts are usually
used to analyse trends and patterns in data sets. Let's say you have been recording the
sales figures in Excel for the past three years. Using charts, you can easily tell which year
had the most sales and which year had the least. You can also draw charts to compare
set targets against actual achievements.
Types of charts
The following table shows some of the most commonly used charts and
when you should consider using them.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Open Excel
● Enter the data from the sample data table above
● Your workbook should now look as follows
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
To get the desired chart you have to follow the following steps
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
When you click on the Insert Column chart, types of 2-D Column Charts,
and 3-D Column Charts are displayed. You can also see the option of
More Column Charts.
Step 3 − If you are sure of which chart you have to use, you can choose a Chart
and proceed.
If you find that the one you pick is not working well for your data, the
new Recommended Charts command on the Insert tab helps you to create a
chart quickly that is just right for your data.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Chart Recommendations
Let us see the options available under this heading. (use another word for
heading)
Step 1 − Select the Data from the worksheet.
Step 2 − Click on Recommended Charts.
The following window displaying the charts that suit your data will be displayed.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 3 − As you browse through the Recommended Charts, you will see the
preview on the right side.
Step 4 − If you find the chart you like, click on it.
Step 5 − Click on the OK button. If you do not see a chart you like, click on All
Charts to see all the available chart types.
Step 6 − The chart will be displayed in your worksheet.
Step 7 − Give a Title to the chart.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Chart Elements
● Chart Styles and Colors, and
● Chart Filters
You can use these buttons −
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 1 − Click on the Chart. Three Buttons will appear at the upper-right corner
of the chart.
Step 2 − Click on the first button Chart Elements. A list of chart elements will be
displayed under the Chart Elements option.
Step 3 − Select / De-select Chart Elements from the given List. Only the
selected chart elements will be displayed on the Chart.
Format Style
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 1 − Click on the Chart. Three Buttons will appear at the upper-right corner
of the chart.
Step 2 − Click on the second button Chart Styles. A small window opens with
different options of STYLE and COLOR as shown in the image given below.
Step 3 − Click on STYLE. Different options of Style will be displayed.
Step 4 − Scroll down the gallery. The live preview will show you how your chart
data will look with the currently selected style.
Step 5 − Choose the Style option you want. The Chart will be displayed with the
selected Style as shown in the image given below.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Format Color
Step 1 − Click on the Chart. Three Buttons will appear at the upper-right corner
of the chart.
Step 2 − Click on Chart Styles. The STYLE and COLOR window will be
displayed.
Step 3 − Click on the COLOR tab. Different Color Schemes will be displayed.
Step 4 − Scroll down the options. The live preview will show you how your chart
data will look with the currently selected color scheme.
Step 5 − Pick the color scheme you want. Your Chart will be displayed with the
selected Style and Color scheme as shown in the image given below.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
You can change color schemes from Page Layout Tab also.
Step 1 − Click the tab Page Layout.
Step 2 − Click on the Colors button.
Step 3 − Pick the color scheme you like. You can also customize the Colors and
have your own color scheme.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 4 − Select / De-select the options given under Series and Categories. The
chart changes dynamically.
Step 5 − After, you decide on the final Series and Categories, click on Apply.
You can see that the chart is displayed with the selected data.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The Format pane is a new entry in Excel 2013. It provides advanced formatting
options in clean, shiny, new task panes and it is quite handy too.
Step 1 − Click on the Chart.
Step 2 − Select the chart element (e.g., data series, axes, or titles).
Step 3 − Right-click the chart element.
Step 4 − Click Format <chart element>. The new Format pane appears with
options that are tailored for the selected chart element.
Format Axis
Step 1 − Select the chart axis.
Step 2 − Right-click the chart axis.
Step 3 − Click Format Axis. The Format Axis task pane appears as shown in
the image below.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
You can move or resize the task pane by clicking on the Task Pane Options to
make working with it easier.
The small icons at the top of the pane are for more options.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 5 − Select the required Axis Options. If you click on a different chart
element, you will see that the task pane automatically updates to the new chart
element.
Step 6 − Select the Chart Title.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 7 − Select the required options for the Title. You can format all the Chart
Elements using the Format Task Pane as explained for Format
Axis and Format Chart Title.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 3 − Select a Combo Chart in the way you want the data to be displayed.
The Combo Chart will be displayed.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The first button on the ribbon is the Add Chart Element, which is the same as
the Chart Elements, given at the upper right corner of the Charts as shown
below.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Quick Layout
You can use Quick Layout to change the overall layout of the Chart quickly by
choosing one of the predefined layout options.
Step 1 − Click on Quick Layout. Different possible layouts will be displayed.
Step 2 − As you move on the layout options, the chart layout changes to that
particular option. A preview of how your chart will look is shown.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 3 − Click on the layout you like. The chart will be displayed with the chosen
layout.
Change Colors
The Change Colors option is the same as in CHART ELEMENTS → Change
Styles → COLOR.
Chart Styles
The Chart Styles option is the same as in CHART ELEMENTS → Change
Styles → STYLE.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 1 − Click on Switch Row / Column. You can see that the data will be
swapped between X-Axis and Y-Axis.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Select Data
You can change the Data Range included in the chart using this command.
Step 1 − Click on Select Data. The Select Data Source window appears as
shown in the image given below.
Step 2 − Select the Chart Data Range.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The window also has the options to edit the Legend Entries
(Series) and Categories. This is the same as Chart Elements → Chart Filters
→ VALUES.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 1 − Click on the Change Chart Type window. The Change Chart
Type window appears.
Step 2 − Select the Chart Type you want. The Chart will be displayed with the
type chosen.
Move Chart
You can move the Chart to another Worksheet in the Workbook using this
option.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
You can have aesthetic and meaningful Data Labels. You can
● include rich and refreshable text from data points or any other text in your data labels
● enhance them with formatting and additional freeform text
● display them in just about any shape
Data labels stay in place, even when you switch to a different type of chart.
You can also connect them to their data points with Leader Lines on all charts
and not just pie charts, which was the case in earlier versions of Excel.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The options for the Scatter Charts and the 2-D and 3-D Bubble Charts appear.
Step 3 − Click on the 3-D Bubble Chart. The 3-D Bubble Chart will appear as
shown in the image given below.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 7 − Right-click on any one Data Label. A list of option appears as shown in
the image given below.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 8 − Click on the Format Data Label. Alternatively, you can also click
on More Options available in the Data Labels options to display the Format
Data Label Task Pane.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
There are many options available for formatting of the Data Label in the Format
Data Labels Task Pane. Make sure that only one Data Label is selected while
formatting.
Step 9 − In Label Options → Data Label Series, click on Clone Current
Label.
This will enable you to apply your custom Data Label formatting quickly to the
other data points in the series.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 1 − Click on the Data Label, whose Fill color you want to change. Double
click to change the Fill color for just one Data Label. The Format Data
Label Task Pane appears.
Step 2 − Click Fill → Solid Fill. Choose the Color you want and then make the
changes.
Step 3 − Click Effects and choose the required effects. For example, you can
make the label pop by adding an effect. Just be careful not to go overboard
adding effects.
Step 4 − In the Label Options → Data Label Series, click on Clone Current
Label. All the other data labels will acquire the same effect.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 4 − From the available options, Click on Choose Cell. A Data Label
Reference window appears.
Step 5 − Select the Cell Reference where the Explanatory Text is written and
then click OK. The explanatory text appears in the data label.
Step 6 − Resize the data label to view the entire text.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
A Leader Line is a line that connects a data label and its associated data point.
It is helpful when you have placed a data label away from a data point.
In earlier versions of Excel, only the pie charts had this functionality. Now, all the
chart types with data label have this feature.
Step 3 − Move the data label. The Leader Line automatically adjusts and
follows it.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 2 − Click on Format Leader Lines. The Format Leader Lines task pane
appears. Now you can format the leader lines as you require.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Financial Functions
● PDURATION − Returns the number of periods required by an investment to reach a
specified value.
● RRI − Returns an equivalent interest rate for the growth of an investment.
Information Functions
● ISFORMULA − Returns TRUE if there is a reference to a cell that contains a
formula.
● SHEET − Returns the sheet number of the referenced sheet.
● SHEETS − Returns the number of sheets in a reference.
Logical Functions
● IFNA − Returns the value you specify if the expression resolves to #N/A, otherwise
returns the result of the expression.
● XOR − Returns a logical exclusive OR of all arguments.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Statistical Functions
● BINOM.DIST.RANGE − Returns the probability of a trial result using a binomial
distribution.
● GAMMA − Returns the Gamma function value.
● GAUSS − Returns 0.5 less than the standard normal cumulative distribution.
● PERMUTATIONA − Returns the number of permutations for a given number of
objects (with repetitions) that can be selected from the total objects.
● PHI − Returns the value of the density function for a standard normal distribution.
● SKEW.P − Returns the skewness of a distribution based on a population: a
characterization of the degree of asymmetry of a distribution around its mean.
Text Functions
● DBCS − Changes half-width (single-byte) English letters or katakana within a
character string to full-width (double-byte) characters.
● NUMBERVALUE − Converts text to number in a locale-independent manner.
● UNICHAR − Returns the Unicode character that is references by the given numeric
value.
● UNICODE − Returns the number (code point) that corresponds to the first character
of the text.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Web Functions
The following web functions are introduced in Excel 2013.
● ENCODEURL − Returns a URL-encoded string.
● FILTERXML − Returns specific data from the XML content by using the specified
XPath.
● WEBSERVICE − Returns the data from a web service.
● Flash Fill helps you to separate first and last names or part names and
numbers, or any other data into separate columns.
● Step 1 − Consider a data column containing full names.
●
● Step 2 − Enter the first name in the column next to your data and press
Enter.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Step 3 − Start typing the next name. Flash Fill will show you a list of
suggested names.
●
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Step 5 − Enter a last name in the next column, and press Enter.
●
● Step 6 − Start typing the next name and press Enter. The column will be
filled with the relevant last names.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
● Step 7 − If the names have middle names also, you can still use Flash
Fill to separate the data out into three columns by repeating it three
times.
● Flash Fill works with any data you need to split into more than one
column, or you can simply use it to fill out data based on an
example. Flash Fill typically starts working when it recognizes a pattern in
your data.
Excel 2013 has a new feature Recommended PivotTables under
the Insert tab. This command helps you to create PivotTables automatically.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 1 − Your data should have column headers. If you have data in the form of
a table, the table should have Table Header. Make sure of the Headers.
Step 2 − There should not be blank rows in the Data. Make sure No Rows are
blank.
Step 3 − Click on the Table.
Step 4 − Click on Insert tab.
Step 5 − Click on Recommended PivotTables. The Recommended
PivotTables dialog box appears.
Step 6 − Click on a PivotTable Layout that is recommended. A preview of that
pivot table appears on the right–side.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 7 − Double-click on the PivotTable that shows the data the way you want
and Click OK. The PivotTable is created automatically for you on a new
worksheet.
Step 4 − Click on the option Use an external data source. The button below
that, ‘Choose Connection’ gets enabled.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 5 − Select the Choose Connection option. A window appears showing all
the Existing Connections.
Step 6 − In the Show Box, select All Connections. All the available data
connections can be used to obtain the data for analysis.
The option Connections in this Workbook option in the Show Box is to reuse
or share an existing connection.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The options of External Data Sources appear as shown in the image below.
Step 3 − Click the option From SQL Server to create a connection to an SQL
Server table.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 5 − Choose the PivotTable Fields from the field list. The fields are added
to the default areas.
The Default areas of the Field List are −
● Nonnumeric fields are added to the Rows area
● Numeric fields are added to the Values area, and
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
You can rearrange the fields in the PivotTable by dragging the fields in the
areas.
Step 6 − Drag Region Field from Rows area to Filters area. The Filters
area fields are shown as top-level report filters above the PivotTable.
Step 7 − The Rows area fields are shown as Row Labels on the left side of the
PivotTable.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The order in which the Fields are placed in the Rows area, defines
the hierarchy of the Row Fields. Depending on the hierarchy of the fields, rows
will be nested inside rows that are higher in position.
In the PivotTable above, Month Field Rows are nested inside Salesperson
Field Rows. This is because in the Rows area, the field Salesperson appears
first and the field Month appears next, defining the hierarchy.
Step 8 − Drag the field - Month to the first position in the Rows area. You have
changed the hierarchy, putting Month in the highest position. Now, in the
PivotTable, the field - Salesperson will nest under Month fields.
In a similar way, you can drag Fields in the Columns area also. The Columns
area fields are shown as Column Labels at the top of the PivotTable.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Under the PivotTable Fields, you will see the options, ACTIVE and ALL.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 7 − Click on ALL. You will see both the tables and the fields in both the
tables.
Step 8 − Select the fields to add to the PivotTable. You will see a
message, “Relationships between tables may be needed”.
Step 9 − Click on the CREATE button. After a few steps for creation of
Relationship, the selected fields from the two tables are added to the PivotTable.
Data Model is used for building a model where data from various sources can
be combined by creating relationships among the data sources. A Data Model
integrates the tables, enabling extensive analysis using PivotTables, Power
Pivot, and Power View.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
A Data Model is created automatically when you import two or more tables
simultaneously from a database. The existing database relationships between
those tables is used to create the Data Model in Excel.
Step 1 − Open a new blank Workbook in Excel.
Step 2 − Click on the DATA tab.
Step 3 − In the Get External Data group, click on the option From Access.
The Select Data Source dialog box opens.
Step 4 − Select Events.accdb, Events Access Database file.
Step 5 − The Select Table window, displaying all the tables found in the
database, appears.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 8 − The data is imported, and a PivotTable is created using the imported
tables.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
You have imported the data into Excel and the Data Model is created
automatically. Now, you can explore data in the five tables, which have
relationships defined among them.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 6 − Click the dropdown list button to the right of the Column labels.
Step 7 − Select Value Filters and then select Greater Than…
Step 8 − Click OK.
The Value Filters dialog box for the count of Medals is greater than appears.
Step 9 − Type 80 in the Right Field.
Step 10 − Click OK.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The PivotTable displays only those regions, which has more than total 80
medals.
You could analyze your data from the different tables and arrive at the specific
report you want in just a few steps. This was possible because of the pre-
existing relationships among the tables in the source database. As you imported
all the tables from the database together at the same time, Excel recreated the
relationships in its Data Model.
If you do not import the tables at the same time, or if the data is from different
sources or if you add new tables to your Workbook, you have to create
the Relationships among the Tables by yourself.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Relationships let you analyze your collections of the data in Excel, and create
interesting and aesthetic reports from the data you import.
Step 1 − Insert a new Worksheet.
Step 2 − Create a new table with new data. Name the new table as Sports.
Step 3 − Now you can create relationship between this new table and the other
tables that already exist in the Data Model in Excel. Rename the Sheet1
as Medals and Sheet2 as Sports.
On the Medals sheet, in the PivotTable Fields List, click All. A complete list of
available tables will be displayed. The newly added table - Sports will also be
displayed.
Step 4 − Click on Sports. In the expanded list of fields, select Sports. Excel
messages you to create a relationship between tables.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 6 − To create the relationship, one of the tables must have a column of
unique, non-repeated, values. In the Disciplines table, SportID column has
such values. The table Sports that we have created also has
the SportID column. In Table, select Disciplines.
Step 7 − In Column (Foreign), select SportID.
Step 8 − In Related Table, select Sports.
Step 9 − In Related Column (Primary), SportID gets selected automatically.
Click OK.
Step 10 − The PivotTable is modified to reflect the addition of the new Data
Field Sport. Adjust the order of the fields in the Rows area to maintain
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
the Hierarchy. In this case, Sport should be first and Discipline should be the
next, as Discipline will be nested in Sport as a sub-category.
PowerPivot is an easy to use data analysis tool that can be used from within
Excel. You can use PowerPivot to access and mashup data from virtually any
source. You can create your own compelling reports and analytical applications,
easily share insights, and collaborate with colleagues through Microsoft Excel
and SharePoint.
Using PowerPivot, you can import data, create relationships, create calculated
columns and measures, and add PivotTables, slicers and Pivot Charts.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 3 − Create a table with the data. Name the table Hosts and rename the
Worksheet Hosts.
Step 4 − Click on the Worksheet Hosts. Click the POWERPIVOT tab on the
Ribbon.
Step 5 − In the Tables group, click on Add to Data Model.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 8 − Rearrange the tables by dragging their title bar, so that they are visible
and positioned next to one another.
Four tables Hosts, Events, W_Teams, and S_Teams are unrelated to the rest
of the tables −
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 9 − Both, the Medals table and the Events table have a field
called DisciplineEvent. Also, DisciplineEvent column in the Events table
consists of unique, non-repeated values. Click on Data View in Views Group.
Check DisciplineEvent column in the Events table.
Step 10 − Once again, click on Diagram View. Click on the field Discipline
Event in the Events table and drag it to the field DisciplineEvent in the Medals
Table. A line appears between the Events Table and the Medals Table,
indicating a relationship has been established.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 11 − Click on the line. The line and the fields defining the relationship
between the two tables are highlighted as shown in the image given below.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
= CONCATENATE([Edition],[Season])
Press Enter. The Add Column is filled with values. Check the values to verify
that they are unique across the rows.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
A new column with values similar to those in the EditionID column in Hosts
Table gets created.
Step 14 − Rename the column as EditionID.
Step 15 − Sort the Column in Ascending Order.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
PowerPivot creates a relationship between the two tables. A line between the
two tables, indicates the relationship. The EditionID Field in both the tables is
highlighted indicating that the relationship is based on the column EditionID.
Once you connect your Excel workbook to an external data source, such as a
SQL Server database, Access database or another Excel workbook, you can
keep the data in your workbook up to date by "refreshing" the link to its source.
Each time you refresh the connection, you see the most recent data, including
anything that is new or has been deleted.
Let us see how to refresh PowerPivot data.
Step 1 − Switch to the Data View.
Step 2 − Click on Refresh.
Step 3 − Click on Refresh All.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The Data Refresh window appears showing all the Data Tables in the Data
Model and tracking the refreshing progress. After the refresh is complete, the
status is displayed.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 5 − You will find a Usage tab and a Definition tab. Click on the Usage tab.
The options for Refresh Control appear.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Power View is a feature of Microsoft Excel 2013 that enables interactive data
exploration, visualization, and presentation encouraging intuitive ad-hoc
reporting.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
The Power View sheet is created for you and added to your Workbook with
the Power View. On the Right-side of the Power View, you find the Power
View Fields. Under the Power View Fields you will find Areas.
In the Ribbon, if you click on Design tab, you will find
various Visualization options.
#2 – FVSCHEDULE
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
#5 – XNPV
#6 – PMT
#7 – PPMT
#10 – XIRR
#11 – NPER
#12 – RATE
#13 – EFFECT
#14 – NOMINAL
#15 – SLN
[Pmt] = Payment/period
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
PV = Present Value
FV Example
A has invested the US $100 in 2016. The payment has been made yearly. The interest
rate is 10% p.a. What would be the FV in 2019?
= FV (10%, 3, 1, – 100)
= US $129.79
This financial function is important when you need to calculate the future value with
the variable interest rate. Have a look at the function below –
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Schedule = A series of interest rate put together (in case of excel, we will use different
boxes and select the range)
FVSCHEDULE Example:
M has invested US $100 at the end of 2016. It is expected that the interest rate will
change every year. In 2017, 2018 & 2019, the interest rates would be 4%, 6% & 5%
respectively. What would be the FV in 2019?
= US $115.752
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
PV Example:
The future value of an investment is US $100 in 2019. The payment has been made
yearly. The interest rate is 10% p.a. What would be the PV as of now?
= PV (10%, 3, 1, – 100)
= US $72.64
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
means profit, and is usually due to a careful management of cash inflows and
expenditure.
Here’s how we will represent it in excel –
● NPV = (Rate, Value 1, [Value 2], [Value 3]…)
● Rate = Discount rate for a period
● Value 1, [Value 2], [Value 3]… = Positive or negative cash flows
Here, negative values would be considered as payments and positive values would be
treated as inflows.
NPV Example
Here is a series of data from which we need to find NPV –
Details In US $
Details In US $ Dates
Rate of Discount 5%
Initial Investment -1000 1st December 2011
Return from 1st year 300 1st January 2012
Return from 2nd year 400 1st February 2013
Return from 3rd year 400 1st March 2014
Return from 4th year 300 1st April 2015
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Details In US $ Dates
Rate of Discount 5%
Initial Investment -1000 1st December 2011
Return from 1st year 300 1st January 2012
Return from 2nd year 400 1st February 2013
Return from 3rd year 400 1st March 2014
Return from 4th year 300 1st April 2015
Solution: In excel, we will do as follows –
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Let's say you are shopping for a mortgage and want to know what your monthly
payment would be. To calculate, all you need are three data points:
● Interest rate
● Length of loan
● The amount borrowed
We've inserted example data points below. Here, we are calculating the monthly
payment for a 30-year mortgage of $250,000 at an interest rate of 5.0%:
6. PPMT:
It is another version of PMT. The only difference is this – PPMT calculates
payment on principal with a constant interest rate and constant periodic payments.
Here’s how to calculate PPMT
PPMT = (Rate, Per, Nper, PV, [FV], [Type])
● [Type] = When the payment is made (if nothing is mentioned, it’s assumed that
the payment has been made at the end of the period)
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Let's say you are shopping for a mortgage and want to know what your monthly
payment would be. To calculate, all you need are three data points:
● Interest rate
● Length of loan
● The amount borrowed
We've inserted example data points below. Here, we are calculating the monthly
payment for a 30-year mortgage of $250,000 at an interest rate of 5.0%:
To calculate our payment, we enter this data into the appropriate field in the PMT
function. Note that because our mortgage is based on monthly payments, we will divide
the interest rate by 12 (to give us the monthly interest rate) and multiply the number of
payments by 12 (to give us the total number of payments):
As you can see below, the monthly principal and interest payment for this mortgage
comes out to $1,342.05. This is shown in Excel as a negative figure because it represents
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
monthly money being spent. If you wanted to show it as a positive figure, you can enter
a negative sign in front of the amount borrowed.
https://investinganswers.com/articles/how-calculate-monthly-loan-payment-excel
PPMT Example
US $1000 needs to be paid in full in 3 years. The interest rate is 10% p.a. and the
payment needs to be done yearly. Find out the PPMT in the first year and second year.
Solution: In excel, we will calculate it in the following manner –
1st year,
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Details in US $
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
MIRR Example
Here is a series of data from which we need to find MIRR –
Details In US $
Initial Investment -1000
Return from 1st year 300
Return from 2nd year 400
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
10. XIRR: The Microsoft Excel XIRR function returns the internal rate of return for a
series of cash flows that may not be periodic. ... It can be used as a worksheet function
(WS) in Excel. As a worksheet function, the XIRR function can be entered as part of a
formula in a cell of a worksheet.
XIRR = (Values, Dates, [Guess])
Details In US $ Dates
Initial Investment -1000 1st December 2011
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
= 24%
11.NPER: The Excel NPER function is a financial function that returns the number of
periods for loan or investment. You can use the NPER function to get the number of
payment periods for a loan, given the amount, the interest rate, and periodic payment
amount. Get number of periods for loan or investment.
NPER = (Rate, PMT, PV, [FV], [Type])
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
US $200 is paid per year for a loan of US $1000. The interest rate is 10% p.a. and the
payment needs to be done yearly. Find out the NPER.
Solution: We need to calculate NPER in the following manner –
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
13. EFFECT: The Excel EFFECT Function returns the effective annual interest rate, from
the nominal annual interest rate (APR), and the number of compounding periods
per year.
EFFECT = (Nominal_Rate, NPERY)
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
SLN Example
The initial cost of machinery is the US $5000. It has been depreciated in the Straight Line
Method. The machinery was used for 10 years and now the salvage value of machinery is the
US $300. Find depreciation charged per year.
INFORMATION FUNCTION
https://www.excelfunctions.net/excel-information-functions.html
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Function Description
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Function Description
CELL function
The Excel CELL function returns information about a given cell. This can be information
in relation to the contents, formatting or location of the cell.
The syntax of the function is:
CELL( info_type, reference )
Examples
Formulas: Results:
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
A B
- =CELL( "address", A1 A B
1 9,999 ) -
2 =CELL( "col", A1 ) 1 9,999 $A$1
3 =CELL( "color", A1 ) 2 1
=CELL( "contents", 3 1
4 A1 ) 4 -9999
=CELL( "filename", C:\
5 A1 ) [Book1.xlsx]Shee
6 =CELL( "format", A1 ) 5 t1
SHEETS function
Excel for Office 365 Excel for Office 365 for Mac Excel for the
web Excel 2019 More...
This article describes the formula syntax and usage of the SHEETS
function in Microsoft Excel.
Description
Returns the number of sheets in a reference.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Syntax
SHEETS(reference)
The SHEETS function syntax has the following arguments.
● Reference Optional. Reference is a reference for which you
want to know the number of sheets it contains. If Reference is
omitted, SHEETS returns the number of sheets in the workbook
that contains the function.
Remarks
● SHEETS includes all worksheets (visible, hidden, or very
hidden) in addition to all other sheet types (macro, chart, or
dialog sheets).
● If reference is not a valid value, SHEETS returns the #REF!
error value.
● SHEETS is not available in the Object Model (OM) because the
Object Model already includes similar functionality.
Example
Copy the example data in the following table, and paste it in cell A1 of
a new Excel worksheet. For formulas to show results, select them,
press F2, and then press Enter. If you need to, you can adjust the
column widths to see all the data.
Formula Description Result
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
reference with
the defined
name My3DRef,
which includes
Sheet2 and
Sheet3 (2).
Database Functions
1. DAVERAGE
Averages the values in a column of a list or database that match conditions you specify.
Description
The DAVERAGE function returns the average of the values in a column of a list or database that match
the conditions specified.
Syntax
● Database: The range of cells that makes up the list or database. A database is a list of
related data in which rows of related information are records, and columns of data are fields.
The first row of the list contains labels for each column.
● Field:Indicates for which column the Average is calculated. Enter the column label enclosed
between double quotation marks, such as "Age" or "Yield," or a number (without quotation
marks) that represents the position of the column within the list: 1 for the first column, 2 for the
second column, and so on.
● Criteria: The range of cells that contains the conditions you specify. You can use any
range for the criteria argument, as long as it includes at least one column label and at least one
cell below the column label in which you specify a condition for the column
Example
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
2.DCOUNT
Counts the cells that contain numbers in a column of a list or database that match conditions you specify.
Syntax
criteria The range of cells that contains the conditions that Optional
you specify. You can use any range for the criteria
argument, as long as the argument includes at least
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
3. DGET
Returns a single value from a column of a list or database that matches conditions you specify.
Syntax
Database: The range of cells that makes up the list or database. A database is a list of related data in
which rows of related information are records, and columns of data are fields. The first row of the list
contains labels for each column.
Field: Indicates which column is used in the function. Enter the column label enclosed between double
quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the
position of the column within the list: 1 for the first column, 2 for the second column, and so on.
Criteria: The range of cells that contains the conditions that you specify. You can use any range for the
criteria argument, as long as the argument includes at least one column label and at least one cell below
the column label in which you specify a condition for the column.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
DMAX
Returns the largest number in a column of a list or database that matches conditions you specify.
Syntax
DMIN
Syntax
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
VBA
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 1 − First, enable 'Developer' menu in Excel 20XX. To do the same, click
File → Options.
Step 2 − Click ‘Customize the Ribbon’ tab and check 'Developer'. Click 'OK'.
Step 3 − The 'Developer' ribbon appears in the menu bar.
Step 4 − Click the 'Visual Basic' button to open the VBA Editor
Step 5 − Start scripting by adding a button. Click Insert → Select the
button.
Step 6 − Perform a right-click and choose 'properties'.
Step 7 − Edit the name and caption as shown in the following screenshot.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Step 8 − Now double-click the button and the sub-procedure outline will be
displayed as shown in the following screenshot.
Modules
Modules is the area where the code is written. This is a new Workbook, hence
there aren't any Modules.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Apart from inbuilt Functions, VBA allows to write user-defined functions as well
and statements are written between Function and End Function.
Sub-Procedures
Sub-procedures work similar to functions. While sub procedures DO NOT
Return a value, functions may or may not return a value. Sub procedures CAN
be called without call keyword. Sub procedures are always enclosed within Sub
and End Sub statements.
MsgBox function
The MsgBox function displays a message box and waits for the user to click a
button and then an action is performed based on the button clicked by the user.
Syntax
MsgBox(prompt[,buttons][,title][,helpfile,context])
Parameter Description
Prompt − A Required Parameter. A String that is displayed as a message in the
dialog box. The maximum length of prompt is approximately 1024 characters. If
the message extends to more than a line, then the lines can be separated using
a carriage return character (Chr(13)) or a linefeed character (Chr(10)) between
each line.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Helpfile − An Optional Parameter. A String expression that identifies the Help file
to use for providing context-sensitive help for the dialog box.
Syntax
InputBox(prompt[,title][,default][,xpos][,ypos][,helpfile,context])
Parameter Description
Prompt − A required parameter. A String that is displayed as a message in the
dialog box. The maximum length of prompt is approximately 1024 characters. If
the message extends to more than a line, then the lines can be separated using
a carriage return character (Chr(13)) or a linefeed character (Chr(10)) between
each line.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Title − An optional parameter. A String expression displayed in the title bar of the
dialog box. If the title is left blank, the application name is placed in the title bar.
Default − An optional parameter. A default text in the text box that the user
would like to be displayed.
Example
Let us calculate the area of a rectangle by getting values from the user at run
time with the help of two input boxes (one for length and one for width).
Function findArea()
Dim Length As Double
Dim Width As Double
Variable
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Variable is a named memory location used to hold a value that can be changed
during the script execution. Following are the basic rules for naming a variable.
● You must use a letter as the first character.
● You can't use a space, period (.), exclamation mark (!), or the characters
@, &, $, # in the name.
● Name can't exceed 255 characters in length.
● You cannot use Visual Basic reserved keywords as variable name.
Syntax
In VBA, you need to declare the variables before using them.
Dim <<variable_name>> As <<variable_type>>
Data Types
There are many VBA data types, which can be divided into two main categories,
namely numeric and non-numeric data types.
Numeric Data Types
Following table displays the numeric data types and the allowed range of values.
Byte 0 to 255
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Operator
An Operator can be defined using a simple expression - 4 + 5 is equal to 9. Here,
4 and 5 are called operands and + is called operator. VBA supports following types of
operators −
● Arithmetic Operators
● Comparison Operators
● Logical (or Relational) Operators
● Concatenation Operators
Assume variable A holds 5 and variable B holds 10, then −
Show Examples
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
= Checks if the value of the two operands are equal or not. If (A = B) is False.
yes, then the condition is true.
<> Checks if the value of the two operands are equal or not. If (A <> B) is True.
the values are not equal, then the condition is true.
> Checks if the value of the left operand is greater than the (A > B) is False.
value of the right operand. If yes, then the condition is true.
< Checks if the value of the left operand is less than the value of (A < B) is True.
the right operand. If yes, then the condition is true.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
>= Checks if the value of the left operand is greater than or equal (A >= B) is False.
to the value of the right operand. If yes, then the condition is
true.
<= Checks if the value of the left operand is less than or equal to (A <= B) is True.
the value of the right operand. If yes, then the condition is
true.
AND Called Logical AND operator. If both the a<>0 AND b<>0 is False.
conditions are True, then the Expression is true.
NOT Called Logical NOT Operator. Used to reverse the NOT(a<>0 OR b<>0) is
logical state of its operand. If a condition is true, false.
then Logical NOT operator will make false.
XOR Called Logical Exclusion. It is the combination of (a<>0 XOR b<>0) is true.
NOT and OR Operator. If one, and only one, of
the expressions evaluates to be True, the result is
True.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Note − Concatenation Operators can be used for both numbers and strings. The
output depends on the context, if the variables hold numeric value or string
value.
1. USER FORMS
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
1. Open the Visual Basic Editor. If the Project Explorer is not visible, click View, Project
Explorer.
2. Click Insert, Userform. If the Toolbox does not appear automatically, click View,
Toolbox. Your screen should be set up as below.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
3. Add the controls listed in the table below. Once this has been completed, the result
should be consistent with the picture of the User form shown earlier. For example,
create a text box control by clicking on Text Box from the Toolbox. Next, you can
drag a text box on the User form. When you arrive at the Car frame, remember to
draw this frame first before you place the two option buttons in it.
4. Change the names and captions of the controls according to the table below.
Names are used in the Excel VBA code. Captions are those that appear on your
screen. It is good practice to change the names of controls. This will make your code
easier to read. To change the names and captions of the controls, click View,
Properties Window and click on each control.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Command
OKButton OK
Button
Command
ClearButton Clear
Button
Command
CancelButton Cancel
Button
Note: a combo box is a drop-down list from where a user can select an item or fill in
his/her own choice. Only one of the option buttons can be selected.
DinnerPlannerUserForm.Show
End Sub
We are now going to create the Sub User Form _Initialize. When you use the Show
method for the User form, this sub will automatically be executed.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
3. Choose Userform from the left drop-down list. Choose Initialize from the right drop-
down list.
'Empty NameTextBox
NameTextBox.Value = ""
'Empty PhoneTextBox
PhoneTextBox.Value = ""
'Empty CityListBox
CityListBox.Clear
'Fill CityListBox
With CityListBox
.AddItem "San Francisco"
.AddItem "Oakland"
.AddItem "Richmond"
End With
'Empty DinnerComboBox
DinnerComboBox.Clear
'Fill DinnerComboBox
With DinnerComboBox
.AddItem "Italian"
.AddItem "Chinese"
.AddItem "Frites and Meat"
End With
'Uncheck DataCheckBoxes
DateCheckBox1.Value = False
DateCheckBox2.Value = False
DateCheckBox3.Value = False
'Empty MoneyTextBox
MoneyTextBox.Value = ""
End Sub
Explanation: text boxes are emptied, list boxes and combo boxes are filled, check
boxes are unchecked, etc.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
MoneyTextBox.Text = MoneySpinButton.Value
End Sub
Explanation: this code line updates the text box when you use the spin button.
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 1).Value = NameTextBox.Value
Cells(emptyRow, 2).Value = PhoneTextBox.Value
Cells(emptyRow, 3).Value = CityListBox.Value
Cells(emptyRow, 4).Value = DinnerComboBox.Value
End Sub
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Call UserForm_Initialize
End Sub
Explanation: this code line calls the Sub UserForm_Initialize when you click on the
Clear button.
Unload Me
End Sub
Explanation: this code line closes the Userform when you click on the Cancel button.
Result:
You can use a Reedit control in Excel VBA to get a range from a user. The Userform we are going to
create colors the minimum value of the range stored in the re edit control.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
1. Open the Visual Basic Editor. If the Project Explorer is not visible, click View, Project Explorer.
2. Click Insert, User form. If the Toolbox does not appear automatically, click View, Toolbox. Your screen
should be set up a
3. Add the label, RefEdit control and command buttons. Once this has been completed, the result should
be consistent with the picture of the Userform shown earlier. For example, create a RefEdit control by
clicking on RefEdit from the Toolbox. Next, you can drag a RefEdit control on the Userform.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Note: If your toolbox does not have a RefEdit control, set a reference to RefEdit control. Click Tools,
References, and check Ref Edit Control.
4. You can change the names and the captions of the controls. Names are used in the Excel VBA code.
Captions are those that appear on your screen. It is good practice to change the names of the controls,
but it is not necessary here because we only have a few controls in this example. To change the caption
of the Userform, label and command buttons, click View, Properties Window and click on each control.
5. To show the Userform, place a command button on your worksheet and add the following code line:
UserForm1.Show
End Sub
We are now going to create the Sub UserForm_Initialize. When you use the Show method for the
Userform, this sub will automatically be executed.
7. In the Project Explorer, right click on UserForm1 and then click View Code.
8. Choose User form from the left drop-down list. Choose Initialize from the right drop-down list.
Sheet1.Cells.Font.Color = vb Black
UserForm1.RefEdit1.Text = Selection.Address
End Sub
Explanation: the first code line changes the font color of all the cells on sheet1 to black. The second code
line obtains the address of the current selection and displays it in the RefEdit control.
We have now created the first part of the Userform. Although it looks neat already, nothing will happen
yet when we click the command buttons on the Userform.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
addr = RefEdit1.Value
minimum = WorksheetFunction.Min(rng)
Next cell
End Sub
Explanation: first, we get the address from the Ref Edit control and store it into the String variable add r.
Next, we set rng to the range specified in the Ref Edit control. Next, we use the worksheet function Min to
find the minimum value in the range. Finally, we color the minimum value(s) using a loop.
Unload Me
End Sub
Explanation: this code line closes the User form when you click on the Cancel button.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
When programming using VBA, there are few important objects that a user
would be dealing with.
● Application Objects
● Workbook Objects
● Worksheet Objects
● Range Objects
Application Objects
The Application object consists of the following −
Example
'Example 1 :
Set xlapp = CreateObject("Excel.Sheet")
xlapp.Application.Workbooks.Open "C:\test.xls"
'Example 2 :
Application.Windows("test.xls").Activate
'Example 3:
Application.ActiveCell.Font.Bold = True
Workbook Objects
The Workbook object is a member of the Workbooks collection and contains all
the Workbook objects currently open in Microsoft Excel.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Example
Worksheet Objects
The Worksheet object is a member of the Worksheets collection and contains all
the Worksheet objects in a workbook.
Example
Range Objects
Range Objects represent a cell, a row, a column, or a selection of cells
containing one or more continuous blocks of cells.
'Ex 1 : To Put a value in the cell A5
Worksheets("Sheet1").Range("A5").Value = "5235"
Below we will look at a program in Excel VBA that creates a User Defined Function. Excel has a large
collection of functions. In most situations those functions are sufficient to get the job done. If not, you can
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
create your own function called User Defined Function or custom Excel function. You can access a User
Defined Function just like any other Excel function.
We want to create a function called SUMEVENNUMBERS that finds the sum of the even numbers of a
randomly selected range.
The name of our Function is SUMEVENNUMBERS. The part between the brackets means we give Excel
VBA a range as input. We name our range rng, but you can use any name.
4. We want to check each cell in a randomly selected range (this range can be of any size). In Excel
VBA, you can use the For Each Next loop for this. Add the following code lines:
Next cell
Note: cell is randomly chosen here, you can use any name.
5. Next, we check for each value in this range whether it is even or not. We use the Mod operator for this.
The Mod operator gives the remainder of a division. So 7 mod 2 would give 1. 7 is divided by 2 (3 times)
to give a remainder of 1. Having said this, it is easy to check whether a number is even or not. Only if the
remainder of a number divided by 2 is 0, the number is even. 8 mod 2 gives 0, 8 is divided by 2 exactly 4
times, and therefore 8 is even. Add the following If statement to the For Each Next loop.
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
End If
6. Only if this statement is true, we add the value to SUMEVENNUMBERS. Add the following code line in
the If statement.
End Function
8. Now you can use this function, just like any other Excel function, to find the sum of the even numbers
of a randomly selected range
'This macro will hide all the worksheet except the active sheet
Sub HideAllExceptActiveSheet()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> ActiveSheet.Name Then ws.Visible = xlSheetHidden
Next ws
End Sub
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Here is the code that will unhide all the worksheets in the workbook.
The above code uses a VBA loop (For Each) to go through each
worksheets in the workbook. It then changes the visible property of the
worksheet to visible
Sub SortSheetsTabName()
Application.ScreenUpdating = False
ShCount = Sheets.Count
For i = 1 To ShCount - 1
For j = i + 1 To ShCount
Sheets(j).Move before:=Sheets(i)
End If
Next j
Next i
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
Application.ScreenUpdating = True
End Sub
It allows you to specify the password within the code. You will need this
password to unprotect the worksheet.
https://trumpexcel.com/excel-macro-examples/
Background Colors
Changing background colors in Excel VBA is easy. Use the Interior property to return an Interior object. Then
use the ColorIndex property of the Interior object to set the background color of a cell.
Place three command buttons on your worksheet and add the following code lines:
ADVANCED EXCEL
G-TEC COMPUTER EDUCATION
ISO 9001:2015 CERTIFIED
1. The code line below sets the background color of cell A1 to light blue.
Range("A1").Interior.ColorIndex = 37
2.The following code line sets the background color of cell A1 to 'No Fill'.
Range("A1").Interior.ColorIndex = 0
3.If you want to know the ColorIndex number of a color, simply ask Excel VBA.
MsgBox Selection.Interior.ColorIndex
ADVANCED EXCEL