Advance Excel
Advance Excel
Before we dive into advanced Excel formulas, let's first refresh the basic functions that
are widely used:
Advanced text functions allow you to manipulate and extract information from text
strings:
LEFT: Extracts the specified number of characters from the beginning of a text
string.
RIGHT: Extracts the specified number of characters from the end of a text string.
1
Advance Excel Zahara Educational Institute
MID: Extracts characters from the middle of a text string, starting from a specific
position.
CONCATENATE (or CONCAT): Joins two or more text strings into one.
Logical Functions
Logical functions help you test conditions and make decisions based on those conditions:
IF: Tests a condition and returns one value if TRUE, another if FALSE.
2
Advance Excel Zahara Educational Institute
Nested Functions: You can combine functions within each other to perform more
complex calculations.
3
Advance Excel Zahara Educational Institute
Combining INDEX and MATCH: Use INDEX and MATCH together for more
dynamic and flexible lookups.
Benefits:
4
Advance Excel Zahara Educational Institute
3. Array Formulas
5
Advance Excel Zahara Educational Institute
Summary
Excel's advanced functions like logical functions, lookup functions, and array
formulas help manage large datasets and perform complex calculations.
INDEX and MATCH provide more flexible lookups than VLOOKUP, and
XLOOKUP offers even greater simplicity and power.
Dynamic arrays in Excel 365/2021 allow users to work with more powerful and
dynamic formulas, simplifying tasks like filtering, sorting, and generating unique
values.
6
Advance Excel Zahara Educational Institute
1. Data Validation
Data validation ensures that only valid data is entered into a spreadsheet, which helps
reduce errors and improves data consistency.
1.1. Setting Data Validation Rules (Drop-down Lists, Date Ranges, etc.)
Drop-down Lists:
o Purpose: Restrict data entry to a predefined set of values.
o Steps:
1. Select the cell(s) where you want the drop-down list.
2. Go to the Data tab and click Data Validation.
3. In the Data Validation dialog box, choose List from the Allow
dropdown.
4. In the Source field, enter the list items separated by commas (e.g.,
Yes,No,Maybe) or refer to a range (e.g., =$A$1:$A$3).
5. Click OK.
o Example: If you want users to select “Yes” or “No” for a question, you
can create a drop-down list with these two options.
Date Ranges:
o Purpose: Ensure that only valid dates, within a specified range, can be
entered.
o Steps:
1. Select the cell(s) where you want to validate the dates.
2. Go to Data > Data Validation.
3. In the Data Validation dialog box, select Date from the Allow
dropdown.
4. In the Data dropdown, choose a condition such as between,
greater than, or less than.
5. Set the date range (e.g., between 01/01/2020 and 12/31/2024).
7
Advance Excel Zahara Educational Institute
6. Click OK.
Purpose: Use formulas to create complex validation rules that go beyond the
built-in options.
Steps:
1. Select the cell(s) where you want to apply custom validation.
2. Go to Data > Data Validation.
3. In the Allow dropdown, select Custom.
4. Enter a formula in the Formula field. For example:
To ensure a number is greater than 0: =A1>0.
To ensure a cell contains only text: =ISTEXT(A1).
5. Click OK.
Purpose: Make one drop-down list dependent on the selection made in another.
Steps:
1. Create two ranges of values in your sheet (e.g., countries and states).
2. Assign Named Ranges to these lists (e.g., name the country list as
Countries and each state's list as the corresponding country name).
3. Create a drop-down for the countries.
4. For the states drop-down, use the formula =INDIRECT(A1) in the Data
Validation Source field, where A1 refers to the cell with the country
selection.
5. Click OK.
8
Advance Excel Zahara Educational Institute
Advanced sorting and filtering techniques allow you to organize and extract relevant data
based on specific criteria.
Purpose: Sort data based on custom criteria (e.g., sorting days of the week or
months of the year).
Steps:
1. Select the range of cells or the table you want to sort.
2. Go to Data > Sort.
3. In the Sort dialog box, under Column, select the column you want to sort.
4. Click Order and choose Custom List to specify the custom sorting order.
5. You can enter a custom list (e.g., Monday, Tuesday, Wednesday) or
select from predefined lists like months or days.
6. Click OK.
Purpose: Sort data based on more than one criterion, such as sorting by region,
then by category.
Steps:
1. Select your data range.
2. Go to Data > Sort.
3. In the Sort dialog box, select the first column to sort by (e.g., Region).
4. Click Add Level to add a second sort level (e.g., Category).
5. For each level, define the sorting order (ascending/descending).
6. Click OK.
2.3. Advanced Filtering (Complex Criteria, Wildcards, and Advanced Filter Dialog)
Purpose: Filter data using complex conditions or wildcards for pattern matching.
Steps:
1. Advanced Criteria:
9
Advance Excel Zahara Educational Institute
Efficiently managing and analyzing large datasets is essential for performance and
clarity.
Purpose: Use Excel Tables for dynamic data management and easy analysis.
Steps:
1. Select your data range.
2. Go to Insert > Table to convert your data into a table.
3. Excel automatically names the table (e.g., Table1), and you can use
structured references in formulas.
4. Example: To sum the sales column, use =SUM(Table1[Sales]) instead of
a regular range formula.
5. Tables automatically expand as new rows are added, making them
dynamic.
10
Advance Excel Zahara Educational Institute
Purpose: Organize data into collapsible groups to make large datasets more
manageable.
Steps:
1. Select the rows or columns you want to group.
2. Go to Data > Group.
3. The data is grouped, and you can collapse or expand it.
4. To ungroup, go to Data > Ungroup.
Purpose: Use Power Query to import, clean, and transform data without affecting
the source data.
Steps:
1. Go to Data > Get & Transform Data.
2. Choose Get Data to import data from external sources.
3. Use Power Query Editor to transform the data (e.g., remove duplicates,
filter rows, change data types).
4. Once cleaned, load the data back into Excel.
11
Advance Excel Zahara Educational Institute
3. Reducing the amount of data in the pivot cache (e.g., by selecting specific
ranges or data sources) can improve performance when dealing with large
datasets.
12
Advance Excel Zahara Educational Institute
Pivot Tables are used to summarize large sets of data by allowing you to easily group,
analyze, and report on key data points. Here’s an overview of the key components of
creating and customizing Pivot Tables:
o It helps with data analysis by allowing users to organize, filter, and display
data from different perspectives.
Common Uses:
Grouping by Categories:
o Steps: Drag a field to the Rows or Columns area in the Pivot Table Field
List. Excel will automatically group the data by unique values in that field.
Grouping by Ranges:
13
Advance Excel Zahara Educational Institute
o Grouping Numbers and Dates: You can group numeric or date fields
into specific ranges (e.g., grouping sales into ranges like 0-100, 101-200).
2. Select Group.
Layouts:
o You can customize how the data is displayed in the Pivot Table by
changing the layout.
Styles:
Calculated Fields:
o Example: If you want to calculate profit, you can add a calculated field
like Profit = Revenue - Cost.
14
Advance Excel Zahara Educational Institute
o Steps:
Calculated Items:
o Purpose: Create calculations within specific items in the Pivot Table (e.g.,
calculating total sales for a specific combination of regions).
Slicers:
o Steps:
3. Choose the fields you want to use as slicers (e.g., Region, Product).
Timelines:
o Purpose: Filter data based on time periods (ideal for date fields).
o Steps:
15
Advance Excel Zahara Educational Institute
4. Select the time period you want to filter by (e.g., months, quarters).
Advanced Pivot Table features allow for even more powerful and flexible data analysis,
making it easier to derive insights and perform complex calculations.
Nested Grouping:
o Purpose: Group data by multiple fields. For example, you might want to
group sales data first by Region, and then by Product Category within
each Region.
o Steps:
2. Excel will automatically nest the fields under each other, creating a
hierarchy.
Running Totals:
o Steps:
16
Advance Excel Zahara Educational Institute
3. Choose the field you want the cumulative total to be based on (e.g.,
Order Date).
Moving Averages:
o Steps:
Percentage of Total:
o Steps:
Data Models:
o Purpose: Combine data from multiple tables into a single data model for
more complex analysis.
o Steps:
1. Go to Insert > PivotTable > Add this data to the Data Model.
17
Advance Excel Zahara Educational Institute
Power Pivot:
o Steps:
2.4. Using Power Pivot for Creating Complex Relationships and Calculations Across
Multiple Tables
Power Pivot allows you to create complex calculated columns and measures
that span multiple tables.
o You can also use DAX (Data Analysis Expressions) for more complex
calculations, such as =SUMX(Sales, Sales[Amount]).
3. Pivot Charts
Pivot Charts are graphical representations of Pivot Table data. They help visualize data
insights and trends in a dynamic way.
18
Advance Excel Zahara Educational Institute
o Steps:
3. Choose a chart type (e.g., column, bar, line) from the chart options.
o Use the Chart Tools (Design and Format tabs) to customize the
appearance of the chart (e.g., changing colors, labels, or chart styles).
Pivot Charts automatically update when the Pivot Table data changes (e.g., when
filters or slicers are applied). This allows for real-time, dynamic analysis of data.
3.3. Advanced Charting Techniques with Pivot Tables and Power Pivot
Advanced Charting:
o Combine multiple data series into a single chart (e.g., combining sales and
profit data).
o Use Combo Charts to display different types of data on the same chart
(e.g., bar chart for sales, line chart for profit margins).
o Power Pivot enables you to create charts from data models, where data can
be pulled from multiple tables, providing a broader and more complex
view of the data.
19
Advance Excel Zahara Educational Institute
Advanced charting techniques allow you to create more insightful and visually appealing
charts. You can combine multiple chart types, use secondary axes, and enhance charts
with dynamic controls.
o It is useful when you have different data series with varying value ranges
or types (e.g., one data series as bars, another as a line).
3. Choose Custom Combination Chart and select the chart type for each
data series (e.g., Column for Sales, Line for Profit).
o When plotting data with different ranges, using a secondary axis helps to
compare them effectively. For example, if you have sales and profit, sales
may range in thousands, and profit may be in smaller amounts.
1.3. Creating Dynamic Charts Using Named Ranges and Form Controls
o Form Controls: Tools like drop-down lists or option buttons that allow
users to interact with charts dynamically.
1. Define a Named Range for your data (e.g., go to Formulas > Define
Name).
2. Use Form Controls (e.g., a drop-down list) to select different data sets.
3. Link the Named Range to the form control. When the user selects a
different option, the data in the chart will automatically update based on
the selected range.
Bullet Charts:
o Steps:
21
Advance Excel Zahara Educational Institute
3. Format the chart to display the actual value and target as different
colored bars.
Heat Maps:
o Purpose: A heat map uses color to represent the intensity of values, where
different colors indicate varying levels of data.
o Steps:
3. Use the Color Scales to display the data with different color
intensities.
Sparklines:
o Purpose: Sparklines are miniature charts that fit within a single cell,
representing trends in a data series.
o Steps:
2. Interactive Dashboards
22
Advance Excel Zahara Educational Institute
Interactive dashboards allow users to explore data and gain insights dynamically. This
section covers how to design a dashboard with interactivity, link Pivot Tables with charts,
and use Excel Power BI for advanced visualizations.
Key Principles:
o Clarity: Use clear labels, legends, and titles to ensure the data is easy to
understand.
1. Identify Key Metrics: Choose the most important data points to display.
Dynamic Dashboards:
o Linking Pivot Tables to charts allows for real-time updates when data
changes.
o Use slicers, timelines, and form controls to give users the ability to filter
data in Pivot Tables, which in turn updates the linked charts dynamically.
23
Advance Excel Zahara Educational Institute
3. Add Slicers or Timelines to filter the data in the Pivot Table, which will
automatically update the Pivot Chart.
Using Slicers:
o Steps:
o Form Controls like drop-down lists allow users to select different data sets
or parameters (e.g., changing the time period displayed).
o Steps:
1. Go to Developer > Insert > Form Controls > Combo Box (drop-
down).
24
Advance Excel Zahara Educational Institute
3. Conditional Formatting
Conditional formatting is used to apply formatting rules based on the data values. This
helps highlight important trends and outliers, making data easier to interpret.
3.1. Advanced Conditional Formatting Rules (Data Bars, Color Scales, Icon Sets)
Data Bars:
o Steps:
Color Scales:
25
Advance Excel Zahara Educational Institute
o Steps:
Icon Sets:
o Steps:
Using Formulas:
o Steps:
26
Advance Excel Zahara Educational Institute
4. Enter the formula (e.g., =A1>100 to format cells greater than 100).
Dynamic Formatting:
to highlight changing values, trends, or specific conditions (e.g., highlighting cells where
sales exceeded targets).
27
Advance Excel Zahara Educational Institute
3. In the Record Macro dialog box, provide a name, shortcut key, and
description (optional).
o By default, macros are saved in the workbook you are working on. You
can choose to store them in the Personal Macro Workbook to make them
available in all workbooks.
VBA Editor:
o Once a macro is recorded, you can view and modify the code by opening
the VBA Editor:
28
Advance Excel Zahara Educational Institute
2. In the editor, you’ll see the Modules where the macro code is
stored.
o Sub MacroName()
o End Sub
Procedures vs Functions:
o Procedure: A set of VBA commands that perform an action but does not
return a value (e.g., a macro that formats a cell).
Writing a Procedure:
o Sub ChangeCellValue()
o End Sub
29
Advance Excel Zahara Educational Institute
Writing a Function:
o AddNumbers = x + y
o End Function
Adding a Button:
o You can add a button to your Excel sheet that, when clicked, will run a
macro.
o Steps:
4. Assign the macro to the button by selecting the macro name in the
dialog box that appears.
o You can also format the button to make it visually appealing and label it
according to its action.
Variables:
30
Advance Excel Zahara Educational Institute
o Example:
Sub Example()
myVariable = 5
End Sub
Loops:
o For i = 1 To 5
o Next i
o Range("A1").Value = Range("A1").Value + 1
o Loop
Sub Example()
31
Advance Excel Zahara Educational Institute
Else
End If
End Sub
On Error Statement:
o Example:
o Sub ExampleMacro()
o End If
o End Sub
Workbook Operations:
o Open a workbook:
o Workbooks.Open "C:\Path\To\Your\Workbook.xlsx"
32
Advance Excel Zahara Educational Institute
o Save a workbook:
o ActiveWorkbook.Save
o Close a workbook:
o ActiveWorkbook.Close
Worksheet Operations:
o Activate a worksheet:
o Worksheets("Sheet1").Activate
o Worksheets.Add
o Delete a worksheet:
o Worksheets("Sheet1").Delete
MultiplyByTwo = Number * 2
End Function
33
Advance Excel Zahara Educational Institute
3. Once the UDF is created, you can use it in Excel like any other function:
=MultiplyByTwo(A1).
o User Forms provide a way to interact with users, allowing them to input
data through controls like text boxes, buttons, and combo boxes.
o Steps:
3. Write VBA code for the controls (e.g., a button click event to
collect user input).
o Example:
o End Sub
Importing Data:
o You can automate importing data from external sources (e.g., CSV files)
into Excel using VBA.
o Example:
34
Advance Excel Zahara Educational Institute
o Sub ImportCSV()
o Workbooks.Open Filename:="C:\Path\To\File.csv"
o End Sub
Exporting Data:
o Example:
o Sub ExportToCSV()
o ActiveWorkbook.SaveAs Filename:="C:\Path\To\Export.csv",
FileFormat:=xlCSV
o End Sub
o You can create custom buttons or commands in the Ribbon using VBA,
making frequently used macros more accessible.
o Steps involve using the Ribbon XML code to design and add buttons to
the ribbon or toolbar and linking them to your macros.
o Example:
o Sub CustomButtonMacro()
o End Sub
o You can also create buttons or commands on the Quick Access Toolbar
(QAT) to run your macros with ease.
35
Advance Excel Zahara Educational Institute
o Example:
o =NPV(0.05, B2:B6) - B1
This formula calculates the present value of cash flows in cells B2 to B6, discounted at
5%, and subtracts an initial investment (in B1).
o IRR determines the discount rate that makes the NPV of cash flows equal
to zero. It is used to evaluate investment profitability.
o Example:
o =IRR(B1:B5)
This formula returns the internal rate of return for the series of cash flows from B1 to B5.
36
Advance Excel Zahara Educational Institute
o PMT calculates the fixed monthly payment required to repay a loan based
on the interest rate, number of periods, and present value.
o Example:
This formula calculates the monthly payment for a loan of $10,000 at 5% annual interest
over 5 years (60 months).
FV (Future Value):
o Example:
This formula calculates the future value of investing $1,000 every year for 10 years at 5%
interest.
o Example:
o =SLN(10000, 2000, 5)
This formula calculates the depreciation of an asset with an initial cost of $10,000, a
salvage value of $2,000, and a useful life of 5 years.
37
Advance Excel Zahara Educational Institute
o Example:
o =DDB(10000, 2000, 5, 1)
This formula calculates the depreciation in the first period using the double-declining
balance method.
Financial Forecasting:
o Example:
Budgeting:
38
Advance Excel Zahara Educational Institute
1.4. Using Excel for Creating Financial Statements and Cash Flow Analysis
Financial Statements:
Income Statements
Balance Sheets
Use functions like SUM, IF, and VLOOKUP to calculate totals and
retrieve data.
=SUM(Revenue) - SUM(Expenses)
o Excel can help track cash inflows and outflows over a period.
o Used to analyze how changing one input affects the output of a formula.
o Steps:
39
Advance Excel Zahara Educational Institute
3. Use Data Table under the What-If Analysis tools to link the input
values to the formula and calculate the corresponding results.
o Used to analyze how changing two inputs affects the output of a formula.
o Example: Analyzing how different interest rates and loan amounts affect
the monthly payment.
o Steps:
2. Set up a table with one set of input values across rows and another
set down columns.
Goal Seek:
o Goal Seek helps find the input value needed to reach a specific result.
o Example:
If you want to know what interest rate will make your loan
payment equal to $500, use Goal Seek:
Steps:
2. Set the formula cell to the desired value and specify the
changing cell.
Solver:
o Example:
40
Advance Excel Zahara Educational Institute
Steps:
Use Excel’s Scenario Manager to create different scenarios (e.g., best case,
worst case) based on different input variables.
Example:
Templates:
o Use pre-built Excel templates or create your own templates for regular
reports.
Formulas:
41
Advance Excel Zahara Educational Institute
Clarity and Simplicity: Keep reports clear and easy to understand. Avoid clutter
and use simple language and visuals.
Effective Use of Charts: Use bar, line, and pie charts to represent trends and
comparisons.
Consistency: Ensure that formatting and layout are consistent across all reports
and dashboards.
o Ctrl + C → Copy
o Ctrl + X → Cut
o Ctrl + V → Paste
o Ctrl + Z → Undo
o Ctrl + Y → Redo
o Ctrl + F → Find
o Ctrl + H → Replace
42
Advance Excel Zahara Educational Institute
o Ctrl + Shift + Arrow Key → Select entire range in the direction of the
arrow
o Use the F4 key to toggle between absolute ($A$1), relative (A1), and
mixed ($A1 or A$1) references when writing formulas.
o Use Ctrl + Enter to apply a formula or data entry across multiple selected
cells.
Paste Special:
o Paste Values and Number Formats: Copy values along with their
formatting but no formulas.
o Quick Access Toolbar: Add your most-used functions for quicker access.
43
Advance Excel Zahara Educational Institute
Workbook Organization:
o Freeze Panes: Use the "Freeze Panes" option to keep row and column
headers visible while scrolling.
Named Ranges:
Quick Navigation:
o Ctrl + G or F5: Open the "Go To" dialog to quickly jump to a specific
cell or range by typing its address.
Trace Precedents:
o This tool shows which cells are referenced in the current cell’s formula.
Trace Dependents:
o This tool shows which cells depend on the value in the current cell.
44
Advance Excel Zahara Educational Institute
Show Formulas:
Formula Auditing:
o Use the Error Checking feature under Formulas > Error Checking to
identify errors in formulas across the workbook.
o Common Errors:
o Click on the error: Excel will provide an error message and offer options
to fix it (e.g., Ignore, Edit, or Help).
Evaluate Formula:
o The Evaluate Formula tool allows you to step through the calculation
process of a formula to understand how Excel evaluates it.
o How to Use: Select the cell with the formula, go to Formulas > Evaluate
Formula. Click Evaluate to see each step of the formula's calculation.
45
Advance Excel Zahara Educational Institute
This tool is useful for resolving complex formulas or understanding why a certain
result is being returned, especially when using nested functions or multiple
references.
Structure:
o Use consistent formatting (e.g., font, color, number formats) for clarity.
o Avoid using merged cells, as they can complicate sorting and filtering.
Documenting Workbooks:
Version Control:
3.2. Protecting Sensitive Data Using Password Protection and Cell Locking
Password Protection:
o How to Protect Workbook: Go to File > Info > Protect Workbook >
Encrypt with Password.
Cell Locking:
46
Advance Excel Zahara Educational Institute
o How to Lock Cells: Select the cells you want to lock, then use Format
Cells > Protection > Locked.
o After locking cells, protect the worksheet by going to Review > Protect
Sheet, setting a password to prevent others from editing the locked cells.
Collaborative Work:
o Track changes using the Track Changes feature under Review > Track
Changes.
o Share workbooks with others, but ensure the file is saved in a secure
location to avoid versioning conflicts.
o For cloud-based collaboration, you can share an Excel file via OneDrive
and use Excel Online for real-time editing and collaboration.
o When sharing a workbook, use File > Save As to save the workbook as a
new version or in different formats (e.g., .xlsx, .xlsm).
47