0% found this document useful (0 votes)
9 views

Final Dass

Uploaded by

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

Final Dass

Uploaded by

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

NIRMA UNIVERSITY

Institute of Management
Integrated BBA MBA Programme

Data Analysis through Spreadsheet-2MU202

By Dr. P. Raja Babu


M.Com., MBA., MBA., M.Phil., Ph. D
Credit Scheme
Course Learning Outcomes (CLO):
At the end of the course, students would be able to:
1.Explain the importance and scope of data analysis using spreadsheet. BL - 2
2.Relate the significance and application of data visualization BL - 2
3.Develop formulas and models for data analysis using spreadsheet. BL - 3

L T Practical Component C
NIRMA UNIVERSITY
LPW PW W S Institute: Institute of Management
2 0 2 0 0 0 3
Name of Integrated BBA – MBA
Programme: Programme
Course Code: 2MU202
Course Title: Data Analysis through
Spreadsheet
Course Type: Core
Year of 2023 – 24 (Semester III)
Introduction:
UNIT I: DATA ANALYSIS USING SPREADSHEETS-I 6 Syllabus
● BASICS OF EXCEL VIEW OF WORKBOOK
•Total Teaching Hours: 30
● WORKING WITH DATA: CONDITIONAL FORMATTING, •Suggested Readings:
SORTING AND FILTERING DATA
•Alexander, M., Kusleika, R., & Walkenbach, J.
● IMPORTING DATA AND CONSOLIDATING DATA
Excel Bible, Latest edition. John Wiley & Sons.
● DATA VALIDATION
•Jelen, B., & Alexander, M. Microsoft Excel 2019
● WORKING WITH FORMULAS: FORMULA BAR, HOW TO Pivot Table Data Crunching. Microsoft Press.
WRITE FORMULA, CELL ADDRESS, RANGE.
•McFedries, P. Excel data analysis for dummies,
UNIT III: DataLatest
Visualization
edition.using
JohnSpreadsheets
Wiley & Sons. 4
UNIT II: Data Analysis using Spreadsheets-II 6 ● Create and modify graphs / charts like Column, Line, Pie,
● Working with Formulas: reference style, absolute reference, relative Bar, Area, Scatter, 3D etc.
reference, mixed reference.
● Working with multiple sheets, hyper linking.
● Working with functions: Use of some basic and advance
Unit IV: Spreadsheet Excel Functions 4
● Introduction to Data Analysis Tool Pack
 Sum, Max, Min, Average, Count, Today, Now,
● Pivot Table and Pivot chart  Datedif, Countif, CountA, CountBlank, Round, Roundup

Unit V: Data Analysis Packages 10


● Introduction to Programming for Excel
● MS Excel Plugin
● Data Analysis Application using Correlation, Regression,
ANNOVA
● Data modelling: Using Solver
● Macros and Visual Basic for Applications (VBA) scripting
UNIT I: DATA ANALYSIS USING SPREADSHEETS-I
• BASICS OF EXCEL VIEW OF WORKBOOK
• WORKING WITH DATA: CONDITIONAL
FORMATTING, SORTING AND FILTERING DATA
• IMPORTING DATA AND CONSOLIDATING DATA
• DATA VALIDATION
• WORKING WITH FORMULAS: FORMULA BAR,
HOW TO WRITE FORMULA, CELL ADDRESS,
RANGE. …..6
UNIT I: DATA ANALYSIS USING SPREADSHEETS-I
BASICS OF EXCEL VIEW OF WORKBOOK

Introduction: Microsoft Office Excel was designed to support accounting functions such as
budgeting, preparing financial statements and creating balance sheets. It is not only accounting
functions, and many complex mathematical calculations can do with the helps of spread sheet.
• Spreadsheets provide a roadmap of analysis. The spreadsheets provide a template that can be filled
in with real data for hands-on illustrations.
• The power of spreadsheets becomes apparent when one compares them to the traditional sequence
of text narratives and numerical derivations for real cases.
• It also supports many activities such as modeling and financial forecasting and integrates with
external data to import and export banking information and financial data to and from other
accounting software platforms.
• There is a few spreadsheet programs but of all of them, excel is the most widely used.
People have been using it for the last 30 years and throughout these years, it has been
upgraded with more and more features.
• The best part about Excel is, that it can apply to many business tasks, including statistics,
finance, data management, forecasting, analysis, tracking inventory and billing, and
business intelligence.
Workbook in excel
(i) At a basic level, a workbook consists of data, charts,
and formulas.
(ii)Excel is a file to create, save, organize, and manage
your data in a structured way.
When you launch Excel, it automatically creates a blank
workbook consisting of one default worksheet named
“Sheet 1”.
Workbook meaning in Excel:
A workbook is an excel file that contains the worksheet
and tools with which we do our work.
The differences between
Workbook and Worksheet
• A workbook comprises
worksheets and tools for excel
work
• while a worksheet
comprises rows, columns, and
cells where we input and process
our data in excel. In other words,
a worksheet is a part of a
workbook.
1.Title bar: The name of the file
2.Quick access toolbar: The place where you can find some
command buttons very quickly (Save, can’t undo control Z and Repeat
typing control Y)
3.Menu bar: The division of commands in the ribbon
4.Ribbon: The place where you can find the command buttons you
need to run for your excel work
5.Address bar: This is the box to give your active cell currently is in
column and row coordinates
6.Formula bar: The box that shows the value of your active cell
7.Active cell: The cell you currently select
8.Column letters: The place that shows the column letters of all the
cells currently displayed in the worksheet
9.Row numbers: The place that shows the row numbers of all the cells
currently displayed in the worksheet.
From Excel 2007 onwards (2010, 2016, etc) we have exactly 1,048,576
rows and 16,384 columns. But with the Excel 2003 version, we have only
65,000 rows and 255 columns.
10. Sheet bar: The place that shows all the worksheets in the
workbook, the active worksheet, and the buttom to add a worksheet
11. Status bar: The place that shows the status of your workbook and
gives some quick calculation results when you highlight a cell
range with multiple data.
12. View buttons: The place where you can select the view mode of
your active worksheet
13. Zoom slider: The place where you can manage the zoom level of
your active worksheet
WORKING WITH DATA: CONDITIONAL
FORMATTING, SORTING AND FILTERING
DATA
• Introduction: In any organization, various types
of decisions are taken based on working with
data or analyzing the data by the data manager.
When we are working with the data, it consists of
various rows and columns related to text type or
values in the form of a table. Sorting, filtering,
and formatting will be helpful for creating,
editing, and formatting tables. In this session, we
will use analysis on table data.
Sorting: Sorting refers to rearrange records so that they are sorted Title Year Director In Stock
alphabetically or numerically. To classify some columns by alphabetical A Christmas Carol 1951 Brain Hurst 0
order, with the highest numbers going to the lowest number or the lowest
Christmas in July 1940 Preston Sturges 1
number going to the highest number. These are things you can do by sorting
An Angel from Texas 1940 Ray Enright 1
your data.
The big sleep 1946 Howard Hawks 2
THE MAIN ADVANTAGES OF USING A TABLE IS THAT TO
Allen 1979 Ridley Scott 3
REARRANGE THE DATA AS PER OUR REQUIREMENT
A Clockwork Orange 1971 Stanley Kubrick 3
ALPHABETICALLY OR NUMERICALLY. EXCEL OFFERS TWO
KINDS OF SORTS: Slade Runner 1982 Ridley Scott 4
Big 1988 Penny Marshall 5
1. Ascending: this type of sort arranges the items in a field from
Die Hard 1991 John Mc. Tieman 6
smallest to largest if the field is numeric, from A to Z if the field
is text, and from oldest to newest if the field contains date or
time data.
2. Descending: this sort type arranges the items in a field from
largest to smallest if the field contains numbers, from Z to A if
the field contains text, and from newest to oldest. if the field
contains dates or times.
We can sort dates in the following ways:
• Oldest to Newest Function:
• Newest to Oldest • Select the headers in your data set
We can sort numbers in the following ways:
• Click on the filter icon
• Smallest to Largest
• Largest to Smallest
• Click on the drop-down icon
For words or letters in the following ways: • Choose ‘Oldest to Newest” to sort the table
• A to Z
• Z to A
• 2: Filtering: One of the biggest
problems in big tables is finding the
required data. Sorting helps will show
the total data as per the requirement
A>Z or Z>A, Highest to Lowest or
Lowest to Highest, but filter helps In
ensure required data will be shown on Title Year Director Stock
the screen. A Christmas
Carol 1951 Brain Hurst 0
To use the “Filter” function: A Clockwork Stanley
Orange 1971 Kubrick 3
• First select the table headers
Allen 1979 Ridley Scott 3
• Then go to the “Data” tab and click on
the “Filter” icon Selected data between 1950 to 1980

• Choose the column you want to filter,


and uncheck the variable(s) that you
want to hide
3: Conditional Formatting: The powerful
features available in Excel include three
types of formatting: data bars, color scales,
and icon sets. In conditional formatting, one
thing is to tell Excel to color cells according
to their value.
Function:
• Go to the “Home” tab and click on the Title Year Director In Stock
“Conditional Formatting” icon. A Christmas Carol 1951 Brain Hurst 0
A Clockwork Orange 1971 Stanley Kubrick 3
• Here, we will format by “Color Scale” and Allen 1979 Ridley Scott 3
choose options. An Angel from Texas 1940 Ray Enright 1
Big 1988 Penny Marshall 5
• The option we chose above colors the cells in Christmas in July 1940 Preston Sturges 1
the column according to the value of the Die Hard 1991 John Mc. Tieman 6
Slade Runner 1982 Ridley Scott 4
numbers. The big sleep 1946 Howard Hawks 2
• Please note that you can also format your
column by data bars that display data bars 1965.33333
corresponding to the value of the numbers in
each cell and by icon sets that show
directional icons as well as colors according
IMPORTING DATA AND CONSOLIDATING DATA
IMPORTING DATA
• The success of any business is backed by a lot of data
collection, research, and analysis. For obtaining data from
multiple sources, such as other worksheets, PDF files,
Google Forms, or other sources, In this session, we will focus
on a few of data obtained from different sources in an Excel
sheet.
• Improved efficiency: Importing data from Excel can save
businesses time and effort by eliminating the need to manually
enter data into their business management software. Reduced
errors: Importing data from Excel directly can help to reduce
errors by eliminating the need to manually enter data.
• Click Data> Get Data> From File> From Text/CSV.

• Function of Importing the


data:
• Go to data tab
• Click on ‘Get Data
• Click on ‘the file’
• From Excel
• From PDF •In the Import Data dialog box, select the text file and
• From Text/CSV click Import.

• From XML
Data consolidation in Excel?
• Data consolidation in Excel is the
process of bringing similar data
from multiple sources to one place.
• It is useful to summarize the same
data from multiple sources.
• Consolidating data in Excel allows
combining data from multiple rows
and ranges using functions such as
sum, average, count, min, and max.
• Example #1 – How to consolidate data in Excel from multiple rows
• Rows consolidation in Excel can be helpful when you have multiple rows with the same entries.
• Let’s say you have a record of various orders placed on an e-commerce store containing
columns for order ID, product SKU, and quantity.
In the upper tab, select Data, and click on Consolidate in the ‘Data Tools’ section.

