Excel Data Analysis - Quick Guide

Data Analysis - Overview

Data Analysis is a process of inspecting, cleaning, transforming and modeling data with the goal of discovering useful information, suggesting conclusions and supporting decision-making

.

Types of Data Analysis

Several data analysis techniques exist encompassing various domains such as business, science, social science, etc. with a variety of names. The major data analysis approaches are −

Data Mining

Data Mining is the analysis of large quantities of data to extract previously unknown, interesting patterns of data, unusual data and the dependencies. Note that the goal is the extraction of patterns and knowledge from large amounts of data and not the extraction of data itself.

Data mining analysis involves computer science methods at the intersection of the artificial intelligence, machine learning, statistics, and database systems.

The patterns obtained from data mining can be considered as a summary of the input data that can be used in further analysis or to obtain more accurate prediction results by a decision support system.

Business Intelligence

Business Intelligence techniques and tools are for acquisition and transformation of large amounts of unstructured business data to help identify, develop and create new strategic business opportunities.

The goal of business intelligence is to allow easy interpretation of large volumes of data to identify new opportunities. It helps in implementing an effective strategy based on insights that can provide businesses with a competitive market-advantage and long-term stability.

Statistical Analysis

Statistics is the study of collection, analysis, interpretation, presentation, and organization of data.

In data analysis, two main statistical methodologies are used −

Predictive Analytics

Predictive Analytics use statistical models to analyze current and historical data for forecasting (predictions) about future or otherwise unknown events. In business, predictive analytics is used to identify risks and opportunities that aid in decision-making.

Text Analytics

Text Analytics, also referred to as Text Mining or as Text Data Mining is the process of deriving high-quality information from text. Text mining usually involves the process of structuring the input text, deriving patterns within the structured data using means such as statistical pattern learning, and finally evaluation and interpretation of the output.

Data Analysis Process

Data Analysis is defined by the statistician John Tukey in 1961 as "Procedures for analyzing data, techniques for interpreting the results of such procedures, ways of planning the gathering of data to make its analysis easier, more precise or more accurate, and all the machinery and results of (mathematical) statistics which apply to analyzing data.”

Thus, data analysis is a process for obtaining large, unstructured data from various sources and converting it into information that is useful for −

Data Analysis with Excel

Microsoft Excel provides several means and ways to analyze and interpret data. The data can be from various sources. The data can be converted and formatted in several ways. It can be analyzed with the relevant Excel commands, functions and tools - encompassing Conditional Formatting, Ranges, Tables, Text functions, Date functions, Time functions, Financial functions, Subtotals, Quick Analysis, Formula Auditing, Inquire Tool, What-if Analysis, Solvers, Data Model, PowerPivot, PowerView, PowerMap, etc.

You will be learning these data analysis techniques with Excel as part of two parts −

Data Analysis - Process

Data Analysis is a process of collecting, transforming, cleaning, and modeling data with the goal of discovering the required information. The results so obtained are communicated, suggesting conclusions, and supporting decision-making. Data visualization is at times used to portray the data for the ease of discovering the useful patterns in the data. The terms Data Modeling and Data Analysis mean the same.

Data Analysis Process consists of the following phases that are iterative in nature −

Data Analysis Process

Data Requirements Specification

The data required for analysis is based on a question or an experiment. Based on the requirements of those directing the analysis, the data necessary as inputs to the analysis is identified (e.g., Population of people). Specific variables regarding a population (e.g., Age and Income) may be specified and obtained. Data may be numerical or categorical.

Data Collection

Data Collection is the process of gathering information on targeted variables identified as data requirements. The emphasis is on ensuring accurate and honest collection of data. Data Collection ensures that data gathered is accurate such that the related decisions are valid. Data Collection provides both a baseline to measure and a target to improve.

Data is collected from various sources ranging from organizational databases to the information in web pages. The data thus obtained, may not be structured and may contain irrelevant information. Hence, the collected data is required to be subjected to Data Processing and Data Cleaning.

Data Processing

The data that is collected must be processed or organized for analysis. This includes structuring the data as required for the relevant Analysis Tools. For example, the data might have to be placed into rows and columns in a table within a Spreadsheet or Statistical Application. A Data Model might have to be created.

Data Cleaning

The processed and organized data may be incomplete, contain duplicates, or contain errors. Data Cleaning is the process of preventing and correcting these errors. There are several types of Data Cleaning that depend on the type of data. For example, while cleaning the financial data, certain totals might be compared against reliable published numbers or defined thresholds. Likewise, quantitative data methods can be used for outlier detection that would be subsequently excluded in analysis.

Data Analysis

Data that is processed, organized and cleaned would be ready for the analysis. Various data analysis techniques are available to understand, interpret, and derive conclusions based on the requirements. Data Visualization may also be used to examine the data in graphical format, to obtain additional insight regarding the messages within the data.

Statistical Data Models such as Correlation, Regression Analysis can be used to identify the relations among the data variables. These models that are descriptive of the data are helpful in simplifying analysis and communicate results.

The process might require additional Data Cleaning or additional Data Collection, and hence these activities are iterative in nature.

Communication

The results of the data analysis are to be reported in a format as required by the users to support their decisions and further action. The feedback from the users might result in additional analysis.

The data analysts can choose data visualization techniques, such as tables and charts, which help in communicating the message clearly and efficiently to the users. The analysis tools provide facility to highlight the required information with color codes and formatting in tables and charts.

Excel Data Analysis - Overview

Excel provide commands, functions and tools that make your data analysis tasks easy. You can avoid many time consuming and/or complex calculations using Excel. In this tutorial, you will get a head start on how you can perform data analysis with Excel. You will understand with relevant examples, step by step usage of Excel commands and screen shots at every step.

Ranges and Tables

The data that you have can be in a range or in a table. Certain operations on data can be performed whether the data is in a range or in a table.

However, there are certain operations that are more effective when data is in tables rather than in ranges. There are also operations that are exclusively for tables.

You will understand the ways of analyzing data in ranges and tables as well. You will understand how to name ranges, use the names and manage the names. The same would apply for names in the tables.

Data Cleaning – Text Functions, Dates and Times

You need to clean the data obtained from various sources and structure it before proceeding to data analysis. You will learn how you can clean the data.

Conditional Formatting

Excel provides you conditional formatting commands that allow you to color the cells or font, have symbols next to values in the cells based on predefined criteria. This helps one in visualizing the prominent values. You will understand the various commands for conditionally formatting the cells.

Sorting and Filtering

During the preparation of data analysis and/or to display certain important data, you might have to sort and/or filter your data. You can do the same with the easy to use sorting and filtering options that you have in Excel.

Subtotals with Ranges

As you are aware, PivotTable is normally used to summarize data. However, Subtotals with Ranges is another feature provided by Excel that will allow you to group / ungroup data and summarize the data present in ranges with easy steps.

Quick Analysis

With Quick Analysis tool in Excel, you can quickly perform various data analysis tasks and make quick visualizations of the results.

Understanding Lookup Functions

Excel Lookup Functions enable you to find the data values that match a defined criteria from a huge amount of data.

PivotTables

With PivotTables you can summarize the data, prepare reports dynamically by changing the contents of the PivotTable.

Data Visualization

You will learn several Data Visualization techniques using Excel Charts. You will also learn how to create Band Chart, Thermometer Chart, Gantt chart, Waterfall Chart, Sparklines and PivotCharts.

Data Validation

It might be required that only valid values be entered into certain cells. Otherwise, they may lead to incorrect calculations. With data validation commands, you can easily set up data validation values for a cell, an input message prompting the user on what is expected to be entered in the cell, validate the values entered with the defined criteria and display an error message in case of incorrect entries.

Financial Analysis

Excel provides you several financial functions. However, for commonly occurring problems that require financial analysis, you can learn how to use a combination of these functions.

Working with Multiple Worksheets

You might have to perform several identical calculations in more than one worksheet. Instead of repeating these calculations in each worksheet, you can do it one worksheet and have it appear in the other selected worksheets as well. You can also summarize the data from the various worksheets into a report worksheet.

Formula Auditing

When you use formulas, you might want to check whether the formulas are working as expected. In Excel, Formula Auditing commands help you in tracing the precedent and dependent values and error checking.

Inquire

Excel also provides Inquire add-in that enables you compare two workbooks to identify changes, create interactive reports, and view the relationships among workbooks, worksheets, and cells. You can also clean the excessive formatting in a worksheet that makes Excel slow or makes the file size huge.

Working with Range Names

While doing Data Analysis, referring to various data will be more meaningful and easy if the reference is by Names rather than cell references – either a single cell or a range of cells. For example, if you are calculating Net Present Value based on a Discount Rate and a series of Cash Flows, the formula

Net_Present_Value = NPV (Discount_Rate, Cash_Flows)

is more meaningful than

C10 = NPV (C2, C6:C8)

With Excel, you can create and use meaningful names to various parts of your data. The advantages of using range names include −

In this chapter, you will learn −

Copying Name using Formula Autocomplete

Type the first letter of the name in the formula. A drop-down box appears with function names and range names. Select the required name. It is copied into your formula.

Copying Name

Range Name Syntax Rules

Excel has the following syntax rules for names −

Creating Range Names

You can create Range Names in two ways −

Create a Range Name using the Name Box

To create a Range name, using the Name box that is to the left of formula bar is the fastest way. Follow the steps given below −

Step 1 − Select the range for which you want to define a Name.

Step 2 − Click on the Name box.

Step 3 − Type the name and press Enter to create the Name.

Creating Range Names

Create a Range Name using the New Name dialog box

You can also create Range Names using the New Name dialog box from Formulas tab.

Step 1 − Select the range for which you want to define a name.

Step 2 − Click the Formulas tab.

Step 3 − Click Define Name in the Defined Names group. The New Name dialog box appears.

Step 4 − Type the name in the box next to Name

Step 5 − Check that the range that is selected and displayed in the Refers box is correct. Click OK.

Creating Range Name Using New Name

Create a Range Name using the Create Names from Selection dialog box

You can also create Range names using the Create Names from the Selection dialog box from Formulas tab, when you have Text values that are adjacent to your range.

Step 1 − Select the range for which you want to define a name along with the row / column that contains the name.

Step 2 − Click the Formulas tab.

Step 3 − Click Create from Selection in the Defined Names group. The Create Names from Selection dialog box appears.

Step 4 − Select top row as the Text appears in the top row of the selection.

Step 5 − Check the range that got selected and displayed in the box next to Refers to be correct. Click OK.

Create from Selection

Now, you can find the largest value in the range with =Sum(Student Name), as shown below −

Find Largest Value

You can create names with multiple selection also. In the example given below, you can name the row of marks of each student with the student’s name.

Create Names with Multiple Selection

Now, you can find the total marks for each student with =Sum (student name), as shown below.

Find Total Marks

Creating Names for Constants

Suppose you have a constant that will be used throughout your workbook. You can assign a name to it directly, without placing it in a cell.

In the example below, Savings Bank Interest Rate is set to 5%.

Creating Names for Constants

The Name Savings_Bank_Interest_Rate is set to a constant 5%. You can verify this in Name Manager. You can see that the value is set to 0.05 and in the Refers to =0.05 is placed.

Name Manager

Managing Names

An Excel Workbook can have any number of named cells and ranges. You can manage these names with the Name Manager.

Managing Names

The List of Names are displayed with the defined Values, Cell Reference (including Sheet Name), Scope and Comment.

The Name Manager has the options to −

Name Manager Options

Scope of a Name

The Scope of a name by default is the workbook. You can find the Scope of a defined names from the list of names under the Scope column in the Name Manager.

You can define the Scope of a New Name when you define the name using New Name dialog box. For example, you are defining the name Interest_Rate. Then you can see that the Scope of the New Name Interest_Rate is the Workbook.

Scope of a Name

Suppose you want the Scope of this interest rate restricted to this Worksheet only.

Step 1 − Click the down-arrow in the Scope Box. The available Scope options appear in the drop-down list.

Scope

The Scope options include Workbook, and the sheet names in the workbook.

Step 2 − Click the current worksheet name, in this case NPV and click OK. You can define / find the sheet name in the worksheet tab.

Step 3 − To verify that Scope is worksheet, click Name Manager. In the Scope column, you will find NPV for Interest_Rate. This means you can use the Name Interest_Rate only in the Worksheet NPV, but not in the other Worksheets.

Verify Scope

Note − Once you define the Scope of a Name, it cannot be modified later.

Deleting Names with Error Values

Sometimes, it may so happen that Name definition may have errors for various reasons. You can delete such names as follows −

Step 1 − Click Filter in the Name Manager dialog box.

The following filtering options appear −

You can apply Filter to the defined Names by selecting one or more of these options.

Step 2 − Select Names with Errors. Names that contain error values will be displayed.

Names with Errors

Step 3 − From the obtained list of Names, select the ones you want to delete and click Delete.

Names List

You will get a message, confirming delete. Click OK.

Editing Names

You can use the Edit option in the Name Manager dialog box to −

Change the Name

Step 1 − Click the cell containing the function Large.

You can see, two more values are added in the array, but are not included in the function as they are not part of Array1.

Change Name

Step 2 − Click the Name you want to edit in the Name Manager dialog box. In this case, Array1.

Click Name

Step 3 − Click Edit. The Edit Name dialog box appears.

Edit Name

Step 4 − Change the Name by typing the new name that you want in the Name Box.

Step 5 − Click the Range button to the right of Refers to Box and include the new cell references.

Step 6 − Add a Comment (Optional)

Notice that Scope is deactive and hence cannot be changed.

Scope Deactivated

Click OK. You will observe the changes made.

Cell Changed

Applying Names

Consider the following example −

Applying Names

As you observe, names are not defined and used in PMT function. If you place this function somewhere else in the worksheet, you also need to remember where exactly the parameter values are. You know that using names is a better option.

In this case, the function is already defined with cell references that do not have names. You can still define names and apply them.

Step 1 − Using Create from Selection, define the names.

Step 2 − Select the cell containing the formula. Click Select Button next to Define Name in the Defined Names group on the Formulas tab. From the drop-down list, click Apply Names.

Select Cell

Step 3 − The Apply Names dialog box appears. Select the Names that you want to Apply and click OK.

Apply Names

The selected names will be applied to the selected cells.

Selected Cells

You can also Apply Names to an entire worksheet, by selecting the worksheet and repeating the above steps.

Using Names in a Formula

You can use a Name in a Formula in the following ways −

Using Names in a Formula Select Name

Viewing Names in a Workbook

You can get all the Names in your workbook along with their References and Save them or Print them.

Viewing Names

The list of names and their corresponding references are copied at the specified location on your worksheet as shown in the screen shot given below −

Worksheet

Using Names for Range Intersections

Range Intersections are those individual cells that have two Ranges in common.

For example, in the data given below, the Range B6:F6 and the Range C3:C8 have Cell C6 in common, which actually represents the marks scored by the student Kodeda, Adam in Exam 1.

Range Intersections

You can make this more meaningful with the Range Names.

Range Names

Here, you are using the Range Intersection operation, space between the two ranges.

Range Intersection operation

This will display marks of Kodeda, Adam in Exam 1, that are given in Cell C6.

Display Marks

Copying Formulas with Names

You can copy a formula with names by Copyand Paste within the same worksheet.

You can also copy a formula with names to a different worksheet by copy and paste, provided all the names in the formula have workbook as Scope. Otherwise, you will get a #VALUE error.

Excel Data Analysis - Tables

A Table is a rectangular range of structured data. The key features are −

Table

You can create and use an Excel table to manage and analyze data easily. Further, with Excel Tables you get built-in Filtering, Sorting, and Row Shading that ease your reporting activities.

Further, Excel responds to the actions performed on a table intelligently. For example, you have a formula in a column or you have created a chart based on the data in the table. When you add more data to the table (i.e., more rows), Excel extends the formula to the new data and the chart expands automatically.

Difference between Tables and Ranges

Following are the differences between a table and range −

Tables provide additional features that are not available for ranges. These are −

You will learn about all these Features in this Chapter.

Create Table

To create a table from the data you have on the worksheet, follow the given steps −

Step 1 − Select the Range of Cells that you want to include in the Table. Cells can contain data or can be empty. The following Range has 290 rows of employee data. The top row of the data has headers.

Create Table

Step 2 − Under the Insert tab, in the Tables group, click Tables. The Create Table dialog box appears. Check that the data range selected in the Where is the data for your table? Box is correct.

Insert Tab

Step 3 − Check the My table has headers box if the top row of the selected Range contains data that you want to use as the Table Headers.

Note − If you do not check this box, your table will have Headers – Column1, Column2, …

Step 4 − Click OK.

Create Table Dialog Box

Range is converted to Table with the default Style.

Table with Default Size

Step 5 − You can also convert a range to a table by clicking anywhere on the range and pressing Ctrl+T. A Create Table dialog box appears and then you can repeat the steps as given above.

Table Name

Excel assigns a name to every table that is created.

Step 1 − To look at the name of the table you just created, click table, click on table tools – design tab on the Ribbon.

Step 2 − In the Properties group, in the Table Name box, your Table Name will be displayed.

Table Name Box

Step 3 − You can edit this Table Name to make it more meaningful to your data.

Step 4 − Click the Table Name box. Clear the Name and type Emp_Data.

Note − The syntax rules of range names are applicable to table names.

Syntax Rules Applicable

Managing Names in a Table

You can manage table names just similar to how you manage range names with Name Manager.

The Name Manager dialog box appears and you can find the Table Names in your workbook.

Managing Names in Table

You can Edit a Table Name or add a comment with New option in the Name Manager dialog box. However, you cannot change the range in Refers to.

Edit Table Name

You can Create Names with column headers to use them in formulas, charts, etc.

The New Name dialog box appears.