The ‘Consolidate’ will appear on the screen. Select the appropriate function, click on the little
upside arrow in the reference field, and select the reference ranges.
• Function:
• Go to Data
• Click on Consolidation button
• Execute different functions sum, count, average, max, min etc.
After selecting the range, click on Add button to add it as a reference. Check the appropriate option in the ‘Use labels in’
section (It is ‘Left column’ in this example to add up product quantities with the same SKU), and click on OK to
proceed.
DATA VALIDATION
Excel is a powerful tool professionals use for data analysis, reporting, and
decision-making. Data validation is a critical Excel feature that helps users control
the input to ensure accuracy and consistency. This feature prevents users from
entering invalid data that could lead to errors in calculations, reports, and
automated processes. For example, you can restrict data entry to a certain range of
numbers, dates, or a list of predefined items, ensuring that data adheres to the
required format and standards.
Importance of data Validation Important:
• Enhances Accuracy: Ensures that data entered spreadsheets meets the predefined
criteria, reducing the chances of errors.
• Saves Time: Reduces the need for manual checks and corrections of data entries.
• Improves Efficiency: Automates data control, streamlining data entry and
processing.
• Supports Data Integrity: Maintaining consistency and reliability in datasets is
crucial for analysis and decision-making.
Step 1: Select the Cells for Data Validation
• First, identify the cells where you want to apply
data validation. Holding down the Ctrl key while
selecting allows you to select a single cell, a range
of cells, or multiple non-adjacent cells.
Step 2: Open the Data Validation Dialog Box
• To access the data validation settings:
• Click on the cell or cells where you want to apply
data validation.
• Go to the Data tab on the Ribbon.
• Click on the Data Validation button in the 'Data
Tools' group.
• This action will open the Data Validation dialog
box, which consists of three tabs: Settings, Input
Message, and Error Alert.
Step 3: Set Up Validation Criteria
• In the Data Validation dialog box, under the Settings tab, you can
define your validation criteria:
• Allow: Select the type of data. Options include:
• Whole Number: Only whole numbers are permitted.
• Decimal: Only decimal values are permitted.
• List: Only values from a predefined list are allowed.
• Date: Only date values are permitted.
• Time: Only time values are permitted.
• Text Length: Only text of a certain length is allowed.
• Custom: For more complex criteria, use a formula.
• Data: Specify the condition (e.g., between, not between, equal to,
not equal to, etc.).
• Minimum/Maximum: Enter the acceptable range or limits based
on your selection above.
• For example, to ensure that only values between 10 and 100 are
entered in a cell, select "Whole Number," "between," and then set
the minimum to 10 and the maximum to 100.
Step 4: Configure an Input Message (Optional)
• Switch to the Input Message tab to create a message that will
appear when the cell is selected:
• Show input message when cell is selected: Check this box to
enable the input message.
• Title: Enter a brief title for the input message box.
• Input Message: Type the guidance text that will appear when
someone selects the cell. This should instruct them on what type
of data to enter.
Step 5: Customize the Error Alert (Optional)
• Under the Error Alert tab, you can specify what happens when
someone tries to enter invalid data:
• Show error alert after invalid data is entered: Check this to
enable error alerts.
• Style: Choose from Stop, Warning, or Information to indicate
the severity of the alert.
• Title: Enter a title for the error message box.
• Error Message: Write the message displaying when invalid data
is entered. This should explain the error and how to correct it.
• WORKING WITH FORMULAS:
FORMULA BAR, HOW TO WRITE
FORMULA, CELL ADDRESS, RANGE.
What Is The Formula Bar?
• The Formula Bar is where data or
formulas you enter a worksheet appear for
the active cell. The Formula Bar can also
be used to edit data or formula in the
active cell.
What is a formula bar in Excel?
• Excel formula bar is a special toolbar at the top of the Excel
worksheet window, labeled with function symbol (fx). You can
use it to enter a new formula or copy an existing one.
• The formula bar comes very handy when you are dealing with
a long formula, and you want to view it entirely without
overlaying the contents of the neighbor cells.
• The formula bar gets activated as soon as you type an equal
sign in any cell or click anywhere within the bar.
• Formula bar missing - how to show
formula bar in Excel
• Formula bar is very helpful for
reviewing and editing formulas in your
worksheets. If the formula bar is
missing in your Excel, most likely it's
because you've accidentally turned off
the Formula Bar option on the
ribbon. To recover a lost formula bar,
perform the following steps.
• Show formula bar in Excel 2019, Excel
2016, Excel 2013 and Excel 2010
• In the modern versions of Excel, you
can unhide formula bar by going to
the View tab > Show group and
selecting the Formula Bar option.
The Formula Bar can be expanded either vertically or horizontally depending on your needs.
1. To expand the Formula Bar horizontally, move the mouse cursor to the area between the Name Box and the the
Formula Bar until the cursor turns into a horizontal double ended arrow. Left click and drag to adjust the horizontal
size.
2. To expand the Formula Bar vertically, move the mouse cursor to the bottom of the Formula Bar area until the cursor
turns into a vertical double ended arrow. Left click and drag to adjust the horizontal size.
3. On the right hand side of the Formula Bar there is a expand or contract toggle. Use this to quickly adjust the Formula
Bar.
Show formula bar in Excel 2007
• In Excel 2007, the Formula Bar option
resides on the View tab > Show/Hide group.
Show formula bar in Excel 2003 and XP
• In insert the formula bar in the old Excel
versions, go to Tools > Options, then switch
to the View tab, and select the Formula
Bar checkbox under the Show category.
Unhide formula bar via Excel Options
• An alternative way to restore a lost
formula bar in Excel is this:
• Click File (or the Office button in earlier
Excel versions).
• Go to Options.
• Click Advanced in the left pane.
• Scroll down to the Display section and
select the Show Formula bar option.
HOW TO WRITE FORMULA:
Instead of entering values directly in your
Excel formula, you can refer to the cells,
containing those values.
For example, if you want to subtract a value
in cell B2 from the value in cell A2, you write
the following subtraction formula: =A2-B2
When making such a formula, you can type
the cell references directly in the formula
or click the cell and Excel will insert a
corresponding cell reference in your
formula. To add range reference, select the
range of cells in the sheet.
A big advantage of using cell references in
Excel formulas is that whenever you change
a value in the referred cell, the formula Note. By default, Excel adds relative cell references. To
recalculates automatically without you switch to another reference type, press the F4 key.
having to manually update all the
calculations and formulas on your
spreadsheet.
CELL ADDRESS, RANGE Get the
address of a cell with the highest or
lowest value
• In this example, we'll first find the
highest and lowest values in the range
B2:B7 by using the MAX and MIN
functions and output those values into
special cells:
• Cell E2:=MAX(B2:B7)
• Cell F2:=MIN(B2:B7)
UNIT II: Data Analysis using Spreadsheets-II
● Working with Formulas: reference style,
absolute reference, relative reference, mixed
reference.
● Working with functions: Use of some basic and
advance
● Introduction to Data Analysis Tool Pack
● Pivot Table and Pivot chart
Data Analysis using Spreadsheets-II
https://spreadsheeto.com/excel-functions/
Introduction
Data analysis with excel is a tool for analyzing and
visualization of data. The software enables to the users to
import, organize, facilitating and a structured foundation
for analysis.
Data analysis is the process of inspecting, cleaning,
transforming, and modeling data to discover useful
information, draw conclusions, and support decision-
making. It involves a variety of techniques and methods
for extracting insights from raw data, with the goal of
gaining a deeper understanding of patterns, trends,
relationships, and characteristics within the dataset.
Working with Formulas: reference style, absolute reference, relative reference,
mixed reference
Excel Cell References
• A cell reference is to capture information that is contained within another
cell or range of cells. By default, references in Excel are relative, which
refers to the relative position of the cell. If you are typing a formula in cell
A1 that involves cell A2, you are referencing the cell that is one cell
below where you are typing. If you were to copy the formula into another
cell, the reference would automatically perform the same relative action as
in its previous location.
• You can also use an absolute reference, which does not change if you
copy the formula into another cell. If you create a formula that refers to a
cell using an absolute reference, that same cell will be referred to
wherever the formula is us.
• Finally, you can use a mixed reference, which is a combination of the two.
When to Use Relative Cell References in Excel?
Relative cell references are useful when you have to
create a formula for a range of cells and the formula
needs to refer to a relative cell reference.
In such cases, you can create the formula for one
cell and copy-paste it into all cells.
Now, instead of entering the formula for all the cells one
by one, you can simply copy cell D2 and paste it into all
the other cells (D3:D8). When you do it, you will notice
that the cell reference automatically adjusts to refer to the
corresponding row. For example, the formula in cell D3
becomes B3*C3 and the formula in D4 becomes B4*C4.
Absolute Cell References in Excel?
• Unlike relative cell references,
absolute cell references don’t change
when you copy the formula to other
cells.
• For example, suppose you have the
data set as shown below where you
have to calculate the commission for
each item’s total sales.
• The commission is 20% and is listed
in cell G1.
• To get the commission amount for each item
sale, use the following formula in cell E2 and
copy for all cells:
• =D2*$G$1
• Note that there are two-dollar signs ($) in the cell
reference that has the commission – $G$2.
What does the Dollar ($) sign do?
• A dollar symbol, when added in front of the row and column
number, makes it absolute (i.e., stops the row and column
number from changing when copied to other cells).
• For example, in the above case, when I copy the formula from
cell E2 to E3, it changes from =D2*$G$1 to =D3*$G$1.
• Note that while D2 changes to D3, $G$1 doesn’t change.
• Since we have added a dollar symbol in front of ‘G’ and ‘1’ in
G1, it wouldn’t let the cell reference change when it’s copied.
• Hence this makes the cell reference absolute.
When to Use Absolute Cell References in Excel?
• Absolute cell references are useful when you don’t want the cell
reference to change as you copy formulas. This could be the case
when you have a fixed value that you need to use in the formula
(such as tax rate, commission rate, number of months, etc.)
• While you can also hard code this value in the formula (i.e., use
20% instead of $G$2), having it in a cell and then using the cell
reference allows you to change it at a future date.
• For example, if your commission structure changes and you’re
now paying out 25% instead of 20%, you can simply change the
value in cell G2, and all the formulas would automatically
update.
What are Mixed Cell References in Excel?
• Mixed cell references are a bit more tricky
than the absolute and relative cell references.
There can be two types of mixed cell references:
• The row is locked while the column changes
when the formula is copied.
• The column is locked while the row changes
when the formula is copied.
• Let’s see how it works using an example.
• Below is a data set where you need to calculate
the three tiers of commission based on the
percentage value in cell E2, F2, and G2.
• Now you can use the power of mixed reference
to calculate all these commissions with just
one formula.
• Enter the below formula in cell E4 and copy
for all cells.
• =$B4*$C4*E$2
Working with functions: Use of some basic and
advance
Microsoft Excel is one of the most well-known
computer applications. It has changed the way
people and companies work with data.
• Thus, learning Excel can help with both your
career and your personal needs. These range
from basic arithmetic to complex statistics. We
have rounded up 15 of the most common and
useful Excel functions that you need to learn.
Basic Math Functions
(Beginner Level)
1. SUM
• This is the first function in
Excel that most new users
need. As the name implies,
the SUM function adds up all
the values in a specified group
of cells or range.
• Syntax: =SUM(number1,
[number2], …)
• Try it out in the practice
workbook.
• What are Excel functions?
• Excel is used to calculate and manipulate
numbers and text. To do this, you
use formulas!
• Formulas are expressions that tell Excel
what you want to do with the data. They
begin with the equal symbol (=) followed
by a combination
of operators and functions.
• What are operators?
• These are symbols that specify the type of
calculation you want to perform on the
elements of a formula.
• For example, to add two numbers, you can
type “=1+1” into a cell. Once you hit Enter,
Excel will run the formula and return the
result which is 2.
• Here are some examples of common
operators:
COUNT: It returns the number of cells
containing numeric values within the
input range.
• Syntax: =COUNT(value1, [value2], …)
• 1. To get the number of quizzes taken
by each student, use this formula
in cell G2:
• =COUNT(B2:E2)
• 2. Hit Enter and fill in the rows
below.
• If you would like to include non-
numeric values in the count, you can
use the COUNTA function. To count
the number of blank cells, you can use
the COUNTBLANK function.
• Learn more about the COUNT
function and its variants here.
AVERAGE
• The average of a list of numbers is
just the total divided by how many
numbers there are in that list.
• But it gets even easier using
the AVERAGE function in Excel.
• Syntax: =AVERAGE (value1,
[value2], …)
• 1. Type this into cell H2:
• =AVERAGE(B2:E2)
• 2. Hit Enter and fill in the rows
below.
Logical Functions
• A logical function in Excel allows you to make comparisons and use
the results to change how a formula calculates.
IF
• The IF function is a very popular function in Excel, and it is
actually quite easy to learn.
• Syntax: =IF(logical_test, value_if_true, [value_if_false])
• This function checks if a logical test is either TRUE or FALSE. It then
returns the specified value based on the result.
• Using the average score of each student, try to assign PASS or FAIL
grades. Assume that the passing score for this class is 60.
1. Begin the formula in cell C2 with “=IF(“
• The logical test is to check if the average score in Column B is
greater than or equal to (>=) the passing score of 60.
2. So, the formula becomes:
• =IF(B2>=60,
• If the comparison returns TRUE, then the formula should return the
text “PASS”. Thus, the value_if_true argument should be “PASS”.
• And if it returns FALSE, then the value_if_false argument should be
“FAIL”.
3. Thus, the formula becomes:
• =IF(B2>=60,”PASS”,”FAIL”)
• 4. Hit Enter and fill in the rows below.
• What if you needed to assign grades according to a scale instead of just
“PASS” and “FAIL”?
For that, you have to use multiple criteria or logical tests. While this is
possible using nested IF functions, it can get messy very quickly.
IFS function
• The IFS function was introduced in Excel 2016 to replace nested IF
functions.
• This function works by evaluating the first logical test or criteria. It
returns the corresponding value if it is TRUE. But if it is FALSE, the
function proceeds to evaluate the second criteria, and so on.
• 📖 In other words, the IFS function outputs the value that
corresponds to the first specified criteria that is true.
• Syntax: =IFS(logical_test1, value_if_true1, [logical_test2],
[value_if_true2],..)
• 1. First, the formula should check if the average score (column B) is
above or equal to 90. If yes, it should return “A”.
• =IFS(B2>=90,”A”,
• 2. If not, it should then check if the average score is greater than or
equal to 80. If yes, it should return “B”. If you do this up to grade D,
the formula becomes:
• =IFS(B2>=90,”A”,B2>=80,”B”,B2>=70,”C”,B2>=60,”D”,
• 3. For the last grade “F”, put “TRUE” for the logical test.
• The IFS function will only evaluate the last specified criteria if all
of the previous logical values were FALSE. Thus, you can set the last
criteria to always be TRUE thus making it a “catch all” statement.
• The final formula is then:
• =IFS(B2>=90,”A”,B2>=80,”B”,B2>=70,”C”,B2>=60,”D”,TRU
E,”F”)
FIND
The names are separated by a space
character ” “. So, you have to
identify the position of the space
within each text string in Column A.

The FIND function in Excel returns


the number or position of a specified
character or substring within another
text string.
Syntax: =FIND(find_text,
within_text, [start_num])
To get the position of the space ” “,
type this formula:
=FIND(” “,A2)
LEN
This function returns the
number of characters in a text
string.
Syntax: =LEN(text)
To get the number of characters
in each student’s name:
=LEN(A2)
MID
•This function extracts a given
number of characters from the middle
of a text string.
•Syntax: = MID(text, start_num,
num_chars)
•It is one of three text functions that
are used to extract text. The other two
are LEFT and RIGHT which extract
text from the start and end of a text
string respectively.
•The first name starts at the
very first character of the text
string. So, you extract starting
from position 1. Then the length of
the first name is given by
the position of the space character
minus 1.
•So, the formula to extract the first
name or first word from a text string
is:
•=MID(A2,1,B2-1)
CONCAT
•Like IFS, CONCAT is
another newly introduced
function in Excel 2016. It
replaced the old
CONCATENATE functi
on
.
•Syntax:
=CONCAT(text1, [text2],
…)
•Combine the last name
and the first name with a
comma and space
character “, ” in between.
•=CONCAT(E2,”, “,D2)
INDEX
•The INDEX
function retrieves a value
from a given table array
based on the provided row
and column numbers.
•Syntax: =INDEX (array,
row_num, [col_num])
•Similar to
the MATCH example, you
need to specify where the
range or array lookup is.
‘PRODUCT’ to perform multiplication. As you can see, we
didn’t use the mathematical operator here.
Sample Formula: "=PRODUCT(A2,B2)"
•1. SUM
•The SUM() function, as the name suggests, gives the total of the selected range of cell values.
It performs the mathematical operation which is addition. Here’s an example of it below:
•Sum "=SUM(C2:C4)"

•Fig: Sum function in Excel
•As you can see above, to find the total amount of sales for every unit, we had to simply type
in the function “=SUM(C2:C4)”. This automatically adds up 300, 385, and 480. The result is
stored in C5.
•2. AVERAGE
•The AVERAGE() function focuses on calculating the average of the selected range of cell values. As seen from the below
example, to find the avg of the total sales, you have to simply type in:
•AVERAGE =AVERAGE(C2, C3, C4)
•Fig: Average function in Excel
•It automatically calculates the average, and you can store the result in your desired location.
•3. COUNT
•The function COUNT() counts the total number of cells in a range
that contains a number. It does not include the cell, which is blank,
and the ones that hold data in any other format apart from numeric.
•COUNT =COUNT(C1:C4)
•Fig: Microsoft Excel Function - Count
•As seen above, here, we are counting from C1 to C4, ideally four
cells. But since the COUNT function takes only the cells with
numerical values into consideration, the answer is 3 as the cell
containing “Total Sales” is omitted here.
•If you are required to count all the cells with numerical values, text,
and any other data format, you must use the function ‘COUNTA()’.
However, COUNTA() does not count any blank cells.
•To count the number of blank cells present in a range of cells,
COUNTBLANK() is used.
•4. SUBTOTAL
•Moving ahead, let’s now understand how the
subtotal function works. The SUBTOTAL() function
returns the subtotal in a database. Depending on
what you want, you can select either average, count,
sum, min, max, min, and others. Let’s have a look at
two such examples.
•Fig: Subtotal function in Excel
•In the example above, we have performed the
subtotal calculation on cells ranging from A2 to A4.
As you can see, the function used is
•SUBTOTAL =SUBTOTAL(1, A2: A4)
•In the subtotal list “1” refers to average. Hence, the
above function will give the average of A2: A4 and
the answer to it is 11, which is stored in C5.
Similarly,
•“=SUBTOTAL(4, A2: A4)”
•This selects the cell with the maximum value from
A2 to A4, which is 12. Incorporating “4” in the
function provides the maximum result.
5. MODULUS
•The MOD() function works on returning the
remainder when a particular number is divided
by a divisor. Let’s now have a look at the
examples below for better understanding.
•In the first example, we have divided 10 by 3.
The remainder is calculated using the function
• MODULUS =MOD(A2,3)
•The result is stored in B2. We can also directly
type “=MOD(10,3)” as it will give the same
answer.
•Fig: Modulus function in Excel
•Similarly, here, we have divided 12 by 4. The
remainder is 0 is, which is stored in B3.
6. POWER
•The function “Power()” returns
the result of a number raised to a
certain power. Let’s have a look at
the examples shown below:
•As you can see above, to find the
power of 10 stored in A2 raised to
3, we have to type:
•Power =POWER (A2,3)
•This is how power function
works in Excel.
7. CEILING
•Next, we have the ceiling function. The
CEILING() function rounds a number up
to its nearest multiple of
significance.
•The nearest highest multiple of 5 for
35.316 is 40.
8. FLOOR
•Contrary to the Ceiling function, the floor function rounds a number down to the nearest multiple of significance.
•Fig: Floor function in Excel
•The nearest lowest multiple of 5 for 35.316 is 35.
9. CONCATENATE
This function merges or joins several text strings into one text string. Given below are the different ways
to perform this function.
•In this example, we have operated with the syntax:
CONCATENATE =CONCATENATE(A25, " ", B25)
Fig: Concatenate function in Excel
•In this example, we have operated with the syntax:
"=CONCATENATE(A27&" "&B27)"
Fig: Concatenate function in Excel
Those were the two ways to implement the concatenation operation in Excel.
10. LEN
The function LEN() returns the total
number of characters in a string. So, it
will count the overall characters,
including spaces and special characters.
Given below is an example of the Len
function.

Fig: Len function in Excel


Let’s now move onto the next Excel
function on our list of this article.
•11. REPLACE
•As the name suggests, the REPLACE() function works on
replacing the part of a text string with a different text
string.
•The syntax is “=REPLACE(old_text, start_num,
num_chars, new_text)”. Here, start_num refers to the index
position you want to start replacing the characters with.
Next, num_chars indicate the number of characters you
want to replace.
•Let’s have a look at the ways we can use this function.
•Here, we are replacing A101 with B101 by typing
• REPLACE =REPLACE(A15,1,1,"B")
•Fig: Replace function in Excel
•Next, we are replacing A102 with A2102 by typing:
• “=REPLACE(A16,1,1, "A2")”
•Fig: Replace function in Excel
•Finally, we are replacing Adam with Saam by typing:
• “=REPLACE(A17,1,2, "Sa")”

12. SUBSTITUTE
The SUBSTITUTE() function replaces the existing text with a new text in a text string.
The syntax is “=SUBSTITUTE(text, old_text, new_text, [instance_num])”.
Here, [instance_num] refers to the index position of the present texts more than once.
Given below are a few examples of this function:
•Here, we are substituting “I like” with “He likes” by typing:
“=SUBSTITUTE(A20, "I like","He likes")”
Now, we are replacing both the 2010s in the original text with 2016 by typing
“=SUBSTITUTE(A22,2010,2016)”.
Next, we are substituting the second 2010 that occurs in the original text in cell A21 with 2016 by
typing “=SUBSTITUTE(A21,2010, 2016,2)”
Shown below is an example using the
mid function.

•13. LEFT, RIGHT, MID


•The LEFT() function gives the number of characters
from the start of a text string. Meanwhile, the MID()
function returns the characters from the middle of a text
string, given a starting position and length. Finally, the
right() function returns the number of characters from
the end of a text string.
•Let’s understand these functions with a few examples.
•In the example below, we use the function left to obtain
the leftmost word on the sentence in cell A5.
14. UPPER, LOWER, PROPER
The UPPER() function converts any text string to uppercase. In
contrast, the LOWER() function converts any text string to
lowercase. The PROPER() function converts any text string to
proper case, i.e., the first letter in each word will be in
uppercase, and all the other will be in lowercase.
Let’s understand this better with the following examples:
•Here, we have converted the text in A6 to a full uppercase one
in A7.
•Now, we have converted the text in A6 to a full lowercase one,
as seen in A7.
•Finally, we have converted the improper text in A6 to a clean
and proper format in A7.
•Now, let us hop on to exploring some date and time functions
in Excel.
• 15. NOW()
• The NOW() function in Excel gives the current system date and time.

• Fig: Now function in Excel
• The result of the NOW() function will change based on your system date and time.
16. TODAY()
The TODAY() function in Excel provides the current system
date.

Fig: Today function in Excel


The function DAY() is used to return the day of the month.
It will be a number between 1 to 31. 1 is the first day of the
month, 31 is the last day of the month.

Fig: Day function in Excel


The MONTH() function returns the month, a number from 1
to 12, where 1 is January and 12 is December.

Fig: Month function in Excel


The YEAR() function, as the name suggests, returns the
year from a date value.

Fig: Year function in Excel


17. TIME()
The TIME() function converts hours, minutes,
seconds given as numbers to an Excel serial
number, formatted with a time format.
18. HOUR, MINUTE, SECOND
The HOUR() function generates the hour from a time value as a number from 0 to
23. Here, 0 means 12 AM and 23 is 11 PM.

Fig: Hour function in Excel


The function MINUTE(), returns the minute from a time value as a number from 0 to
59.

Fig: Minute function in Excel


The SECOND() function returns the second from a time value as a number from 0 to
59.

Fig: Second function in Excel


19. DATEDIF
The DATEDIF() function provides the difference
between two dates in terms of years, months, or days.
Below is an example of a DATEDIF function where we
calculate the current age of a person based on two given
dates, the date of birth and today’s date.

Fig: Datedif function in Excel


Now, let’s skin through a few critical advanced functions
in Excel that are popularly used to analyze data and
create reports.
We will use the below table to learn how the VLOOKUP
20. VLOOKUP function works.
• Next up in this article is the VLOOKUP() If you wanted to find the department to which Stuart belongs,
function. This stands for the vertical you could use the VLOOKUP function as shown below:
lookup that is responsible for looking for
a particular value in the leftmost column
of a table. It then returns a value in the
same row from a column you specify.
• Below are the arguments for the
VLOOKUP function:
• lookup value - This is the value that you
have to look for in the first column of a
table. Here, A11 cell has the lookup value, A2: E7 is the table
• table - This indicates the table from array, 3 is the column index number with information about
which the value is retrieved. departments, and 0 is the range lookup.
• col_index - The column in the table from
the value is to be retrieved.
• range_lookup - [optional] TRUE =
approximate match (default). FALSE =
exact match.
AI2
=IF(AI2>=9," 10True
True","False") 5False
• 21. IF Formula 6False
•The IF() function checks a given
condition and returns a particular 7False
value if it is TRUE. It will return
another value if the condition is
FALSE.
8False
•In the below example, we want
to check if the value in cell A2 is 10True
greater than 5. If it’s greater than
5, the function will return “Yes 4 11True
is greater”, else it will return
“No”. 12True
22. COUNTIF AL
The function COUNTIF() is used to count the total number of 3 India
cells within a range that meet the given condition. 4 India
5 India
=COUNTIF(AL3:AL12,"India") 6 India
India
England
23. The SUMIF() function adds the cells specified by a given India
condition or criteria. England
India
India 100 12 USA
India 300
India 200
India 100
India 500
England 100 =SUMIF(AN3:AN12,"India",AO3:AO12)
India 600
England 200
India 500
USA 200
24. Random: Generates a random number. A random number is
26. Left
a number that is chosen by chance from a set of numbers, where
all numbers have an equal probability of being chosen.
xyz
=RAND()

0.715529036
0.867206977
x
0.561431854
0.540269293 =LEFT(AW3)
0.520915676
27.=TRIM- Removes irregular spacing, leaving
one space between each value
25. Right: Returns values from the right side of a cell
a bcd d a

232 2 =TRIM(AX3)
=RIGHT(AU3)
123 3 a bcd d a
=RIGHT(AU4)
2019 1000
2020 2000
2021 2000
28. NPV- 2022 2500
10% 2023 3500
discount
factor
₹ 7,945.37

=NPV(0.1,BA3:BA7)
1000E
29. The IFS function is 3000C
a premade function in
Excel, which returns 4000B
values based on one or 2000D
more true or false con
ditions. 1000E

=IFS(BB3>=5000,"A",BB3=4000,"B",BB3=3000,"C",BB3=20
00,"D",BB3>=1000,"E")
Introduction to Data Analysis Tool Pack

•The Data Analysis ToolPak is an add-in for Microsoft Excel that provides a set of tools for data analysis and
statistical analysis. The tools are designed to help users perform complex data analysis tasks, such as
statistical analysis, data modeling, and forecasting.
Calculating Descriptive Statistics in Excel
Microsoft Excel's Data Analysis ToolPak is a powerful tool that allows users to perform various statistical
analyses on their data. In this tutorial, I will show you how to use the ToolPak to perform descriptive
statistics, such as mean, median, and standard deviation. By the end of this tutorial, you will be able to use
Excel's Data Analysis ToolPak to better understand your data and make more informed decisions. See a
preview of each step to get descriptive statistics result.
Step 1. Activate the Data Analysis ToolPak
Step 2. Open the Data Analysis TookPak
Step 3. Select the Descriptive Statistics Option
Step 4. Add a Dataset
Step 5. Review the Results
Step 1. Activate the Data Analysis ToolPak
If you have never used the Data Analysis ToolPak, it is probably inactive on your Excel program. You can
check to see if you have it by first clicking on the data tab. Next, look for the analysis group on the far-right
side of your screen. If the data analysis option does not exist use the following steps to activate this add-in.
1.Click on the File tab, followed by clicking on options. Next, click on “Add-Ins.”
2.Next, click on the “Go” button to the manage add-ins section.
3.Lastly, check the “Analysis Pak” box and click “OK.”
You should now be ready to use the Data Analysis ToolPak from the data tab in the analysis group.
Step 2. Open the Data Analysis
TookPak
Click on “Data Analysis” in the
data tab and then click on
Descriptive Statistics in the dialog
box. Click the OK button.
Step 3. Select the Descriptive
Statistics Option
The tool has a lot of statistical
options. Select the descriptive
statistics option to return a variety
of descriptive statics calculations.
Step 4. Add a Dataset
Next, the range of the data needs to be
typed in the input range section of the
dialog box. Choose the output range
option and choose a cell for the output to
display by typing that cell location in the
blank field. Lastly, click in the Summary
statistics checkbox and click OK to
display the results.
Step 5. Review the Results
The results are printed in two columns.
The first column represents the
descriptive statistic label and the second
column shows the results. In the
following sections, I will describe what
these descriptive statistics mean.
Mean: The mean, which is a measure of central tendency, was calculated by taking the average of the whole data set. The sum of the data set is 222 and when
divided by 30 gives a mean of 222/30 = 7.4. The mean can be written as the expression: ∑x i /n, where n is the number of values and ∑x i is the sum of data values.
Standard Error: The standard error is defined as the standard deviation divided by the square root of the sample size. In the above example, the standard error is
4.45/sqrt(30) = 0.813.
Median: The median is the middle value and another measure of central tendency. To find the median or middle value of the data set, you need to arrange the
whole data set in ascending or descending order. The median value is directly in the middle when there is an odd number of values in the data set. When there is
an even number of values, there will be two middle values that need to be averaged to find the median.
Mode: Another measure of central tendency is mode. This is the value that appears more frequently than any other value. In the example above, 4 appears more
than any other number. There may be a case where there is more than one mode. This occurs when two numbers appear most frequently in a data set but appear
the same number of times.
Standard Deviation: Standard deviation is the square root of the variance result. There are two scenarios depending on whether the standard deviation is
calculated from a population or a sample. For a population standard deviation, the mathematical calculation is sqrt(∑(x i-Xbar)2/n). When calculating the standard
deviation for a sample the calculation is sqrt(∑(x i-Xbar)2/(n-1)). In the above example, the population standard deviation is or 4.378. The sample standard
deviation is the square root of or 4.453.
Variance: The variance is found by calculating the deviation of each value from the mean value followed by squaring the deviations and finding the average of
these squared deviations. To simplify the variance is the mean square deviation. The equation to calculate the population variance is ∑(x i-Xbar)2/n for a
population and for a sample variance ∑(x i-Xbar)2/(n-1). In the example above, the population variance is 19.173 (575.2/30) and the sample variance is 19.834
(575.2/29).
Kurtosis: Kurtosis describes the shape of a probability distribution. It specifically characterizes the peakedness or flatness of a distribution compared to a normal
distribution, which has a kurtosis of 3. A positive kurtosis indicates a higher peak and fatter tails compared to a normal distribution, while a negative kurtosis
indicates a lower peak and thinner tails. Kurtosis is used in finance and other fields to assess risk and describe the distribution of returns or other variables. In the
above example, kurtosis is 1.52.
Skewness: Skewness measures the asymmetry of a distribution. Symmetric data has data that are distributed symmetrically about the mean. If perfectly
symmetric we would say that the skewness of a distribution is zero. A distribution is positively skewed, or to the right, if the right tail is longer. If the left tail is
longer, we say the distribution is negatively skewed or skewed to the left. In the example, the skewness is 1.218. As a result, it can be said that the data is skewed
to the right and positively skewed with a long right tail.
Range: The range is the highest value in the data set minus the lowest value. In the example above, the range is 20 (Highest) minus 1 (Lowest) which equals 19.
Min and Max: The min and the max are the lowest and highest values in the data set respectfully. In the example above, the highest value is 20 and the lowest is 1.
Sum
The sum or ∑ is simply the addition of all the numbers in the data set. In the example above the sum is 222.
Count
The count is simply the size of the population or the size of the sample. In the example, the count is 30.
More About the Data Analysis ToolPak
The Data Analysis ToolPak is an add-in for Microsoft Excel that provides a set of tools for data analysis and statistical
analysis. The tools are designed to help users perform complex data analysis tasks, such as statistical analysis, data
modeling, and forecasting. Some of the tools included in the Data Analysis ToolPak are:
1. Histogram: Creates a histogram chart that shows the distribution of data within a dataset.
2. Frequency Distribution: Helps to create a table that shows the frequency of each value in a dataset.
3. Descriptive statistics: Provides summary statistics (mean, median, mode, standard deviation, etc.) for a dataset.
4. Correlation: Determines the strength of the linear relationship between two variables in a dataset.
5. Covariance: Measures how two variables are related to each other.
6. Regression: Helps to create a regression model and make predictions based on the data
7. Anova: Helps to determine whether there is a significant difference between the means of two or more groups
8. Sampling: Helps to select a random sample from a dataset.
9. Exponential smoothing: Helps to create a forecast based on historical data.
10.Moving Average: Helps to analyze time-series data and make predictions.
Pivot Table and Pivot chart: PivotTable to summarize, analyze, explore, and present summary data. Pivot Charts complement
PivotTables by adding visualizations to the summary data in a PivotTable, and allow you to easily see comparisons, patterns,
and trends. Both PivotTables and Pivot Charts enable you to make informed decisions about critical data in your enterprise.
You can also connect to external data sources such as SQL Server tables, SQL Server Analysis Services cubes, Azure
Marketplace, Office Data Connection (.odc) files, XML files, Access databases, and text files to create PivotTables, or use
existing PivotTables to create new tables.
Sometimes it's hard to see the big picture when your raw data hasn’t been summarized. Your first instinct may be to create a
PivotTable, but not everyone can look at numbers in a table and quickly see what's going on. Pivot Charts are a great way to
add data visualizations to your data.
What is pivot chart?
Pivot Chart is a dynamic visualization tool that works together with Excel PivotTables. While PivotTables provide a way to
summarize and analyze large datasets, Pivot Charts offer a graphical representation of that summarized data, making
trends and patterns easier to spot.
The beauty of pivot charts lies in their interactivity and flexibility. Like pivot tables, pivot charts are dynamic, meaning
they can be easily manipulated to display different aspects of the data.
Pivot graphs are particularly useful for presenting complex data in a clear and concise manner. They enable users to
identify trends, compare data points, and draw insights quickly. For example, with a pivot chart, you can easily visualize
how sales vary across different geographical regions, product categories, or specific time periods.
You can create different types of charts, such as pie, bar, line or scatter, and customize them to suit your needs. You
can also change their layout and appearance by applying different filters, fields, and formats. A pivot chart is linked to
the pivot table that it is based on, so any changes you make to the pivot table will be reflected in the graph.
In essence, a pivot chart serves as a visual storyteller, transforming raw data into meaningful insights that are easy to
understand and act upon.
Sometimes to create a summary of data using
Excel, you may need to use a Pivot Table. In
addition, sometimes for data visualization, you
may need to use a Pivot Chart. Apart from this,
you must know the difference between Pivot Table
& Pivot Chart in Excel.
What Are Pivot Table and Pivot Chart?
• A Pivot Table is a functional table that represents
the summary of data collection. On the other
hand, a Pivot Chart is the visual presentation of
the pivot table. So, you can say, this is the basic
difference between a pivot table and a pivot
chart in Excel. Besides, an example is given
below. In where the B12:D17 range represents a
pivot table and the corresponding pivot chart is
exactly below the pivot table.
How to Create a Pivot Table
• In this section, I will describe how to create a pivot table. In
addition, by creating pivot table and pivot chart, you can easily
understand the difference between a pivot table and a pivot chart
in Excel.
• Now, let’s start the making of the pivot table first. You can make
the pivot table not only from the internal data source but also
from the external data source. Besides, you can make the pivot
table both from a given table or from a given data range. Here, I
will show the easiest steps to create a pivot table. Let’s have the
following sample data set.
• The steps are given below.
Steps:
• Firstly, you must select the range. Here, I have selected the
range B4:D10.
• Secondly, from the Insert tab >> choose Pivot Table.
• Thirdly, you need to select From Table/Range.
• Subsequently, a dialog
box named PivotTable from
table or range will appear.
• Firstly, select the range for your
PivotTable. Which will be auto-
selected here.
• Secondly, choose Existing
Worksheet.
• Thirdly, select
the Location for PivotTable.
Here, I have selected
the B12 cell.
• Finally, press OK to get the
pivot table.
• Now, in PivotTable Fields, you must
drag Product to Rows.
• Similarly, you need to drag Sales and Profit to the Values.
• Finally, your PivotTable is done.
• Lastly, you can see the created pivot table.
At this time, you will see the following dialog box named Value
Field Settings.
•Now, from Summarize value field by option >> select your
targeted operation. Here, I have selected Average.
•Then, you need to click on OK to see the changes.
•As a result, you can see the following changes.
• Similarly, by changing the
operationof Profit from Sum to Ma
x, you will get the final result.
Which is given below.
How to Make a Pivot Chart
• To make a pivot chart in Excel, you can use
the PivotChart feature. The steps are given below.
• Steps:
• Firstly, you have to select the data range with which you
want to make a pivot chart. Here, I have selected the
range B4:D10.
• Secondly, you must go to the Insert tab.
• Thirdly, from PivotChart >> you need to
choose PivotChart.
• Now, a dialog box named Create PivotChart will appear.
• From the dialog box firstly, you have to
select Table/Range, which will be auto-selected here.
• Secondly, you may click on the Existing Worksheet under
the choose where you want the PivotChart to be
placed option.
• Thirdly, you have to choose the Location. Here, I have
chosen the new Location as B12 cell.
• Finally, you must click on OK to get the changes.
• At this time, you will see the following
situation.
• Now, in PivotChart Fields, you have to
drag Product to Axis (Categories).
• Similarly, drag Sales and Profit to the Values.
• Finally, your PivotChart is done.
• You will see that the
corresponding PivotTable will be also auto-
generated.
• Furthermore, you can change the style and color
of the pivot chart by clicking on the brush icon.
• Lastly, you will see the following formatted
result.
PIVOT TABLE PIVOT CHART
Pivot Chart is the visual
Pivot Table is a table of representation of the
summarized data. corresponding pivot
•Difference Between Pivot Table and table.
Pivot Chart If you create a pivot
You can create only a pivot chart, the corresponding
•The differences between pivot table and table. pivot table will be auto-
pivot chart in Excel are given below. generated.
•Moreover, both are connected in a two- In the pivot chart, you
way link. If you do any kind of There are lots of features in
can use the features that
functional or filtering changes to one, the the pivot table.
are available in the
other will be also changed. corresponding pivot
table.
UNIT III: Data Visualization using 4
Spreadsheets
● Create and modify graphs / charts like
Column, Line, Pie, Bar, Area, Scatter, 3D
etc.
● Working with multiple sheets, hyper
linking.
Defining Data Visualization
https://www.datacamp.com/tutorial/visualizing-d
ata-in-excel
• Data visualization is a graphical representation of
data. By utilizing charts, graphs, maps, etc., we
can provide a simple and accessible way to
understand our data and identify trends and
outliers within our datasets. Note that Excel uses
the term "chart" to mean a "plot". For example, a
bar plot is called a bar chart in Excel terminology.
Creating Basic Charts in Excel
• Excel has multiple options for choosing a
particular chart type. For example, if you want to
create a column or bar chart, you are often
presented with various visualization options.
Excel bar charts
• Bar charts are one of the easiest charts to interpret, enabling the person
viewing the chart an easy way to compare categorical data quickly. On a
bar chart, the categorical data is on the y-axis, and the values are on the x-
axis.
• To create a bar chart:
• Select the data range A1:D13
• Click the "Insert" tab in the Excel ribbon
• Click on the columns icon button dropdown, and under the “2-D Bar”
category, choose “Clustered Bar”
• Example Dataset
• We first need a dataset to work with before creating any visualizations. The
dataset contains information on the number of units sold for various
product types in 2022 and totals for columns and rows.
Excel column charts
• A column chart, also known as a vertical bar
chart, helps visualize data where categories
are placed on the x-axis and the values on the
y-axis. Similar to bar charts, they help
visualize data across categories.
• To create a column chart in Excel:
• Select the data range A1:D13
• Click the "Insert" tab in the Excel ribbon
• Click on the columns icon dropdown, and
under the “2-D Column” category, choose
“Clustered Column”
• You can now see a column chart that displays
the number of units sold for each product
category by the month.
Excel line charts
• A line chart is the most useful way to capture how a
numerical variable changes over time. This is helpful
to identify trends in numeric values.
• To create a line chart in Excel:
• Select the data range A1:D13
• Click the "Insert" tab in the Excel ribbon
• Click on the line chart dropdown, and under the “2-D
Line” category, choose “Line with Markers"
• You can now see a line chart displaying units sold
each month split by product category. This enables
you to compare each product category's performance
over time easily.
Excel pie charts
• A pie chart is most used to show the
proportions of a whole. It’s like
visualizing fractions when you were in
high school. With this pie chart, we want
to compare the total sales between the
three categories.
To create a pie chart in Excel:
• First, select the data range B1:D1
• Second, using the command (for Mac) or
ctrl (for Windows), select the second
date range: B14:D14
• Click the "Insert" tab in the Excel ribbon
• Click on the pie chart dropdown, and
under the “2-D Pie” category, choose
“Pie”
Advanced Excel Visualization Techniques
• Excel scatter plots
• A scatter plot is commonly used to
visualize the relationship between two
variables. It can be useful for quickly
surfacing potential correlations between
data points. We’ll create a scatter plot to
compare the number of TVs and laptops
sold.
• To create a scatter plot in Excel:
• Select the data range A1:C13
• Click the "Insert" tab in the Excel ribbon
• Click on the scatter plot dropdown, and
under the “Scatter” category, choose
“Histogram”
• Click "Scatter or Bubble Chart" and
choose "Scatter with Smooth Lines and
Markers"
• Traditional charts might not tell the whole story when dealing with
complex data. That’s where 3D scatter plots come to the rescue! It’s like
seeing data in a 3D picture. This becomes useful in various fields, like
science, engineering, or business.
• Whether you are a student, teacher or scientist, this context must improve
your chart skills. So, let’s get started.
What Is a 3D Scatter Plot?
https://www.exceldemy.com/3d-scatter-plot-excel/
• A 3D scatter plot is a graph that shows data in 3D.
It’s like a regular scatter plot but with an extra
dimension. Instead of points on a flat surface. It
uses dots in 3D space. This type of plot helps us see
patterns more effectively.
• Step 1: Prepare a Dataset to Plot 3D Scatter
• The first and foremost task is to create a data model
to create a 3D scatter plot in Excel. To illustrate
that, consider B, C and D columns
titled Month, Sales, and Revenue.
• Step 2: Insert a Scatter Chart
• Secondly, select range B4:D16 >> go to
the Insert tab >> expand Insert Scatter.
• Step 3: Adjust Scatter Chart Settings
• To begin, right-click on the chart area >>
choose Select Data from the context menu.
• Step 4: Format Data Series in Scatter Chart
• Now, click on a Data Series >> press
the Ctrl+1 keys.
• Step 5: Save and Display 3D Scatter Plot
• Lastly, place the 3D scatter chart on the right side
of the dataset >> Save the workbook.
• Working with multiple sheets, hyper linking
• https://www.exceldemy.com/learn-excel/linking/hyperlink/another-sh
eet/
Perhaps one of Excel’s most important and complex activities while
working on big projects is adding hyperlinks. We have to add hyperlinks.
We have to add one or more hyperlinks to worksheets of the same workbook
or different workbooks in a worksheet in Excel.
This article will demonstrate how to add hyperlinks to another sheet by
using the HYPERLINK function and the Context Menu. Here we’ve got a
worksheet called “Sheet1” with the names of some students and their marks
in the examination of a school called Sunflower Kindergarten. Our objective
today is to add hyperlinks to this sheet in another worksheet of the same
workbook or a different workbook.
• 1. Inserting HYPERLINK Function to Add Hyperlink
to Another Sheet in Excel
• We can add hyperlinks through the HYPERLINK function in
Excel. This is the simplest way, in fact. First, we shall add
hyperlinks to a worksheet of the same workbook, and then to a
different workbook.
1.1 Adding Hyperlink to Different Worksheets in
Same Workbook
We have opened a worksheet called “Sheet2” in the same workbook
and created an empty table there to insert the hyperlinks for the marks.
Steps:
•Firstly, to add a hyperlink in the sheet, select a cell and enter
the HYPERLINK function.
The Syntax of the HYPERLINK Function is:
= HYPERLINK(link_location,friendly_name)

•Then, to create a link to cell C5 of Sheet1, the link_location will be “#Sheet1!C4”.


•After that, friendly_name is any convenient name that you want to show as the link.
For this example, I name it “Marks”.
•So, the HYPERLINK formula for this example will be:
=HYPERLINK("#Sheet1!C5","Marks")

•Besides, press Enter.


• Therefore, you will see the result for the grade.
• Additionally, use the Fill Handle tool and drag it down from the C5 cell to the C21 cell.
• Finally, you will get all the hyperlinked
marks in the below image.
• NOTES The symbol (#) is important. It
denotes that the worksheet is from the
same workbook.
•1.2 Adding Hyperlink to Different Worksheets in Different
Workbooks
•To create a hyperlink to a worksheet of a different workbook,
enter the name of the workbook before the worksheet name,
enclosed by a square bracket [ ], inside the HYPERLINK
function. Here we’ve created a new workbook
called “Book2”. And the previous workbook was “Book1”.
•Steps:
•Firstly, to create a hyperlink to cell C5 of Sheet1 of Book1 in
the Sheet1 of Book2, the HYPERLINK formula will be:
•=HYPERLINK("[Book1]Sheet1!C5","Marks")

•Finally, you will get the same results for the different
worksheets.
Using Context Menu to Add
.
2

Hyperlink to Another Sheet in


Excel
• If you don’t want to use the formula, you can add hyperlinks using the context menu
of Excel.
• 2.1 Adding Hyperlink to Different Worksheets in Same Workbook
• Firstly, we will use the context menu for hyperlinking to another sheets from the same
workbook.
• Steps:
• Firstly, right-click on the cell where you want to enter the hyperlink. From the options
available in the below image, select the Link.
• After clicking on the Link, you will get a dialogue box called Insert Hyperlink.
• To add a hyperlink to a worksheet of the same workbook, Select Place in this
Document from the left panel.
• So, in the Text to Display box, enter the name of the link to show. For this example, I
enter it as Marks.
• Then, in the Type the Cell reference box, enter the cell reference of the cell that you
want to link. For this example, it is C5.
• After that, in the select a place in this document box, select the worksheet name to
which you want to link. For this example, it is Sheet1.
• Then, click OK. And you will see a hyperlink has been created on your selected cell.
2.2 Adding Hyperlink to Different
Worksheets in Different Workbooks
• You can also use this method to create a hyperlink to
a worksheet in a different workbook. Here, we have
opened a new workbook called “Book2”. Now we
want to add a hyperlink
from Sheet1 of Book2 to Sheet1 of Book1.
• Steps:
• So, follow the same procedure as discussed above to
open the Insert Hyperlink dialogue box.
• Therefore, in the Insert Hyperlink dialogue box,
from the left panel, click on Existing File or Web
Page.
• Then, browse the workbook to which you want to
link. For this example, I want to link to Book1.
Then, click OK. You will find a hyperlink created on
your selected cell connecting you to the desired
workbook.
Unit IV: Spreadsheet Excel Functions
 Sum, Max, Min, Average, Count, Today, Now, 4
 Datedif, Countif, CountA, CountBlank, Round, Roundup
Mathematical Functions - Sum, Sumif,
Sumifs, Count, Counta, Countif, Max, Min,
Average
Functions
• A very important feature in Excel is the
formula. It is used to calculate values based on
what is in cells, perform operations on a cell
content, fetch values after an operation based
on your search criteria and much more.
• Mathematical Formulas in Excel are used to
perform various arithmetic operations like
sum, average, count, max, min etc. Here is a
list of most frequently used mathematical
formulas in excel.
Sum: This function is used to adds all the values within a cell range: Formula Sheet.xlsx
=Sum(number1, number2, ...)
Sumif
The SUMIF function is a worksheet function that adds all numbers in a range of cells based on one criteria
=Sumif(Range, Criteria, Sum_Range)
Sumifs
The SUMIFS function, one of the math and trig function, adds all of its arguments that meet multiple criteria.
=Sumifs(Sum_Range, Criteria_Range1, Criteria1, Criteria_Range2, Criteria2, ..)
Count
The COUNT function counts the number of cells that contain numbers and counts numbers within the list of arguments.
=Count(Value1, Value2, ...)
Countif
COUNTIF is a function to count cells that meet a single criteria. COUNTIF can be used to count cells with dates, numbers, and text that match
specific criteria.
=Countif(Range, Criteria)
Counta
The Excel COUNTA function returns the count of cells that contain numbers, text, logical values, error values, and empty text (""). COUNTA
does not count empty cells.
=Counta(Value1, Value2, ...)
Max
The Microsoft Excel MAX function returns the largest value from the numbers provided.
=Max(Number1, Number2, .....)
Min
The Microsoft Excel MAX function returns the smallest value from the numbers provided.
=Min(Number1, Number2, ....)
Average
The Microsoft Excel MAX function returns the average value from the numbers provided.um
• Today, Now,:
https://www.exceldemy.com/excel-now-vs-today/
While working in an Excel spreadsheet, you may have a good
thought about the Excel NOW vs TODAY Function.
The TODAY Function is used to determine the current date,
as in the date one is opening the workbook. This function
updates automatically, so let’s say you open the workbook on
1 April 2017, and the TODAY Function will reflect that date,
if you next open the workbook on 18 April 2017, the TODAY
Function will reflect that date. The TODAY Function does
not take any arguments and the syntax is:
• =TODAY()
• You can use the NOW Function to return the current date
as well as the current time. It also does not take any
arguments and the syntax is:
• =NOW()
• So, as you can see, the NOW vs TODAY Function in
Excel is a common topic to consider in Excel. Without any
further delay, Let’s get started with a few simple examples
to show how to use the TODAY Function and the NOW
Function.
NOW vs TODAY Function in Excel: 3
Suitable Examples
• We have a spreadsheet showing some
data of an employee working for a
company. Details such as the employee’s
name, department, and total sales are
recorded. The source data is shown
below.
1.Use of TODAY Function to Find Today’s
Date
Here I am going to show the use of
the TODAY function step by step.
Steps:
•To show the current date in cell A2, we
enter the formula:
=TODAY()
Upon pressing CTRL-
ENTER, Excel returns the value
o9/15/2022, which is the current date, at the
time of opening the workbook
• If you open the workbook on the
following day, this date will update
automatically to 9/15/2022.
• We now want to format this date, to have
it appear as a long date, so to do this with
cell A2 selected, we go
to Home>Number> and then select Long
Date.
• Excel returned the date formatted as
a Long Date as shown below.
2. Application of TODAY Function to Determine Number of Days
We now want to calculate the number of days of the employee hiring, and we could hard
code the date into a formula, however, we want the formula to update, so as the workbook,
is opened the number of days is updated based on the current date the workbook is opened
on.
Steps:
• Therefore, in cell B7, we enter the following formula:
=DAYS(TODAY(),B6)
Upon pressing CTRL-ENTER we get the value 3161, which means 3161 days have
passed since the hire date of the employee at hand and the current date of opening the
workbook which was 15 September 2022.
Ensure the number format in cell B7 is General, to see the number of days.
Determine Time and Date by Using NOW Function
We would now like to obtain not only the current date but the current
time in conjunction with the date, so we can utilize
the NOW function for this specific purpose.
Steps:
• So in cell B2, we type the following formula:
=NOW()
Upon pressing CTRL-ENTER we get the current date and time
returned as shown below.
If one wants to format this with a long date format with the
time, right-click the cell and choose Format Cells as shown below.
Difference Between NOW and
TODAY Function • In the Format Cells Dialog Box, select Custom
•NOW Function returns the instant time and date and enter:
of a user using the function.
•The TODAY Function returns only the date of a • dd mmmm yyyy hh: mm
user using the function. • Press Ok and then Excel will show the long date
and time as shown below.
Argument
start_date
Description
A date that represents the first, or starting date of Syntax
Required a given period. Dates may be entered as text
strings within quotation marks (for example,
"2001/1/30"), as serial numbers (for example,
DATEDIF(start_date,end_date,un
36921, which represents January 30, 2001, if it)
you're using the 1900 date system), or as the • Datedif, Countif, CountA, CountBlank,
results of other formulas or functions (for
example, DATEVALUE("2001/1/30")). Round, Roundup
end_date A date that represents the last, or ending, date of
Required the period. • https://support.microsoft.com/en-us/office/d
Unit The type of information that you want returned, atedif-function-25dba1a4-2812-480b-84dd-8
where:
b32a451b35c
Unit Returns
"Y" The number of complete years in the period. • Datedif: Calculates the number of days,
"M" The number of complete months in the period.
"D" The number of days in the period.
months, or years between two dates.
"MD" The difference between the days in start_date and
end_date. The months and years of the dates are
• Warning: Excel provides the DATEDIF
ignored. function in order to support older workbooks
Important: We don't recommend using the "MD"
argument, as there are known limitations with it. from Lotus 1-2-3. The DATEDIF function
See the known issues section below.
may calculate incorrect results under certain
"YM" The difference between the months in start_date
and end_date. The days and years of the dates are scenarios. Please see the known issues
"YD"
ignored
The difference between the days of start_date and
section of this article for further details.
end_date. The years of the dates are ignored.
Start_date End_dat Formula Description
e (Result)
Remarks
1/1/2001 1/1/200 =DATEDIF(Start_date,End_date,"Y") Two
3 complete
• Dates are stored as sequential serial
years in the numbers so they can be used in
period (2) calculations. By default, January 1,
6/1/2001 8/15/20 =DATEDIF(Start_date,End_date,"D") 440 days
1900, is serial number 1, and
02 between January 1, 2008, is serial number
June 1,
2001, and
39448 because it is 39,447 days
August 15, after January 1, 1900.
2002 (440)
• The DATEDIF function is useful in
6/1/2001 8/15/20 =DATEDIF(Start_date,End_date,"YD" 75 days formulas where you need to
02 ) between
June 1 and
calculate an age.
August 15,
ignoring the
• If the start_date is greater than the
years of the end_date, the result will be #NUM!
dates (75)
• Examples
Known issues
The "MD" argument may result in a negative
number, a zero, or an inaccurate result. If you are
trying to calculate the remaining days after the
last completed month, here is a workaround:

This formula subtracts the first day of the ending


month (5/1/2016) from the original end date in
cell E17 (5/6/2016). Here's how it does this: First
the DATE function creates the date, 5/1/2016. It
creates it using the year in cell E17, and the
month in cell E17. Then the 1 represents the first
day of that month. The result for the DATE
function is 5/1/2016. Then, we subtract that from
the original end date in cell E17, which is
5/6/2016. 5/6/2016 minus 5/1/2016 is 5 days.
Countif, CountA, CountBlank
• Next up is the COUNT function. It
returns the number of cells containing
numeric values within the input range.
• Syntax: =COUNT(value1, [value2], …)
• 1. To get the number of quizzes taken
by each student, use this formula
in cell G2:
• =COUNT(B2:E2)
• 2. Hit Enter and fill in the rows below.
• If you would like to include non-
numeric values in the count, you can
use the COUNTA function. To count
the number of blank cells, you can use
the COUNTBLANK function.
• Learn more about the COUNT function
and its variants here.
How to use COUNTIF
If you need to count cells
based on a specific criteria
then use
the COUNTIF function. An
example would be if you only
want Excel to count the cells
with values greater than 5.
How to use COUNTIFS
in Excel
If you need to count
cells based on multiple
criteria then use
the COUNTIFS function.
An example would be if
you want Excel to count
all cells with values
greater than 5 and that
are Red.
Excel COUNTA Function Calculation Example
• Suppose you’re tasked with counting the number of employees that worked over the holidays.
• Using the following data set – which states the hours logged per employee – the total number of
employees working per day must be calculated.
• Of the ten employees at this particular company, half of the employees are currently on paid time off
(PTO) for the holidays.
• Once the data is entered into Excel, the COUNTA function can be used to determine the number of
employees working each day.
• Note that if the empty cells contained either “0” or “N/A”, those would still be mistakenly counted.
• We’re left with the following figures for the working employee count per day.
• 12/24/22 = 5 Employees
• 12/25/22 = 2 Employees
• 12/30/22 = 5 Employees
• 12/31/22 = 2 Employees
• 01/01/23 = 5 Employees
Why Does Excel Have Three ROUND Functions?
There are three separate rounding functions in Microsoft Excel.
While all three are similar and have nearly the same syntax, each
produces a slightly different result, and Excel developers should
be aware of the differences.
The three rounding functions are ROUND, ROUNDUP, and
ROUNDDOWN. They are all highly useful for helping users to
format the output from operations. Each of the functions is used
to limit the number of decimal places shown in a number.
1. ROUND
The ROUND function is the most well-known of the three
functions. It has a relatively simple syntax:
=ROUND(number, number_digits)
The first argument is the number being rounded, while the second
number is the number of decimal places it should be limited to.
The function follows the standard rules for rounding and can
round its input up or down.
The first argument in the function can be either a static value, a
reference to another cell, or another function. The second
argument determines how many decimal places the function
should round to. It can be any whole number.
By entering a 0 into the second position, the function can round
the first argument to a whole number.
=ROUND(3.78, 0)
• The above formula will result in the number 4. The numbers in column B of the following
spreadsheet were generated using the ROUND function on the numbers in column A, with
2 as the second argument.
=ROUNDUP(0.0072, 3)

•2. ROUNDUP
•The ROUNDUP function is the second of the ROUND
functions. It is very similar to the standard round function.
ROUNDUP’s syntax looks just like ROUND’s:
•=ROUNDUP(number, number_digits)
•Functionally, the ROUNDUP function works almost exactly
like ROUND as well. The major difference between the two is
that where ROUND can round the number in argument one up
or down, ROUNDUP only rounds up.
•Only rounding up means that regardless of the value in the
final decimal place of the number being rounded, as long as it
isn’t 0, it will be rounded up.
• Even though the final decimal place in the number above is
2, the results will still round up to 0.008. The only way that
the number won’t round up is if all the trailing digits after
the decimal place are rounded to 0. Using 0.0070 will still
round to 0.007 in the above example.
• In the above spreadsheet, the differences between ROUND
and ROUNDUP can be clearly seen when comparing
columns B and C.
•3. ROUNDDOWN
•Excel’s ROUNDDOWN function is quite similar to
the first two rounding functions. The
ROUNDDOWN function uses the same syntax as
both ROUND and ROUNDUP:
•=ROUNDDOWN(number, number_digits)
•Much like the ROUNDUP function from above, the
key difference between ROUND and ROUNDDOWN
is that ROUNDDOWN will always round its output
down. Rounding down will occur regardless of the
value of the remaining digits.
•=ROUNDDOWN(0.0078, 3)
•The output of the corrected function will be 0.007,
despite the value of the next digit being an 8. The
results will always appear to truncate the current
number at the specified digit without consideration
of any trailing digits.
•The differences between all three rounding
functions are readily visible in the above example.
One important thing to note is visible in cell D2. If
the final digit is a 0, it will be hidden by default in
the results. The hidden final digit can be changed by
configuring Excel's custom formatting for the cells to
show a pre-specified number of digits.
ata Data
6 • Use the COUNTBLANK function, one of the
Statistical functions, to count the number of empty
cells in a range of cells.
27
Syntax
4 34 • COUNTBLANK(range)
• The COUNTBLANK function syntax has the
Formula Description Result following arguments:
• Range Required. The range from which you want
to count the blank cells.
=COUNTBLANK(A2:B4) Counts empty 2
cells in the • Remark
range above. • Cells with formulas that return "" (empty text) are
also counted. Cells with zero values are not
counted.
Unit V: Data Analysis Packages
● Introduction to Programming for Excel
● MS Excel Plugin
● Data Analysis Application using Correlation,
Regression, ANNOVA
● Data modelling: Using Solver
● Macros and Visual Basic for Applications (VBA)
scripting
Introduction to Programming for Excel:
Programming refers to writing a set of instructions that tell Excel
to perform one or more tasks. These instructions are written in the
Visual Basic for Applications (VBA) as this is the language
understandable to Excel. To write an instruction, one can either
write a code in VBA or record a macro in Excel. A macro is
recorded to automate repetitive tasks. When a macro is recorded,
VBA generates a code in the background.
For example, to submit an Excel report, a table needs to undergo
the same set of tasks each time. These tasks include applying a pre-
defined border, color, alignment, and font. To program in Excel, a
macro can be recorded for performing all these tasks.
Get an Office add-in for Excel/MS Excel Plugin
1. Click File> Get Add-ins. You can directly install an add-in on the page or click More
Add-ins to explore.

Or you can also select Home > Add-ins >More Add-ins.


2. In the Office Add-ins box, select My Add-ins to view your add-ins. Or browse for the
add-in you want by selecting Store tab and using the Search box.
3. Click an add-in to read more about it, including a longer description and customer
reviews, if available. Then, click Add, Try, or Buy for the add-in you want.
• Start using your Office add-in with Excel
• To start using your add-in with Excel, double-click it in the add-ins list.
1. Click Home> Add-ins > More Add-ins.
2. In the Office dialog, select My Add-ins tab.
3. Select the add-in from My Add-ins tab in the Office Add-ins dialog and click Add to
install the add-in.
Remove an Office add-in
4. Click Home > Add-ins > More Add-ins.
5. In the Office Add-ins dialog, select My Add-ins tab and click on the add-in you
would like to remove and select Remove.
6. Click Remove in the confirmation window.
Data Analysis Application using Correlation, Regression, ANNOVA
• Regression Analysis in Excel using the Data Analysis tool and interpret the Anova
Table obtained from the analysis. It is widely used in statistical modeling to
estimate the impact of variables on a particular topic of interest. Follow the article
to learn how to use the regression analysis tool in Excel to perform this task.
• What Is Regression Analysis?

• Regression Analysis is a set of methods used to create a relationship between a


dependent variable and a single or multiple independent variables. The two most
common forms of regression are-
• Simple Linear Regression
• Multiple Linear Regression
• Simple Linear Regression: You can perform this analysis when there is only one
independent variable affecting the outcome of the dependent variable. The
equation for simple linear regression may be as follows.
• Y = α0 + α1X1 + ϵ

• Multiple Linear Regression: You can do this analysis when there are multiple
independent variables affecting the outcome of the dependent variable. The
equation for multiple linear regression may be as follows.
• Y = α0 + α1X1 + α2X2 +….+ αnXn + ϵ
• How to Perform Regression Analysis in Excel and Interpretation of
ANOVA
• ⦿ Part-1: How to Perform Regression Analysis in Excel

• You can perform Regression Analysis using


the Data Analysis tool in Excel. But you may
need to activate the tool to be able to access
it. The following steps will be sufficient for
that.
• Go to File>>Options or press ALT+F+T.
• Select the Add-ins tab>>Manage Excel Add-
ins>>Go.
• Check the Analysis
ToolPak checkbox>>Click OK.
• After that, you can access the Data
Analysis tool from the Data tab as shown
below.
i. Simple Linear Regression
• Assume you have the following dataset. Here, X is the
independent variable that indicates the rates of interest
and Y is the dependent variable that indicates the price of
homes. You can perform a regression analysis to see how
these variables are related to each other.
• Follow the steps below to perform a Simple Linear
Regression analysis on the dataset in Excel for that.
• 📌 Steps:
• First, select Data>>Data Analysis. Then
choose Regression from the analysis toolbox and click OK.
• Next, you will see the Regression dialog box. Now select
the Y values including labels for Input Y Range and
the X values for Input X Range. Then check
the Labels checkbox. Next, mark the radio button
for Output Range and enter the cell reference where you
want to get the analysis results. Click OK after that.
• Finally, you will see the
following results in the
specified location.
ii. Multiple Linear Regression

• Now assume you have the following dataset instead. Here


the dependent Y variable represents the number of weekly
riders in different cities. On the other hand, the
independent X variables represent the price per week, the
population of cities, monthly income of riders, and average
parking rates per month respectively. You can verify how
the independent variables affect the number of weekly
riders by performing a regression analysis on the dataset.
• Follow the steps below to perform a Multiple Linear
Regression analysis on the dataset in Excel for that.
• 📌 Steps:

• First, select Data>>Data Analysis. Then


choose Regression from the analysis toolbox as earlier and
click OK.
• Next, you will see the Regression dialog box as earlier.
Now select the Y values including labels for Input Y
Range and all of the X values for Input X Range. Then
check the Labels checkbox. Next, mark the radio button
for Output Range. Then, enter the cell reference where
you want to get the analysis results. Click OK after that.
• Finally, you will see the following
result in the specified location.
• Part-2: How to Interpret ANOVA and Other Regression Analysis Results in Excel
• The regression analysis output is divided into three different parts as follows.
• Regression Statistics
• ANOVA Table
• Coefficients Table
• We will briefly explain a few components from each part as the rest of them do not have much importance.
• Regression Statistics: The two important values from this table are-
• Multiple R: It is called the correlation coefficient. It tells you how strong the linear relationship is between the
independent and dependent variables. 1, -1, and 0 indicate a strong positive, a strong negative, and no relationship
respectively.
• R Square: This is called the coefficient of determination. It tells you the percentages of the dependent variable that
can be explained by the independent variable(s). A value closer to 1 indicates that a difference in the dependent
variable can be explained by the difference in the independent variable(s) for most of the values.
• ANOVA Table: The Significance F is of the most importance here.
• Significance F: A value below 0.05 indicates the linear relationship is statistically significant.
• Coefficients Table: The coefficients from this table are used to form the linear equation to represent the relationship
between the variables.
• i. Simple Linear Regression
• First, observe the Regression Statistics table below.
• Multiple R = 0.62 indicates that the relationship between the variables is not so strong but not so weak
either.
• R Square = 0.38 indicates that 38% of Y values can be explained by X values.
• Then, observe the ANOVA Table below.
• Significance F = 0.01 <
0.05 indicates that the linear
relationship between the variables
is statistically significant.
• Finally, observe the Coefficient
table below.

• The regression equation can be- Y


= 393348.62 – 23409.45X +
41456.52.
•i. Multiple Linear Regression
•First, observe the Regression Statistics table.
•Multiple R = 0.97 indicates that the relationship is strong.
•R Square = 0.94 indicates that 94% of Y values can be explained by X values.
•Then, observe the ANOVA Table below.
•Significance F << 0.05 indicates that the linear relationship between the variables is highly statistically
significant.
• Finally, observe the Coefficient table below.
• The regression equation can be- Y = 100222.56 –
689.52X1 + 0.055X2 – 1.3X3 + 152.45X4 + 5406.37.
Data modelling: Using Solver
● Solver works with a group of cells, called decision variables or simply
variable cells that are used in computing the formulas in the objective and
constraint cells. Solver adjusts the values in the decision variable cells to
satisfy the limits on constraint cells and produce the result you want for
the objective cell.

● Solver is a Microsoft Excel add-in program you can use for what-if
analysis. Use Solver to find an optimal (maximum or minimum)
value for a formula in one cell — called the objective cell — subject
to constraints, or limits, on the values of other formula cells on a
worksheet. Solver works with a group of cells, called decision
variables or simply variable cells that are used in computing the
formulas in the objective and constraint cells. Solver adjusts the
values in the decision variable cells to satisfy the limits on
constraint cells and produce the result you want for the objective
cell.
What is Excel Solver?
• Excel Solver belongs to a special set of commands often referred to as What-if Analysis Tools. It is primarily
purposed for simulation and optimization of various business and engineering models.
• The Excel Solver add-in is especially useful for solving linear programming problems, aka linear optimization
problems, and therefore is sometimes called a linear programming solver. Apart from that, it can handle smooth
nonlinear and non-smooth problems. Please see Excel Solver algorithms for more details.
• While Solver can't crack every possible problem, it is really helpful when dealing with all kinds of optimization
problems where you need to make the best decision. For example, it can help you maximize the return of
investment, choose the optimal budget for your advertising campaign, make the best work schedule for your
employees, minimize the delivery costs, and so on.
• How to add Solver to Excel
• The Solver add-in is included with all versions of Microsoft Excel beginning with 2003, but it is not enabled by
default.
• To add Solver to your Excel, perform the following steps:
1. In Excel 2010 - Excel 365, click File > Options.
In Excel 2007, click the Microsoft Office button, and then click Excel Options.
2. In the Excel Options dialog, click Add-Ins on the left sidebar, make sure Excel Add-ins is selected in
the Manage box at the bottom of the window, and click Go.
• In the Add-Ins dialog box, check the Solver Add-in box, and click OK
• To get Solver on Excel 2003, go to the Tools menu, and click Add-Ins. In the Add-
Ins available list, check the Solver Add-in box, and click OK.
• Note. If Excel displays a message that the Solver Add-in is not currently
installed on your computer, click Yes to install it.
• Where is Solver in Excel?
• In the modern versions of Excel, the Solver button appears on the Data tab, in
the Analysis group:
Where is Solver in Excel 2003?
• After the Solver Add-in is loaded to Excel 2003, its command is added to
the Tools menu:
• Now that you know where to find Solver in Excel, open a new worksheet and
let's get started!
• Note. The examples discussed in this tutorial use Solver in Excel 2013. If you
have another Excel version, the screenshots may not match your version
exactly, although the Solver functionality is basically the same.
• How to use Solver in Excel
• Before running the Excel Solver add-in, formulate the model you want to solve
in a worksheet. In this example, let's find a solution for the following simple
optimization problem.
• Problem. Supposing, you are the owner of a beauty salon and you are planning
on providing a new service to your clients. For this, you need to buy a new
equipment that costs $40,000, which should be paid by instalments within 12
months.
• Goal: Calculate the minimal cost per service that will let you pay for the new
equipment within the specified timeframe.
• For this task, I've created the following model:
And now, let's see how Excel Solver can find a solution for this
problem.
1. Run Excel Solver
On the Data tab, in the Analysis group, click the Solver button.

2. Define the problem


The Solver Parameters window will open where you have to set up the
3 primary components:
•Objective cell
•Variable cells
•Constraints
Exactly what does Excel Solver do with the above parameters? It finds
the optimal value (maximum, minimum or specified) for the formula
in the Objective cell by changing the values in the Variable cells, and
subject to limitations in the Constraints cells.
Objective
The Objective cell (Target cell in earlier Excel versions) is the
cell containing a formula that represents the objective, or goal, of
the problem. The objective can be to maximize, minimize, or achieve
some target value.
In this example, the objective cell is B7, which calculates the payment
term using the formula =B3/(B4*B5) and the result of the formula
should be equal to 12:
• Variable cells
• Variable cells (Changing cells or Adjustable cells in
earlier versions) are cells that contain variable data
that can be changed to achieve the objective. Excel
Solver allows specifying up to 200 variable cells.
• In this example, we have a couple of cells whose
values can be changed:
• Projected clients per month (B4) that should be
less than or equal to 50; and
• Cost per service (B5) that we want Excel Solver to
calculate.
• Tip. If the variable cells or ranges in your model are non-adjacent,
select the first cell or range, and then press and hold the Ctrl key
while selecting other cells and/or ranges. Or, type the ranges
manually, separated with commas.
Constraints
• The Excel Solver Constrains are restrictions or limits of the
possible solutions to the problem. To put it differently,
constraints are the conditions that must be met.
• To add a constraint(s), do the following:
• Click the Add button right to the "Subject to the Constraints"
box.
• In the Constraint window, enter a constraint.
• Click the Add button to add the constraint to the list.
• Continue entering other constraints.
• After you have entered the final constraint, click OK to return to the
main Solver Parameters window.
• Excel Solver allows specifying the following relationships between the
referenced cell and the constraint.
• Less than or equal to, equal to, and greater than or equal to. You set these
relationships by selecting a cell in the Cell Reference box, choosing one of the
following signs: <=, =, or >=, and then typing a number, cell reference / cell
name, or formula in the Constraint box (please see the above screenshot).
• Integer. If the referenced cell must be an integer, select int, and the
word integer will appear in the Constraint box.
• Different values. If each cell in the referenced range must contain a different
value, select dif, and the word AllDifferent will appear in the Constraint box.
• Binary. If you want to limit a referenced cell either to 0 or 1, select bin, and the
word binary will appear in the Constraint box.
• Note. The int, bin, and dif relationships can only be used for constraints on
Variable cells.
• To edit or delete an existing constraint do the following:
• In the Solver Parameters dialog box, click the constraint.
• To modify the selected constraint, click Change and make the changes you
want.
• To delete the constraint, click the Delete button.
• In this example, the constraints are:
• B3=40000 - cost of the new equipment is $40,000.
• 3. Solve the problem
• After you've configured all the parameters, click the Solve button at the
bottom of the Solver Parameters window (see the screenshot above) and
let the Excel Solver add-in find the optimal solution for your problem.
• Depending on the model complexity, computer memory and processor
speed, it may take a few seconds, a few minutes, or even a few hours.
• When Solver has finished processing, it will display the Solver
Results dialog window, where you select Keep the Solver Solution and
click OK:
• The Solver Result window will close and the solution will appear on the
worksheet right away.
• In this example, $66.67 appears in cell B5, which is the minimal cost per
service that will let you pay for the new equipment in 12 months,
provided there are at least 50 clients per month:

• Tips:
• If the Excel Solver has been processing a certain problem for too long,
you can interrupt the process by pressing the Esc key. Excel will
recalculate the worksheet with the last values found for
the Variable cells.
• To get more details about the solved problem, click a report type in
the Reports box, and then click OK. The report will be created on a new
worksheet:
• Now that you've got the basic idea of how to use Solver in Excel, let's
have a closer look at a couple more examples that might help you gain
more understanding.
Excel Solver examples
• Below you will find two more examples of using the Excel Solver addin. First,
we will find a solution for a well-known puzzle, and then solve a real-life
linear programming problem.
• Excel Solver example 1 (magic square)
• I believe everyone is familiar with "magic square" puzzles where you have to
put a set of numbers in a square so that all rows, columns and diagonals
add up to a certain number.
• For instance, do you know a solution for the 3x3 square containing numbers
from 1 to 9 where each row, column and diagonal adds up to 15?
• It's probably no big deal to solve this puzzle by trial and error, but I bet the
Solver will find the solution faster. Our part of the job is to properly define
the problem.
• To begin with, enter the numbers from 1 to 9 in a table consisting of 3 rows
and 3 columns. The Excel Solver does not actually need those numbers, but
they will help us visualize the problem. What the Excel Solver add-in really
needs are the SUM formulas that total each row, column and 2 diagonals:
• With all the formulas in place, run Solver and set up the following
parameters:
• Set Objective. In this example, we don't need to set any objective, so leave
this box empty.
• Variable Cells. We want to populate numbers in cells B2 to D4, so select the
range B2:D4.
• Constraints. The following conditions should be met:
• $B$2:$D$4 = AllDifferent - all of the Variable cells should contain different values.
• $B$2:$D$4 = integer - all of the Variable cells should be integers.
• $B$5:$D$5 = 15 - the sum of values in each column should equal 15.
• $E$2:$E$4 = 15 - the sum of values in each row should equal 15.
• $B$7:$B$8 = 15 - the sum of both diagonals should equal 15.
Finally, click the Solve button, and the solution is there!
https://www.wallstreetmojo.com/programming-in-excel/

● Macros and Visual Basic for


Applications (VBA) scripting

Stage 1–Enable the Developer Tab in Excel


• Let us understand how to enable the Developer tab in
Excel. This tab is enabled to record a macro and access
VBA. When the Developer tab is enabled, it appears on
the Excel ribbon. However, by default, Excel does not
display the Developer tab.
• Note: To know an alternate method to record a macro and
access VBA, refer to the “alternative to step 1” in stages 2
and 3.
• The steps to enable the Developer tab in Excel are listed
as follows:
• Step 1: Go to the File tab displayed on the Excel ribbon.
• Step 2: Select “options” shown in the following image.
• Step 3: The “Excel options” window
opens, as shown in the following
image. Select “customize ribbon”
displayed on the left side of this
window.
• Step 4: Under “choose commands
from” (on the left side of the window),
ensure that “popular commands” is
selected. Under “customize the ribbon”
(on the right side of the window),
choose “main tabs” from the drop-
down list.
• Next, select the checkbox of
“developer” and click “Ok.” This
checkbox is shown in the following
image.
• Step 5: The Developer tab appears on
the Excel ribbon, as shown in the
following image.
Stage 2–Record a Macro in Excel
• Let us learn how to record a macro in Excel. When a macro is
recorded, all tasks performed by the user (within the workbook)
are stored in the Macro Recorder until the “stop recording” option
is clicked. Apart from Microsoft Excel, a macro can be recorded
for all Office applications that support VBA.
• The steps to record a macro in Excel are listed as follows:
• Step 1: From the Developer tab, click “record macro” from the
“code” group.
• Alternative to step 1: One can also click “record macro” from
the “macros” group of the View tab of Excel.
Step 2: The “record macro” window opens, as shown in the
following image. In this window, one can name the macro before
recording it. The default macro name given by Excel is “macro1.”
• The rules governing a macro name are stated as follows:
• It should not contain any space ( ), period (.) or exclamation point
(!).
• It cannot contain any special characters (like $, @, ^, #, *, &)
except the underscore (_).
• It should not begin with a numerical value. Rather, it must start
with a letter.
• It cannot exceed 255 characters in length.
• Note: It is recommended to use short and meaningful names for
macros. Further, one must assign a unique name to each macro. In
VBA, two macros within the same code module cannot have the
same names.
Step 3: In the “macro name” box, we have entered the name “recording macro.”
• Notice that an underscore has been used as a separator between the two
strings (recording and macro) of the name. No spaces, periods or special
characters have been used in this name.
Step 4: Click “Ok” to start recording the macro. Once “Ok” is clicked in the
preceding window, the “record macro” button (in the Developer tab or the View
tab) changes to the “stop recording” button.
• Next, carry out the tasks to be recorded in the macro “recording macro.”
• Note: Since the Macro Recorder records every action performed by the user,
ensure that the actions are executed in the right sequence. If the recorded
sequence is correct, Excel will perform the tasks efficiently each time the
macro is run.
• However, if a sequencing error occurs, one must either re-record the actions
or edit the VBA code manually. If one is recording the macro for the first
time, it is recommended to keep a copy of the workbook to prevent any
undesired changes to the stored data.
• In the following steps (step 4a to step 4c), the tasks to be recorded have been
performed.
• Step 4a: Select cell A1 of the worksheet. This is the first task that is recorded.
The selection is shown in the following image.
• Step 4b: Type “welcome to VBA” in cell A1. This is the second task that is
recorded. Exclude the beginning and ending double quotation marks while
typing.
• Step 4c: Press the “Enter” key. As a result, the selection shifts from cell A1 to
cell A2. This becomes the third task that is recorded.
• The selection is shown in the following image.
Step 5: Click “stop recording” in the “code” group of the Developer tab. By
clicking this option, Excel is told to refrain from recording any further tasks.
• Stage 3–View and Examine the VBA Code Generated by the Recorded
Macro
• Let us observe and study the VBA code generated by the macro recorded in stage
2. Remember that one can either directly write a code in the Visual Basic Editor
(VBE or VB Editor) or let a macro do the same.
• The VBE is a tool or program where VBA codes are written, edited, and
maintained. When a macro is recorded, a code is automatically written in a new
module of VBE. Note that VBA is the programming language of Excel.
• The steps to view and study the code generated by the recorded macro are
listed as follows:
• Step 1: Click “visual basic” from the “code” group of the Developer tab. This
option is shown in the following image.
• Alternative to step 1: As a substitute for the preceding step, press the keys
“Alt+F11” together. This is the shortcut to open the VBE window.
• Note: “Alt+F11” is a toggle key which when pressed repeatedly, helps to switch
between VBE and Excel.
• Step 2: The Visual Basic Editor window opens, as shown in the following image.
• To the left of the VBE window, the worksheet, workbook, and module are
shown. This window on the left (named “Project-VBAProject”) is also known as
the Project window or the Project Explorer of VBE.
• Step 3: Double-click “modules” shown in the following image.
• Note: “Modules” are folders shown in the Project window after recording a
macro. They are not shown prior to recording a macro. “Modules” are also
shown when a module is inserted manually from the Insert tab of the VBE.
• Step 4: Double-click “module1” under modules. A code appears on the right side of the VBE window. This
window on the right [named “Book1-Module1 (Code)”] is known as the module code window.
• The code is displayed in the following image.
• Note: The code generated by recording a macro can be checked in the “modules” folder (in the module
code window). In a module code window, one can also write a code manually or copy-paste it from another
source.
• In the following steps (step 4a to step 4d), the code generated by the recorded macro has been studied.
• Step 4a: The first word of the code is “Sub.” “Sub” stands for subroutine or procedure. At the start of the
code, the word “Sub,” the macro name (recording_macro), and a pair of empty parentheses are displayed.
This is followed by the statements to be executed by the code. These statements are:
• ActiveCell.FormulaR1C1 = “Welcome to VBA”
• Range (“A2”). Select
• The code ends with “End Sub.”
• The start or head [Sub Recording_Macro ()] and the end or tail [End Sub] of the code are shown in the
following image.
• Note 1: The words “macro” and “code” are often used interchangeably by several Excel users. However,
some users also distinguish between these two words.
• A VBA code is a command created either by writing a code directly in VBE or by recording a macro in
Excel. In contrast, a macro consists of instructions that automate tasks in Excel. According to one’s choice,
one can decide whether or not to differentiate between the two words.
• Note 2: The “Sub” can be preceded by the words “Private,” “Public,” “Friend,” or “Static.” All these words
set the scope of the subroutine. The default subroutine used in VBA is “Public Sub.” So, when “Sub” is
written in a code, it implies “Public Sub.”
• A “Public Sub” can be initiated by subroutines of different modules. However, a “Private Sub” cannot be
initiated by subroutines of other modules.
• Stage 4–Test the VBA Code of the Recorded Macro
• Let us test the code when it is run multiple times. Note that a macro (or code) can
be run as many times as one wants. Each time it runs, it performs the recorded
tasks in Excel.
• The steps to test the code that we examined in stage 3 are listed as follows:
• Step 1: Delete the string “welcome to VBA” from cell A1 of Excel. Let A1 remain
as a blank, selected cell. The following image shows the empty cell A1.
• Note: To go back from VBE to Excel, press the toggle key “Alt+F11.”
• Step 2: Go to VBE again by pressing the key “Alt+F11.” Click anywhere within
the code. Next, click the “Run Sub/UserForm (F5)” button. This button is shown
within a blue box in the following image.
• Note: Alternatively, one can press the key F5 to run the VBA code.
• Step 3: The output is shown in the following image. The preceding code enters the
string “welcome to VBA” in cell A1. Thereafter, the selection shifts to cell A2. The
string “welcome to VBA” has been entered in cell A1 because this cell was selected
(in step 1) before running the code.
• Each time the code is run, the currently selected cell (or the active cell) is filled
with the string “welcome to VBA.” Then, the selection shifts to cell A2. So, if cell
M10 is the active cell, running the code fills this cell with the stated string and
selects cell A2 at the end.
• However, had cell A2 been selected, running the code would have filled this cell
with the string “welcome to VBA.” Moreover, in the end, cell A2 would have
remained the selected cell.
• Stage 5–Save the Recorded Macro (or the VBA Code)
• Let us learn how to save a workbook containing a recorded macro. If a macro is
saved, its VBA code is also saved.
• The steps to save a workbook containing a macro (or a VBA code) are listed
as follows:
a. Click “save as” from the File tab of Excel. The “save as” dialog box opens, as
shown in the following image.
b. Assign a name to the Excel workbook in the “file name” box. We have entered
the name “macro class.”
c. Save the workbook with the “.xlsm” extension. So, in the “save as type” box,
choose “Excel macro-enabled workbook.”
d. Click “save” to save the workbook.
• A workbook containing a macro should always be saved with the “.xlsm”
extension. This extension ensures that the macro is saved and can be reused the
next time the workbook is opened.
• Note 1: The “save as” command is used when a workbook is saved for the first
time. It is also used when a new copy of the workbook is to be created and, at
the same time, the original copy is to be retained as well.
• Note 2: If the workbook containing a macro is saved as a regular workbook
(with the “.xlsx” extension), the macro will not be saved. Further, one may lose
the code of the recorded macro.

You might also like