In the Name box, you can find the Column Header, and in the Refers to box,you will find Emp_Data[[#Headers],[EmployeeID]].

Name Box

As you observe, this is a quick way of defining Names in a Table.

Table Headers replacing Column Letters

When you are working with more number of rows of data in a table, you may have to scroll down to look at the data in those rows.

However, while doing so, you also require the table headers to identify which value belongs to which column. Excel automatically provides a smooth way of doing this. As you scroll down your data, the column letters of the worksheet themselves get converted to table headers.

In the worksheet given below, the column letters are appearing as they are and the table headers are in row 2. 21 rows of 290 rows of data are visible.

Column Letters

Scroll down to see the table rows 25 – 35. The table headers will replace the column letters for the table columns. Other column letters remain as they are.

Column Letters Replaced

Propagation of a Formula in a Table

In the table given below, suppose you want to include the age of each employee.

Step 1 − Insert a column to the right of the column Birthdate. Type Age in the Column Header.

Step 2 − In any of the Cells in that empty column, type the Formula, =DAYS ([@BirthDate], TODAY ()) and Press Enter.

Formula Propagation

The formula propagates automatically to the other cells in that column of the table.

Formula Propagates Automatically

Resize Table

You can resize a table to add or remove rows/columns.

Consider the following table Student_Marks that contains Total Marks for Batches 1 - 15.

Resize Table

Suppose you want to add three more batches 16 – 18 and a column containing pass percentage.

Add Batches

Your table looks as follows. You can also check the range included in the table in the Name Manager dialog box −

Check Range

Remove Duplicates

When you gather data from different sources, you probably can have duplicate values. You need to remove the duplicate values before going further with analysis.

Look at the following data where you have information about various products of various brands. Suppose, you want to remove duplicates from this data.

Remove Duplicates Design Tab

The column headers appear under columns in the Remove Duplicates dialog box.

You will get a message on how many rows with duplicate values are removed and how many unique values remain. The cleaned data will be displayed in the table.

Cleaned Data

You can also remove duplicates with Remove Duplicates in the Data Tools group under DATA tab on the Ribbon.

Convert to Range

You can convert a table to a Range.

Convert to Range

You will get a message asking you if you want to convert the table to a Range. After you confirm with Yes, the table will be converted to Range.

Table Converted to Range

Table Style Options

You have several options of Table Styles to choose. These options can be used if you need to highlight a Row / Column.

Table Style Options

You can check / uncheck these boxes to see how your table looks. Finally, you can decide on what options suit your data.

It is advised that the Table Style Options be used only to project important information in your data rather than making it colorful, which is not needed in data analysis.

Table Styles

You have several table styles to choose from. These styles can be used depending on what color and pattern you want to display your data in the table.

Table Styles

Move your mouse on these styles to have a preview of your table with the styles. Finally, you can decide on what style suit your data.

It is advised that the Table Styles be used only to project important information in your data in a presentable way rather than making it colorful, which is not needed in data analysis.

Slicers for Tables

If you are using Excel 2013 or Excel 2016, you can use Slicers for filtering data in your table.

For details on how to use Slicers for Tables, refer the chapter on Filtering in this tutorial.

Cleaning Data with Text Functions

The data that you obtain from different sources many not be in a form ready for analysis. In this chapter, you will understand how to prepare your data that is in the form of text for analysis.

Initially, you need to clean the data. Data cleaning includes removing unwanted characters from text. Next, you need to structure the data in the form you require for further analysis. You can do the same by −

Removing Unwanted Characters from Text

When you import data from another application, it can have nonprintable characters and/or excess spaces. The excess spaces can be −

If you sort or analyze such data, you will get erroneous results.

Consider the following example −

Product Data

This is the raw data that you have obtained on product information containing the Product ID, Product description and the price. The character “|” separates the field in each row.

When you import this data into Excel worksheet, it looks as follows −

Import Data

As you observe, the entire data is in a single column. You need to structure this data to perform data analysis. However, initially you need to clean the data.

You need to remove any nonprintable characters and excess spaces that might be present in the data. You can use the CLEAN function and TRIM function for this purpose.

S.No. Function & Description
1.

CLEAN

Removes all nonprintable characters from text

2.

TRIM

Removes spaces from text

The formula is filled in the cells C3 – C11.

Formula Filled

The result will be as shown below −

Formula Filled Result

Finding required Text Patterns with the Text Functions

To structure your data, you might have to do certain Text Pattern matching based on which you can extract the Data Values. Some of the Text Functions that are useful for this purpose are −

S.No. Function & Description
1.

EXACT

Checks to see if two text values are identical

2.

FIND

Finds one text value within another (case-sensitive)

3.

SEARCH

Finds one text value within another (not case-sensitive)

Extracting Data Values from Text

You need to extract the required data from text in order to structure the same. In the above example, say, you need to place the data in three columns – ProductID, Product_Description and Price.

You can extract data in one of the following ways −

Extracting Data Values with Convert Text to Columns Wizard

You can use the Convert Text to Columns Wizard to extract Data Values into Excel columns if your fields are −

In the above example, the fields are delimited by the character “|”. Hence, you can use the Convert Text to Columns wizard.

Convert Text to Columns

Step 1 − Convert Text to Columns Wizard - Step 1 of 3 appears.

Convert Text to Columns Step1

Step 2 − Convert Text to Columns Wizard - Step 2 of 3 appears.

Convert Text to Columns Step2

Step 3 − Convert Text to Columns Wizard - Step 3 of 3 appears.

In this screen, you can select each column of your data in the wizard and set the format for that column.

Convert Text to Columns Step3

Your data, which is converted to columns appears in the three Columns – D, E and F.

Name Column Headers

Extracting Data Values with Text Functions

Suppose the fields in your data neither are delimited by a character nor are aligned in columns with spaces between each field, you can use text functions to extract data values. Even in the case the fields are delimited, you can still use text functions to extract data.

Some of the text functions that are useful for this purpose are −

S.No. Function & Description
1.

LEFT

Returns the leftmost characters from a text value

2.

RIGHT

Returns the rightmost characters from a text value

3.

MID

Returns a specific number of characters from a text string starting at the position you specify

4.

LEN

Returns the number of characters in a text string

You can also combine two or more of these text functions as per the data you have at hand, to extract the required data values. For example, using a combination of LEFT, RIGHT and VALUE functions or using a combination of FIND, LEFT, LEN and MID functions.

In the above example,

Observing this information, you can extract the data values with the following steps −

Extract Data Values

The result will be as shown below −

Extract Data Values Result

You can observe that the values in the price column are text values. To perform calculations on these values, you have to format the corresponding cells. You can look at the section given below to understand formatting text.

Extracting Data Values with Flash Fill

Using Excel Flash Fill is another way to extract data values from text. However, this works only when Excel is able to find a pattern in the data.

Step 1 − Create three columns for ProductID, Product_Description and Price next to the data.

Create Columns

Step 2 − Copy and paste the values for C3, D3 and E3 from B3.

Paste Values

Step 3 − Select cell C3 and click Flash Fill in the Data Tools group on the Data tab. All the values for ProductID get filled.

Flash Fill

Step 4 − Repeat the above given steps for Product_Description and Price. The data is filled.

Repeat Steps

Formatting Data with Text Functions

Excel has several built-in text functions that you can use for formatting data containing text. These include −

Functions that format the Text as per your need

S.No. Function & Description
1.

LOWER

Converts text to lowercase

S.No. Function & Description
1.

UPPER

Converts text to uppercase

2.

PROPER

Capitalizes the first letter in each word of a text value

Functions that convert and/or format the Numbers as Text

S.No. Function & Description
1.

DOLLAR

Converts a number to text, using the $ (dollar) currency format

2.

FIXED

Formats a number as text with a fixed number of decimals

3.

TEXT

Formats a number and converts it to text

Functions that convert the Text to Numbers

S.No. Function & Description
1.

VALUE

Converts a text argument to a number

Executing Data Operations with the Text Functions

You might have to perform certain Text Operations on your Data. For example, if Login-IDs for the Employees are changed to a New Format in an Organization, based on the Format Change, Text Replacements might have to be done.

Following Text Functions help you in performing Text Operations on your data containing Text −

S.No. Function & Description
1.

REPLACE

Replaces characters within text

2.

SUBSTITUTE

Substitutes new text for old text in a text string

3.

CONCATENATE

Joins several text items into one text item

4.

CONCAT

Combines the text from multiple ranges and/or strings, but it does not provide the delimiter or IgnoreEmpty arguments.

5.

TEXTJOIN

Combines the text from multiple ranges and/or strings, and includes a delimiter you specify between each text value that will be combined. If the delimiter is an empty text string, this function will effectively concatenate the ranges.

6.

REPT

Repeats text a given number of times

Cleaning Data Containing Date Values

The data that you obtain from different sources might contain date values. In this chapter, you will understand how to prepare your data that contains data values for analysis.

You will learn about −

Date Formats

Excel supports Date values in two ways −

You can convert −

Date in Serial Format

A Date in serial format is a positive integer that represents the number of days between the given date and January 1, 1900. Both the current Date and January 1, 1900 are included in the count. For example, 42354 is a Date that represents 12/16/2015.

Date in Month-Day-Year Formats

Excel supports different Date Formats based on the Locale (Location) you choose. Hence, you need to first determine the compatibility of your Date formats and the Data Analysis at hand. Note that certain Date formats are prefixed with *(asterisk) −

For understanding purpose, you can assume United States as the Locale. You find the following Date formats to choose for the Date - 8th June, 2016 −

If you enter only two digits to represent a year and if −

For example, 1/1/29 is treated as January 1, 2029 and 1/1/30 is treated as January 1, 1930.

Converting Dates in Serial Format to Month-Day-Year Format

To convert dates from serial format to Month-Day-Year format, follow the steps given below −

Converting Dates in Serial Format

After choosing the Format, click OK.

Converting Dates in Month-Day-Year Format to Serial Format

You can convert dates in Month-Day-Year format to Serial format in two ways −

Using Format Cells dialog box

Format Cells

Using Excel DATEVALUE Function

You can use Excel DATEVALUE function to convert a Date to Serial Number format. You need to enclose the Date argument in “”. For example,

=DATEVALUE ("6/8/2016") results in 42529

Obtaining Today's Date

If you need to perform calculations based on today’s date, simply use the Excel function TODAY (). The result reflects the date when it is used.

The following screenshot of TODAY () function usage has been taken on 16th May, 2016 −

Obtaining Today's Date

Finding a Workday after Specified Days

You might have to perform certain calculations based on your workdays.

Workdays exclude weekend days and any holidays. This means if you can define your weekend and holidays, whatever calculations you do will be based on workdays. For example, you can calculate invoice due dates, expected delivery times, the next meeting date, etc.

You can use Excel WORKDAY and WORKDAY.INTL functions for such operations.

S.No. Function & Description
1.

WORKDAY

Returns the serial number of the date before or after a specified number of workdays

2.

WORKDAY.INTL

Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days

For example, you can specify the 15th working day from today (the screenshot below is taken on 16th May 2016) using the Functions TODAY and WORKDAY.

Finding Workday

Suppose 25th May 2016 and 1st June 2016 are holidays. Then, your calculation will be as follows −

Calculation

Customizing the Definition of a Weekend

By default, weekend is Saturday and Sunday, i.e. two days. You can also optionally define your weekend with the WORKDAY.INTL function. You can specify your own weekend by a weekend-number that corresponds to the weekend days as given in the table below. You need not remember these numbers, because when you start typing the function, you get a list of numbers and the weekend days in the drop-down list.

Weekend Days Weekend-number
Saturday, Sunday 1 or omitted
Sunday, Monday 2
Monday, Tuesday 3
Tuesday, Wednesday 4
Wednesday, Thursday 5
Thursday, Friday 6
Friday, Saturday 7
Sunday only 11
Monday only 12
Tuesday only 13
Wednesday only 14
Thursday only 15
Friday only 16
Saturday only 17

Suppose, if weekend is Friday only, you need to use the number 16 in the WORKDAY.INTL function.

WORKDAY.INTL function

Number of Workdays between two given Dates

There might be a requirement to calculate the number of workdays between two dates, for example, in the case of calculating payment to a contract employee who is paid on per day basis.

You can find the number of workdays between two dates with the Excel functions NETWORKDAYS and NETWORKDAYS.INTL. Just as in the case of WORKDAYS and WORKDAYS.INTL, NETWORKDAYS and NETWORKDAYS.INTL allow you to specify holidays and with NETWORKDAYS.INTL you can additionally specify the weekend.

S.No. Function & Description
1.

NETWORKDAYS

Returns the number of whole workdays between two dates

2.

NETWORKDAYS.INTL

Returns the number of whole workdays between two dates using parameters to indicate which and how many days are weekend days

You can calculate the number of workdays between today and another date with the functions TODAY and NETWORKDAYS. In the screen shot given below, today is 16th May 2016 and end date is 16th June 2016. 25th May 2016 and 1st June 2016 are holidays.

Calculate Workdays

Again, the weekend is assumed to be Saturday and Sunday. You can have your own definition for weekend and calculate the number of workdays between two dates with the NETWORKDAYS.INTL function. In the screen shot given below, only Friday is defined as weekend.

Weekend Friday

Extracting Year, Month, Day from Date

You can extract from each date in a list of dates, the corresponding day, month and year using the excel functions DAY, MONTH and YEAR.

For example, consider the following dates −

Dates

From each of these dates, you can extract day, month and year as follows −

Extracting Year, Month, Day from Date

Extracting Day of the Week from Date

You can extract from each date in a list of dates, the corresponding day of the week with Excel WEEKDAY function.

Consider the same example given above.

Extracting Day of the Week from Date

Obtaining Date from Year, Month and Day

You data might have the information about Year, Month and Day separately. You need to get the date combining these three values to perform any calculation. You can use the DATE function for getting the date values.

Consider the following data −

Obtaining Date from Year, Month and Day

Use the DATE function to obtain DATE values.

DATE function

Calculating Years, Months and Days between two Dates

You might have to calculate the time lapsed from a given date. You might need this information in the form of years, months and days. A simple example would be calculating the current age of a person. It is effectively the difference between the birth date and today. You can use Excel DATEDIF, TODAY and CONCATENATE functions for this purpose.

Calculate Time Lapsed

The output is as follows −

Calculate Time Lapsed Output

Working with Time Values

The data that you obtain from different sources might contain time values. In this chapter, you will understand how to prepare your data that contains time values for analysis.

You will learn about −

Time Formats

Excel supports Time Values in two ways −

You can convert −

Time in Serial Format

Time in serial format is a positive number that represents the Time as a fraction of a 24-hour day, the starting point being midnight. For example, 0.29 represents 7 AM and 0.5 represents 12 PM.

You can also combine Date and Time in the same cell. The serial number is the number of days after January 1, 1900, and the time fraction associated with the given time. For example, if you type May 17, 2016 6 AM, it gets converted to 42507.25 when you format the cell as General.

Time in Hour-Minute-Second Format

Excel allows you to specify time in Hour-Minute-Second Format with a colon (:) after the hour and another colon before the seconds. Example, 8:50 AM, 8:50 PM or just 8:50 using the 12-Hour Format or as 8:50, 20:50 in 24-Hour format. The time 8:50:55 AM represents 8 hours, 50 minutes and 55 seconds.

You can also specify date and time together. For example, if you type May 17, 2016 7:25 in a cell, it will be displayed as 5/17/2016 7:25 and it represents 5/17/2016 7:25:00 AM.

Excel supports different Time formats based on the Locale (Location) you choose. Hence, you need to first determine the compatibility of your Time formats and data analysis at hand.

For understanding purpose, you can assume United States as the Locale. You find the following Time formats to choose for Date and Time – 17th May, 2016 4 PM −

Converting Times in Serial Format to Hour-Minute-Second Format

To convert serial time format to hour-min-sec format follow the steps given below −

Converting Times

After choosing the Format, click OK

Converting Times in Hour-Minute-Second Format to Serial Format

You can convert Time in Hour-Minute-Second format to serial format in two ways −

Using Format Cells dialog box

Format Cells Dialog Box

Using Excel TIMEVALUE Function

You can use Excel TIMEVALUE function to convert Time to Serial Number format. You need to enclose the Time argument in “”. For example,

TIMEVALUE ("16:55:15") results in 0.70503472

Obtaining the Current Time

If you need to perform calculations based on current time, simply use the Excel function NOW (). The result reflects the date and time when it is used.

The following screen shot of Now () function usage has been taken on 17th May, 2016 at 12:22 PM.

Obtaining Current Time

Obtaining Time from Hour, Minute and Second

Your data might have the information about hours, minutes and seconds separately. Suppose, you need to get the Time combining these 3 values to perform any calculation. You can use Excel Function Time for getting the Time values.

Obtaining Time

Extracting Hour, Minute and Second from Time

You can extract hour, minute and second from a given time using the Excel functions HOUR, MINUTE and SECOND.

Extract Time

Number of hours between Start Time and End Time

When you perform computations on Time values, the result displayed depends on the format used in the cell. For example, you can compute the number of hours between 9:30 AM and 6 PM as follows −

Number of Hours

You get the time difference as days. To convert to hours you need to multiply by 24.

Excel Data Analysis - Conditional Formatting

In Microsoft Excel, you can use Conditional Formatting for data visualization. You have to specify formatting for a cell range based on the contents of the cell range. The cells that meet the specified conditions would be formatted as you have defined.

Example

In a range containing the sales figures of the past quarter for a set of salespersons, you can highlight those cells representing who have met the defined target, say, $2500.

You can set the condition as total sales of the person >= $2500 and specify a color code green. Excel checks each cell in the range to determine whether the condition you specified, i.e., total sales of the person >= $2500 is satisfied.

Excel applies the format you chose, i.e. the green color to all the cells that satisfy the condition. If the content of a cell does not satisfy the condition, the formatting of the cell remains unchanged. The result is as expected, only for the salespersons who have met the target, the cells are highlighted in green – a quick visualization of the analysis results.

You can specify any number of conditions for formatting by specifying Rules. You can pick up the rules that match your conditions from

You can also define your own rules. You can −

Further, you have several formatting options in Excel to choose the ones that are appropriate for your Data Visualization −

Conditional formatting has been promoted over the versions Excel 2007, Excel 2010, Excel 2013. The examples you find in this chapter are from Excel 2013.

In the following sections, you will understand the conditional formatting rules, formatting options and how to work with rules.

Highlight Cells Rules

You can use Highlight Cells rule to assign a format to cells whose contents meet any of the following criteria −

Follow the steps to conditionally format cells −

Highlight Cells Rules Rules

The data will be highlighted based on the given conditions and the corresponding formatting.

Data Highlighted

Top / Bottom Rules

You can use Top / Bottom Rules to assign a format to cells whose contents meet any of the following criteria −

Follow the steps given below to assign the Top/Bottom rules.

Top/Bottom Rules Choose Green and Red Color

The data will be highlighted based on the given conditions and the corresponding formatting.

D Cell Formatted Conditionally Choose Red Color for D cell

The data will be highlighted based on the given conditions and the corresponding formatting.

D Cell Highlighted Data Choose Red Color for E cell

The data will be highlighted based on the given conditions and the corresponding formatting.

E Cell Highlighted Data

Data Bars

You can use colored Data Bars to see the value in a cell relative to the values in the other cells. The length of the data bar represents the value in the cell. A longer bar represents a higher value, and a shorter bar represents a lower value. You have six solid colors to choose from for the data bars – blue, green, red, yellow, light blue and purple.

Data bars are helpful in visualizing the higher, lower and intermediate values when you have large amounts of data. Example - Day temperatures across regions in a particular month. You can use gradient fill color bars to visualize the value in a cell relative to the values in other cells. You have six Gradient Colors to choose from for the Data Bars – Blue, Green, Red, Yellow, Light Blue and Purple.

Data Bars

Click the blue data bar in the Gradient Fill options.

Gradient Fill Solid Fill

You can also format data bars such that the data bar starts in the middle of the cell, and stretches to the left for negative values and stretches to the right for positive values.

Stretches to Left and Right

Color Scales

You can use Color Scales to see the value in a cell relative to the values in the other cells in a given range. As in the case of Highlight Cells Rules, a Color Scale uses cell shading to display the differences in cell values. A color gradient will be applied to a range of cells. The color indicates where each cell value falls within that range.

You can choose from −

Follow the steps given below −

The Data will be highlighted based on the Green – Yellow – Red color scale in the selected range.

Green Yellow Red Color

The data will be highlighted based on the Green – White color scale in the selected range.

Green White Color Scale

Icon Sets

You can use the icon sets to visualize numerical differences. The following icon sets are available −

Icon Sets

As you observe, an icon set consists of three to five symbols. You can define criteria to associate an icon with each value in a cell range. For example, a red down arrow for small numbers, a green up arrow for large numbers, and a yellow horizontal arrow for intermediate values.

Colored Arrows appear next to the Data based on the Values in the selected range.

Colored Arrows Rating Icons

New Rule

You can use New Rule to create your own formula as a condition to format a cell as you define.

There are two ways to use New Rule −

With New Rule option from the Drop-Down Menu

Drop Down Menu

The New Formatting Rule dialog box appears.

Edit Rule Description

Cells that contain values with the formula TRUE, are formatted as defined.

Cells with Values

With New Rule Button in Manage Rules dialog box

New Rule Button

The Conditional Formatting Rules Manager dialog box appears.

Click the New Rule button.

Conditional Formatting Rules Manager

The New Formatting Rule dialog box appears.

Repeat the Steps given above to define your formula and format.

Define Formula and Format

The Conditional Formatting Rules Manager dialog box appears with defined New Rule highlighted. Click the Apply button.

Click Apply Button

Cells that contain values with the formula TRUE, are formatted as defined.

Cells

Clear Rules

You can Clear Rules to delete all conditional formats you have created for

Follow the given steps −

Clear Rules

Select the appropriate option. The conditional formatting is cleared from the Range / Worksheet / Table / PivotTable.

Manage Rules

You can Manage Rulesfrom the Conditional Formatting Rules Manager window. You can see formatting rules for the current selection, for the entire current worksheet, for the other worksheets in the workbook or the tables or PivotTables in the workbook.

Manage Rules

The Conditional Formatting Rules Manager dialog box appears.

Click the arrow in the List Box next to Show formatting rules for Current Selection, This Worksheet and other Sheets, Tables, PivotTable if exist with Conditional Formatting Rules, appear.

Show Formatting Rules

Select This Worksheet from the drop-down list. Formatting Rules on the current Worksheet appear in the order that they will be applied. You can change this order by using the up and down arrows.

Worksheet Drop-down

You can add a New Rule, Edit a Rule and Delete a Rule.

Add New Edit and Delete Rule modified Conditional Formatting Rules

Excel Data Analysis - Sorting

Sorting data is an integral part of Data Analysis. You can arrange a list of names in alphabetical order, compile a list of sales figures from highest to lowest, or order rows by colors or icons. Sorting data helps you quickly visualize and understand your data better, organize and find the data that you want, and ultimately make more effective decisions.

You can sort by columns or by rows. Most of the sorts that you use will be column sorts.

You can sort data in one or more columns by

Sort criteria for a table are saved with the workbook such that you can reapply the sort to that table every time you open the workbook. Sort criteria are not saved for a range of cells. For multicolumn sorts or for sorts that take a long time to create, you can convert the range to a table. Then, you can reapply the sort when you open a workbook.

In all the examples in the following sections, you will find tables only, since it is more meaningful to sort a table.

Sort by Text

You can sort a table using a column containing text.

The following table has information about employees in an organization (You are able to see only the first few rows in the data).

Sort by Text Sort and Filter

The table will be sorted by the column – Title in the ascending alphanumeric order.

Note − You can sort in the descending alphanumeric order, by clicking Sort Z to A. You can also sort with case-sensitive option. Go through the Sort by a Custom List section given below.

Sort by Custom List

Sort by Numbers

To sort the table by the column ManagerID that contains numbers, follow the steps given below −

Sort by Numbers

The column, ManagerID will be sorted in the ascending numeric order. You can sort in the descending numeric order, by clicking Sort Z to A.

ManagerID

Sort by Dates or Times

To sort the Table by the column HireDate that contains Dates, follow the steps given below −

Sort by Dates or Times

The column – HireDate will be sorted with the dates sorted from oldest to newest. You can sort the dates from newest to oldest, by clicking Sort Z to A.

HireDate

Sort by Cell Color

To sort the table by the column total marks that contains cells with colors (Conditionally Formatted) −

Sort by Cell Color Choose Sort By

The column – Total Marks will be sorted by the cell color as specified in the Order.

Total Marks Sorted by Cell Color

Sort by Font Color

To sort the column Total Marks in the table, that contains cells with font colors (conditionally formatted) −

Sort by Font Color

The column – Total Marks is sorted by the font color as specified in the Order.

Total Marks Sorted by Font Color

Sort by Cell Icon

To sort the table by the column Total Marks that contains cells with Cell Icons (Conditionally Formatted), follow the steps given below −

Sort by Cell Icon

The column – Total Marks will be sorted by Cell Icon as specified in the Order.

Total Marks Sorted by Cell Icon

Sort by a Custom List

You can create a custom list and sort the table by the custom list.

In the table given below, you find an indicator column with title – Position. It has the values high, medium and low based on the position of total marks with respect to the entire range.

Sort by a Custom List

Now, suppose you want to sort the column - Position, with all High values on top, all low values at bottom, and all medium values in between. That means the order you want is low, medium and high. With Sort A to Z, you get the order high, low and medium. On the other hand, with Sort Z to A, you get the order medium, low and high.

You can resolve this is to create a custom list.

Select Range Edit Custom Lists

The Edit Custom Lists dialog box appears. The select range in worksheet appears in the Import list from cells Box. Click Import.

Import List

Your custom list is added to the Custom Lists. Click OK.

Custom Lists

The next step is to sort the table with this Custom List.

Sort Table with Custom List

In the Sort dialog box, in the Order Box, High, Medium, Low appears. Click on OK.

Order Box

The table will be sorted in the defined order – high, medium, low.

Table Sorted

You can create Custom Lists based on the following values −

You cannot create custom lists based on format, i.e. by cell / font color, or cell icon.

Sort by Rows

You can sort a table by rows also. Follow the steps given below −

Sort by Rows Sort On

The data will be sorted by the selected row in a descending order.

Descending Order

Sort by more than one Column or Row

You can sort a table by more than one column or row.

In the screen shot given below, Sort By Title, Sort On Values, Order A – Z are chosen.

Sort By Then By HireDate

The data will be sorted for Title in the ascending alphanumeric order and then by HireDate. You will see the employee data sorted by title, and in each title category, in the seniority order.

Seniority Order

Excel Data Analysis - Filtering

Filtering allows you to extract data that meets the defined criteria from a given Range or table. This is a quick way to display only the information that is needed by you.

You can Filter data in a Range, table or PivotTable.

You can filter data by −

In a table, the column headers are automatically tagged to filters, known as AutoFilters. AutoFilter is represented by the arrow Arrow next to column header. Each AutoFilter has filter options based on the type of data you have in that column. For example, if the column contains numbers, when you click on the arrow Arrow next to the column header, Number Filter Options appear.

When you click a Filter option or when you click on Custom Filter that appears at the end of the Filter options, Custom AutoFilter dialog box appears, wherein you can customize your filtering options.

In case of a Range, you can provide the column headers in the first row of the range and click on filter in the Editing group on Home tab. This will make the AutoFilter on for the Range. You can remove the filters that you have in your data. You can also reapply the filters when data changes occur.

Filter by Selected Values

You can choose what data is to be displayed by clicking the arrow next to a column header and selecting the Values in the column. Only those rows containing the selected values in the chosen column will be displayed.

Consider the following data −

Filter by Selected Values

If you want to display the data only for Position = High, click the arrow next to Position. A drop-down box appears with all the values in the position column. By default, all the values will be selected.

Values Selected Select High

Click OK. Only those Rows, which have the value High as Position, will be displayed.

High Position

Filter by Text

Consider the following data −

Filter by Text

You can filter this data such that only those Rows wherein the Title is “Manager” will be displayed.

Click the arrow next to the column header Title. From the drop-down list, click Text Filters. Text filter options appear.

Text Filters

Select Contains from the available options. The Custom AutoFilter dialog box opens. Type Manager in the Box next to Contains.

Custom AutoFilter

Click OK. Only the Rows where Title contains Manager will be displayed.

Title Rows

Filter by Date

You can filter this data further such that only those Rows wherein the Title is “Manager” and HireDate is prior to 2011 can be displayed. That means you will display the Employee information for all the managers who have been with the organization from before 2011.

Click the arrow next to the column header HireDate. From the drop-down list, click Date Filters. The Date filter options appear. Select Before from the drop-down list.

Date Filters

Custom AutoFilter dialog box opens. Type 1/1/2011 in the box next to is before. You can also select the date from the date picker next to the box.

Custom AutoFilter Dialog Box

Click OK. Only the rows where Title contains Manager and HireDate is prior to 1/1/2011 will be displayed.

Manager and HireDate

Filter by Numbers

Consider the following data −

Filter by Numbers

You can filter this data such that only those rows where Total Marks > 850 can be displayed.

Click the arrow next to the column header Total Marks. From the drop-down list, click Number Filters. The Number Filter options appear.

Number Filters

Click Greater Than. Custom AutoFilter dialog box opens. Type 850 in the box next to Greater Than.

Click Greater Than

Click OK. Only the rows wherein the total marks are greater than 850 will be displayed.

Greater than 850

Filter by Cell Color

If the data has different cell colors or is conditionally formatted, you can filter by the colors that are displayed in your table.

Consider the following data. The column Total Marks has conditional formatting with different cell colors.

Filter by Cell Color

Click the arrow Arrow in the header Total Marks. From the drop-down list, click Filter by Color. The Filter by Cell Color options appear.

Filter by Color

Select the green color and click OK. Only the rows wherein the total marks column has green color cells will be displayed.

Total Marks Column

Filter by Font Color

If the data has different font colors or is conditionally formatted, you can filter by the colors that are displayed in your table.

Consider the following data. The column - Total Marks has conditional formatting with font color applied.

Filter by Font Color

Click the arrow Arrow in the header Total Marks. From the Drop-Down List, click Filter by Color. Filter by Font Color options appear.

Click Filter by Color

Select the green color and click OK. Only the rows wherein the Total Marks column has green color font will be displayed.

Select Green Color

Filter by Cell Icon

If the data has different icons or a conditional format, you can filter by the icons that are shown in your table.

Consider the following data. The column Total Marks has conditional formatting with icons applied.

Filter by Cell Icon

Click the arrow Arrow in the header Total Marks. From the drop-down list, select Filter by Color. The Filter by Cell Icon options appear.

Filter by Cell Icon Appear

Select the icon Select Green Arrow Icon and click OK.

Only the rows wherein the Total Marks column has the Select Green Arrow Icon icon will be displayed.

Column with Green Arrow Icon

Clear Filter

Removing filters is termed as Clear Filter in Excel.

You can remove

To remove a filter from a specific column, click the arrow in the table header of that column. From the drop-drown menu, click Clear Filter From “<specific Column Name>”.

Clear Filter

The filter in the column is removed. To remove filtering from the entire worksheet, select Clear Clear in the

All the filters in the worksheet are removed at once. Click Undo Show All Undo Show All if you have removed the Filters by mistake.

Reapply Filter

When changes occur in your data, click Reapply in Sort & Filter group on the Data tab. The defined filter will be applied again on the modified data.

Advanced Filtering

You can use Advance Filtering if you want to filter the data of more than one column.

You need to define your filtering criteria as a range. Suppose you want to display the information of those employees who are specialists or whose EmployeeID is 2, define the Criteria as follows −

Advanced Filtering Filter Data

The employee information where ManagerID = 2 OR Title = “*Specialist” is displayed.

Employee Information

Suppose you want to display information about specialists and vice presidents. You can define the criteria and filter as follows −

Specialist and Vice President Information

The criteria you applied is Title = “*Specialist” OR Title = “Vice President”. The employee information of specialists and vice presidents will be displayed.

Specialist and Vice President Information Displayed

You can copy the filtered data to another location. You can also select only few columns to include in the copy operation.

 Advanced Filter Dialog Box

Click OK after specifying the List Range and Criteria Range. The selected columns in the filtered data will be copied to the location you specified.

Specify List and Criteria Range

Filter Using Slicers

Slicers to filter data in PivotTables were introduced in Excel 2010. In Excel 2013, you can use Slicers to filter data in tables also.

Consider the data in the following table.

Filter Using Slicers  Insert Slicer Check Boxes Title and HireDate

A Slicer appears for each of the table headers you checked in the Insert Slicers dialog box. In each Slicer, all the values of that column will be highlighted.

Title and HireDate Highlighted

In the Title Slicer, click the first value. Only that value will be highlighted and the rest of the values get unselected. Further, you will find the values in HireDate Slicer that are corresponding to the value in the Title Slicer also get highlighted.

In the table, only the selected values are displayed.

Slicer

You can select / deselect the values in the Slicers and you find that the data is automatically updated in the table. To choose more than one value, hold down the Ctrl key, and pick the values that you want to display.

Select the Title values that belong to the Accounts department and the HireDate values in the year 2015 from the two Slicers.

Select Title Values

You can clear the selections in any Slicer by clicking the Clear Filter Clear at the right end corner of the Slicer header.

Excel Data Analysis - Subtotals with Ranges

If you have a list of data that you want to group and summarize, you can use Excel Subtotal and Outline to display summary rows or columns. You can use PivotTable also for this purpose, but using Subtotal and Outline is the quickest way to analyze a range of data. Note that Subtotal and Outline can be used only on a range and not on a table.

You can create an Outline of up to eight levels, one for each group. Outer Levels are represented by Lower Numbers and Inner Levels by Higher Numbers. Each inner level displays detailed data for the preceding outer level.

To understand how to use Subtotal and Outline, consider the following example wherein the sales data of various items is given salesperson wise and location wise. In total, there are 1891 rows of data.

Rows Data

Subtotals

You can obtain the sum of sales location wise using Subtotal.

First, sort the data location wise.

Data is selected. The Sort dialog box appears.

Subtotals

In the Sort dialog box,

Sort Dialog Box

Click OK. The data is sorted location wise.

Data Sorted Subtotal Dialog Box

In the Subtotal dialog box,

Add Subtotal

Click OK. The data is grouped with three levels and the subtotals are calculated location wise.

Note − The data that is displayed is of Level 3 – i.e. entire data.

Calculate Subtotal

Click the Outline Level 2. The Totals will be displayed location wise for units and amount.

Display Totals

Click Outline Level 1. The Grand Totals will be displayed for units and amount.

Grand Totals

You can zoom-in or zoom-out the data by clicking the Outline Levels or by clicking the + Symbols to the left of the data.

Nested Subtotals

You can obtain the sum of sales by each salesperson, location wise using Nested Subtotals.

Sort the data location wise and then salesperson wise.

Nested Subtotals

In the Sort dialog box,

Then by row appears

Add Level

Click OK. The data is sorted by location and then by name.

Sort by Location

Data gets selected. Subtotal dialog box appears.

Data Selected

In the Subtotal dialog box,

Location

Click OK. The data is grouped with three Levels and the subtotals are calculated location wise as described earlier.

Outline Levels

In the Subtotal dialog box,

Click Subtotal

Click OK. The data is grouped with four levels and the subtotals are calculated location wise and name wise.

Calculated Location and Name Wise

Click Outline Level 3. The Totals will be displayed name wise and location wise for Units and Amount.

Outline Level 3

Click on Outline Level 2. The Totals will be displayed location wise for Units and Amount.

Subtotal Outline Level 2

Click Outline Level 1. The Grand Totals will be displayed for Units and Amount.

Outline Level 1

You can zoom-in or zoom-out the data by clicking the Outline Levels or by clicking the + symbol to the Left of the data.

Excel Data Analysis - Quick Analysis

In Microsoft Excel 2013, the Quick Analysis tool makes it possible to analyze your data quickly and easily using different Excel tools.

You can use Quick Analysis with a range or a table of data. To access Quick Access tool, select the cells that contain the data you want to analyze. The Quick Analysis tool button Quick Analysis Tool Button appears at the bottom right of your selected data.

Quick Analysis

Click the Quick Analysis Quick Analysis Tool Button button. The Quick Analysis toolbar appears with the options FORMATTING, CHARTS, TOTALS, TABLES, SPARKLINES.

Quick Analysis Toolbar

Quick Analysis tool is handy and quick to use as you can also have a preview of applying different options, before selecting the one you want.

Formatting

Conditional Formatting allows you to highlight parts of your data by adding Data Bars, Colors, etc. This lets you quickly visualize the values in your data.

You have learnt about formatting rules in the Conditional Formatting chapter in this tutorial. The difference is that you can have a quick preview and select the option you want. However, if you want to utilize all the features of Conditional Formatting, you rather go through the main menu on the Ribbon. The same thing holds for all the options in the Quick Analysis tool.

Click Formatting on the Quick Analysis toolbar. The Conditional Formatting options appear in the toolbar. Move your mouse on the options. You will see the previews. You can then select the option you want by clicking it.

Formatting

Charts

Charts are used to depict the data pictorially. There are several types of Charts to suit different types of data.

If you click CHARTS on the Quick Analysis toolbar, the recommended charts for the data you have selected will be displayed. You can always choose More Charts option if you want to go to the main Charts on the Ribbon.

Hover your mouse on the options. You will see the previews. You can then select the option you want by clicking it.

Charts

Totals

Totals can be used to calculate the numbers in columns and rows. You will have functions such as Sum, Average, Count, etc.

We will go into the details on how to use Quick Analysis tool with TOTALS later in this chapter. You can use the other options in Quick Analysis with the same ease, as you observe.

Tables

Tables help you to filter, sort and summarize your data, as you have already learnt in the Tables chapter. In the Quick Analysis tool, both the Table and PivotTable options are available under TABLES. However, you can have a preview for the table, but in the case of PivotTable no preview is available as by clicking you will get an empty PivotTable which you need to populate with the data.

Tables

Sparklines

Sparklines are tiny charts that you can show alongside your data in single cells. They provide a quick way to see trends.

Sparklines

Quick Analysis with TOTALS

Click on TOTALS in the Quick Analysis Toolbar.

In Quick Analysis with TOTALS, you can analyze

Row-wise Row-wise

Column-wise Column-wise

For row wise calculations, ensure that you have an empty row below the selected data.

Example

We will analyze the data of the votes polled in an election for five candidates. The counting is done in four rounds. Following is the data.

TOTALS

Sum

Select the data and Click Sum on the Quick Analysis toolbar under TOTALS.

Ensure that the row below the data is empty. Otherwise, you will get a message saying that there is already data present there and you will only have two options, either replace the existing data or cancel the operation.

In the row below the selected data, the sum of each column of the data is displayed. The caption Sum is also automatically provided. This means the total count of votes in each round for all the candidates is displayed.

Sum on Quick Analysis

Average

Select the data and click Average on the Quick Analysis Toolbar under TOTALS.

The average of each column of the data appears in the row below the data. The caption Average is also automatically provided. The average number of votes polled in each round is displayed.

Average on Quick Analysis

Count

Select the data and click Count on the Quick Analysis Toolbar under TOTALS.

The count of each column of the data appears in the row below the data. The caption Count is also automatically provided. This means the count of candidates in each round is displayed.

Count on Quick Analysis

%Total

Select the data and click Percentile Total on the Quick Analysis Toolbar under TOTALS.

The %Total of each column of the data appears in the row below the data. The caption %Total is also automatically provided. This means the %Total of votes in each round is displayed.

Percentile Total Count on Quick Analysis

Running Total

Select the data and Click Running Total on the Quick Analysis Toolbar under TOTALS.

The running total of each column of the data appears in the row below the data. The caption Running Total is also automatically provided. This means the running total of votes across the rounds is displayed.

Running Total Count on Quick Analysis

Sum of Columns

Select the data and click Sum of Columns on the Quick Analysis toolbar under TOTALS.

Ensure that the column next to the data is empty. Otherwise, you will get a message saying that there is already data present there and you will only have two options, either replace the existing data or cancel the operation.

In the column next to the selected data, the sum of each row of the data is displayed. The column header Sum is also automatically provided. This means the total number of votes polled for each candidate in all the rounds is displayed.

Sum of Columns Count on Quick Analysis

Excel Data Analysis - Lookup Functions

You can use Excel functions to −

You can also combine these functions to get the required results based on the inputs you have.

Using VLOOKUP Function

The syntax of the VLOOKUP function is

VLOOKUP (lookup_value, table_array, col_index_num, [range_lookup])

Where

Note − If range_lookup is omitted or TRUE or 1, VLOOKUP works correctly only when the first column in table_array is sorted in ascending order. Otherwise, it may result in incorrect values. In such a case, use FALSE for range_lookup.

Using VLOOKUP Function with range_lookup TRUE

Consider a list of student marks. You can obtain the corresponding grades with VLOOKUP from an array containing the marks intervals and pass category.

table_array −

Vlookup Function with True

Note that the first column marks based on which the grades are obtained is sorted in ascending order. Hence, using TRUE for range_lookup argument you can get approximate match that is what is required.

Name this array as Grades.

It is a good practice to name arrays in this way so that you need not remember the cell ranges. Now, you are ready to look up the grade for the list of marks you have as follows −

Grades

As you can observe,

Marks Pass Category
< 35 Fail
>= 35 and < 50 Third Class
>= 50 and < 60 Second Class
>=60 and < 75 First Class
>= 75 First Class with Distinction

You will get the following results −

Vlookup Function with True Result

Using VLOOKUP Function with range_lookup FALSE

Consider a list of products containing the Product ID and price for each of the products. The product ID and price will be added to the end of the list whenever a new product is launched. This would mean that the product IDs need not be in ascending order. The product list might be as shown below −

table_array −

Table Array

Name this array as ProductInfo.

You can obtain the price of a product given the product ID with the VLOOKUP function as the product ID is in the first column. The price is in column 3 and hence col_index_ num should be 3.

Vlookup Function with False

The correct answer is from the ProductInfo array is 171.65. You can check the results.

Vlookup Function with False Result

You observe that you got −

This is because, the first column in the ProductInfo array is not sorted in ascending order. Hence, remember to use FALSE whenever the data is not sorted.

Using HLOOKUP Function

You can use HLOOKUP function if the data is in rows rather than columns.

Example

Let us take the example of product information. Suppose the array looks as follows −

Hlookup Function

The Syntax of HLOOKUP function is

HLOOKUP (lookup_value, table_array, row_index_num, [range_lookup])

Where

Note − If range_lookup is Omitted or TRUE or 1, HLOOKUP works correctly only when the first column in table_array is sorted in ascending order. Otherwise, it may result in incorrect values. In such a case, use FALSE for range_lookup.

Using HLOOKUP Function with range_lookup FALSE

You can obtain the price of a product given the product ID with the HLOOKUP function as the product ID is in the first row. The price is in row 3 and hence row_index_ num should be 3.

Hlookup Function with False

The correct answer from the ProductRange array is 171.65. You can check the results.

Hlookup Function with False Result

You observe that as in the case of VLOOKUP, you got

This is because the first row in the ProductRange array is not sorted in ascending order. Hence, remember to use FALSE whenever the data is not sorted.

Using HLOOKUP Function with range_lookup TRUE

Consider the example of student marks used in VLOOKUP. Suppose you have the data in rows instead of columns as shown in the table given below −

table_array −

Hlookup Function with True

Name this array as GradesRange.

Note that the first row marks based on which the grades are obtained is sorted in ascending order. Hence, using HLOOKUP with TRUE for range_lookup argument, you can get the Grades with approximate match and that is what is required.

GradesRange

As you can observe,

Marks < 35 >= 35 and < 50 >= 50 and < 60 >=60 and < 75 >= 75
Pass Category Fail Third Class Second Class First Class First Class with Distinction

You will get the following results −

Student Grades

Using INDEX Function

When you have an array of data, you can retrieve a value in the array by specifying the row number and column number of that value in the array.

Consider the following sales data, wherein you find the sales in each of the North, South, East and West regions by the salespersons who are listed.

SalesData

Using INDEX Function, you can find −

Using Index Function

You will get the following results −

Using Index Function Result

Suppose you do not know the row numbers for the salespersons and column numbers for the regions. Then, you need to find the row number and column number first before you retrieve the value with the index function.

You can do it with the MATCH function as explained in the next section.

Using MATCH Function

If you need the position of an item in a range, you can use the MATCH function. You can combine MATCH and INDEX functions as follows −

Using Match Function

You will get the following results −

Using Match Function Result

Excel Data Analysis - PivotTables

Data analysis on a large set of data is quite often necessary and important. It involves summarizing the data, obtaining the needed values and presenting the results.

Excel provides PivotTable to enable you summarize thousands of data values easily and quickly so as to obtain the required results.

Consider the following table of sales data. From this data, you might have to summarize total sales region wise, month wise, or salesperson wise. The easy way to handle these tasks is to create a PivotTable that you can dynamically modify to summarize the results the way you want.

Sales Data Table

Creating PivotTable

To create PivotTables, ensure the first row has headers.

Creating PivotTable

As you can see in the dialog box, you can use either a Table or Range from the current workbook or use an external data source.

Table Range Box

A Blank PivotTable and a PivotTable fields list appear.

Blank PivotTable Fields

Recommended PivotTables

In case you are new to PivotTables or you do not know which fields to select from the data, you can use the Recommended PivotTables that Excel provides.

Recommended PivotTables

In the recommended PivotTables dialog box, the possible customized PivotTables that suit your data are displayed.

Recommended PivotTables Dialog Box

Click OK. The selected PivotTable appears on a new worksheet. You can observe the PivotTable fields that was selected in the PivotTable fields list.

PivotTable Fields List

PivotTable Fields

The headers in your data table will appear as the fields in the PivotTable.

Header PivotTable Fields

You can select / deselect them to instantly change your PivotTable to display only the information you want and in a way that you want. For example, if you want to display the account information instead of order amount information, deselect Order Amount and select Account.

Select / Deselect PivotTable Fields

PivotTable Areas

You can even change the Layout of your PivotTable instantly. You can use the PivotTable Areas to accomplish this.

PivotTable Areas

In PivotTable areas, you can choose −

An instant update helps you to play around with the different Layouts and pick the one that suits your report requirement.

You can just drag the fields across these areas and observe the PivotTable layout as you do it.

Observe PivotTable Layout

Nesting in the PivotTable

If you have more than one field in any of the areas, then nesting happens in the order you place the fields in that area. You can change the order by dragging the fields and observe how nesting changes. In the above layout options, you can observe that

The resulting PivotTable is as follows −

PivotTable Result

In the PivotTable Areas, in rows, click region and drag it below salesperson such that it looks as follows −

Salesperson

The nesting order changes and the resulting PivotTable is as follows −

Nesting Order Changes

Note − You can clearly observe that the layout with the nesting order – Region and then Salesperson yields a better and compact report than the one with the nesting order – Salesperson and then Region. In case Salesperson represents more than one area and you need to summarize the sales by Salesperson, then the second layout would have been a better option.

Filters

You can assign a Filter to one of the fields so that you can dynamically change the PivotTable based on the values of that field.

Drag Region from Rows to Filters in the PivotTable Areas.

Filters

The filter with the label as Region appears above the PivotTable (in case you do not have empty rows above your PivotTable, PivotTable gets pushed down to make space for the Filter.

Filters with Label

You can see that −

Click the arrow in the box to the right of the filter region. A drop-down list with the values of the field region appears.

Field Values Select Multiple Items

The data pertaining to South and West Regions only will be summarized as shown in the screen shot given below −

Data Pertaining

You can see that next to the Filter Region, Multiple Items is displayed, indicating that you have selected more than one item. However, how many items and / or which items are selected is not known from the report that is displayed. In such a case, using Slicers is a better option for filtering.

Slicers

You can use Slicers to have a better clarity on which items the data was filtered.

Slicers

Slicers for each of the selected fields appear with all the values selected by default. Slicer Tools appear on the Ribbon to work on the Slicer settings, look and feel.

Selected Fields

Selected items in the Slicers are highlighted. PivotTable with summarized values for the selected items will be displayed.

Selected Items Highlighted

Summarizing Values by other Calculations

In the examples so far, you have seen summarizing values by Sum. However, you can use other calculations also if necessary.

In the PivotTable Fields List

Summarizing Values Value Field Settings

The Value Field Settings box appears. Several types of calculations appear as a list under Summarize value field by −

Select Count

The PivotTable summarizes the Account values by Count.

Summarizes Account Values

PivotTable Tools

Follow the steps given below to learn to use the PivotTable Tools.

The following PivotTable Tools appear on the Ribbon −

PivotTable Tools

ANALYZE

Some of the ANALYZE Ribbon commands are −

DESIGN

Some of the DESIGN Ribbon commands are −

Expanding and Collapsing Field

You can either expand or collapse all items of a selected field in two ways −

By selecting the Expand symbol Plus or Collapse symbol Minus to the left of the selected field

Expanding and Collapsing Field

All the items under East will be collapsed. The Collapse symbol Minus to the left of East changes to the Expand symbol Plus.

Collapse and Expand

You can observe that only the items below East are collapsed. The rest of the PivotTable items are as they are.

Click the Expand symbol Plus to the left of East. All the items below East will be displayed.

Using ANALYZE on the Ribbon

You can collapse or expand all items in the PivotTable at once with the Expand Field and Collapse Field commands on the Ribbon.

Using Analyze

All the items of the field East in the PivotTable will collapse.

East Field Items

Click Expand Field in the Active Field group.

Expand Field

All the items will be displayed.

Report Presentation Styles

You can choose the presentation style for your PivotTable as you would be including it as a report. Select a style that fits into the rest of your presentation or report. However, do not get over bored with the styles because a report that gives an impact in showing the results is always better than a colorful one, which does not highlight the important data points.

Report Presentation Styles

Blank rows will be displayed after each value of the Region field.

You can insert blank rows from the DESIGN tab also.

Insert Blank Rows Outline Form

PivotTable in Outline Form with the selected Style will be displayed.

Displays Selected Style

Timeline in PivotTables

To understand how to use Timeline, consider the following example wherein the sales data of various items is given salesperson wise and location wise. There are total 1891 rows of data.

Timeline

Create a PivotTable from this Range with −

Range Insert Timelines

Click Date and click OK. The Timeline dialog box appears and the Timeline Tools appear on the Ribbon.

Ribbon

Timeline is selected to Q2 – Q4 2014.

PivotTable is filtered to this Timeline.

PivotTable Filtered

Excel Data Analysis - Data Visualization

You can display your data analysis reports in a number of ways in Excel. However, if your data analysis results can be visualized as charts that highlight the notable points in the data, your audience can quickly grasp what you want to project in the data. It also leaves a good impact on your presentation style.

In this chapter, you will get to know how to use Excel charts and Excel formatting features on charts that enable you to present your data analysis results with emphasis.

Visualizing Data with Charts

In Excel, charts are used to make a graphical representation of any set of data. A chart is a visual representation of the data, in which the data is represented by symbols such as bars in a Bar Chart or lines in a Line Chart. Excel provides you with many chart types and you can choose one that suits your data or you can use the Excel Recommended Charts option to view charts customized to your data and select one of those.

Refer to the Tutorial Excel Charts for more information on chart types.

In this chapter, you will understand the different techniques that you can use with the Excel charts to highlight your data analysis results more effectively.

Creating Combination Charts

Suppose you have the target and actual profits for the fiscal year 2015-2016 that you obtained from different regions.

Creating Combination Charts

We will create a Clustered Column Chart for these results.

Clustered Column Chart

As you observe, it is difficult to visualize the comparison quickly between the targets and actual in this chart. It does not give a true impact on your results.

A better way of distinguishing two types of data to compare the values is by using Combination Charts. In Excel 2013 and versions above, you can use Combo charts for the same purpose.

Use Vertical Columns for the target values and a Line with Markers for the actual values.

Use Vertical Columns Change Chart Type

Your Customized Combination Chart will be displayed.

Customized Combination Chart

As you observe in the chart, the Target values are in Columns and the Actual values are marked along the line. The data visualization has become better as it also shows you the trend of your results.

However, this type of representation does not work well when the data ranges of your two data values vary significantly.

Creating a Combo Chart with Secondary Axis

Suppose you have the data on the number of units of your product that was shipped and the actual profits for the fiscal year 2015-2016 that you obtained from different regions.

Combo Chart

If you use the same combination chart as before, you will get the following −

Combination Chart

In the chart, the data of No. of Units is not visible as the data ranges are varying significantly.

In such cases, you can create a combination chart with secondary axis, so that the primary axis displays one range and the secondary axis displays the other.

Custom Combo Chart

The Insert Chart dialog box appears with Combo highlighted.

For Chart Type, choose −

A preview of your chart appears under Custom Combination.

Custom Combination

Your Combo chart appears with Secondary Axis.

Combo Chart with Secondary Axis

You can observe the values for Actual Profits on the primary axis and the values for No. of Units on the secondary axis.

A significant observation in the above chart is for Quarter 3 where No. of Units sold is more, but the Actual Profits made are less. This could probably be assigned to the promotion costs that were incurred to increase sales. The situation is improved in Quarter 4, with a slight decrease in sales and a significant rise in the Actual Profits made.

Discriminating Series and Category Axis

Suppose you want to project the Actual Profits made in Years 2013-2016.

Discriminating Series and Category Axis

Create a clustered column for this data.

Clustered Column

As you observe, the data visualization is not effective as the years are not displayed. You can overcome this by changing year to category.

Remove the header year in the data range.

Remove Header Year

Now, year is considered as a category and not a series. Your chart looks as follows −

Year as Category

Chart Elements and Chart Styles

Chart Elements give more descriptions to your charts, thus helping visualizing your data more meaningfully.

Three buttons appear next to the upper-right corner of the chart −

For a detailed explanation of these, refer to Excel Charts tutorial.

Click Data Labels Select Style and Color

You can use Trendline to graphically display trends in data. You can extend a Trendline in a chart beyond the actual data to predict future values.

Trendline

Data Labels

Excel 2013 and later versions provide you with various options to display Data Labels. You can choose one Data Label, format it as you like, and then use Clone Current Label to copy the formatting to the rest of the Data Labels in the chart.

The Data Labels in a chart can have effects, varying shapes and sizes.

It is also possible to display the content of a cell as part of the Data Label with Insert Data Label Field.

Data Label

Quick Layout

You can use Quick Layout to change the overall layout of the chart quickly by choosing one of the predefined layout options.

Different possible layouts will be displayed. As you move on the layout options, the chart layout changes to that particular option.

Quick Layout

Select the layout you like. The chart will be displayed with the chosen layout.

Using Pictures in Column Charts

You can create more emphasis on your data presentation by using a picture in place of columns.

Using Pictures

The picture you have chosen will appear in place of columns in the chart.

Place Pictures

Band Chart

You might have to present customer survey results of a product from different regions. Band Chart is suitable for this purpose. A Band Chart is a Line Chart with an added shaded area to display the upper and lower boundaries of groups of data.

Suppose your customer survey results from the east and west regions, month wise are −

Band Chart

Here, in the data < 50% is Low, 50% - 80% is Medium and > 80% is High.

With Band Chart, you can display your survey results as follows −

Display Survey Results

Create a Line Chart from your data.

Create Line Chart

Change the chart type to −

Change the Chart Type

Your chart looks as follows.

charts Format Data Series

You will get Bands instead of columns.

Bands

To make the chart more presentable −

The final result is the Band Chart with the defined boundaries and the survey results represented across the bands. One can quickly and clearly make out from the chart that while the survey results for the region West are satisfactory, those for the region East have a decline in the last quarter and need attention.

Band Chart

Thermometer Chart

When you have to represent a target value and an actual value, you can easily create a Thermometer Chart in Excel that emphatically shows these values.

With Thermometer chart, you can display your data as follows −

Thermometer Chart

Arrange your data as shown below −

Arrange your Data Clustered Charts

As you observe, the right side Column is Target.

Target Secondary Axis

As you observe the Primary Axis and Secondary Axis have different ranges.

Primary and Secondary Axis have Different Ranges

Both Primary Axis and Secondary Axis will be set to 0% - 100%. The Target Column hides the Actual Column.

Target Column Format Axis Chart Area

Resize the chart area, to get the shape of a thermometer.

Thermometer Shape

You got your thermometer chart, with the actual value as against target value being shown. You can make this thermometer chart more impressive with some formatting.

Format Shape

The result is the Thermometer Chart that we started with.

Thermometer Chart Result

Gantt Chart

A Gantt chart is a chart in which a series of horizontal lines shows the amount of work done in certain periods of time in relation to the amount of work planned for those periods.

In Excel, you can create a Gantt chart by customizing a Stacked Bar chart type so that it depicts tasks, task duration, and hierarchy. An Excel Gantt chart typically uses days as the unit of time along the horizontal axis.

Consider the following data where the column −

Note that Start of any Task is Start of previous Task + Duration. This is the case when the Tasks are in hierarchy.

Gantt Chart Stacked Bar Chart Format Data Series Select Categories Chart Title

Waterfall Chart

Waterfall Chart is one of the most popular visualization tools used in small and large businesses. Waterfall charts are ideal for showing how you have arrived at a net value such as net income, by breaking down the cumulative effect of positive and negative contributions.

Excel 2016 provides Waterfall Chart type. If you are using earlier versions of Excel, you can still create a Waterfall Chart using Stacked Column Chart.

The columns are color coded so that you can quickly tell positive from negative numbers. The initial and the final value columns start on the horizontal axis, while the intermediate values are floating columns. Because of this look, Waterfall Charts are also called Bridge Charts.

Consider the following data.

Waterfall Chart Compute Values

The data will be as follows.

Float Column Stacked Column Chart Select No Fill Negative Series Positive Series Delete Legend Series Options

Give the Chart Title. The Waterfall Chart will be displayed.

Deplays Waterfall Chart

Sparklines

Sparklines are tiny charts placed in single cells, each representing a row of data in your selection. They provide a quick way to see trends.

You can add Sparklines with Quick Analysis tool.

Sparkline

Quick Analysis button Quick Analysis Tool Button appears at the bottom right of your selected data.

Quick Analysis Button at Bottom Quick Analysis Toolbar Options

Click SPARKLINES. The chart options displayed are based on the data and may vary.

Click SPARKLINES

Click Line. A Line Chart for each row is displayed in the column to the right of the data.

Line

PivotCharts

Pivot Charts are used to graphically summarize data and explore complicated data.

A PivotChart shows Data Series, Categories, and Chart Axes the same way a standard chart does. Additionally, it also gives you interactive filtering controls right on the chart so that you can quickly analyze a subset of your data.

PivotCharts are useful when you have data in a huge PivotTable, or many complex worksheet data that includes text and numbers. A PivotChart can help you make sense of this data.

You can create a PivotChart from

PivotChart from PivotTable

To create a PivotChart follow the steps given below −

Insert Chart

Select Clustered Column from the option Column.

Select Clustered Column

Click OK. The PivotChart is displayed.

Display PivotChart

The PivotChart has three filters – Region, Salesperson and Month.

Filter

The filtered data appears on both the PivotChart and the PivotTable.

PivotChart without a PivotTable

PivotChart without a PivotTable

You can create a standalone PivotChart without creating a PivotTable.

You can choose a cell in the existing worksheet itself, or in a new worksheet. Click OK.

Choose Cell

An empty PivotChart and an empty PivotTable appear along with the PivotChart Field List to build the PivotChart.

Empty PivotTable

Excel will automatically create a coupled PivotTable.

Coupled PivotTable

Excel Data Analysis - Data Validation

Data Validation is a very useful and easy to use tool in Excel with which you can set data validations on the data that is entered that is entered into your Worksheet.

For any cell on the worksheet, you can

Consider the following Risk Tracker that can be used to enter and track the identified Risks information.

Risk Tracker

In this tracker, the data that is entered into the following columns is validated with preset data constraints and the entered data is accepted only when it meets the validation criteria. Otherwise, you will get an error message.

The column Risk Exposure will have calculated values and you cannot enter any data. Even the column S. No. is set to have calculated values that are adjusted even if you delete a row.

Now, you will learn how to set up such a worksheet.

Prepare the Structure for the Worksheet

To prepare the structure for the worksheet −

Your worksheet will look as follow −

Worksheet Result

Set Valid Values for Risk Category

In the cells M5 – M13 enter the following values (M5 is heading and M6 - M13 are the values)

Category Values
End-Users
Customer
Management
Schedule
Schedule
Environment
Product
Project
Select Data Validation

The Data Validation dialog box appears.

Select List Check Boxes

Set Input Message for Risk Category

Show Input Message

Set Error Alert for Risk Category

To set error alert −

Set Error Alert

Verify Data Validation for Risk Category

For the selected first cell under Risk Category,

Now, you can verify your settings.

Click in the cell for which you have set Data Validation criteria. The Input message appears. The dropdown button appears on the right side of the cell.

Verify Data Validation

The input message is correctly displayed.

Message Correctly Displayed

Both the sets of values match. Note that if the number of values is more, you will get a scroll-down bar on the right side of the dropdown list.

Select a value from the dropdown list. It appears in the cell.

Dropdown List

You can see that the selection of valid values is working fine.

Finally, try to enter an invalid entry and verify the Error alert.

Type People in the cell and press Enter. Error message that you have set for the cell will be displayed.

Error Message Displayed

You have successfully set the Data Validation for the cell.

Note − It is very important to check the spelling and grammar of your messages.

Set Valid Criteria for the Risk Category Column

Now, you are ready to apply the Data Validation criteria to all the cells in the Risk Category column.

At this point, you need to remember two things −

Follow the steps given below −

Set Valid Criteria

Data Validation is set for all the selected cells.

Click the last column that is selected and verify.

Column Selected and Verify

Data Validation for the column Risk Category is complete.

Set Validation Values for Risk Source

In this case, we have only two values – Internal and External.

Data Validation dialog box appears.

Set Validation Values

Set Input Message for Risk Source.

Set Input

Set Error Alert for Risk Source.

Set Error Alert

For the selected first cell under Risk Source −

Now, you can verify your settings.

Click in the cell for which you have set Data Validation criteria. Input message appears. The drop-down button appears on the right side of the cell.

Verify Settings

The input message is displayed correctly.

Input Message Displayed Correctly

Both the sets of values match. Select a value from the drop-down list. It appears in the cell.

Cell

You can see that the selection of valid values is working fine. Finally, try to enter an invalid entry and verify the Error alert.

Type Financial in the cell and press Enter. Error message that you have set for the cell will be displayed.

Type Financial

Data Validation is set for all the selected cells. Data Validation for the column Risk Source is complete.

Set Validation Values for Status

Data Validation is set for all the selected cells. Data Validation for the column status is complete.

Set Validation Values for Probability

Risk Probability Score values are in the range 1-5, 1 being low and 5 being high. The value can be any integer between 1 and 5, both inclusive.

The Data Validation dialog box appears.

Data Validation Select Between

Set Input Message for Probability

Set Input Message

Set Error Alert for Probability and click OK.

Set Error Alert for Probability

For the selected first cell under Probability,

Now, you can verify your settings.

Click on the cell for which you have set Data Validation criteria. Input message appears. In this case, there will not be a dropdown button because the input values are set to be in a range and not from list.

Click Cell

The input message is correctly displayed.

Enter an integer between 1 and 5 in the cell. It appears in the cell.

Enter Integer

Selection of valid values is working fine. Finally, try to enter an invalid entry and verify the Error alert.

Type 6 in the cell and press Enter. The Error message that you have set for the cell will be displayed.

Type 6

You have successfully set the Data Validation for the cell.

Data Validation is set for all the selected cells. Data Validation for the column Probability is complete.

Set Validation Values for Impact

To set the validation values for Impact, repeat the same steps that you used for setting validation values for probability.

Apply the Data Validation criteria to the cells F6 - F15 in the Impact column (i.e. same range as that of Risk Category column).

Data Validation is set for all the selected cells. Data Validation for the column Impact is complete.

Set the Column Risk Exposure with Calculated Values

Risk Exposure is calculated as a product of Risk Probability and Risk Impact.

Risk Exposure = Probability * Impact

Type =E6*F6 in cell G6 and press Enter.

Set Column Risk Exposure

0 will be displayed in the cell G6 as E6 and F6 are empty.

Copy the formula in the cells G6 – G15. 0 will be displayed in the cells G6 - G15.

Copy Formula

As the Risk Exposure column is meant for calculated values, you should not allow data entry in that column.

Locked

This is to ensure that data entry is not allowed in those cells. However, this will come into effect only when the worksheet is protected, which you will do as the last step after the worksheet is ready.

Shade Cells

Format Serial Number Values

You can leave it to the user to fill in the S. No. Column. However, if you format the S. No. values, the worksheet looks more presentable. In addition, it shows for how many rows the worksheet is formatted.

Type =row()-5 in the cell B6 and press Enter.

Format Serial Number Values

1 will appear in cell B6. Copy the formula in the cells B6-B15. Values 1-10 appear.

Values Appear

Shade the cells B6-B15.

Wrap-up

You are almost done with your project.

Wrap-up Select Protect Sheet

The Protect Sheet dialog box appears.

Select Unlocked Cells

You have protected the locked cells in the column Risk Exposure from data entry and kept the rest of the unlocked cells editable. Click OK.

The Confirm Password dialog box appears.

Confirm Password

Your worksheet with Data Validation set for selected cells is ready to use.

Worksheet with Data Validation

Excel Data Financial Analysis

You can perform financial analysis with Excel in an easy way. Excel provides you several financial functions such as PMT, PV, NPV, XNPV, IRR, MIRR, XIRR, and so on that enable you to quickly arrive at the financial analysis results.

In this chapter, you will learn where and how you can use these functions for your analysis.

What is Annuity?

An annuity is a series of constant cash payments made over a continuous period. For example, savings for retirement, insurance payments, home loan, mortgage, etc. In annuity functions −

Present Value of a series of Future Payments

The present value is the total amount that a series of future payments is worth now. You can calculate the present value using the Excel functions −

Note that

In this section, you will understand how to work with PV. You will learn about NPV in a later section.

Example

Suppose you are buying a refrigerator. The salesperson tells you that the price of the refrigerator is 32000, but you have an option to pay out the amount in 8 years with an interest rate of 13% per annum and yearly payments of 6000. You also have an option to make the payments either at the beginning or end of each year.

You want to know which of these options is beneficial for you.

You can use Excel function PV −

PV (rate, nper, pmt, [fv ], [type])

To calculate present value with payments at the end of each year, omit type or specify 0 for type.

To calculate present value with payments at the end of each year, specify 1 for type.

Payments

You will get the following results −

Payments Result

Therefore,

You can clearly see that option 2 is beneficial for you.

What is EMI?

An Equated Monthly Installment (EMI) is defined by Investopedia as "A fixed payment amount made by a borrower to a lender at a specified date each calendar month. Equated monthly installments are used to pay off both interest and principal each month, so that over a specified number of years, the loan is paid off in full."

EMI on a Loan

In Excel, you can calculate the EMI on a loan with the PMT function.

Suppose, you want to take a home loan of 5000000 with an annual interest rate of 11.5% and the term of the loan for 25 years. You can find your EMI as follows −

Use PMT Function

As you observe,

You will get the following results −

Present and Future Value

Monthly Payment of Principal and Interest on a Loan

EMI includes both-interest and a part payment of principal. As the time increases, these two components of EMI will vary, reducing the balance.

To get

For example, if you have taken a loan of 1,000,000 for a term of 8 months at the rate of 16% per annum. You can get values for the EMI, the decreasing interest amounts, the increasing payment of principal amounts and the diminishing loan balance over the 8 months. At the end of 8 months, loan balance will be 0.

Follow the procedure given below.

Step 1 − Calculate the EMI as follows.

Calculate EMI

This results in an EMI of Rs. 13261.59.

EMI Result

Step 2 − Next calculate the interest and principal parts of the EMI for the 8 months as shown below.

Calculate Interest and Principal

You will get the following results.

Calculate Interest and Principal Result

Interest and Principal paid between two Periods

You can compute the interest and principal paid between two periods, inclusive.

Summing Up

You will get the following results.

Summing Up Result

You can see that your calculations match with your verification results.

Calculating Interest Rate

Suppose you take a loan of 100,000 and you want to pay back in 15 months with a maximum monthly payment of 12000. You might want to know the interest rate at which you have to pay.

Find the interest rate with the Excel RATE function −

Calculating Interest Rate

You will get the result as 8%.

Calculating Interest Rate Result

Calculating Term of Loan

Suppose you take a loan of 100,000 at the interest rate 10%. You want a maximum monthly payment of 15,000. You might want to know how long it will take for you to clear the loan.

Find the number of payments with Excel NPER function

Excel Nper Function

You will get the result as 12 months.

Excel Nper Function result

Decisions on Investments

When you want to make an investment, you compare the different options and choose the one that yields better returns. Net present value is useful in comparing cash flows over a period of time and deciding which one is better. The cash flows can occur at regular, periodical intervals or at irregular intervals.

First, we consider the case of regular, periodical cash flows.

The net present value of a sequence of cash flows received at different points in time in n years from now (n can be a fraction) is 1/(1 + r)n, where r is the annual interest rate.

Consider the following two investments over a period of 3 years.

Decisions on Investments

At face value, Investment 1 looks better than Investment 2. However, you can decide on which investment is better only when you know the true worth of the investment as of today. You can use the NPV function to calculate the returns.

The cash flows can occur

NPV function assumes that the cash flows are at the end of the year. If the cash flows occur at different times then you have to take into account that particular factor along with the calculation with NPV.

Suppose the cash flows occur at the end of the year. Then you can straight away use the NPV function.

NPV Function

You will get the following results −

NPV Function Result

As you observe NPV for Investment 2 is higher than that for Investment 1. Hence, Investment 2 is a better choice. You got this result as cash out flows for Investment 2 are at later periods as compared to that of Investment 1.

Cash Flows at the Beginning of the Year

Suppose the cash flows occur at the beginning of every year. In such a case, you should not include the first cash flow in NPV calculation as it already represents the current value. You need to add the first cash flow to the NPV obtained from rest of the cash flows to get the net present value.

Cash Flows at Beginning Year

You will get the following results −

Cash Flows at Beginning Year Result

Cash Flows in the Middle of the Year

Suppose the cash flows occur in the middle of every year. In such a case, you need to multiply the NPV obtained from the cash flows by $\sqrt{1+r}$ to get the net present value.

Cash Flows in Middle Year

You will get the following results −

Cash Flows in Middle Year Result

Cash Flows at Irregular Intervals

If you want to calculate the net present value with irregular cash flows, i.e. cash flows occurring at random times, the calculation is a bit complex.

However, in Excel, you can easily do such a calculation with XNPV function.

Note − The first date in your data should be the earliest of all the dates. The other dates can occur in any order.

Cash Flows at Irregular Intervals

You will get the following results −

Cash Flows at Irregular Intervals Result

Suppose today’s date is 15th March, 2015. As you observe, all the dates of cash flows are of later dates. If you want to find the net present value as of today, include it in the data at the top and specify 0 for the cash flow.

Include Date

You will get the following results −

Include Date Result

Internal Rate of Return (IRR)

Internal Rate of Return (IRR) of an investment is the rate of interest at which NPV is 0. It is the rate value for which the present values of the positive cash flows exactly compensate the negative ones. When the discount rate is the IRR, the investment is perfectly indifferent, i.e. the investor is neither gaining nor losing money.

Consider the following cash flows, different interest rates and the corresponding NPV values.

Internal Rate of Return

As you can observe between the values of interest rate 10% and 11%, the sign of NPV changes. When you fine-tune the interest rate to 10.53%, NPV is nearly 0. Hence, IRR is 10.53%.

Determining IRR of Cash Flows for a Project

You can calculate IRR of cash flows with Excel function IRR.

Calculate IRR

The IRR is 10.53% as you had seen in the previous section.

For the given cash flows, IRR may −

Unique IRR

If IRR exists and is unique, it can be used to choose the best investment among several possibilities.

To find if an IRR is unique or not, vary the guess value and calculate IRR. If IRR remains constant then it is unique.

Unique IRR

As you observe, the IRR has a unique value for the different guess values.

Unique Value

Multiple IRRs

In certain cases, you may have multiple IRRs. Consider the following cash flows. Calculate IRR with different guess values.

Multiple IRRs

You will get the following results −

Multiple IRRs result

You can observe that there are two IRRs - -9.59% and 216.09%. You can verify these two IRRs calculating NPV.

Calculating NPV

For both -9.59% and 216.09%, NPV is 0.

No IRRs

In certain cases, you may not have IRR. Consider the following cash flows. Calculate IRR with different guess values.

No IRRs

You will get the result as #NUM for all the guess values.

No IRRs result

The result #NUM means that there is no IRR for the cash flows considered.

Cash Flows Patterns and IRR

If there is only one sign change in the cash flows, such as from negative to positive or positive to negative, then a unique IRR is guaranteed. For example, in capital investments, the first cash flow will be negative, while the rest of the cash flows will be positive. In such cases, unique IRR exists.

If there is more than one sign change in the cash flows, IRR may not exist. Even if it exists, it may not be unique.

Decisions based on IRRs

Many analysts prefer to use IRR and it is a popular profitability measure because, as a percentage, it is easy to understand and easy to compare to the required return. However, there are certain problems while making decisions with IRR. If you rank with IRRs and make decisions based on these ranks, you may end up with wrong decisions.

You have already seen that NPV will enable you to make financial decisions. However, IRR and NPV will not always lead to the same decision when projects are mutually exclusive.

Mutually exclusive projects are those for which the selection of one project precludes the acceptance of another. When projects that are being compared are mutually exclusive, a ranking conflict may arise between NPV and IRR. If you have to choose between project A and project B, NPV may suggest acceptance of project A whereas IRR may suggest project B.

This type of conflict between NPV and IRR may arise because of one of the following reasons −

Projects of significant size difference

Significant Size

If you want to make a decision by IRR, project A yields a return of 100 and Project B a return of 50. Hence, investment on project A looks profitable. However, this is a wrong decision because of the difference in the scale of projects.

Consider −

Thus, NPV is a better way for decision making in such cases.

Projects with different cash flows timings

Different Cash Flows

Again, if you consider IRR to decide, project B would be the choice. However, project A has a higher NPV and is an ideal choice.

IRR of Irregularly Spaced Cash Flows (XIRR)

Your cash flows may sometimes be irregularly spaced. In such a case, you cannot use IRR as IRR requires equally spaced time intervals. You can use XIRR instead, which takes into account the dates of the cash flows along with the cash flows.

XIRR

The Internal Rate of Return that results in is 26.42%.

Internal Rate

Modified IRR (MIRR)

Consider a case when your finance rate is different from your reinvestment rate. If you calculate Internal Rate of Return with IRR, it assumes same rate for both finance and reinvestment. Further, you might also get multiple IRRs.

For example, consider the cash flows given below −

MIRR

As you observe, NPV is 0 more than once, resulting in multiple IRRs. Further, reinvestment rate is not taken into account. In such cases, you can use modified IRR (MIRR).

Modified IRR

You will get a result of 7% as shown below −

Modified IRR Result

Note − Unlike IRR, MIRR will always be unique.

Working with Multiple Sheets

In certain situations, you might have to

For example, you might have to track sales information region wise and month wise in separate worksheets. The price of each product is taken from the product catalog that is set up across the company in a separate worksheet. Finally, you have to summarize the results across all the regions into a summary sheet.

In this chapter, you will learn how you can accomplish this in easy steps. You are going to summarize results from April 2015 to March 2016, i.e. financial year 2015-16.

The First Step

The first step is to set up a product catalog. Follow the steps given below −

The price of a product at selling time is determined by the current cost of the product.

First Step

Multiple Worksheets with same Structure

Next, you have to set up worksheets for the Regions – East, North, South, and West, in that order with same structure.

Multiple Worksheets with same Structure

These four worksheets should have the same structure.

Select Tabs

Now, whatever editing you do in the East worksheet will get automatically reflected in the other three selected worksheets.

In the East worksheet,

East Worksheet

The same structure appears in the other worksheets North, South and West.

Creating a Formula across Multiple Worksheets

To create a formula across multiple worksheets −

Create Formula

As we defined earlier, the price of a product is as per the product catalog that is updated on the first of every month.

Product Price Repeat Same Steps

Therefore, for the worksheets for the regions East, North, South, and West, you have successfully set the same structure and placed the price information for each product based on the month from product catalog worksheet.

The Product Catalog can be in another Workbook too.

Calculations in the Worksheets

The next step is to fill in the information of No. of Units sold for each Product in each Month and in each Region. Therefore, you need to work separately on these worksheets.

For each region, for each product −

Calculate Total Amount

In each worksheet (East, North, South and West), calculate subtotals month-wise −

Calculate Subtotals

Note − You can use Subtotal on a single worksheet but not on multiple worksheets. Hence, you have to repeat this step for North, South and West worksheets.

Subtotal

Click the Outline Level 2. You will get all month-wise Totals.

Outline Level 2

Now, you are ready to summarize the results from all the four worksheets – East, North, South and West.

Summarizing Data in Multiple Worksheets

The following steps will show you how to summarize data from multiple worksheets.

Summarizing Data

In the column- Total Sales, in the cell C3, type =sum(

Total Sales

=sum(‘East:West’!G7)

Select Worksheet East

Note that you are still in the East worksheet. Press Enter.

You will be in the Summary worksheet. In the formula bar, you will see the formula as

=SUM(East:West!G7)

The calculated value appears in the cell C3.

Calculated Value in Cell

All the formulas in the column Total Sales appear.

Total Sales Appear

This is exactly how you wanted to summarize the results from each region.

Summarize Results

Your summarized results are ready in the Summary worksheet.

Summarized Results are Ready

Excel Data Analysis - Formula Auditing

You might want to check formulas for accuracy or find the source of an error. Excel Formula Auditing commands provide you an easy way to find

These findings are shown graphically by arrow lines that makes the visualization easy. You can display all the formulas in the active worksheet with a single command. If your formulas refer to cells in a different workbook, open that workbook also. Excel cannot go to a cell in a workbook that is not open.

Setting the Display Options

You need to check whether the display options for the workbooks you are using are correctly set.

Setting the Display Options

Tracing Precedents

Precedent cells are those cells that are referred to by a formula in the active cell.

In the following example, the active cell is C2. In C2, you have the formula =B2*C4.

B2 and C4 are precedent cells for C2.

Tracing Precedents

To trace the precedents of the cell C2,

Trace Precedents

Two arrows, one from B2 to C2 and another from C4 to C2 will be displayed, tracing the precedents.

Two Arrows Displayed

Note that for tracing precedents of a cell, the cell should have a formula with valid references. Otherwise, you will get an error message.

You will get a message.

Get Message

Removing Arrows

Click Remove Arrows in the Formula Auditing group.

Removing Arrows

All the arrows in the worksheet will disappear.

Tracing Dependents

Dependent cells contain formulas that refer to other cells. That means, if the active cell contributes to a formula in another cell, the other cell is a dependent cell on the active cell.

In the example below, C2 has the formula =B2*C4. Therefore, C2 is a dependent cell on the cells B2 and C4

Tracing Dependents

To trace the dependents of the cell B2,

Trace Dependents in Formula Auditing

An arrow appears from B2 to C2, showing C2 is dependent on B2.

To trace the dependents of the cell C4 −

Another arrow appears from C4 to C2, showing C2 is dependent on C4 also.

Trace Dependents of Cell

Click Remove Arrows in the Formula Auditing group. All the arrows in the worksheet will disappear.

Note − For tracing dependents of a cell, the cell should be referenced by a formula in another cell. Otherwise, you will get an error message.

Click Trace Dependents

Working with Formulae

You have understood the concept of Precedents and Dependents. Now, consider a worksheet with several formulae.

Working with Formulae Exam Results Table Student Grades Table

Showing Formulas

The worksheet below contains the summary of sales by the salespersons in the regions East, North, South, and West.

Showing Formulas Show Formula Click Trace Precedents

Double-click on the arrow. A Go TO dialog box appears, showing the precedents.

Go To Dialog Box

As you observe, there are four precedents, on four different worksheets.

Evaluating a Formula

To find how a complex formula in a cell works step by step, you can use Evaluate Formula command.

Consider the formula NPV (Middle Year) in the cell C14. The formula is

=SQRT (1 + C2)*C10

Evaluating Formula

In the Evaluate Formula dialog box, the formula is displayed in the box under Evaluation. By clicking the Evaluate button several times, the formula gets evaluated step-wise. The expression with an underline will always be executed next.

Evaluate Formula

Here, C2 is underlined in the formula. So, it is evaluated in the next step. Click Evaluate.

Click Evaluate Button

Cell C2 has value 0.2. Hence, C2 will be evaluated as 0.2. 1+0.2 is underlined showing it as the next step. Click Evaluate.

Click Evaluate

1+0.2 will be evaluated as 1.2. SQRT(1.2) is underlined showing it as next step. Click Evaluate.

Evaluate

SQRT(1.2) will be evaluated as 1.09544511501033. C10 is underlined showing it as next step. Click Evaluate.

Evaluate SQRT

C10 will be evaluated as 4976.8518518515.

1.09544511501033*4976.8518518515 is underlined showing it as next step. Click Evaluate.

Restart Button

1.09544511501033*4976.8518518515 will be evaluated as 5,451.87.

There are no more expressions to evaluate and this is the answer. The Evaluate button will be changed to Restart button, indicating completion of evaluation.

Error Checking

It is a good practice to do an error check once your worksheet and/or workbook is ready with calculations.

Consider the following simple calculations.

Error Checking

The calculation in the cell has resulted in the error #DIV/0!.

Select Trace Error

The cells needed to compute the active cell are indicated by blue arrows.

Activate Cell Select Error Checking

The Error Checking dialog box appears.

Error Checking Dialog Box

Observe the following −

Excel Data Analysis - Inquire

You can use Inquire to −

The INQUIRE tab will be on the Ribbon. If you find the INQUIRE tab on the Ribbon, you can skip to the next section.

If you do not find the INQUIRE tab on the Ribbon, make the Inquire Add-in active.

INQUIRE Tab

COM Add-Ins dialog box appears.

COM Add-Ins

INQUIRE Commands

Let us learn about the INQUIRE commands.

Click the INQUIRE tab. You will find the following commands −

INQUIRE Commands

Comparing Two Workbooks

You can compare two workbooks cell by cell and find the differences, if any, in terms of changes in the second workbook as compared to the first.

Follow the below given steps −

Comparing Two Workbooks Select Files To Compare Workbooks Displayed Compare File Click Compare

The results of the comparison appear in a two-pane grid −

Details of changes in workbook-To as compared to Workbook-Compare appear in a pane below these two grids. The changes are highlighted by color, depending on the kind of change. The legend for the highlight colors appears in the lower-left pane.

Highlight Changes

Click Resize Cells to Fit on the Ribbon to view the cell contents in the Compare and To workbooks. The cells in both the workbooks are resized so that the contents are visible.

Resize Cells to Fit

Click the Export Results in the Export group on the Ribbon.

Export Results

The Save As dialog box appears. You can save the results to an Excel workbook. Note that only .xlsx file type is available.

Save As Dialog Box

If you need the results in another application, you can do it by copying it to Clipboard.

Click Copy Results to Clipboard in the Export group on the Ribbon.

Copy Results

Paste in an application you want.

Creating an Interactive Report

You can use the Workbook Analysis command to create an interactive report that can show detailed information about the workbook and its Structure, Formulas, Cells, Ranges and Warnings.

Workbook Analysis

The report will be displayed after the Workbook Analysis is completed.

Workbook Analysis Completed

The Report has the following six categories −

Report Category

Selecting a category gives you more information about that category.

Check the Formulas option. The sub-categories of formulas will be displayed.

Check Formula Option

You will observe the following in the workbook that you are analyzing −

In the Results pane, for each of the cells with formula with numeric values, worksheet name, cell address and formula are displayed.

Results Pane

Click the Excel Export button. The Save As dialog box appears.

Excel Export Button Load Export File

The saved Report Excel workbook opens and you can clearly view the workbook analysis results.

Workbook Analysis Results

Viewing with Diagrams

You can view workbook relationships, worksheet relationships and cell relationships with interactive diagrams created by links. The links show the dependencies between the nodes in the diagram. You can drag the links or nodes to arrange them and align them to view whatever you are looking for.

Viewing Workbook Relationships

You can have an interactive, graphical map of workbook dependencies created by connections (links) between files using workbook relationship diagram.

The types of links in the diagram can include other workbooks, Access databases, text files, HTML pages, SQL Server databases and other data sources.

Viewing Workbook Relationships

The Workbook Relationship Diagram appears, showing links of the workbook with different Data Sources.

Workbook Relationship Diagram

Viewing Worksheet Relationships

You can use Worksheet Relationship Diagram to create an interactive, graphical map of connections (links) between worksheets in the same workbook and /or worksheets in other workbooks.

Viewing Worksheet Relationships

The Worksheet Relationship Diagram appears, showing links between the worksheets in the same workbook, and in other workbooks.

The difference between these two can be identified by the direction of the arrows.

Arrow Direction

Viewing Cell Relationships

You can use the Cell Relationship Diagram to get a detailed, interactive map of all links from a selected cell to cells in other worksheets or even other workbooks.

Cell Relationship

The Cell Relationship Diagram Options dialog box appears.

Cell Relationship Diagram

The Cell Relationship Diagram appears, showing links between the selected cell and the cells in the same worksheet, same workbook and in other workbooks, based on the options you have chosen.

Links between Selected Cells and Cells

Click Zoom. You can view the nodes clearly.

View Nodes

Cleaning Excess Cell Formatting

When you find that a workbook is getting loaded slowly, or has become huge in size, it might have formatting applied to rows and/or columns that is not needed (for example, conditional formatting an entire column that has less than 15 values).

You can use the Clean Excess Cell Formatting command to remove excess formatting and greatly reduce the file size. This also results in improving Excel's speed.

Before cleaning the excess cell formatting, create a backup copy of your Excel file because there are certain cases where this process may increase your file size, and there is no way to undo the change.

Cleaning Excess Cell Formatting

The Clean Excess Cell Formatting dialog box appears. Choose All Sheets in the Apply to box

Choose Sheets

You will get a message about saving changes. Click OK.

Saving Changes

Managing Passwords of Files

If you are using Workbook Analysis or Compare Files commands for workbooks that are password protected, you can avoid having to type the password each time those files are opened. This is possible with using Password Manager.

Managing Passwords of Files

The Password Manager Dialog box appears. Click the Add button to add passwords of your workbooks.

Password Manager

Add password descriptions also, for the passwords you added.

Add Password

Next time when you need to use any of these files for comparing or analyzing, you do not have to key in the passwords.

Advanced Data Analysis - Overview

Excel provides several commands, functions and tools that make your complex data analysis tasks easy. Excel lets you perform various complex calculations with ease. In this tutorial, you will understand the versatile data analysis tools of Excel. You will understand data analysis with relevant examples, step by step instructions and screen shots at every step.

Data Consolidation

You might have to consolidate the data from various sources and present a report. The data could be in the worksheets of the same workbook or in different workbooks. With Excel data tool Consolidate, you can perform this in a few easy steps.

What-If Analysis

What-If Analysis provides you tools to handle the following data analysis situations −

Optimizing with Excel Solver Add-in

Solver is used to handle complex goal seek situations. In such cases, in addition to the inputs and outputs, there will be defined constraints or limits imposed on the possible input values. Further, Solver is used to result in an optimal solution.

Excel has a Solver Add-in that helps you solve such complex problems.

Importing Data into Excel

Your data analysis might depend on various external data sources. In Excel, you can import data from different data sources, such as Microsoft Access Database, Web Pages, Text Files, SQL Server Table, SQL Server Analysis Cube, XML File, etc.

You can import any number of data tables simultaneously from a database. When you are importing multiple tables from a relational database such as Access, the existing relationships among the tables will be retained in Excel also. While importing the data, you can also optionally create a PivotTable or PivotChart or Power View report based on that data.

You can just create a data connection with a data source, or import the data into Excel. If you import the data into Excel, the data tables are added to the Data Model in Excel.

Data Model

Data Model in Excel is used to integrate data from multiple tables in the current workbook and / or from the imported data and / or from the data sources connected to the workbook through data connections. Data model is used transparently in PivotTable, PivotChart, PowerPivot and Power View reports.

Exploring Data with PivotTable

As you can integrate the Data Model with a PivotTable, you can do extensive data analysis by collating, connecting, summarizing and reporting data from several different sources. As you can import tables from external data sources and create a PivotTable, it is possible to have automatic updates of the values in the PivotTable whenever the data in the connected data sources is updated.

You can create a PivotTable with the fields from multiple tables, provided the tables have relationships defined. If a relationship does not exist, Excel prompts you to create one and you can do so from the PivotTable itself. The relationship that you so define is reflected in the Data Model.

Exploring Data with PowerPivot

You can use PowerPivot to access, analyze and report data from various data sources. PowerPivot can help you handle large data with ease and produce fascinating analysis reports.

PowerPivot provides you commands to manage the Data Model, add Excel tables to Data Model, to add calculated fields in the Data Tables, to define KPIs, etc.

Exploring Data with Power View

Power View provides interactive exploration, visualization and analysis of large data. Owing to its versatile visualization options, you can definitely find the one that gives your data the perfect platform wherein you can explore the data, summarize and report.

Ranging from Tables to Maps, it is just a play for you to visualize your data, filter it, analyze it, and report it interactively. Moreover, you can have multiple visualizations on the same Power View sheet that reflect and highlight values, when you click on a data point in any one of them.

You can explore data in Power View with a table, a matrix, a card, different chart types, multiples, maps and tiles. You will get fascinated with the versatility of these different views once you get hands-on experience. This is because it is easy to produce interactive reports highlighting significant values and dynamically switching across the views.

Exploring Data with Hierarchies

If your data has hierarchies, they can be either defined in the Data Model that is reflected in the Power View or build the hierarchies in Power View itself.

Once a hierarchy is defined, you can drill-up and drill-down the hierarchy, displaying the required data.

Aesthetic Power View Reports

You can arrive at a report layout based on what you want to present in Power View. You can add a background image that reflects your company logo or your corporate view. Optionally, you can format the background of the report to give it an elegant look.

You can select a theme for your report that best portrays your data. You can change the font and text size so that your report becomes easily readable.

Key Performance Indicators (KPIs)

Key Performance Indicators are commonly used to gauge the performance. In Excel, you define and portray KPIs in PowerPivot or Power View. The graphical presentation of KPIs will uplift your reports.

Advanced Data Analysis - Data Consolidation

You might have come across different situations wherein you have to present consolidated data. The source of the data could be from one place, or several places. Another challenge could be that the data might be updated by other people from time to time.

You need to know how you can set up a summary worksheet that consolidates the data from the sources that you set up, whenever you want. In Excel, you can easily perform this task in a few steps with the Data Tool – Consolidate.

Preparing Data for Consolidation

Before you begin consolidating the data, make sure that there is consistency across the data sources. This means that the data is arranged as follows −

In case the data sources are external, ensure usage of a predefined layout in the form of an Excel template.

Suppose you have the sales data of various commodities from each of the regions – East, North, South, and West. You might need to consolidate this data and present a product wise summary of sales from time to time. Preparation includes the following −

Preparing Data for Consolidation

Consolidating Data in the Same Workbook

If you have all the data, that you have to consolidate, in the same workbook, proceed as follows −

Step 1 − Ensure that data of each region is on a separate worksheet.

Separate Worksheet

Step 2 − Add a new worksheet and name it Summary.

Step 3 − Click the Summary worksheet.

Step 4 − Click the cell where you want to place the summary results.

Step 5 − Click the DATA tab on the Ribbon.

Step 6 − Click the Consolidate button in the Data Tools group.

The Consolidate dialog box appears.

Consolidate Dialog Box

Step 7 − Select Sum from the dropdown list under Function.

Step 8 − Select the data from each worksheet as follows.

The selected range appears in the Reference box −

Reference Box

Step 9 − Click the Add button to the right of the box. The selected data range appears in the box under All References.

All References

Step 10 − Repeat Steps 1-5 for the rest of the data worksheets – North, South, and West. The Consolidate dialog box looks as follows.

Data Worksheets

You can see that the data ranges appear worksheet wise in alphabetical order, in the box under All references.

Step 11 − Check the boxes Top row and Left column under Use labels in. Click OK.

Use Labels in

Your data is summarized product wise for the regions – East, North, South and West.

Regions

You can repeat the steps given above to refresh your summary results manually, whenever you need them.

Consolidating Data Automatically

Suppose you want your summary sheet to be updated automatically, whenever there are changes in the data. To accomplish this, you need to have links to the source data.

Step 1 − Check the box - Create links to source data in the Consolidate dialog box and click OK.

Consolidating Data Automatically

Your summary results appear with an outline as follows −

Outline

You will observe that a new column is inserted to the right of the column named Product.

Step 2 − Click the + sign on the outline in the row containing the Product value named Soap. You can see that the new column contains the consolidated value for each set of product values, region wise.

Consolidated Value

Consolidating Data from Different Workbooks

In the previous example, all the data that you need to summarize is in the same workbook. However, it is likely that the data is maintained separately for each region and is updated region wise. In such a case, you can consolidate the data as follows −

Step 1 − Open the workbooks containing the data, say, workbooks – East-Sales, North-Sales, South-Sales and West-Sales.

Step 2 − Open a new workbook.

Step 3 − On a new worksheet, click a cell where you want the summary to appear.

Step 4 − Click the DATA tab on the Ribbon.

Step 5 − Click Consolidate in the Data Tools box.

A Consolidate dialog box appears. In the Consolidate dialog box −

The Consolidate dialog box looks as follows −

Consolidate

Step 6 − Repeat the steps 1–6 to add the data ranges from the workbooks – South-Sales.xlsx and West-Sales.xlsx.

Step 7 − Under Use labels in, check the following boxes.

Step 8 − Check the box Create links to source data.

Your Consolidate dialog box looks as follows −

Create Links

Your data is summarized in your workbook.

Consolidate Data Summarized

Advanced Data Analysis - What-If Analysis

What-if analysis is the process of changing the values in cells to see how those changes will affect the outcome of formulas on the worksheet. You can use several different sets of values in one or more formulas to explore all the various results.

What-if analysis is useful in many situations while doing data analysis. For example −

Excel provides you with the following What-if analysis tools that can be used based on your data analysis needs −

Data Tables and Scenarios take sets of input values and project forward to determine possible results. Goal seek differs from Data Tables and Scenarios in that it takes a result and projects backwards to determine possible input values that produce that result.

In this chapter, you will understand the possible situations where you can use the Whatif Analysis tools. For details on usage of these tools, refer to the later chapters in this tutorial.

Data Tables

A Data Table is a range of cells in which you can change values in some of the cells and come up with different answers to a problem. For example, you might want to know how much loan you can afford for a home by analyzing different loan amounts and interest rates. You can put these different values along with the PMT function in a Data Table and get the desired result.

A Data Table works only with one or two variables, but it can accept many different values for those variables.

For the details on Data Tables, refer to the chapter – What-If Analysis with Data Tables in this tutorial.

Scenario Manager

A scenario is a set of values that Excel saves and can substitute automatically in cells on a worksheet.

The key features are −

For the details on Scenarios, refer to the chapter – What-If Analysis with Scenario Manager in this tutorial.

Goal Seek

Goal Seek is useful if you know the result that you want from a formula, but not sure what input value the formula needs, to get that result. For example, if you want to borrow a loan and you know the loan amount, tenure of loan and the EMI that you can pay, you can use Goal Seek to find the interest rate at which you can avail the loan.

Goal Seek can be used only with one variable input value. If you have more than one variable for input values, you can use the Solver add-in.

For details on the usage of Goal Seek, refer to the chapter – What-If Analysis with Goal Seek in this tutorial.

Solver

Solver comes with Excel as an add-in. You can use Solver to find an optimal value for a formula in a cell called the target cell on a worksheet.

Solver works with a group of cells that are related to the formula in the target cell. Solver adjusts the values in the adjustable cells that you specify, to produce the result that you specify, from the target cell formula.

For the details on the usage of Excel Solver add-in, refer to the chapter - Optimization with Excel Solver in this tutorial.

What-If Analysis with Data Tables

With a Data Table in Excel, you can easily vary one or two inputs and perform What-if analysis. A Data Table is a range of cells in which you can change values in some of the cells and come up with different answers to a problem.

There are two types of Data Tables −

If you have more than two variables in your analysis problem, you need to use Scenario Manager Tool of Excel. For details, refer to the chapter – What-If Analysis with Scenario Manager in this tutorial.

One-variable Data Tables

A one-variable Data Table can be used if you want to see how different values of one variable in one or more formulas will change the results of those formulas. In other words, with a one-variable Data Table, you can determine how changing one input changes any number of outputs. You will understand this with the help of an example.

Example

There is a loan of 5,000,000 for a tenure of 30 years. You want to know the monthly payments (EMI) for varied interest rates. You also might be interested in knowing the amount of interest and Principal that is paid in the second year.

Analysis with One-variable Data Table

Analysis with one-variable Data Table needs to be done in three steps −

Step 1 − Set the required background.

Step 2 − Create the Data Table.

Step 3 − Perform the Analysis.

Let us understand these steps in detail −

Step 1: Set the required background

Your worksheet should look as follows −

Set Required Background

You can see that the cells in column C are named as given in the corresponding cells in column D.

Step 2: Create the Data Table

Create Data Table Type Functions Below Data Table

Step 3: Do the analysis with the What-If Analysis Data Table Tool

Do Analysis

Data Table dialog box appears.

Data Table

You can see that the Column input cell is taken as $C$2. Click OK.

The Data Table is filled with the calculated results for each of the input values as shown below −

Fill Data Table

If you can pay an EMI of 54,000, you can observe that the interest rate of 12.6% is suitable for you.

Two-variable Data Tables

A two-variable Data Table can be used if you want to see how different values of two variables in a formula will change the results of that formula. In other words, with a twovariable Data Table, you can determine how changing two inputs changes a single output. You will understand this with the help of an example.

Example

There is a loan of 50,000,000. You want to know how different combinations of interest rates and loan tenures will affect the monthly payment (EMI).

Analysis with Two-variable Data Table

Analysis with two-variable Data Table needs to be done in three steps −

Step 1 − Set the required background.

Step 2 − Create the Data Table.

Step 3 − Perform the Analysis.

Step 1: Set the required background

Your worksheet should look as follows −

Set Background

You can see that the cells in the column C are named as given in the corresponding cells in the column D.

Step 2: Create the Data Table

Set EMI Type Input Values

Do the analysis with the What-If Analysis Tool Data Table

Perform Analysis

Data Table dialog box appears.

Column Input Cell Box

You will see that the Row input cell is taken as $C$3 and the Column input cell is taken as $C$2. Click OK.

The Data Table gets filled with the calculated results for each combination of the two input values −

Rename Input Cell Boxes

If you can pay an EMI of 54,000, the interest rate of 12.2% and 288 EMIs are suitable for you. This means the tenure of the loan would be 24 years.

Data Table Calculations

Data Tables are recalculated each time the worksheet containing them is recalculated, even if they have not changed. To speed up the calculations in a worksheet that contains a Data Table, you need to change the calculation options to Automatically Recalculate the worksheet but not the Data Tables, as given in the next section.

Speeding up the Calculations in a Worksheet

You can speed up the calculations in a worksheet containing Data Tables in two ways −

From Excel Options

Excel Options dialog box appears.

Excel Options

From the Ribbon

From Ribbon

What-If Analysis with Scenario Manager

Scenario Manager is useful in the cases where you have more than two variables in sensitivity analysis. Scenario Manager creates scenarios for each set of the input values for the variables under consideration. Scenarios help you to explore a set of possible outcomes, supporting the following −

If you want to analyze more than 32 input sets, and the values represent only one or two variables, you can use Data Tables. Although it is limited to only one or two variables, a Data Table can include as many different input values as you want. Refer to What-If Analysis with Data Tables in this tutorial.

Scenarios

A scenario is a set of values that Excel saves and can substitute automatically on your worksheet. You can create and save different groups of values as scenarios on a worksheet and then switch between these scenarios to view the different results.

For example, you can have several different budget scenarios that compare various possible income levels and expenses. You can also have different loan scenarios from different sources that compare various possible interest rates and loan tenures.

If the information that you want to use in scenarios is from different sources, you can collect the information in separate workbooks, and then merge the scenarios from the different workbooks into one.

After you have all the scenarios you need, you can create a scenario summary report −

Scenario Manager

Scenario Manager is one of the What-if Analysis tools in Excel.

To create an analysis report with Scenario Manager, you have to follow these steps −

Step 1 − Define the set of initial values and identify the input cells that you want to vary, called the changing cells.

Step 2 − Create each scenario, name the scenario and enter the value for each changing input cell for that scenario.

Step 3 − Select the output cells, called the result cells that you want to track. These cells contain formulas in the initial set of values. The formulas use the changing input cells.

The Scenario Manager creates a report containing the input and the output values for each scenario.

Initial Values for Scenarios

Before you create several different scenarios, you need to define a set of initial values on which the scenarios will be based.

The steps for setting up the initial values for Scenarios are −

Consider the previous example of loan. Now, proceed as follows −

Your worksheet looks as shown below −

Define Cells

As you can see that the input cells and the result cells are in column C with the names as given in column D.

Creating Scenarios

After setting up the initial values for the Scenarios, you can create the scenarios using Scenario Manager as follows −

Creating Scenarios

The Scenario Manager Dialog box appears. You can observe that it contains a message −

“No Scenarios defined. Choose Add to.”

Add Scenario

You need to create scenarios for each set of changing values in the Scenario Manager. It is good to have the first scenario defined with initial values, as it enables you to switch back to initial values whenever you want while displaying different scenarios.

Create the first scenario with the initial values as follows −

The Add Scenario dialog box appears.

The name of the dialog box changes to Edit Scenario.

Prevent Changes

The Scenario Values dialog box appears. The initial values that you have defined appear in each of the changing cells boxes.

Scenario Values

Scenario 1 with the initial values is created.

Create three more scenarios with varying values in the changing cells as follows −

Add Scenario dialog box appears. Note that C3, C4, C5 appear in the Changing cells box.

Select Prevent Changes

The Scenario Values dialog box appears. The initial values appear in the changing cells. Change the value of Interest_Rate to 0.13 and click Add.

Scenario Values Dialog Box

The Add Scenario dialog box appears. Note that C3, C4, C5 appear in the box under changing cells.

Scenario Name Box

The Scenario Values dialog box appears. The initial values appear in the changing cells. Change the value of NPER to 300 and click Add.

Change Value

The Add Scenario dialog box appears. Note that C3, C4, C5 appear in the Changing cells box.

Add Scenario Dialog Box

The Scenario Values dialog box appears. The initial values appear in the changing cells. Change the value of Type to 1. Click OK as you have added all the scenarios that you wanted to add.

Changed value

The Scenario Manager dialog box appears. In the box under Scenarios, You will find the names of all the scenarios that you have created.

Scenario Summary Reports

Excel provides two types of Scenario Summary reports −

In the Scenario Summary dialog box, you can find these two Report types.

Select Scenario summary under Report type.

Select Scenario Summary

Scenario Summary

In the Result cells box, select the cell C6 (Here, we had put the PMT function). Click OK.

Scenario Summary report appears in a new worksheet. The worksheet is named as Scenario Summary.

Scenario Summary

You can observe the following in the Scenario Summary report −

You can make the report more meaningful by displaying the comments that you added while creating the scenarios.

Click Plus Button

Scenarios from Different Sources

Suppose you get the scenarios from three different sources and you need to prepare the Scenario summary report in a Master workbook. You can do this by merging the scenarios from different workbooks into the Master workbook. Follow the steps given below −

The Scenario Manager Dialog box appears.

Scenarios from Different Sources

As you can observe, there are no scenarios as you have not yet added any. Click Merge.

The Merge Scenarios dialog box appears.

Merge Scenarios

As you can see, under Merge scenarios from, you have two boxes −

You can select specific worksheet from a specific workbook that contains the scenarios, which you want to add to your results. Click the drop-down arrow of Book to see the workbooks.

Note − The corresponding workbooks should be open to appear in this list.

Merge Scenarios Dialog Box

Select the book – Bank1_Scenarios.

Bank1 sheet is displayed. At the bottom of the dialog box, the number of scenarios found on source sheet is displayed. Click OK.

Select Book

The Scenario Manager dialog box appears. The two scenarios that were merged into the Master workbook will be listed under Scenarios.

Master Workbook

Click the Merge button. The Merge Scenarios dialog box appears. Now, select Bank2_Scenarios from the drop-down list in the Book box.

Bank2 sheet is dislayed. At the bottom of the dialog box, the number of scenarios found on source sheet are displayed. Click OK.

Source Sheet Displayed

The Scenario Manager Dialog box appears. The four scenarios that were merged into the Master workbook are listed under Scenarios.

Scenarios

Click the Merge button. The Merge Scenarios dialog box appears. Now, select Bank3_Scenarios from the drop-down list in the Book box.

Bank3 sheet is displayed. At the bottom of the dialog box, the number of scenarios found on source sheet will be displayed. Click OK.

Scenario Found

The Scenario Manager Dialog box appears. The five scenarios that were merged into the Master workbook will be listed under Scenarios.

Scenarios Merged

Now, you have all the required scenarios to produce the Scenario summary report.

Click the Summary button. The Scenario Summary dialog box appears.

Result Cells Box

The Scenario summary report appears on a new worksheet in the Master workbook.

New Worksheet Summary

Displaying Scenarios

Suppose you are presenting your scenarios and you would like to dynamically switch from one scenario to another and display the set of input values and result values of the corresponding scenario.

Displaying Scenarios

The values on the worksheet are updated to that of the selected scenario. The result values are recalculated.

Selected Scenario

Scenario PivotTable Report

You can see the Scenario report in the form of a PivotTable also.

Scenario PivotTable Report

Scenario PivotTable report appears on a new worksheet.

Scenario PivotTable Report on Worksheet

What-If Analysis with Goal Seek

Goal Seek is a What-If Analysis tool that helps you to find the input value that results in a target value that you want. Goal Seek requires a formula that uses the input value to give result in the target value. Then, by varying the input value in the formula, Goal Seek tries to arrive at a solution for the input value.

Goal Seek works only with one variable input value. If you have more than one input value to be determined, you have to use the Solver add-in. Refer to the chapter – Optimization with Excel Solver in this tutorial.

Analysis with Goal Seek

Suppose you want to take a loan of 5,000,000 and you want to repay in 25 years. You can pay an EMI of 50000. You want to know at what interest rate you can borrow the loan.

You can use Goal Seek to find the interest rate at which you can borrow the loan as follows −

Step 1 − Set up the Excel cells for Goal Seek as given below.

Goal Seek

Step 2 − Enter the values in column C corresponding to column D. The cell Interest_Rate is kept empty, as you have to retrieve that value. Further, though you know the EMI that you can pay (50000), that value is not included as you have to use the Excel PMT function to arrive at it. Goal Seek requires a formula to find the result. The PMT function is placed in the cell EMI so that it can be used by Goal Seek.

Excel computes the EMI with the PMT function. The table now looks like −

Computes EMI

As the Interest_Rate cell is empty, Excel takes that value as 0 and calculates the EMI. You can ignore the result -13,888.89.

Perform the Analysis with Goal Seek as follows −

Step 1 − Go to DATA > What If Analysis > Goal Seek on the Ribbon.

Goal Seek on Ribbon

The Goal Seek dialog box appears.

Step 2 − Type EMI in the Set cell box. This box is the reference for the cell that contains the formula that you want to resolve, in this case the PMT function. It is the cell C6, which you named as EMI.

Step 3 − Type -50000 in the To value box. Here, you get the formula result, in this case, the EMI that you want to pay. The number is negative because it represents a payment.

Step 4 − Type Interest_Rate in the By changing cell box. This box has the reference of the cell that contains the value you want to adjust, in this case the interest rate. It is cell C2, which you named as Interest_Rate.

Step 5 − This cell that Goal Seek changes, must be referenced by the formula in the cell that you specified in the Set cell box. Click OK.

Set Cell Box

Goal Seek produces a result, as shown below −

Goal Seek Result

As you can observe, Goal Seek found the solution using cell C6 (containing the formula) as 12% that is displayed in the cell C2, which is the interest rate. Click OK.

Solving Story Problems

You can solve story problems easily with Goal Seek. Let us understand this with the help of an example.

Example

Suppose there is a bookstore that has 100 books in storage. The original price of the book is 250 and certain number of books was sold at that price. Later, the bookstore announced a 10% discount on that book and cleared off the stock. You might want to know how many books are sold at the original price to obtain a total revenue of 24,500.

You can use Goal Seek to find the solution. Follow the steps given below −

Step 1 − Set the worksheet as given below.

Solving Story Problems

Step 2 − Go to DATA > What If Analysis > Goal Seek on the Ribbon.

The Goal Seek dialog box appears.

Step 3 − Type Revenue, 24500 and Books_OriginalPrice in the Set cell box, To Value box and By changing cell box respectively. Click OK.

Type Revenue

Goal Seek displays the status and solution.

Status and Solution

If 80 books were sold at the original price, the revenue would be 24500.

Performing a Break-even Analysis

In economy, break-even point is the point at which there is neither profit nor loss. This would mean −

Revenue = Expenses, or

Revenue – Expenses = 0

You can do break-even analysis with Goal Seek in Excel.

Example

Suppose there is a store that sells toys. You might want to make a break-even analysis of the store. Collect the following information from the store −

You need to find at which price they should sell the toys to break even.

Step 1 − Set the worksheet as given below.

Set Worksheet

Step 2 − Go to DATA > What If Analysis > Goal Seek on the Ribbon. The Goal Seek dialog box appears.

Step 3 − Type Break_even_Point, 0, and Unit_Price in the Set cell box, To value box and By changing cell box respectively. Click OK.

Value and Cell Box

As you can observe, Goal Seek gave the result that if the Unit Price is 35, the store will break even.

Break Store

Optimization with Excel Solver

Solver is a Microsoft Excel add-in program you can use for optimization in what-if analysis.

According to O'Brien and Marakas, optimization analysis is a more complex extension of goal-seeking analysis. Instead of setting a specific target value for a variable, the goal is to find the optimum value for one or more target variables, under certain constraints. Then, one or more other variables are changed repeatedly, subject to the specified constraints, until you discover the best values for the target variables.

In Excel, you can use Solver to find an optimal value (maximum or minimum, or a certain value) for a formula in one cell called the objective cell, subject to certain constraints or limits, on the values of other formula cells on the worksheet.

This means that the Solver works with a group of cells called decision variables 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.

You can use Solver to find optimal solutions for diverse problems such as −

Activating Solver Add-in

Before you proceed with finding solution for a problem with Solver, ensure that the Solver Add-in is activated in Excel as follows −

Activating Solver Add-in

In case you do not find the Solver command, activate it as follows −

Select Excel Add-Ins

The Add-Ins dialog box appears. Check Solver Add-in and click Ok. Now, you should be able to find the Solver command on the Ribbon under the DATA tab.

Solver Add-in

Solving Methods used by Solver

You can choose one of the following three solving methods that Excel Solver supports, based on the type of problem −

LP Simplex

Used for linear problems. A Solver model is linear under the following conditions −

Generalized Reduced Gradient (GRG) Nonlinear

Used for smooth nonlinear problems. If your target cell, any of your constraints, or both contain references to changing cells that are not of the (changing cell)*(constant) form, you have a nonlinear model.

Evolutionary

Used for smooth nonlinear problems. If your target cell, any of your constraints, or both contain references to changing cells that are not of the (changing cell)*(constant) form, you have a nonlinear model.

Understanding Solver Evaluation

The Solver requires the following parameters −

Solver evaluation is based on the following −

Defining a Problem

Suppose you are analyzing the profits made by a company that manufactures and sells a certain product. You are asked to find the amount that can be spent on advertising in the next two quarters subject to a maximum of 20,000. The level of advertising in each quarter affects the following −

You can proceed to define the problem as −

Defining Problem

Next, set the cells for the required calculations as given below.

Set Cells

As you can observe, the calculations are done for Quarter1 and Quarter2 that are in consideration are −

Next, you can set the parameters for Solver as given below −

Set Parameters

As you can observe, the parameters for Solver are −

Solving the Problem

The next step is to use Solver to find the solution as follows −

Step 1 − Go to DATA > Analysis > Solver on the Ribbon. The Solver Parameters dialog box appears.

Solver Parameters

Step 2 − In the Set Objective box, select the cell D3.

Step 3 − Select Max.

Step 4 − Select range C8:D8 in the By Changing Variable Cells box.

Changing Variable Cells

Step 5 − Next, click the Add button to add the three constraints that you have identified.

Step 6 − The Add Constraint dialog box appears. Set the constraint for total budget as given below and click Add.

Add Constraint

Step 7 − Set the constraint for total no. of units sold in Quarter1 as given below and click Add.

Click Add

Step 8 − Set the constraint for total no. of units sold in Quarter2 as given below and click OK.

Set Constraint

The Solver Parameters dialog box appears with the three constraints added in box –Subject to the Constraints.

Step 9 − In the Select a Solving Method box, select Simplex LP.

Select Solving Method

Step 10 − Click the Solve button. The Solver Results dialog box appears. Select Keep Solver Solution and click OK.

Keep Solver Solution

The results will appear in your worksheet.

Result

As you can observe, the optimal solution that produces maximum total profit, subject to the given constraints, is found to be the following −

Stepping through Solver Trial Solutions

You can step through the Solver trial solutions, looking at the iteration results.

Step 1 − Click the Options button in the Solver Parameters dialog box.

The Options dialog box appears.

Step 2 − Select the Show Iteration Results box and click OK.

Show Iteration

Step 3 − The Solver Parameters dialog box appears. Click Solve.

Step 4 − The Show Trial Solution dialog box appears, displaying the message - Solver paused, current solution values displayed on worksheet.

Show Trial Solution

As you can observe, the current iteration values are displayed in your working cells. You can either stop the Solver accepting the current results or continue with the Solver from finding solution in further steps.

Step 5 − Click Continue.

The Show Trial Solution dialog box appears at every step and finally after the optimal solution is found, Solver Results dialog box appears. Your worksheet is updated at every step, finally showing the result values.

Saving Solver Selections

You have the following saving options for the problems that you solve with Solver −

Saving Solver Selections Solver Parameters Set

Importing Data into Excel

You might have to use data from various sources for analysis. In Excel, you can import data from different data sources. Some of the data sources are as follows −

You can import any number of tables simultaneously from a database.

Importing Data from Microsoft Access Database

We will learn how to import data from MS Access database. Follow the steps given below −

Step 1 − Open a new blank workbook in Excel.

Step 2 − Click the DATA tab on the Ribbon.

Step 3 − Click From Access in the Get External Data group. The Select Data Source dialog box appears.

From Access

Step 4 − Select the Access database file that you want to import. Access database files will have the extension .accdb.

Select Access Database

The Select Table dialog box appears displaying the tables found in the Access database. You can either import all the tables in the database at once or import only the selected tables based on your data analysis needs.

Select Table Dialog Box

Step 5 − Select the Enable selection of multiple tables box and select all the tables.

Enable Selection

Step 6 − Click OK. The Import Data dialog box appears.

Import Data Dialog Box

As you observe, you have the following options to view the data you are importing in your workbook −

You also have an option - only create connection. Further, PivotTable Report is selected by default.

Excel also gives you the options to put the data in your workbook −

You will find another check box that is selected and disabled – Add this data to the Data Model. Whenever you import data tables into your workbook, they are automatically added to the Data Model in your workbook. You will learn more about the Data Model in later chapters.

You can try each one of the options to view the data you are importing, and check how the data appears in your workbook −

Importing Data from a Web Page

Sometimes, you might have to use the data that is refreshed on a web site. You can import data from a table on a website into Excel.

Step 1 − Open a new blank workbook in Excel.

Step 2 − Click the DATA tab on the Ribbon.

Step 3 − Click From Web in the Get External Data group. The New Web Query dialog box appears.

New Web Query

Step 4 − Enter the URL of the web site from where you want to import data, in the box next to Address and click Go.

Enter URL

Step 5 − The data on the website appears. There will be yellow arrow icons next to the table data that can be imported.

Data Appears

Step 6 − Click the yellow icons to select the data you want to import. This turns the yellow icons to green boxes with a checkmark as shown in the following screen shot.

Selected Area

Step 7 − Click the Import button after you have selected what you want.

Click Import Button

The Import Data dialog box appears.

Import Data Dialog Box Appears

Step 8 − Specify where you want to put the data and click Ok.

Step 9 − Arrange the data for further analysis and/or presentation.

Arrange Data

Copy-pasting data from web

Another way of getting data from a web page is by copying and pasting the required data.

Step 1 − Insert a new worksheet.

Step 2 − Copy the data from the web page and paste it on the worksheet.

Step 3 − Create a table with the pasted data.

Copy-Pasting Data

Importing Data from a Text File

If you have data in .txt or .csv or .prn files, you can import data from those files treating them as text files. Follow the steps given below −

Step 1 − Open a new worksheet in Excel.

Step 2 − Click the DATA tab on the Ribbon.

Step 3 − Click From Text in the Get External Data group. The Import Text File dialog box appears.

Importing Data from Text File

You can see that .prn, .txt and .csv extension text files are accepted.

Step 4 − Select the file. The selected file name appears in the File name box. The Open button changes to Import button.

Select File

Step 5 − Click the Import button. Text Import Wizard – Step 1 of 3 dialog box appears.

Step 6 − Click the option Delimited to choose the file type and click Next.

Delimited

The Text Import Wizard – Step 2 of 3 dialog box appears.

Step 7 − Under Delimiters, select Other.

Step 8 − In the box next to Other, type | (That is the delimiter in the text file you are importing).

Step 9 − Click Next.

Text Import Wizard

The Text Import Wizard – Step 3 of 3 dialog box appears.

Step 10 − In this dialog box, you can set column data format for each of the columns.

Set Column Data Format

Step 11 − After you complete the data formatting of columns, click Finish. The Import Data dialog box appears.

Complete Data Formatting

You will observe the following −

Data appears on the worksheet you specified. You have imported data from Text file into Excel workbook.

Importing Data from another Workbook

You might have to use data from another Excel workbook for your data analysis, but someone else might maintain the other workbook.

To get up to date data from another workbook, establish a data connection with that workbook.

Step 1 − Click DATA > Connections in the Connections group on the Ribbon.

The Workbook Connections dialog box appears.

Workbook Connections

Step 2 − Click the Add button in the Workbook Connections dialog box. The Existing Connections dialog box appears.

Existing Connections

Step 3 − Click Browse for More… button. The Select Data Source dialog box appears.

Browse More

Step 4 − Click the New Source button. The Data Connection Wizard dialog box appears.

Data Connection Wizard

Step 5 − Select Other/Advanced in the data source list and click Next. The Data Link Properties dialog box appears.

Data Link Properties

Step 6 − Set the data link properties as follows −

The Select Workbook dialog box appears.

Select Workbook

Step 7 − Browse to the location where you have the workbook to be imported is located. Click OK.

The Data Connection Wizard dialog box appears with Select Database and Table.

Note − In this case, Excel treats each worksheet that is getting imported as a table. The table name will be the worksheet name. So, to have meaningful table names, name / rename the worksheets as appropriate.

Data Connection Wizard Dialog Box

Step 8 − Click Next. The Data Connection Wizard dialog box appears with Save Data Connection File and Finish.

Save and Finish

Step 9 − Click the Finish button. The Select Table dialog box appears.

Select Table Dialog Box Appears

As you observe, Name is the worksheet name that is imported as type TABLE. Click OK.

The Data connection with the workbook you have chosen will be established.

Importing Data from Other Sources

Excel provides you options to choose various other data sources. You can import data from these in few steps.

Step 1 − Open a new blank workbook in Excel.

Step 2 − Click the DATA tab on the Ribbon.

Step 3 − Click From Other Sources in the Get External Data group.

Importing Data from Other Sources

Dropdown with various data sources appears.

Dropdown

You can import data from any of these data sources into Excel.

Importing Data using an Existing Connection

In an earlier section, you have established a data connection with a workbook.

Now, you can import data using that existing connection.

Step 1 − Click the DATA tab on the Ribbon.

Step 2 − Click Existing Connections in the Get External Data group. The Existing Connections dialog box appears.

Step 3 − Select the connection from where you want to import data and click Open.

Importing Data using Existing Connection

Renaming the Data Connections

It will be useful if the data connections you have in your workbook have meaningful names for the ease of understanding and locating.

Step 1 − Go to DATA > Connections on the Ribbon. The Workbook Connections dialog box appears.

Step 2 − Select the connection that you want to rename and click Properties.

Renaming the Data Connections

The Connection Properties dialog box appears. The present name appears in the Connection name box −

Connection Properties

Step 3 − Edit the Connection name and click OK. The data connection will have the new name that you have given.

Refreshing an External Data Connection

When you connect your Excel workbook to an external data source, as you have seen in the above sections, you would like to keep the data in your workbook up to date reflecting the changes made to the external data source time to time.

You can do this by refreshing the data connections you have made to those data sources. Whenever you refresh the data connection, you see the most recent data changes from that data source, including anything that is new or that is modified or that has been deleted.

You can either refresh only the selected data or all the data connections in the workbook at once.

Step 1 − Click the DATA tab on the Ribbon.

Step 2 − Click Refresh All in the Connections group.

Refreshing External Data Connection

As you observe, there are two commands in the dropdown list – Refresh and Refresh All.

Updating all the Data Connections in the Workbook

You might have several data connections to your workbook. You need to update them from time to time so that your workbook will have access to the most recent data.

Step 1 − Click any cell in the table that contains the link to the imported data file.

Step 2 − Click the Data tab on the Ribbon.

Step 3 − Click Refresh All in the Connections group.

Data Connections

Step 4 − Select Refresh All from the dropdown list. All the data connections in the workbook will be updated.

Select Refresh All

Automatically Refresh Data when a Workbook is opened

You might want to have access to the recent data from the data connections to your workbook whenever your workbook is opened.

Step 1 − Click any cell in the table that contains the link to the imported data file.

Step 2 − Click the Data tab.

Step 3 − Click Connections in the Connections group.

The Workbook Connections dialog box appears.

Automatically Refresh Data

Step 4 − Click the Properties button. The Connection Properties dialog box appears.

Click Properties Button

Step 5 − Click the Usage tab.

Click Usage Tab

Step 6 − Check the option - Refresh data when opening the file.

You have another option also - Remove data from the external data range before saving the workbook. You can use this option to save the workbook with the query definition but without the external data.

Step 7 − Click OK. Whenever you open your workbook, the up to date data will be loaded into your workbook.

Automatically Refresh Data at regular Intervals

You might be using your workbook keeping it open for longer durations. In such a case, you might want to have the data refreshed periodically without any intervention from you.

Step 1 − Click any cell in the table that contains the link to the imported data file.

Step 2 − Click the Data tab on the Ribbon.

Step 3 − Click Connections in the Connections group.

The Workbook Connections dialog box appears.

Automatically Refresh Data at Regular Intervals

Step 4 − Click the Properties button.

Click the Properties Button

The Connection Properties dialog box appears. Set the properties as follows −

Refresh Every

Your Data will be automatically refreshed every 60 min. (i.e. every one hour).

Enabling Background Refresh

For very large data sets, consider running a background refresh. This returns control of Excel to you instead of making you wait several minutes or more for the refresh to finish. You can use this option when you are running a query in the background. However, during this time, you cannot run a query for any connection type that retrieves data for the Data Model.

Click Connections

Click the Properties button.

Properties

The Connection Properties dialog box appears. Click the Usage tab. The Refresh Control options appear.

Refresh Control Options

Advanced Data Analysis - Data Model

Data Model is available in Excel 2013 and later versions. In Excel, you can use the Data Model to integrate data from multiple tables in the current workbook and / or from the imported data and / or from the data sources connected to the workbook through data connections.

With a Data Model, you can create relationships among the tables. Data model is used transparently in PivotTable, PivotChart, PowerPivot and Power View reports.

Creating Data Model while Importing Data

When you import data from relational databases like Microsoft Access database that contain multiple related tables, Data Model is automatically created if you import more than one table at once.

Creating Data Model

You can optionally add tables to the Data Model, when you import data from the following data sources −

For example, while you are importing data from an Excel workbook, you can observe the option Add this data to the Data Model, with an enabled check box.

Observe Option

If you want to add the data you are importing to the Data Model, check the box.

Creating Data Model from Excel Tables

You can create the Data Model from Excel tables using PowerPivot commands. You will learn PowerPivot in detail in later chapters.

All the Data Model commands are available under the PowerPivot tab on the Ribbon. You can add Excel tables to the Data Model with these commands.

Consider the following sales data workbook, wherein you have Product Catalog worksheet that contains Product, Product ID and Price. You have four worksheets for the sales in 4 regions – East, North, South and West.

Each of these four worksheets contain No. of Units sold and Total Amount for each of the Products in each month. You need to calculate the total amount for each of the products in each region and total amount of sales in each region.

Creating Data Model Tables

The following steps enable you to arrive at the desired results −

Desired Results

A new window – PowerPivot for Excel - <your Excel file name> appears.

The following message appears in the center of the blank window −

Message Appears

The table Product Backlog that you added to the Data Model appears as a sheet in PowerPivot window. Each row in the table is a record and you can go back and forth the records using the left and right arrow buttons at the bottom of the window.

Product Backlog Excel Table

The Excel data window appears.

Another sheet appears in the PowerPivot window displaying the East table.

Repeat for the worksheets – North, South and West. In all, you have added five tables to the Data Model. Your PowerPivot window looks as below −

Excel Data Window

Creating Relationships between Tables

If you want to make calculations across the tables, you have to first define relationships among them.

Creating Relationships Between Tables

The tables appear in the Diagram View. As you observe, some of the tables may be out of display area and all the fields in the tables may not be visible.

Drag and Arrange table Click Create Relationship

In the box under Table, East is displayed. In the box under Column, Product ID is displayed.

Click Create Button

Line representing Relationship between the tables East and Product Backlog appears.

Relationship Between Tables Relationship Lines

Summarizing the Data in the Tables in the Data Model

Now, you are all set to summarize the sales data for each of the products in each region in just few steps.

Select PivotTable

Create PivotTable dialog box appears in the Excel tables window. Select New Worksheet.

Select New Worksheet

In a new worksheet, an empty PivotTable appears. As you can observe, the Fields List contains all the tables in the Data Model with all the fields displayed.

PivotTable Change Custom Name

The sum of Total Amount will be replaced by the label you give. PivotTable with summarized values from all the data tables shows you the required results.

Total Amount

Adding Data to Data Model

You can add a new data table to the Data Model or new rows of data to the existing tables in the Data Model.

Add a new data table to the Data Model with the following steps.

Adding Data to Data Model

Click on the Open button. The Import Data dialog box appears.

Open Button

As you are aware, while importing data table, it is automatically added to the Data Model. The newly added table appears in the PowerPivot window.

Add new rows of data to the existing tables in the Data Model.

Refresh the Data Connection. New rows of data from the data source get added to the Data Model.

Exploring Data with PivotTables

You can do extensive data analysis using PivotTables and produce desired reports. The integration of Data Model with PivotTable enhances the way the data is collated, connected, summarized and reported. You can import tables from external data sources and create a PivotTable with the imported tables. This facilitates automatic updations of the values in the PivotTable whenever the data in the connected data sources is updated.

Creating a PivotTable to analyze External Data

To create a PivotTable to analyze external data −

Create PivotTable Select Tables

The Import Data dialog box appears. Select PivotTable Report. This option imports the tables into your Excel workbook and creates a PivotTable for analyzing the imported tables.

Analyze Imported Tables

As you observe, the checkbox Add this data to the Data Model is selected and disabled, indicating that the tables will be added to the Data Model automatically.

The data will be imported and an empty PivotTable will be created. The imported tables appear in the PivotTable Fields list.

PivotTable Fields

Exploring Data in Multiple Tables

You can analyze the data from the imported multiple tables with PivotTable and arrive at the specific report you want in just few steps. This is possible because of the pre-existing relationships among the tables in the source database. As you imported all the tables from the database together at the same time, Excel recreates the relationships in its Data Model.

In the PivotTable Fields list, you will find all the tables that you imported and the fields in each of them. If the fields are not visible for any table,

Exploring Data using PivotTable

You know how to add fields to PivotTable and drag fields across areas. Even if you are not sure of the final report that you want, you can play with the data and choose the appropriate report.

Suppose you want to have a report displaying the following −

You can see how easily you can create this report in few steps.

To start with, create a PivotTable displaying the count of medals in all the regions for the selected five disciplines as follows −

You will get the following PivotTable −

Drag Medal

As you observe, Count of Medals is displayed for all the regions and for the five disciplines that you selected. Next, you have to fine-tune this report so that only those regions with total count of medals greater than 80 will be displayed.

Greater Than

Value Filters dialog box appears.

Value Filters

As you observe, Count of Medals and is greater than are displayed in the boxes below Show items for which. Type 80 in the box next to the box containing is greater than and click OK.

Show Items

Now, the PivotTable displays only those regions with total count of medals in the selected five disciplines greater than 80.

PivotTable Displays

Creating a Relationship between Tables with PivotTable Fields

If you do not import the tables at the same time, if the data is from different sources, or if you add new tables to your workbook, you have to create the relationships among the tables by yourself.

Add a new worksheet with a table that contains Sport and SportID fields to your workbook.

Sport and SportID Sports Table

You can see that the newly added table- Sports is also visible in the PivotTable Fields list.

Next, add the field Sport also to the PivotTable as follows −

Message to Create Relations

Click the CREATE button. The Create Relationship dialog box appears.

Create Relationship Dialog Box Select Sports

Drag Discipline under Sport in ROWS. This is to define the hierarchy in the PivotTable. The PivotTable displays the Sport and the corresponding group of disciplines for that sport.

Sport in ROWS

Exploring Data with Powerpivot

PowerPivot is an easy to use Data Analysis tool that can be used from within Excel. You can use PowerPivot to access and mashup data from virtually any data source. You can create your own fascinating reports with PowerPivot.

You can access the PowerPivot commands from PowerPivot tab on the Ribbon. Click the PowerPivot tab on the Ribbon. The PowerPivot commands will be displayed on the Ribbon. You can observe that the commands related to Data Model also appear here.

PowerPivot Commands

Adding Tables to Data Model

If you have imported tables, they are added to the Data Model. You can manage the Data Model from PowerPivot Ribbon. You can add tables to Data Model with PowerPivot as follows −

Adding Tables to Data Model Tables Group

The table is added to the Data Model. The PowerPivot window appears. You will find the table Hosts in the Data Model tables.

Hosts

Viewing Tables in the Data Model

Viewing Tables in Data Model

PowerPivot window appears, in Data View.

PowerPivot has two views −

You will understand the Diagram View and the Relationships in detail in the later sections.

Here, observe that all the tables in the Data Model are visible in the PowerPivot window, irrespective of whether they are present as worksheets in the workbook or not.

Viewing Relationships between Tables

You can use the data from different tables for analysis and reporting only when relationships exist among them.

You can view the relationships between tables from the diagram view in the PowerPivot window.

All the tables in the Data Model appear with their fields lists. The relationships among the tables are denoted by the lines connecting them.

Viewing Relationships between Tables

Creating Relationships between Tables

You might want to create a relationship between the tables – Medals and Events. In order to do this, there should be a field that is common in both the tables and contains unique values in one of the tables. First, you need to verify this.

Creating Relationships

You can observe that the field DisciplineEvent in the Events table has unique values (no duplicate values).

Click the Medals tab to view the Medals table. The field DisciplineEvent is available in the Medals table also. Hence, you can create a relationship using the field DisciplineEvent as follows −

Resize Tables

Click the field DisciplineEvent in the Events table and Drag to the field DisciplineEvent in the Medals table.

A line appears between the Events table and the Medals table, indicating that a relationship has been established.

Line between Events and Medals

Viewing the Field defining a Relationship

You can view the field that is used to create the relationship between two tables.

Click the relationship line connecting the two tables. The relationship line and the field defining the relationship between the two tables get highlighted.

Viewing Field defining Relationship

Exploring Data with Power View

Power View enables interactive data exploration, visualization and presentation that encourages intuitive ad-hoc reporting. Large data sets can be analyzed on the fly using the versatile visualizations. The data visualizations can also be made dynamic facilitating ease of presentation of the data with a single Power View report.

Power View is introduced in Microsoft Excel 2013. Before you start your data analysis with Power View, make sure that the Power View add-in enabled and available on the Ribbon.

Click the INSERT tab on the Ribbon. Power View should be visible in the Reports group.

Power View

Creating a Power View Report

You can create a Power View report from the tables in the Data Model.

Opening Power View message box appears with a horizontal scrolling green status bar. This might take a little while.

Opening Power View

Power View sheet is created as a worksheet in your Excel workbook. It contains an empty Power View report, Filters space holder and the Power View Fields list displaying the tables in the Data Model. Power View appears as a tab on the Ribbon in the Power View sheet.

Power View Sheet

Power View with Calculated Fields

In the Data Model of your workbook, you have the following data tables −

Suppose you want to display the number of medals that each country has won.

These two fields appear under FIELDS in the Areas. Power View will be displayed as a table with the two selected fields as columns.

FIELDS

The Power View is displaying what medals each country has won. To display the number of medals won by each country, the medals need to be counted. To get the medal count field, you need to do a calculation in the Data Model.

Medals Table

You can observe that the medal count formula appears in the formula bar and to the left of the formula bar, the column name Medal is displayed.

You will get a Power View message that the Data Model is changed and if you click OK, the changes will be reflected in your Power View. Click OK.

Power View Message

In the Power View Sheet, in the Power View Fields list, you can observe the following −

Your Power View table displays the medal count country wise.

Newly Added Calculated Field

Filtering Power View

You can filter the values displayed in Power View by defining the filter criteria.

Below the field name – Medal Count, is greater than or equal to 1000 appears. Power View will display only those records with Medal Count >= 1000.

Medal Count Greater Than Thousand

Power View Visualizations

In the Power View sheet, two tabs – POWER VIEW and DESIGN appear on the Ribbon.

Click the DESIGN tab.You will find several visualization commands in the Switch Visualization group on the Ribbon.

Power View Visualizations

You can quickly create a number of different data visualizations that suit your data using Power View. The visualizations possible are Table, Matrix, Card, Map, Chart types such as Bar, Column, Scatter, Line, Pie and Bubble Charts, and sets of multiple charts (charts with same axis).

To explore the data using these visualizations, you can start on the Power View sheet by creating a table, which is the default visualization and then easily convert it to other visualizations, to find the one that best illustrates your Data. You can convert one Power View visualization to another, by selecting a visualization from the Switch Visualization group on the Ribbon.

It is also possible to have multiple visualizations on the same Power View sheet, so that you can highlight the significant fields.

In the sections below, you will understand how you can explore data in two visualizations – Matrix and Card. You will get to know about exploring data with other Power View visualizations in later chapters.

Exploring Data with Matrix Visualization

Matrix Visualization is similar to a Table Visualization in that it also contains rows and columns of data. However, a matrix has additional features −

You can see these the differences in the views by having a Table Visualization and a Matrix Visualization of the same data side by side in the Power View.

Exploring Data with Matrix Visualization

As you observe, there are multiple disciplines for every sport and multiple events for every discipline. Now, create another Power View visualization on the right side of this Table visualization as follows −

Another Table representing these fields appears in Power View, to the right of the earlier Table.

Choose Fields Table Represents Fields

The Table on the right in Power View gets converted to Matrix.

Power View Converted to Matrix

The table on the left lists the sport and discipline for each and every event, whereas the matrix on the right lists each sport and discipline only once. So, in this case, Matrix visualization gives you a comprehensive, compact and readable format for your data.

Now, you can explore the data to find the countries that scored more than 300 medals. You can also find the corresponding sports and have subtotals.

Select Fields

Once again, you can observe that in the Matrix view, the results are legible.

Exploring Data with Card Visualization

In a card visualization, you will have a series of snapshots that display the data from each row in the table, laid out like an index card.

Select Card

The Matrix Visualization gets converted to Card Visualization.

Matrix to Card Visualization

You can use the Card view for presenting the highlighted data in a comprehensive way.

Data Model and Power View

A workbook can contain the following combinations of Data Model and Power View.

If you have multiple Power View sheets in your workbook, you can copy visualizations from one to another only if both the sheets are based on the same Data Model.

Creating Data Model from Power View Sheet

You can create and/or modify the Data Model in your workbook from the Power View sheet as follows −

Start with a new workbook that contains Salesperson data and Sales data in two worksheets.

Salesperson and Sales Data

You have two tables – Salesperson and Sales in your workbook.

Click Power View

Power View Sheet will be created in your workbook.

You can observe that in the Power View Fields list, both the tables that are in the workbook are displayed. However, in the Power View, only the active table (Sales) fields are displayed since only the active data table fields are selected in the Fields list.

Power View Fields List

You can observe that in the Power View, Salesperson ID is displayed. Suppose you want to display the Salesperson name instead.

In the Power View Fields list, make the following changes.

As you do not have a Data Model in the workbook, no relationship exists between the two tables. No data is displayed in Power View. Excel displays messages directing you what to do.

Excel Displays Messages

A CREATE button also will be displayed. Click the CREATE button.

The Create Relationship dialog box opens in the Power View Sheet itself.

Create Relationship

Without leaving the Power View sheet, you have successfully created the following −

The field Salesperson appears in Power View along with the Sales data.

Sales Data Appears Matrix Visualization

As you observe, for each of the regions, the Salespersons of that region and sum of Order Amount are displayed. Subtotals are displayed for each region. The display is month wise as selected in the tile above the view. As you select the month in the tile, the data of that month will be displayed.

Exploring Data with Power View Charts

In Power View, you have a number of Chart options: Pie, Column, Bar, Line, Scatter, and Bubble. The Charts in Power View are interactive. If you click on a value in one chart −

Thus, Power View Charts serve as interactive, pictorial data analysis tools. Further, the charts are interactive in a presentation setting also, which would enable you to highlight the analysis results.