Excel Data Analysis 简明教程

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 −

  1. Data Mining

  2. Business Intelligence

  3. Statistical Analysis

  4. Predictive Analytics

  5. Text Analytics

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 −

  1. Descriptive statistics − In descriptive statistics, data from the entire population or a sample is summarized with numerical descriptors such as − Mean, Standard Deviation for Continuous Data Frequency, Percentage for Categorical Data

  2. Inferential statistics − It uses patterns in the sample data to draw inferences about the represented population or accounting for randomness. These inferences can be − answering yes/no questions about the data (hypothesis testing) estimating numerical characteristics of the data (estimation) describing associations within the data (correlation) modeling relationships within the data (E.g. regression analysis)

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

数据分析在 1961 年由统计学家 John Tukey 定义为:“分析数据的程序、解释此类程序结果的技术、规划数据收集以使其分析更为容易、更准确或更高精度的途径,以及适用于分析数据的(数学)统计的所有机制和结果。”

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 −

  1. Answering questions

  2. Test hypotheses

  3. Decision-making

  4. Disproving theories

Data Analysis with Excel

Microsoft Excel 提供了几种分析和解释数据的方式和手段。数据可以来自各种来源。数据可以以多种方式进行转换和格式化。它可以使用相关 Excel 命令、函数和工具进行分析,这些工具包括条件格式,区域,表格,文本函数,日期函数,时间函数,财务函数,小计,快速分析,公式审计,查询工具,假设分析,求解器,数据模型,PowerPivot,PowerView,PowerMap,等等。

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.

您将学习这些数据分析技术,把 Excel 分为两个部分:

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

  1. Data Analysis with Excel and

  2. Advanced Data Analysis with Excel

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 −

  1. Data Requirements Specification

  2. Data Collection

  3. Data Processing

  4. Data Cleaning

  5. Data Analysis

  6. Communication

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 提供了简化数据分析任务的命令、函数和工具。使用 Excel,您可以避免许多耗时的和/或复杂的计算。在本教程中,您将抢先了解如何使用 Excel 执行数据分析。您将通过相关的示例、逐步了解 Excel 命令的使用方法以及每个步骤的屏幕截图。

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.

  1. With Text Functions

  2. Containing Date Values

  3. Containing Time Values

Conditional Formatting

Excel 为您提供了条件格式命令,使您可以根据预定义的条件为单元格或字体着色,并在单元格中的值的旁边放置符号。这有助于人们可视化重要值。您将了解用于有条件格式化单元格的各种命令。

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

在准备数据分析和/或显示某些重要数据期间,您可能必须对数据进行排序和/或筛选。您可以使用 Excel 中易于使用的排序和筛选选项执行相同操作。

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

如你所知,数据透视表通常用于汇总数据。但是,子总计(带范围)是 Excel 提供的另一种允许你对数据进行分组/取消分组并使用简单步骤汇总范围中数据的特性。

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

使用 Excel 中的快速分析工具,你可以快速执行各种数据分析任务并快速查看结果的可视化内容。

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 查询函数使你能够从大量数据中查找与已定义条件相匹配的数据值。

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

你将学习使用 Excel 图表进行多种数据可视技术。你还将学习如何创建带状图、温度计图、甘特图、瀑布图、迷你图和数据透视图表。

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 为你提供了多个财务函数。但是,对于需要财务分析的常见问题,你可以学习如何结合使用这些函数。

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

使用公式时,你可能需要检查这些公式是否按预期工作。Excel 中的公式审核命令可帮助你跟踪先例和从属值,以及检查错误。

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 还提供 Inquire 加载项,使你能够比较两个工作簿以识别更改、创建交互式报告以及查看工作簿、工作表和单元格之间的关系。你还可以清除工作表中的多余格式,这可能使 Excel 运行缓慢或导致文件大小过大。

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)

Net_Present_Value = NPV (Discount_Rate, Cash_Flows)

比以下公式更有意义:

is more meaningful than

C10 = NPV (C2, C6:C8)

借助 Excel,您可为数据中的各个部分创建和使用有意义的名称。使用区域名称的优势包括:

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

  1. A meaningful Range name (such as Cash_Flows) is much easier to remember than a Range address (such as C6:C8).

  2. Entering a name is less error prone than entering a cell or range address.

  3. If you type a name incorrectly in a formula, Excel will display a #NAME? error.

  4. You can quickly move to areas of your worksheet by using the defined names.

  5. With Names, your formulas will be more understandable and easier to use. For example, a formula Net_Income = Gross_Income – Deductions is more intuitive than C40 = C20 – B18.

  6. Creating formulas with range names is easier than with cell or range addresses. You can copy a cell or range name into a formula by using formula Autocomplete.

在本章中,您将学习 −

In this chapter, you will learn −

  1. Syntax rules for names.

  2. Creating names for cell references.

  3. Creating names for constants.

  4. Managing the names.

  5. Scope of your defined names.

  6. Editing names.

  7. Filtering names.

  8. Deleting names.

  9. Applying names.

  10. Using names in a formula.

  11. Viewing names in a workbook.

  12. Using paste names and paste list.

  13. Using names for range intersections.

  14. Copying formulas with names.

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 的名称遵循以下语法规则 −

Excel has the following syntax rules for names −

  1. You can use any combination of letters, numbers and the symbols - underscores, backslashes, and periods. Other symbols are not allowed.

  2. A name can begin with a character, underscore or backslash.

  3. A name cannot begin with a number (example - 1stQuarter) or resemble a cell address (example - QTR1).

  4. If you prefer to use such names, precede the name with an underscore or a backslash (example - \1stQuarter, _QTR1).

  5. Names cannot contain spaces. If you want to distinguish two words in a name, you can use underscore (example- Cash_Flows instead of Cash Flows)

  6. Your defined names should not clash with Excel’s internally defined names, such as Print_Area, Print_Titles, Consolidate_Area, and Sheet_Title. If you define the same names, they will override the Excel’s internal names and you will not get any error message. However, it is advised not to do so.

  7. Keep the names short but understandable, though you can use up to 255 characters

Creating Range Names

您可以通过两种方式创建范围名称 −

You can create Range Names in two ways −

  1. Using the Name box.

  2. Using the New Name dialog box.

  3. Using the Selection dialog box.

Create a Range Name using the Name Box

要使用公式栏左侧的 Name 框创建范围名称,这是最快的方法。请按照下面给出的步骤操作−

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 − 选择要定义名称的范围。

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

Step 2 − 单击“名称”框。

Step 2 − Click on the Name box.

Step 3 − 键入名称并按 Enter 以创建名称。

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 − 选择要定义名称的范围。

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

Step 2 − 单击“公式”选项卡。

Step 2 − Click the Formulas tab.

Step 3 − 在“已定义名称”组中单击“定义名称”。显示 New Name 对话框。

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

Step 4 − 在“名称”旁边的框中键入名称

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

Step 5 − 检查“引用”框中选择并显示的范围是否正确。单击确定。

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

如果范围内相邻的文本值,则还可以使用“公式”选项卡的“选择”对话框中的 Create Names 创建范围名称。

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 − 沿着包含名称的行/列选择要定义名称的范围。

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

Step 2 − 单击“公式”选项卡。

Step 2 − Click the Formulas tab.

Step 3 − 在“已定义名称”组中单击 Create from Selection 。显示 Create Names from Selection 对话框。

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

Step 4 − 选择“顶部行”,因为文本显示在选择内容的顶部行中。

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

Step 5 − 检查“引用”旁边框中选择并显示的范围是否正确。单击“确定”。

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

create from selection

现在,您可以使用 = Sum (学生姓名) 查找范围中的最大值,如下所示−

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

现在,您可以使用 = Sum (学生姓名) 查找每个学生的总分,如下所示。

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.

在以下示例中,Savings Bank Interest Rate 被设置为 5%。

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

  1. Click Define Name.

  2. In the New Name dialog box, type Savings_Bank_Interest_Rate in the Name box.

  3. In Scope, select Workbook.

  4. In Refers to box, clear the contents and type 5%.

  5. Click OK.

creating names for constants

名称 Savings_Bank_Interest_Rate 被设置为常量 5%。你可以在名称管理器中验证这一点。你可以看到该值被设置为 0.05,并且 Refers to = 0.05 被置于其中。

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

Excel 工作簿可以包含任意数量的已命名单元格和区域。你可以使用名称管理器管理这些名称。

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

  1. Click the Formulas tab.

  2. Click Name Manager in the Defined Names group. The Name Manager dialog box appears. All the names defined in the current workbook are displayed.

managing names

Names 列表会显示与已定义 Values, Cell Reference (包括工作表名称)、 ScopeComment

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 −

  1. Define a New Name with the New Button.

  2. Edit a Defined Name.

  3. Delete a Defined Name.

  4. Filter the Defined Names by Category.

  5. Modify the Range of a Defined Name that it Refers to.

name manager options

Scope of a Name

默认情况下,名称的 Scope 是工作簿。你可以在 Name Manager 中的 Scope 列下的名称列表中找到已定义名称的 Scope

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.

在使用 New Name 对话框定义名称时,你可以定义 New NameScope 。例如,你在定义 Interest_Rate 名称。然后你可以看到 New Name Interest_Rate 的 ScopeWorkbook

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

假设你只想将这种利率的 Scope 限制在该 Worksheet 内。

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

Step 1 - 单击范围框中的向下箭头。可用的范围选项会出现在下拉列表中。

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

scope

范围选项包括 Workbook 和工作簿中的工作表名称。

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

Step 2 - 单击当前工作表名称(在本例中为 NPV),然后单击确定。你可以在工作表选项卡中定义/查找工作表名称。

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 - 若要验证范围是否是工作表,请单击 Name Manager 。在范围列中,你会在 Interest_Rate 的后面找到 NPV。这意味着,你只能在 NPV 工作表中使用名称 Interest_Rate,而不能在其他工作表中使用。

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 - 一旦定义了名称的范围,以后就不能再对其进行修改。

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 − 在 Name Manager 对话框中单击 Filter

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

将出现以下筛选选项 −

The following filtering options appear −

  1. Clear Filter

  2. Names Scoped to Worksheet

  3. Names Scoped to Workbook

  4. Names with Errors

  5. Names without Errors

  6. Defined Names

  7. Table Names

你可以通过选择其中一个或多个选项,把 Filter 应用于 defined Names

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

Step 2 − 选择 Names with Errors 。将显示包含错误值的名称。

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

names with errors

Step 3 − 从 Names 的获得的列表中,选择你想要删除的名称,然后单击 Delete

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

你可以在 Name Manager 对话框中使用 Edit 选项来 −

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

  1. Change the Name.

  2. Modify the Refers to range

  3. Edit the Comment in a Name.

Change the Name

Step 1 − 单击包含函数 Large 的单元格。

Step 1 − Click the cell containing the function Large.

可以看到,在数组中添加了另外两个值,但由于它们不属于 Array1,因此未包括在函数中。

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 − 在 Name Manager 对话框中单击想要编辑的 Name 。在本例中,为 Array1

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

click name

Step 3 − 单击 Edit 。将出现 Edit Name 对话框。

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

edit name

Step 4 − 通过在 Name Box 中键入新的名称,来更改 Name

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

Step 5 − 单击 Refers to 框右边的 Range 按钮,并包括新的单元格引用。

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

Step 6 − 添加 Comment (可选)

Step 6 − Add a Comment (Optional)

请注意, Scope 处于非激活状态,因此无法更改。

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

正如您所观察到的,在 PMT 函数中未定义和使用名称。如果您将此函数放在工作表的其他位置,您还需要记住参数值的具体位置。您知道使用名称是更好的选择。

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 − 使用 Create from Selection ,定义名称。

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

Step 2 − 选择包含公式的单元格。在 Formulas 选项卡上的 Defined Names 组中,单击 Define Name 旁边的 。从下拉列表中,单击 Apply Names

Step 2 − Select the cell containing the formula. Click 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 − 将出现 Apply Names 对话框。选择要 ApplyNames ,然后单击确定。

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

您还可以通过选择工作表并重复上述步骤,将 Apply Names 应用到整个工作表。

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

Using Names in a Formula

您可以在 Formula 中的 Name 中使用以下方法:

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

  1. Typing the Name if you remember it, or

  2. Typing first one or two letters and using the Excel Formula Autocomplete feature.

  3. Clicking Use in Formula in the Defined Names group on the Formulas tab. Select the required Name from the drop-down list of defined names. Double-click on that name.

using names in formula
  1. Using the Paste Name dialog box. Select the Paste Names option from the drop-down list of defined names. The Paste Name dialog box appears. Select the Name in the Paste Names dialog box and double-click it.

select name

Viewing Names in a Workbook

您可以获取工作簿中的所有 Names 以及它们的 ReferencesSave 它们或 Print 它们。

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

  1. Click an empty Cell where you want to copy the Names in your workbook.

  2. Click Use in Formula in the Defined Names group.

  3. Click Paste Names from the drop-down list.

  4. Click Paste List in the Paste Name dialog box that appears.

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 是那些具有两个公共区域的单个单元格。

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

例如,在下方的给定数据中,B6:F6 范围和 C3:C8 范围含有公共单元格 C6,它代表了学生 Kodeda,Adam 在考试 1 中的分数。

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

可以使用 Range Names 获得更有意义的结果。

You can make this more meaningful with the Range Names.

  1. Create Names with Create from Selection for both Students and Exams.

  2. Your Names will look as follows −

range names
  1. Type =Kodeda_Adam Exam_1 in B11.

此处,您正在使用范围交集运算,两个范围之间应留有空格。

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

range intersection operation

这将显示单元格 C6 中给出的 Kodeda,Adam 在考试 1 中的分数。

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

display marks

Copying Formulas with Names

您可以在同一个工作表中通过 Copy*and *Paste 复制带有名称的公式。

You can copy a formula with names by Copy*and *Paste within the same worksheet.

还可以通过 copypaste 将带有名称的公式复制到其他工作表,前提是 formula 中的所有 names 都以 workbook 作为 Scope 。否则,您会收到一个 #VALUE 错误。

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

Table 是结构化数据的矩形区域。其主要功能如下 −

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

  1. Each row in the table corresponds to a single record of the data. Example - Employee information.

  2. Each column contains a specific piece of information. Exmaple - The columns can contain data such as name, employee number, hire date, salary, department, etc.

  3. The top row describes the information contained in each column and is referred to as header row.

  4. Each entry in the top row is referred to as column header.

table

您可以创建并使用 Excel 表格轻松管理和分析数据。此外,借助 Excel 表格,您还可以获得内置的筛选、排序和行阴影功能,以便轻松进行报告活动。

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.

此外,Excel 对执行在表格上的操作做出智能响应。例如,您在列中有公式或根据表格中的数据创建图表。当您向表格中添加更多数据(即更多的行)时,Excel 会将公式扩展到新的数据并且图表会自动展开。

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 −

  1. A table is a more structured way of working with data than a range.

  2. You can convert a range into a table and Excel automatically provides − a Table NameColumn Header NamesFormatting to the Data (Cell Color and Font Color) for better Visualization

表格提供了范围没有的其他功能。它们是 −

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

  1. Excel provides table tools in the ribbon ranging from properties to styles.

  2. Excel automatically provides a Filter button in each column header to sort the data or filter the table such that only rows that meet your defined criteria are displayed.

  3. If you have multiple rows in a table, and you scroll down the sheet so that the header row disappears, the column letters in the worksheet are replaced by the table headers.

  4. When you place a formula in any cell in a column of the table, it gets propagated to all the cells in that column.

  5. You can use table name and column header names in the formulas, without having to use cell references or creating range names.

  6. You can extend the table size by adding more rows or more columns by clicking and dragging the small triangular control at the lower-right corner of the lower-right cell.

  7. You can create and use slicers for a table for filtering data.

您将在本章学习所有这些功能。

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 - 选择要包括在表中的单元格区域。单元格可以包含数据或为空。以下范围包含 290 行员工数据。数据的顶部有标题。

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 - 在 Insert 选项卡的“表格”组中,单击“表格”。出现 Create Table 对话框。在 Where is the data for your 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 - 如果所选范围的顶部有要作为表标题使用的数据,请选中 My table has headers 框。

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 - 如果不选中该框,则表将有标题 - Column1、Column2、…

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

Step 4 - 单击“确定”。

Step 4 − Click OK.

create table dialog box

范围使用默认样式转换为表格。

Range is converted to Table with the default Style.

table with default size

Step 5 - 你还可以通过单击该范围内的任意位置并按下 Ctrl+T 将范围转换成表格。一个 Create Table 对话框会出现,然后你可以重复上面给出的步骤。

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 会为每一个创建的表格分配一个名称。

Excel assigns a name to every table that is created.

Step 1 - 若要查看刚创建的表格的名称,请单击表格,然后单击功能区上的 table tools – design 选项卡。

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 - 在 Properties 组的 Table Name 框中,会显示你的表名。

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

table name box

Step 3 - 可编辑该表名,使其更有意义。

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

Step 4 - 单击表名框。清除该名称并输入 Emp_Data。

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

Note - 命名范围的语法规则适用于表名。

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.

  1. Click the Table.

  2. Click Name Manager in the Defined Names group on Formulas tab.

Name Manager 对话框会出现,你可以在工作簿中找到 Table Names

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

managing names in table

可以在 Name Manager 对话框中通过 New 选项 Edit 一个 Table Name 或添加注释。但是,你无法更改 Refers to 中的范围。

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.

  1. Click the Column Header EmployeeID in the Table.

  2. Click Name Manager.

  3. Click New in the Name Manager dialog box.

将出现 New Name 对话框。

The New Name dialog box appears.

在名称框中,您可以找到列标题,在 Refers to 框中,您将找到 Emp_Data[[#Headers],[EmployeeID]]

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.

然而,在这样做时,您还需要表头来识别哪个值属于哪一列。Excel 会自动提供一种流畅的方法来执行此操作。在滚动浏览数据时,工作表本身的列字母会转换为表头。

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.

在下面给出的工作表中,列字母按原样显示,表头在第 2 行。从 290 行数据中可以看到 21 行。

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

向下滚动以查看表行 25 至 35。表头将替换表列的列字母。其他列字母仍然保留原样。

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 − 在 Birthdate 列的右侧插入一列。在列标题中键入 Age。

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

Step 2 − 在该空列中的任意单元格中,键入公式 = DAYS ([@BirthDate], TODAY ()) ,然后按 Enter。

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.

考虑以下包含 1-15 批次总分数的学生成绩表。

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

resize table

假设您想添加三个批次 16-18 和一列包含通过率。

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

  1. Click the table.

  2. Drag the blue-color control at the lower-right, downwards to include three more rows in the table.

add batches
  1. Again drag the blue-color control at the lower-right, sideways to include one more column in the table.

您的表如下所示。您还可以检查在名称管理器对话框中包含在表中的范围 −

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
  1. Click the table.

  2. On the DESIGN tab, click Remove Duplicates in the Tools group on the Ribbon. The Remove Duplicates dialog box appears.

design tab

列标题在“删除重复项”对话框中的“列”下显示。

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

  1. Check the column headers depending on which column you want to remove the duplicates and click OK.

有关删除了多少含重复值的行列以及剩余多少唯一值,您会收到一条消息。清除后的数据将显示在表中。

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

您还可以使用功能区“数据”工作表下“编辑”组中的 Remove Duplicates 删除重复项。

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

Convert to Range

您可以将表格转换为 Range

You can convert a table to a Range.

  1. Click the table.

  2. Click Convert to Range in the Tools group, under the Design tab on the Ribbon.

convert to range

将收到一条消息,询问您是否要将表格转换为区域。在您使用 Yes 进行确认后,该表格将被转换为区域。

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

您可以选择多种 Table Styles 选项。如果需要突出显示行/列,可以使用这些选项。

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.

建议 Table Style Options 仅用于突出显示数据中的重要信息,而不是使其变得花哨,在数据分析中并不需要这一点。

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.

建议 Table Styles 仅用于以一种展示方式突出显示数据中的重要信息,而不是使其变得花哨,在数据分析中并不需要这一点。

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

如果您使用的是 Excel 2013 或 Excel 2016,您可以使用 Slicers 过滤表格中的数据。

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

有关如何对表格使用切片器的详细信息,请参阅本教程中 Filtering 章节。

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 −

  1. Finding required text patterns with the text functions.

  2. Extracting data values from text.

  3. Formatting data with text functions.

  4. Executing data operations with the text functions.

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 −

  1. leading spaces, and/or

  2. extra spaces between words.

如果您对该数据进行排序或分析,您会得到错误的结果。

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

考虑以下示例 −

Consider the following example −

product data

这是您获得的产品信息中包含产品 ID、产品描述和价格的原始数据。字符“|”分隔每一行中的字段。

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.

当您将该数据导入 Excel 工作表时,它将显示如下所示 −

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.

您需要删除数据中可能存在的任何不可打印的字符和多余空格。为此,可以使用 CLEAN 函数和 TRIM 函数。

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

  1. Select the Cells C3 – C11.

  2. Type =TRIM (CLEAN (B3)) and then press CTRL + Enter.

公式填入单元格 C3 – C11 中。

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

您需要从文本中提取所需数据以对其进行结构化处理。在上例中,假设您需要将数据放入三个列中:ProductID、Product_Description 和 Price。

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 −

  1. Extracting Data Values with Convert Text to Columns Wizard

  2. Extracting Data Values with Text Functions

  3. Extracting Data Values with Flash Fill

Extracting Data Values with Convert Text to Columns Wizard

如果您的字段符合以下条件,则可以使用 Convert Text to Columns Wizard 将数据值提取到 Excel 列中:

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

  1. Delimited by a character, or

  2. Aligned in columns with spaces between each field.

在上例中,字段以字符“|”分隔。因此,可以使用 Convert Text to Columns 向导。

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

  1. Select the data.

  2. Copy and paste values in the same place. Otherwise, Convert Text to Columns takes the functions rather than the data itself as the input.

convert text to columns
  1. Select the data.

  2. Click on Text to Columns in the Data Tools group under Data Tab on the Ribbon.

出现 Step 1 −“文本到列向导” - 步骤 1/3。

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

  1. Select Delimited.

  2. Click Next.

convert text to columns step1

出现 Step 2 −“文本到列向导” - 步骤 2/3。

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

  1. Under Delimiters, select Other.

  2. In the box next to Other, type the character |

  3. Click Next.

convert text to columns step2

出现 Step 3 −“文本到列向导” - 步骤 3/3。

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.

  1. For Destination, select the cell D3.

  2. You can click Advanced, and set Decimal Separator and Thousands Separator in the Advanced Text Import Settings dialog box that appears.

  3. Click Finish.

convert text to columns step3

已转换为列的数据显示在三列中 - D、E 和 F。

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

  1. Name the Column headers as ProductID, Product_Description and Price.

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

您还可以根据手头的数据,将两个或更多文本函数组合在一起,以提取所需的数据值。例如,使用 LEFT、RIGHT 和 VALUE 函数的组合或使用 FIND、LEFT、LEN 和 MID 函数的组合。

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,

  1. All the characters left to the first | give the name ProductID.

  2. All the characters right to the second | give the name Price.

  3. All the characters that lie between the first | and second | give the name Product_Description.

  4. Each | has a space before and after.

观察此信息后,您可以按以下步骤提取数据值 −

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

  1. Find the Position of First | - First | Position You can use FIND function

  2. Find the Position of Second | - Second | Position You can use FIND function again

  3. Beginning to (First | Position – 2) Characters of the Text give ProductID You can use LEFT Function

  4. (First | Position + 2) to (Second | Position - 2) Characters of the Text give Product_Description You can use MID Function

  5. (Second | Position + 2) to End Characters of the Text give Price You can use RIGHT Function

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

使用 Excel Step 1 是从文本中提取数据值的另一种方式。但是,只有在 Excel 能够在数据中找到模式时,此方法才会起作用。

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 2 − 在数据旁边创建三列,分别用于 ProductID、Product_Description 和 Price。

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

create columns

Step 3 − 复制并粘贴 B3 中的 C3、D3 和 E3 的值。

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

paste values

Flash Fill − 选择单元格 C3,然后单击 Data Tools 选项卡上的 Data 组中的 Step 4 。将填充 ProductID 的所有值。

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

Functions that format the Text as per your need − 对 Product_Description 和 Price 重复上述步骤。将填充数据。

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

repeat steps

Formatting Data with Text Functions

Excel 具有几个内置文本函数,您可以使用这些函数设置包含文本的数据的格式。其中包括 −

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

PROPER

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

Executing Data Operations with the Text Functions

你可能需要在你的数据上执行一些文本操作。例如,如果组织中员工的登录 ID 更改为新格式,基于格式更改,可能必须执行文本替换。

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 −

  1. Date Formats Date in Serial FormatDate in different Month-Day-Year Formats

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

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

  4. Obtaining Today’s Date

  5. Finding a Workday after specified Days

  6. Customizing the Definition of a Weekend

  7. Number of Workdays between two given Dates

  8. Extracting Year, Month, Day from Date

  9. Extracting Day of the Week from Date

  10. Obtaining Date from Year, Month and Day

  11. Calculating Number of Years, Months and Days between two Dates

Date Formats

Excel 支持通过两种方式解析 Date 值−

Excel supports Date values in two ways −

  1. Serial Format

  2. In different Year-Month-Day Formats

您可以转换−

You can convert −

  1. A Date in Serial Format to a Date in Year-Month-Day Format

  2. A Date in Year-Month-Day Format to a Date in Serial Format

Date in Serial Format

按序列格式的 Date 是一个正整数,表示给定日期与 1900 年 1 月 1 日之间的天数。当前 Date 与 1900 年 1 月 1 日都包含在计数中。例如,42354 是一个 Date ,代表 2015 年 12 月 16 日。

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 支持基于您选择的 Locale (位置)的不同 Date 格式。因此,您需要首先确定您的 Date 格式和手头的数据分析的兼容性。请注意,某些 Date 格式以 *(星号) 为前缀−

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) −

  1. Date formats that begin with *(asterisk) respond to changes in regional date and time settings that are specified for the operating system

  2. Date formats without an *(asterisk) are not affected by operating system settings

为了理解,你可以把美国作为地点。你会发现以下 {s0} 格式可供选择 {s1} - 2016 年 6 月 8 日 −

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 −

  1. *6/8/2016 (affected by operating system settings)

  2. *Wednesday, June 8, 2016 (affected by operating system settings)

  3. 6/8

  4. 6/8/16

  5. 06/08/16

  6. 8-Jun

  7. 8-Jun-16

  8. 08-Jun-16

  9. Jun-16

  10. June-16

  11. J

  12. J-16

  13. 6/8/2016

  14. 8-Jun-2016

如果你输入仅仅两位数来表示年份而且如果 −

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

  1. The digits are 30 or higher, Excel assumes the digits represent years in the twentieth century.

  2. The digits are lower than 30, Excel assumes the digits represent years in the twenty-first century.

例如,1/1/29 被视为 2029 年 1 月 1 日,1/1/30 被视为 1930 年 1 月 1 日。

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 −

  1. Click the Number tab in the Format Cells dialog box.

  2. Click Date under Category.

  3. Select Locale. The available Date formats will be displayed as a list under Type.

  4. Click on a Format under Type to look at the preview in the box adjacent to Sample.

converting dates in serial format

选择格式后,单击 OK.

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 −

  1. Using Format Cells dialog box

  2. Using Excel DATEVALUE function

Using Format Cells dialog box

  1. Click the Number tab in the Format Cells dialog box.

  2. Click General under Category.

format cells

Using Excel DATEVALUE Function

您可以使用 Excel DATEVALUE 函数将 Date 转换为 Serial Number 格式。您需要用引号将 Date 参数括起来。例如,

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") 结果为 42529

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

Obtaining Today’s Date

如果您需要根据今天的日期进行计算,只需使用 Excel 函数 TODAY()。结果反映了它使用的日期。

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.

TODAY() 函数在 2016 年 5 月 16 日使用了以下屏幕截图:

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

obtaining todays 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.

您可以使用 Excel WORKDAYWORKDAY.INTL 函数执行此类操作。

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

例如,您可以使用函数 TODAY 和 WORKDAY 指定从今天开始的第 15 个工作日(下图截取于 2016 年 5 月 16 日)。

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

假设 2016 年 5 月 25 日和 2016 年 6 月 1 日是节假日。那么你的计算如下 −

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

calculation

Customizing the Definition of a Weekend

默认情况下,周末是周六和周日,即两天。您还可以使用 WORKDAY.INTL 函数选择自定义周末。您可以通过周末编号指定自己的周末,此编号对应于下表中指定的周末日期。您无需记住这些编号,因为当您开始键入该函数时,您可以在下拉列表中获得编号和周末日期。

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

假设只有周五是周末,则需要在 WORKDAY.INTL 函数中使用编号 16。

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.

您可以使用 Excel 函数 NETWORKDAYSNETWORKDAYS.INTL 查找两个日期之间的工作日数量。与 WORKDAYS 和 WORKDAYS.INTL 的用法相同,NETWORKDAYS 和 NETWORKDAYS.INTL 允许您指定节假日,另外,使用 NETWORKDAYS.INTL 还可以指定周末。

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

您可以使用函数 TODAY 和 NETWORKDAYS 计算今天和另一个日期之间的工作日数量。在下图截屏中,今天是 2016 年 5 月 16 日,结束日期是 2016 年 6 月 16 日。2016 年 5 月 25 日和 2016 年 6 月 1 日是节假日。

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

同样,假设周末是周六和周日。您可以根据自己的定义设置周末,并使用 NETWORKDAYS.INTL 函数计算两个日期之间的工作日数量。在下图截屏中,只将周五定义为周末。

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

您可以从日期列表中的每个日期中提取对应的星期、月份和年份,方法是使用 Excel 函数 DAY、MONTH 和 YEAR。

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

您可以从日期列表中的每个日期中提取对应的星期,方法是使用 Excel WEEKDAY 函数。

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 week from date

Obtaining Date from Year, Month and Day

您的数据可能分别包含年、月和日信息。您需要将这三个值组合起来以获取日期,以便进行任何计算。您可以使用 DATE 函数获取日期值。

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

使用 DATE 函数获取 DATE 值。

Use the DATE function to obtain DATE values.

date function

Calculating Years, Months and Days between two Dates

您可能需要计算从给定日期开始逝去的时间。您可能需要以年、月和日格式的信息。一个简单的示例是计算一个人的当前年龄。它的计算方式是生日和今天之间的差。您可以使用 Excel 函数 DATEDIF、TODAY 和 CONCATENATE 进行此操作。

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 −

  1. Time Formats Time in Serial FormatTime in Hour-Minute-Second Format

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

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

  4. Obtaining the Current Time

  5. Obtaining Time from Hour, Minute and Second

  6. Extracting Hour, Minute and Second from Time

  7. Number of hours between Start Time and End Time

Time Formats

Excel 支持 Time 值,有两种方式−

Excel supports Time Values in two ways −

  1. Serial Format

  2. In various Hour-Minute-Second Formats

您可以转换−

You can convert −

  1. Time in Serial Format to Time in Hour-Minute-Second Format

  2. Time in Hour-Minute-Second Format to Time in Serial Format

Time in Serial Format

以串行格式表示的 Time 是一个正数,表示 Time 是 24 小时天的一个分数,起点是午夜。例如,0.29 表示上午 7 点,0.5 表示中午 12 点。

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.

你也可以在同一个单元格中组合 DateTime 。序列号是指 1900 年 1 月 1 日之后的第几天,以及与给定时间相关的日期部分。例如,如果你输入 2016 年 5 月 17 日上午 6 点,当你将该单元格格式化为 General 时,它将转换为 42507.25。

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 允许你使用冒号 (:) 在小时后和秒前指定时间以小时-分钟-秒格式。例如,8:50 AM、8:50 PM 或仅使用 8:50 采用 12 小时制格式或作为 8:50、20:50 采用 24 小时制格式。时间 8:50:55 AM 表示 8 小时、50 分钟和 55 秒。

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.

你也可以同时指定日期和时间。例如,如果你在单元格中输入 2016 年 5 月 17 日 7:25,它将显示为 5/17/2016 7:25,它表示 5/17/2016 7:25:00 AM。

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 支持基于你选择的 Locale (位置)的不同 Time 格式。因此,你需要首先确定手头 Time 格式和数据分析的兼容性。

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.

为了理解,你可以将美国视为语言环境。你找到以下 Time 格式可供 DateTime 选择——2016 年 5 月 17 日下午 4 点 -

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 −

  1. 4:00:00 PM

  2. 16:00

  3. 4:00 PM

  4. 16:00:00

  5. 5/17/16 4:00 PM

  6. 5/17/16 16:00

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 −

  1. Click the Number tab in the Format Cells dialog box

  2. Click Time under Category.

  3. Select the Locale. Available Time formats will be displayed as a list under Type.

  4. Click on a Format under Type to look at the Preview in the box adjacent to Sample.

converting times

在选择格式后,单击 OK

After choosing the Format, click OK

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

您可以使用两种方式将 Hour-Minute-Second 格式中的时间转换为序列格式 −

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

  1. Using Format Cells dialog box

  2. Using Excel TIMEVALUE function

Using Format Cells dialog box

  1. Click the Number tab in the Format Cells dialog box.

  2. Click General under Category.

format cells dialog box

Using Excel TIMEVALUE Function

您可以使用 Excel TIMEVALUE 函数将 Time 转换为 Serial Number 格式。需要将 Time 参数用引号括起来。例如,

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") 导致 0.70503472

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

Obtaining the Current Time

如果需要根据当前时间执行计算,简单使用 Excel 函数 NOW ()。结果反映使用日期和时间。

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.

以下 NOW () 函数使用情况的屏幕截图是在 2016 年 5 月 17 日下午 12:22 分拍摄的。

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

您的数据可能分别包含有关时间、分和秒的信息。假设,您需要获取时间,将这 3 个值结合起来以执行任何计算。您可以使用方法 Time 获取时间值。

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

您可以使用 Excel 函数 HOUR、MINUTE 和 SECOND 从给定时间中提取小时、分钟和秒。

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

当对时间值执行计算时,显示的结果取决于单元格中使用的格式。例如,您可以按如下方式计算上午 9:30 和下午 6:00 之间的小时数 −

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
  1. C4 is formatted as Time

  2. C5 and C6 are formatted as Number.

时间差以天为单位。要转换为小时,您需要乘以 24。

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

Excel Data Analysis - Conditional Formatting

在 Microsoft Excel 中,您可以使用 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

在包含过去一个季度一系列销售人员销售数据的一个区域中,您可以突出显示代表满足已定义目标(例如 $2500)单元格。

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.

您可以将条件设置为个人的总销售量 >= $2500 并指定颜色代码绿色。Excel 检查范围内的每个单元格以确定您指定的条件(即个人的总销售量 >= $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 将您选择的格式(即绿色)应用于满足条件的所有单元格。如果单元格的内容不满足条件,单元格的格式保持不变。结果如预期的那样,对于达到目标的销售人员,单元格以绿色突出显示 - 分析结果的快速可视化。

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.

您可以通过指定 Rules 来指定任何数量的格式化条件。您可以从下列规则中选择与您的条件匹配的规则:

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

  1. Highlight cells rules

  2. Top / Bottom rules

您还可以定义自己的规则。您可以 −

You can also define your own rules. You can −

  1. Add a rule

  2. Clear an existing rule

  3. Manage the defined rules

此外,您可以在 Excel 中选择多个格式化选项以选择适合您的数据可视化的选项 −

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

  1. Data Bars

  2. Color Scales

  3. Icon Sets

条件格式已在 Excel 2007、Excel 2010、Excel 2013 版本中得到推广。您在本章中找到的示例来自 Excel 2013。

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

您可以使用 Highlight Cells 规则将格式分配给内容符合以下任意标准的单元格 -

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

  1. Numbers within a given numerical range − Greater ThanLess ThanBetweenEqual To

  2. Text that contains a given text string.

  3. Date occurring within a given range of dates relative to the current date − YesterdayTodayTomorrowIn the last 7 daysLast weekThis weekNext weekLast monthThis MonthNext month

  4. Values that are duplicate or unique.

按照步骤条件格式化单元格:

Follow the steps to conditionally format cells −

  1. Select the range to be conditionally formatted.

  2. Click Conditional Formatting in the Styles group under Home tab.

  3. Click Highlight Cells Rules from the drop-down menu.

highlight cells rules
  1. Click Greater Than and specify >750. Choose green color.

  2. Click Less Than and specify < 500. Choose red color.

  3. Click Between and specify 500 and 750. Choose yellow color.

rules

数据将根据给定条件和对应的格式突出显示。

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

data highlighted

Top / Bottom Rules

您可以使用 Top / Bottom Rules 将格式分配给内容符合以下任意标准的单元格 -

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

  1. Top 10 items − Cells that rank in the top N, where 1 ⇐ N ⇐ 1000.

  2. Top 10% − Cells that rank in the top n%, where 1 ⇐ n ⇐ 100.

  3. Bottom 10 items − Cells that rank in the bottom N, where 1 ⇐ N ⇐ 1000.

  4. Bottom 10% − Cells that rank in the bottom n%, where 1 ⇐ n ⇐ 100.

  5. Above average − Cells that are above average for the selected range.

  6. Below average − Cells that are below average for the selected range.

按照以下步骤分配顶部/底部规则。

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

  1. Select the range to be conditionally formatted.

  2. Click Conditional Formatting in the Styles group under Home tab.

  3. Click Top/Bottom Rules from the drop-down menu. Top/Bottom rules options appear.

top bottom rules
  1. Click Top Ten Items and specify 5. Choose green color.

  2. Click Bottom Ten Items and specify 5. Choose red color.

choose green and red color

数据将根据给定条件和对应的格式突出显示。

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

d cell formatted conditionally
  1. Repeat the first three steps given above.

  2. Click Top Ten% and specify 5. Choose green color.

  3. Click Bottom Ten% and specify 5. Choose red color.

choose red color for d cell

数据将根据给定条件和对应的格式突出显示。

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

d cell highlighted data
  1. Repeat the first three steps given above.

  2. Click Above Average. Choose green color.

  3. Click Below Average. Choose red color.

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

您可以使用彩色 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.

当您有大量数据时,数据条有助于可视化更高、更低和中间值。例如 - 特定月份多个区域的日温度。您可以使用渐变填充色条可视化单元格中相对于其他单元格中的值。您可以为数据条选择六种 Gradient Colors - 蓝色、绿色、红色、黄色、淡蓝色和紫色。

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.

  1. Select the range to be formatted conditionally.

  2. Click Conditional Formatting in the Styles group under Home tab.

  3. Click Data Bars from the drop-down menu. The Gradient Fill options and * Fill* options appear.

data bars

单击 Gradient Fill 选项中的蓝色数据条。

Click the blue data bar in the Gradient Fill options.

gradient fill
  1. Repeat the first three steps.

  2. Click the blue data bar in the Solid Fill options.

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

您可以使用 Color Scales 查看单元格中相对于给定范围中其他单元格中的值。与 Highlight Cells Rules 一样, Color Scale 使用单元格阴影显示单元格值之间的差异。将向范围的单元格应用颜色渐变。颜色表示每个单元格值在这个范围内所处的位置。

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 −

  1. Three - Color Scale − Green – Yellow – Red Color ScaleRed – Yellow – Green Color ScaleGreen – White – Red Color ScaleRed – White – Green Color ScaleBlue – White – Red Color ScaleRed – White – Blue Color Scale

  2. Two-Color Scale − White – Red Color ScaleRed – White Color ScaleGreen – White Color ScaleWhite – Green Color ScaleGreen – Yellow Color ScaleYellow – Green Color Scale

按照以下步骤操作 −

Follow the steps given below −

  1. Select the Range to be conditionally formatted.

  2. Click Conditional Formatting in the Styles group under Home tab.

  3. Click Color Scales from the drop-down menu. The Color Scale options appear.

  4. Click the Green – Yellow – Red Color Scale.

数据将根据所选区域中的绿色 – 黄色 – 红色颜色比例高亮显示。

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

green yellow red color
  1. Repeat the first three steps.

  2. Click the Green – White color scale.

数据将根据所选区域中的绿色 – 白色颜色比例高亮显示。

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.

  1. Select the range to be conditionally formatted.

  2. Click Conditional Formatting in the Styles group under Home tab.

  3. Click Icon Sets from the drop-down menu. The Icon Sets options appear.

  4. Click the colored three arrows.

根据所选区域中的值,彩色的箭头将显示在数据旁边。

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

colored arrows
  1. Repeat the first three steps. The Icon Sets options appear.

  2. Select 5 Ratings. The Rating Icons appear next to the data based on the values in the selected range.

rating icons

New Rule

您可以使用 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 −

  1. With New Rule option from the drop-down menu

  2. With New Rule button in Manage Rules dialog box

With New Rule option from the Drop-Down Menu

  1. Select the Range to be conditionally formatted.

  2. Click Conditional Formatting in the Styles group under Home tab.

  3. Click New Rule from the drop-down menu.

drop down menu

New Formatting Rule 对话框显示。

The New Formatting Rule dialog box appears.

  1. From the Select a Rule Type Box, select Use a formula to determine which cells to format. Edit the Rule Description box appears.

  2. In the format values where this formula is true: type the formula.

  3. Click the format button and click OK.

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

  1. Select the range to be conditionally formatted.

  2. Click Conditional Formatting in the Styles group under Home tab.

  3. Click Manage Rules from the drop-down menu.

new rule button

Conditional Formatting Rules Manager 对话框显示。

The Conditional Formatting Rules Manager dialog box appears.

单击 New Rule 按钮。

Click the New Rule button.

conditional formatting rules manager

New Formatting Rule 对话框显示。

The New Formatting Rule dialog box appears.

重复以上步骤以定义公式和格式。

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

define formula and format

Conditional Formatting Rules Manager 对话框显示由 New Rule 高亮显示的定义。单击 Apply 按钮。

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

  1. Selected cells

  2. Current Worksheet

  3. Selected Table

  4. Selected PivotTable

按照给定的步骤执行操作 -

Follow the given steps −

  1. Select the Range / Click on a Worksheet / Click the table > PivotTable where conditional formatting rules need to be removed.

  2. Click Conditional Formatting in the Styles group under Home tab.

  3. Click Clear Rules from the drop-down menu. The Clear rules options appear.

clear rules

选择合适的选项。条件格式从区域/工作表/表格/数据透视表中清除。

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

Manage Rules

可以选择 Manage Rules*from the *Conditional Formatting Rules Manager 窗口。可以看到当前选择、整个当前工作表、工作簿中的其他工作表或工作簿中的表格或数据透视表的格式化规则。

You can Manage Rules*from 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.

  1. Click Conditional Formatting in the Styles group under Home tab.

  2. Click Manage Rules from the drop-down menu.

manage rules

Conditional Formatting Rules Manager 对话框显示。

The Conditional Formatting Rules Manager dialog box appears.

Show formatting rules for 当前选择旁边的列表框中单击箭头,将弹出会显示当前工作表和其他工作表、表格、数据透视表(如果存在且具有条件格式规则)。

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

从下拉列表中选择 This Worksheet 。当前工作表上的格式规则将按应用顺序列出。您可以使用向上和向下箭头更改此顺序。

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 dropdown

您可以添加新规则、编辑规则和删除规则。

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

add new edit and delete rule
  1. You have already seen New Rule in the earlier section. You can delete a rule by selecting the Rule and clicking Delete Rule. The highlighted Rule is deleted.

  2. To edit a Rule, select the RULE and click on Edit Rule. Edit Formatting Rule dialog box appears.

  3. You can Select a Rule Type Edit the Rule Description Edit Formatting

  4. Once you are done with the changes, click OK.

  5. The changes for the Rule will be reflected in the Conditional Formatting Rules Manager dialog box. Click Apply.

  6. The data will be highlighted based on the modified Conditional Formatting Rules.

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

  1. text (A to Z or Z to A)

  2. numbers (smallest to largest or largest to smallest)

  3. dates and times (oldest to newest and newest to oldest)

  4. a custom list (E.g. Large, Medium, and Small)

  5. format, including cell color, font color, or icon set

表的排序条件会与工作簿一起保存,这样您每次打开工作簿时都可以对该表重新应用排序。不会为单元格区域保存排序条件。对于多列排序或创建需要花费很长时间的排序,您可以将区域转换为表格。然后,您可以在打开工作簿时重新应用该排序。

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
  1. To sort the table by the column title that contains text, click the header of the column – Title.

  2. Click the Data tab.

  3. In the Sort & Filter group, click Sort A to Z

sort and filter

将按标题列对表格按升序字母数字顺序进行排序。

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

Note − 您可以通过单击 Sort Z to A ,按降序字母数字顺序进行排序。您还可以使用区分大小写的选项进行排序。请参阅下方给出的 Sort by a Custom List 部分。

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

要按包含数字的列 ManagerID 对表进行排序,请按照下面给出的步骤进行操作 -

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

  1. Click the header of the column – ManagerID.

  2. Click the Data tab.

  3. In the Sort & Filter group, click Sort A to Z

sort by numbers

ManagerID 列将按升序数字顺序进行排序。您可以通过单击从 Z 到 A 排序,按降序数字顺序进行排序。

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

要按包含日期的列 HireDate 对表进行排序,请按照以下步骤操作 -

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

  1. Click the Header of the column – HireDate.

  2. Click Data tab.

  3. In the Sort & Filter group, click Sort A to Z as shown in the screen shot given below −

sort by dates or times

按列排序 – HireDate,按最旧到最新的顺序对日期进行排序。您可以通过单击 Sort Z to A ,按从最新到最旧的顺序对日期排序。

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) −

  1. Click the Header of the column – Total Marks.

  2. Click Data tab.

  3. In the Sort & Filter group, click Sort. The Sort dialog box appears.

sort by cell color
  1. Choose Sort By as Total Marks, Sort on as Cell Color and specify the color green in Order. Click Add Level.

  2. Choose Sort By as Total Marks, Sort on as Cell Color and specify the color Yellow in Order. Click Add Level.

  3. Choose Sort By as Total Marks, Sort on as Cell Color and specify the color Red in Order.

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) −

  1. Click the header of the column – Total Marks.

  2. Click Data tab.

  3. In the Sort & Filter group, click Sort. The Sort dialog box appears.

  4. Choose Sort By as Total Marks, Sort On as Font Color and specify the color green in Order. Click Add Level.

  5. Choose Sort By as Total Marks, Sort On as Font Color and specify the color yellow in Order. Click Add Level.

  6. Choose Sort By as Total Marks, Sort On as Font Color and specify the color red in Order.

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 −

  1. Click the Header of the column – Total Marks.

  2. Click Data tab.

  3. In the Sort & Filter group, click Sort. The Sort dialog box appears.

  4. Choose Sort By as Total Marks, Sort On as Cell Icon and specify in Order. Click Add Level.

  5. Choose Sort By as Total Marks, Sort On as Cell Icon and specify in Order. Click Add Level.

  6. Choose Sort By as Total Marks, Sort On as Cell Icon and specify in Order.

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

现在,假设您想要对排名列进行排序,所有高值在顶部,所有低值在底部,所有中等值在中间。这意味着您想要的是低、中、高。使用 Sort A to Z ,您获得的高、低和中等的顺序。另一方面,使用 Sort Z to A ,您获得低、中和高的顺序。

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.

  1. Define the order for the custom list as high, medium and low in a range of cells as shown below.

  2. Select that Range.

select range
  1. Click the File tab.

  2. Click Options. In the Excel Options dialog box, Click Advanced.

  3. Scroll to the General.

  4. Click Edit Custom Lists.

edit custom lists

Edit Custom Lists 对话框将出现。工作表中选择的范围将出现在 Import list from cells Box 中。单击 Import

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

import list

你的自定义列表已添加到 {s2}。单击确定。

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.

  1. Click the Column – Position. Click on Sort. In the Sort dialog box, ensure Sort By is Position, Sort On is Values.

  2. Click on Order. Select Custom List. Custom Lists dialog box appears.

  3. Click on the High, Medium, Low Custom List. Click on OK.

sort table with custom list

在 {s10} 对话框中,{s11} 框中会出现 {s12}。单击确定。

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 −

  1. Text

  2. Number

  3. Date

  4. Time

你不能根据格式创建自定义列表,即,按单元格/字体颜色或单元格图标创建。

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 −

  1. Click the row you want to sort the data.

  2. Click Sort.

  3. In the Sort dialog box, Click Options. The Sort Options dialog box opens.

  4. Under Orientation, click Sort from left to right. Click OK.

sort by rows
  1. Click Sort by row. Select the row.

  2. Choose values for Sort On and Largest to Smallest for Order.

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.

  1. Click the Table.

  2. Click Sort.

  3. In the Sort dialog box, specify the column by which you want to sort first.

在下面提供的屏幕截图中,选择了 Sort By 标题、 Sort On 值、 Order A – Z。

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

sort by
  1. Click Add Level in the Sort dialog box. The Then By dialog appears.

  2. Specify the column by which you want to sort next.

  3. In the screen shot given below, Then By HireDate, Sort On Values, Order Oldest to Newest are chosen.

  4. Click OK.

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 −

  1. Selected values

  2. Text filters if the column you selected contains text

  3. Date filters if the column you selected contains dates

  4. Number filters if the column you selected contains numbers

  5. Number filters if the column you selected contains numbers

  6. Font color if the column you selected contains font with color

  7. Cell icon if the column you selected contains cell icons

  8. Advanced filter

  9. Using slicers

在表格中,列头自动标记为筛选器,称为 AutoFiltersAutoFilter 由列头旁边的一个箭头表示。每个 AutoFilter 都有基于该列中的数据类型的筛选器选项。例如,如果该列包含数字,则当单击列头旁边的箭头时,将会出现 Number Filter Options

In a table, the column headers are automatically tagged to filters, known as AutoFilters. AutoFilter is represented by the 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 next to the column header, Number Filter Options appear.

当你单击筛选器选项或单击筛选器选项末尾出现的 Custom Filter 时,将会出现 Custom AutoFilter 对话框,其中你可以自定义你的筛选器选项。

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.

如果是范围,你可以在范围的第一行提供列头,然后单击 Home 选项卡 Editing 组中的筛选器。这将为范围打开 AutoFilter 。你可以移除数据中你拥有的筛选器。你还可以重新应用筛选器,当数据更改发生时。

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

如果你只想显示 Position = High 的数据,则单击 Position 旁边的箭头。将出现一个下拉框,其中包含 position 列中的所有值。默认情况下,将选择所有值。

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
  1. Click Select All. All the boxes are cleared.

  2. Select High as shown in the following screen shot.

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.

单击列标题“标题”旁边的箭头。在下拉列表中,单击 Text Filters 。显示文本筛选器选项。

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

text filters

从可用选项中选择 ContainsCustom AutoFilter 对话框打开。在“包含”旁边的框中键入经理。

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

您可以进一步过滤这些数据,以便仅显示标题为“经理”,并且雇佣日期早于2011年的行。这意味着您将显示2011年前在组织中工作的经理的员工信息。

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.

单击列标题雇佣日期旁边的箭头。在下拉列表中,单击 Date Filters 。显示日期筛选器选项。从下拉列表中选择 Before

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 对话框打开。在 is before 旁边的框中输入1/1/2011。您还可以从框旁边的日期选择器中选择日期。

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

单击确定。仅显示标题包含经理,并且雇佣日期早于1/1/2011的行。

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

您可以筛选这些数据,以便仅显示总分>850的行。

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

单击列标题总分旁边的箭头。在下拉列表中,单击 Number Filters 。显示数字筛选器选项。

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

单击 Greater ThanCustom AutoFilter 对话框打开。在 Greater Than 旁边的框中输入850。

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

click greater than

单击确定。仅显示总分大于850的行。

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

单击标题总分中的箭头。在下拉列表中,单击 Filter by ColorFilter by Cell Color 选项显示。

Click the 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 Filter by Color. Filter by Font Color 选项。

Click the 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

单击标题总分中的箭头 。从下拉列表中,选择 Filter by Color 。将出现 Filter by Cell Icon 选项。

Click the 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 and click OK.

仅显示总分列中带有 图标的行。

Only the rows wherein the Total Marks column has the icon will be displayed.

column with green arrow icon

Clear Filter

删除筛选器在 Excel 中称为 Clear Filter

Removing filters is termed as Clear Filter in Excel.

可以移除

You can remove

  1. A filter from a specific column, or

  2. All of the filters in the worksheet at once.

要从特定列中移除筛选器,请单击该列的表标题中的箭头。从下拉菜单中,单击 Clear Filter From “<specific Column Name>”

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 in the

  1. Editing group on the Home tab, or

  2. Sort & Filter group in the Data tab.

工作表中的所有筛选器一次全部移除。如果您错误地移除了过滤器,请单击 Undo Show All

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

Reapply Filter

当数据发生更改时,请单击 Data 选项卡上的 Sort & Filter 组中的 Reapply 。将再次对已修改数据应用定义的筛选器。

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.

您需要将筛选条件定义为一个范围。假设您想要显示那些专业人员或 EmployeeID 为 2 的员工的信息,则按如下方式定义条件:

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
  1. Next, click Advanced in the Sort & Filter group on the Data tab. The Advanced Filter dialog box appears.

  2. Specify the List Range and the Criteria Range.

  3. You can either filter the list, in place or copy to another location.

  4. In the filtering given below, filter the data in place is chosen.

filter data

将显示 ManagerID = 2 OR 并且 Title = “*Specialist”的员工信息。

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

你应用的标准是 Title = “*Specialist” OR Title = “Vice President”。将显示专家和副总裁的员工信息。

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

can copy the filtered data to another location 。你还可以只选择少数列包含在复制操作中。

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

  1. Copy EmployeedID, Title and SalariedFlag to the Cells Q2, R2, S2. This will be the first Row of your filtered data.

  2. Click on Advanced and in the Advanced Filter dialog box, click on Copy to another location. In the Copy to box, specify reference to the Headers you copied in another location, i.e. Q2:S2.

advanced filter dialog box

在指定“@ {s10}”和“@ {s11}”后,单击“确定”。筛选数据中的所选列将复制到你指定的位置。

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

在 Excel 2010 中引入了在数据透视表中按条件筛选数据 Slicers 。在 Excel 2013 中,你也可以使用 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
  1. Click the Table.

  2. Click *Table Tools*that appear on the Ribbon.

  3. The Design Ribbon appears.

  4. Click Insert Slicer.

insert slicer
  1. Insert Slicers dialog box appears as shown in the screen shot given below.

  2. In the Insert Slicers dialog box, you will find all the column headers including those columns that are hidden.

  3. Check the boxes Title and HireDate. Click OK.

check boxes title and hiredate

对于你选中“@ {s18}”对话框中的每一个表标题,都会出现一个 Slicer 。在每个 Slicer 中,将突出显示该列的所有值。

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

在 Title Slicer 中,单击第一个值。只将该值突出显示,其余值取消选中。此外,你将发现,HireDate Slicer 中与 Title Slicer 中的值相对应的值也将突出显示。

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

您可以在切片器中选择/取消选择值,并会发现数据会在表中自动更新。若要选择多个值,可按住 Ctrl 键并选择要显示的值。

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.

从两个切片器中选择属于帐户部门的标题值和 2015 年内的招聘日期值。

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 at the right end corner of the Slicer header.

Excel Data Analysis - Subtotals with Ranges

如果您有想要分组并汇总的数据列表,则可以使用 Excel SubtotalOutline 来显示汇总行或列。您也可以使用 PivotTable 来实现此目的,但是使用 SubtotalOutline 是分析数据范围的最快速方法。请注意, SubtotalOutline 只能用于范围,而不能用于表格。

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.

您可以创建一个最多包含八个级别的 Outline ,每个组一个级别。外部级别表示为较低数字,内部级别表示为较高级数字。每个内部级别都会显示上一外部级别的详细数据。

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.

若要了解如何使用 SubtotalOutline ,请考虑以下示例,其中按销售人员和地点给出了不同产品的销售数据。总共有 1891 行数据。

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

您可以使用 Subtotal 获得按销售地点进行汇总的销售额。

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

首先,按数据按地点进行排序。

First, sort the data location wise.

  1. Click anywhere on the data range.

  2. Click the DATA tab.

  3. Click Sort.

选择了数据。 Sort 对话框出现。

Data is selected. The Sort dialog box appears.

subtotals

Sort 对话框中,

In the Sort dialog box,

  1. Select Location for Sort by

  2. Select Values for Sort On

  3. Select A to Z for Order

sort dialog box

点击 OK 。数据按位置排序。

Click OK. The data is sorted location wise.

data sorted
  1. Click anywhere on the Data Range.

  2. Click DATA tab.

  3. Click Subtotal in the Outline group. The data gets selected and the Subtotal dialog box appears.

subtotal dialog box

Subtotal dialog 框中,

In the Subtotal dialog box,

  1. Select Location under At each change in:

  2. Select Sum under Use function:

  3. Select Unit and Amount under Add subtotal to:

  4. Select Replace current subtotals

  5. Select Summary below data

add subtotal

点击 OK 。数据按三个级别分组,小计按位置计算。

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

Note - 显示的数据是第 3 级 - 即整个数据。

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

calculate subtotal

点击大纲级别 2。将按单位和金额按位置显示 Totals

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

dispaly totals

点击大纲级别 1。将按单位和金额显示 Grand Totals

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

grand totals

您可以通过点击 Outline Levels 或数据左侧的 + 符号来放大或缩小数据。

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

您可以使用 Nested Subtotals 根据每个销售人员按位置获得销售总和。

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

根据 Sort 数据按位置,然后按销售人员。

Sort the data location wise and then salesperson wise.

  1. Click anywhere on the data range.

  2. Click the DATA tab.

  3. Click Sort. The data is selected and the Sort dialog box appears.

nested subtotals

Sort 对话框中,

In the Sort dialog box,

  1. Select Location for Sort by

  2. Select Values for Sort On

  3. Select A to Z for Order

  4. Click on Add Level

Then by 行显示

Then by row appears

  1. Select Name for Then by

  2. Select Values for Sort On

  3. Select A to Z for Order

add level

点击 OK 。数据按位置分类,再按名称分类。

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

sort by location
  1. Click anywhere on the Data Range

  2. Click on DATA tab

  3. Click on Subtotal in the Outline group

数据得到选中。 Subtotal 对话框出现。

Data gets selected. Subtotal dialog box appears.

data selected

Subtotal 对话框中,

In the Subtotal dialog box,

  1. Select Location under At each change in:

  2. Select Sum under Use function:

  3. Select Unit and Amount under Add subtotal to:

  4. Select Replace current subtotals

  5. Select Summary below data

location

单击 OK 。数据按三层分组,子总计按前文所述的方式按位置计算。

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

outline levels
  1. Click Subtotal.

Subtotal 对话框中,

In the Subtotal dialog box,

  1. Select Name under At each change in:

  2. Select Sum under Use function:

  3. Select Unit and Amount under Add subtotal to:

  4. Unselect Replace current subtotals

  5. Select Summary below data

click subtotal

单击 OK 。数据按四层分组,子总计按位置和名称计算。

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

calculated location and name wise

单击 Outline Level 3Totals 将显示按单元和金额的名称和位置。

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

outline level 3

单击 Outline Level 2Totals 将显示按单元和金额的位置。

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

sub total outline level 2

单击 Outline Level 1Grand Totals 将显示单元和金额。

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

outline level 1

通过单击 Outline Levels ,或者单击数据左侧的+号,可以放大或缩小数据。

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

在 Microsoft Excel 2013 中, Quick Analysis 工具可以使用不同的 Excel 工具对您的数据进行快速、轻松的分析。

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

您可以将 Quick Analysis 用于数据区域或表。要访问 Quick Access 工具,请选择包含您想要分析的数据的单元格。 Quick Analysis 工具按钮 会显示在所选数据的右下方。

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 appears at the bottom right of your selected data.

quick analysis

点击 Quick Analysis 按钮。快速分析工具栏随 FORMATTING, CHARTS, TOTALS, TABLES, SPARKLINES 选项一起出现。

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

quick analysis toolbar

Quick Analysis 工具方便快捷,因为您还可以在选择所需的选项之前预览应用不同的选项。

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 允许您通过添加数据条、颜色等来突出显示数据的部分。这使您可以快速可视化数据中的值。

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.

您已经在本教程的 Conditional Formatting 章节中学习了格式化规则。区别在于您可以快速预览并选择您想要的选项。但是,如果您想使用 Conditional Formatting 的所有功能,您最好通过功能区上的主菜单。 Quick Analysis 工具中的所有选项也一样。

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.

Quick Analysis 工具栏上单击 FormattingConditional Formatting 选项出现在工具栏中。将鼠标移动到选项上。您将看到预览。然后,您可以通过单击来选择所需的选项。

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 用于以图形方式描绘数据。有几种类型的 Charts 适用于不同类型的数据。

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

如果您在 Quick Analysis 工具栏上单击 CHARTS ,将显示您已选择的数据的推荐图表。如果您想转到功能区上的主 Charts ,您始终可以选择 More Charts 选项。

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 可用于计算列和行中的数字。您将拥有求和、平均值、计数等功能。

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

我们将在本章节后面详细介绍如何使用 Quick Analysis 工具和 TOTALS 。您可以像观察到的那样,轻松地使用 Quick Analysis 中的其他选项。

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 帮助您过滤、排序和汇总数据,正如您已经在 Tables 章节中了解的那样。在 Quick Analysis 工具中, TablePivotTable 选项在 TABLES 下都可用。但是,您可以对表格进行预览,但在 PivotTable 的情况下,无法获得预览,因为通过单击,您将获得一个空的 PivotTable ,您需要用数据来填充它。

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 是您可以在单个单元格中与数据一起显示的小图表。它们提供了一种快速查看趋势的方法。

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

Quick Analysis 工具栏中单击 TOTALS

Click on TOTALS in the Quick Analysis Toolbar.

TOTALSQuick Analysis 中,您可以按以下方式分析

In Quick Analysis with TOTALS, you can analyze

按行

Row-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

选择数据,然后在 TOTALS 下的 Quick Analysis 工具栏上单击。

Select the data and Click 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.

在所选数据的下方的行中,显示了数据的每列之和。标题 Sum 也将自动提供。这意味着将显示所有候选人在每轮中的总票数。

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

选择数据并单击 TOTALS 下的 Quick Analysis 工具栏。

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

数据的每列的平均值显示在数据下方的行中。标题 Average 也将自动提供。将显示在每轮中获得的平均选票数。

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

选择数据并单击 TOTALS 下的 Quick Analysis 工具栏。

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

数据的每列的计数显示在数据下方的行中。标题 Count 也将自动提供。这意味着将显示在每轮中的候选人数量。

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

选择数据并单击 TOTALS 下的 Quick Analysis 工具栏。

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

数据的每列的 %Total 显示在数据下方的行中。标题 %Total 也将自动提供。这意味着将显示在每轮中的选票的 %Total

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 on quick analysis

Running Total

选择数据并单击 TOTALS 下的 Quick Analysis 工具栏。

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

数据的每列的运行总计显示在数据下方的行中。标题 Running Total 也将自动提供。这意味着将显示在各轮中的选票运行总计。

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 on quick analysis

Sum of Columns

选择数据并单击 TOTALS 下的 Quick Analysis 工具栏。

Select the data and click 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.

在所选数据的旁边的列中,显示了数据的每行的和。列头 Sum 也将自动提供。这意味着将显示在所有各轮中每个候选人获得的总票数。

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 on quick analysis

Excel Data Analysis - Lookup Functions

您可以使用 Excel 函数来 −

You can use Excel functions to −

  1. Find values in a range of data - VLOOKUP and HLOOKUP

  2. Obtain a value or the reference to a value from within a table or range - INDEX

  3. Obtain the relative position of a specified item in a range of cells - MATCH

您还可基于提供的输入将这些函数结合使用,以获得所需的结果。

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

Using VLOOKUP Function

VLOOKUP 函数的语法为

The syntax of the VLOOKUP function is

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

其中

Where

  1. lookup_value − is the value you want to look up. Lookup_value can be a value or a reference to a cell. Lookup_value must be in the first column of the range of cells you specify in table_array

  2. table_array − is the range of cells in which the VLOOKUP will search for the lookup_value and the return value. table_array must contain the lookup_value in the first column, and the return value you want to find Note − The first column containing the lookup_value can either be sorted in ascending order or not. However, the result will be based on the order of this column.

  3. col_index_num − is the column number in the table_array that contains the return value. The numbers start with 1 for the left-most column of table-array

  4. range_lookup − is an optional logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match. range_lookup can be omitted, in which case it is assumed to be TRUE and VLOOKUP tries to find an approximate match TRUE, in which case VLOOKUP tries to find an approximate match. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned FALSE, in which case VLOOKUP tries to find an exact match 1, in which case it is assumed to be TRUE and VLOOKUP tries to find an approximate match 0, in which case it is assumed to be FALSE and VLOOKUP tries to find an exact match

Note − 如果省略了 range_lookup,或者将其设为 TRUE 或 1,则 VLOOKUP 只有在 table_array 中的第一列按升序排列时才会正确运行。否则,可能会导致值不正确。在这种情况下,请对 range_lookup 使用 FALSE。

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

考虑一下学生成绩列表。您可以使用 VLOOKUP 从包含成绩间隔和通过类别的数组中获取相应的成绩。

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

请注意,成绩按升序排列的第一列是获取成绩的依据。因此,对 range_lookup 参数使用 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.

将此数组命名为 Grades

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,

  1. col_index_num − indicates the column of the return value in table_array is 2

  2. the range_lookup is TRUE The first column containing the lookup value in the table_array grades is in ascending order. Hence, the results will be correct. You can get the return value for approximate matches also. i.e. VLOOKUP computes as follows −

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

考虑一个产品列表,其中包含每个产品的产品 ID 和价格。每当推出新产品时,产品 ID 和价格都会添加到列表末尾。这意味着产品 ID 不一定按升序排列。产品列表可能如下所示:−

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

将此数组命名为 ProductInfo。

Name this array as ProductInfo.

您可以使用 VLOOKUP 函数获取给定产品 ID 的价格,因为产品 ID 在第一列。价格在列 3 中,因此 col_index_ num 应为 3。

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.

  1. Use VLOOKUP Function with range_lookup as TRUE

  2. Use VLOOKUP Function with range_lookup as FALSE

vlookup function with false

正确答案来自 ProductInfo 数组为 171.65。您可以检查结果。

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 −

  1. The correct result when range_lookup is FALSE, and

  2. A wrong result when range_lookup is TRUE.

这是因为 ProductInfo 数组中的第一列不是按升序排序的。因此,请记住,每当数据未排序时都要使用 FALSE。

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

如果数据是以行而不是列的形式,则可以使用 HLOOKUP 函数。

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
  1. Name this Array ProductRange. You can find the price of a product given the product ID with HLOOKUP function.

HLOOKUP 函数的语法为:

The Syntax of HLOOKUP function is

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

其中

Where

  1. lookup_value − is the value to be found in the first row of the table

  2. table_array − is a table of information in which data is looked up

  3. row_index_num − is the row number in table_array from which the matching value will be returned

  4. range_lookup − is a logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match

  5. range_lookup can be omitted, in which case it is assumed to be TRUE and HLOOKUP tries to find an approximate match TRUE, in which case HLOOKUP tries to find an approximate match. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned FALSE, in which case HLOOKUP tries to find an exact match 1, in which case it is assumed to be TRUE and HLOOKUP tries to find an approximate match 0, in which case it is assumed to be FALSE and HLOOKUP tries to find an exact match

Note − 如果 range_lookup 被省略或为 TRUE 或 1,则只有当 table_array 中的第一列按升序排序时,HLOOKUP 才能正常工作。否则,它可能会导致值不正确。在这种情况下,请对 range_lookup 使用 FALSE。

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

可以使用 HLOOKUP 函数获取给定产品 ID 的产品价格,因为产品 ID 位于第一行。价格位于第 3 行,因此 row_index_num 应为 3。

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.

  1. Use HLOOKUP Function with range_lookup as TRUE.

  2. Use HLOOKUP Function with range_lookup as FALSE.

hlookup function with false

ProductRange 数组中的正确答案为 171.65。您可以查看结果。

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

hlookup function with false result

您观察到,就像在 VLOOKUP 的情况下,您获得了

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

  1. The correct result when range_lookup is FALSE, and

  2. A wrong result when range_lookup is TRUE.

这是因为 ProductRange 数组中的第一行没有按升序排序。因此,请记住,只要数据未按升序排序,就始终使用 FALSE。

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

考虑 VLOOKUP 中使用的学生成绩示例。假设您将数据放在行中而不是列中,如下表所示 −

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

将此数组命名为 GradesRange。

Name this array as GradesRange.

请注意,基于此获得成绩的第一行按升序排序。因此,对 range_lookup 参数使用 TRUE,可以使用 HLOOKUP 获取近似匹配的成绩,这就是所需的内容。

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,

  1. row_index_num − indicates the column of the return value in table_array is 2

  2. the range_lookup is TRUE The first column containing the lookup value in the table_array Grades is in ascending order. Hence, the results will be correct. You can get the return value for approximate matches also. i.e. HLOOKUP computes as follows −

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
  1. Name the array as SalesData.

使用 INDEX 函数,您可以找到 -

Using INDEX Function, you can find −

  1. The Sales of any of the Salespersons in a certain Region.

  2. Total Sales in a Region by all the Salespersons.

  3. Total Sales by a Salesperson in all the Regions.

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.

您可以使用 MATCH 函数执行此操作,如下一节所述。

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

Using MATCH Function

如果您需要某个项目在一组范围中的位置,您可以使用 MATCH 函数。您可以将 MATCH 和 INDEX 函数组合如下 -

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 提供了数据透视表,以便您轻松快速地汇总数千个数据值,从而获得所需的结果。

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.

  1. Click the table.

  2. Click the INSERT tab on the Ribbon.

  3. Click PivotTable in the Tables group. The PivotTable dialog box appears.

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.

  1. In the Table / Range Box, type the table name.

  2. Click New Worksheet to tell Excel where to keep the PivotTable.

  3. Click OK.

table range box

将显示一个空白数据透视表和一个数据透视表字段列表。

A Blank PivotTable and a PivotTable fields list appear.

blank pivottable fields

如果您是数据透视表的新手,或者您不知道从数据中选择哪些字段,则可以使用 Excel 提供的 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.

  1. Click the data table.

  2. Click the INSERT tab.

  3. Click on Recommended PivotTables in the Tables group. The Recommended PivotTables dialog box appears.

recommended pivottables

在推荐数据透视表对话框中,显示了适合您数据的可能的自定义数据透视表。

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

  1. Click each of the PivotTable options to see the preview on the right side.

  2. Click the PivotTable Sum of Order Amount by Salesperson and month.

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 −

  1. What fields to display as rows

  2. What fields to display as columns

  3. How to summarize your data

  4. Filters for any of the fields

  5. When to update your PivotTable Layout You can update it instantly as you drag the fields across areas, orYou can defer the update and get it updated only when you click on UPDATE

即时更新有助于使用不同布局,并选择最适合报告要求的布局。

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

  1. Months are in columns.

  2. Region and salesperson in rows in that order. i.e. salesperson values are nested under region values.

  3. Summarizing is by Sum of Order Amount.

  4. No filters are chosen.

结果数据透视表如下 −

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 − 您清楚地观察到,嵌套顺序为区域,然后是销售人员的布局比嵌套顺序为销售人员,然后是区域的布局产生了更好、更简洁的报告。如果销售人员代表多个区域,并且您需要按销售人员汇总销售,那么第二个布局将是一个更好的选择。

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.

filter with label

您可以看到 −

You can see that −

  1. Salesperson values appear in rows.

  2. Month values appear in columns.

  3. Region Filter appears on the top with default selected as ALL.

  4. Summarizing value is Sum of Order Amount Sum of Order Amount Salesperson-wise appears in the column Grand TotalSum of Order Amount Month-wise appears in the row Grand Total

单击筛选区域右侧框中的箭头。将出现一个下拉列表,其中包含区域字段的值。

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
  1. Check the option Select Multiple Items. Check boxes appear for all the values.

  2. Select South and West and deselect the other values and click OK.

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

您会在“筛选区域”旁边看到已显示 Multiple Items ,表示您选择了一项以上内容。但是,从报告中无法得知选择了多少项和/或选择了哪些项。这时,使用切片器是筛选的较佳选项。

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.

  1. Click ANALYZE under PIVOTTABLE TOOLS on the Ribbon.

  2. Click Insert Slicer in the Filter group. The Insert Slicers box appears. It contains all the fields from your data.

  3. Select the fields Region and month. Click OK.

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
  1. Select South and West in the Slicer for Region.

  2. Select February and March in the Slicer for month.

  3. Keep Ctrl key pressed while selecting multiple values in a Slicer.

切片器中选定的项目将突出显示。将显示选定项目的汇总值透视表。

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

  1. Select the Field Account.

  2. Unselect the Field Order Amount.

summarizing values
  1. Drag the field Account to Summarizing Values area. By default, Sum of Account will be displayed.

  2. Click the arrow on the right side of the box.

  3. In the drop-down that appears, click Value Field Settings.

value field settings

“值字段设置”框将出现。列表下会显示几种类型的计算,以按值字段汇总 -

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

  1. Select Count in the list.

  2. The Custom Name automatically changes to Count of Account. Click OK.

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.

  1. Select the PivotTable.

以下数据透视表工具显示在功能区上 -

The following PivotTable Tools appear on the Ribbon −

  1. ANALYZE

  2. DESIGN

pivottable tools

ANALYZE

某些 ANALYZE 功能区命令如下 -

Some of the ANALYZE Ribbon commands are −

  1. Set PivotTable Options

  2. Value Field Settings for the selected Field

  3. Expand Field

  4. Collapse Field

  5. Insert Slicer

  6. Insert Timeline

  7. Refresh Data

  8. Change Data Source

  9. Move PivotTable

  10. Solve Order (If there are more calculations)

  11. PivotChart

DESIGN

某些 DESIGN 功能区命令如下 -

Some of the DESIGN Ribbon commands are −

  1. PivotTable Layout Options for Sub TotalsOptions for Grand TotalsReport Layout FormsOptions for Blank Rows

  2. PivotTable Style Options

  3. PivotTable Styles

Expanding and Collapsing Field

您可以通过两种方式展开或折叠所选字段的所有项 -

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

  1. By selecting the symbol or to the left of the selected field.

  2. By clicking the Expand Field or Collapse Field on the ANALYZE Ribbon.

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

  1. Select the cell containing East in the PivotTable.

  2. Click on the Collapse symbol to the left of East.

expanding and collapsing field

East 下的所有项都将折叠。East 左侧的折叠符号更改为展开符号。

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

collapse and expand

您可以观察到,只有 East 下的项被折叠。数据透视表的其余项保持原样。

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

单击 East 左侧的展开符号。将显示 East 下的所有项。

Click the Expand symbol 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.

  1. Click the cell containing East in the PivotTable.

  2. Click the ANALYZE tab on the Ribbon.

  3. Click Collapse Field in the Active Field group.

using analyze

数据透视表中字段 East 的所有项目将折叠。

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.

  1. Click East in the PivotTable.

  2. Click ANALYZE.

  3. Click Field Settings in Active Field group. The Field Settings dialog box appears.

  4. Click the Layout & Print tab.

  5. Check Insert blank line after each item label.

report presentation styles

将在区域字段的每个值后面显示空行。

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

您还可以从“@ {s0}”选项卡中插入空行。

You can insert blank rows from the DESIGN tab also.

insert blank rows
  1. Click the DESIGN tab.

  2. Click Report Layout in Layout group.

  3. Select Show in Outline Form in the drop-down list.

outline form
  1. Hover the mouse over the PivotTable Styles. A preview of the style on which the mouse is placed will appear.

  2. Select the Style that suits your report.

将显示具有所选样式的轮廓形式的数据透视表。

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

displays selected style

Timeline in PivotTables

为了理解如何使用时间线,请考虑下面的示例,其中销售数据按销售人员和地区分组。数据共有 1891 行。

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 −

  1. Location and Salesperson in Rows in that order

  2. Product in Columns

  3. Sum of Amount in Summarizing values

range
  1. Click the PivotTable.

  2. Click INSERT tab.

  3. Click Timeline in Filters group. The Insert Timelines appears.

insert timelines

单击日期,然后单击确定。将显示时间线对话框,并且时间线工具显示在功能区上。

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

ribbon
  1. In Timeline dialog box, select MONTHS.

  2. From the drop-down list select QUARTERS.

  3. Click 2014 Q2.

  4. Keep the Shift key pressed and drag to 2014 Q4.

时间线已选择 2014 第 2 季度至第 4 季度。

Timeline is selected to Q2 – Q4 2014.

数据透视表已筛选到此时间线。

PivotTable is filtered to this Timeline.

pivottable filtered

Excel Data Analysis - Data Visualization

您可以在 Excel 中以多种方式显示数据分析报告。但是,如果您的数据分析结果可以可视化为图表,以突出数据中的要点,您的受众可以快速掌握您想要在数据中展示的内容。它还对您的演示文稿样式产生良好影响。

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.

在本章中,您将了解如何使用 Excel 图表和图表上的 Excel 格式化功能,使您能够重点展示数据分析结果。

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

在 Excel 中,图表用于对任何数据集进行图形表示。图表是数据的可视化表示,其中数据由符号表示,例如条形图中的条形或折线图中的线。Excel 为您提供了许多图表类型,您可以选择一种适合您数据的图表,或者您可以使用 Excel 推荐的图表选项来查看根据您的数据自定义的图表,然后选择其中一个。

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.

有关图表类型的更多信息,请参阅教程 Excel 图表。

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

在本章中,您将了解可以使用 Excel 图表的高亮显示数据分析结果的不同技术。

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

假设您从不同区域获得的 2015-2016 财年的目标利润和实际利润。

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.

区分两种类型数据以比较值的一种更佳方法是使用组合图表。在 Excel 2013 及更高版本中,您可以将组合图表用于相同目的。

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.

  1. Click the DESIGN tab under the CHART TOOLS tab on the Ribbon.

  2. Click Change Chart Type in the Type group. The Change Chart Type dialog box appears.

use vertical columns
  1. Click Combo.

  2. Change the Chart Type for the series Actual to Line with Markers. The preview appears under Custom Combination.

  3. Click OK.

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

假设您有 2015-2016 财政年度不同地区所发货的产品数量和实际利润数据。

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

在图表中, No. of Units 的数据不可见,因为数据范围有显着差异。

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.

  1. Click the INSERT tab.

  2. Click Combo in Charts group.

  3. Click Create Custom Combo Chart from the drop-down list.

custom combo chart

插入图表对话框出现,其中组合突出显示。

The Insert Chart dialog box appears with Combo highlighted.

对于图表类型,选择 -

For Chart Type, choose −

标记线用于单位数量系列

. Line with Markers for the Series No. of Units

聚类柱用于实际利润系列

. Clustered Column for the Series Actual Profits

勾选单位数量系列右侧的辅助轴框并点击确定。

. Check the Box Secondary Axis to the right of the Series No. of Units and click OK.

图表预览将出现在自定义组合中。

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.

图表中的一个显著观察结果是第 3 季度,其中售出的单位数更多,但获得的实际利润更低。这可能应该归因于为增加销售而产生的促销成本。第 4 季度的情况有所改善,销售额略有下降,实际利润大幅上升。

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

假设您想预测 2013-2016 年间获得的实际利润。

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.

  1. Click the Chart

图表右上角附近会出现三个按钮 −

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

  1. Chart Elements

  2. Chart Styles

  3. Chart Filters

有关这些按钮的详细说明,请参阅 Excel 图表教程。

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

  1. Click Chart Elements.

  2. Click Data Labels.

click data labels
  1. Click Chart Styles

  2. Select a Style and Color that suits your data.

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 及更高版本为您提供了多种选项来显示数据标签。您可以选择一个数据标签,按您喜欢的方式设置格式,然后使用克隆当前标签将格式复制到图表中的其他数据标签。

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.

  1. Click the chart.

  2. Click the DESIGN tab under CHART TOOLS.

  3. Click Quick Layout.

将显示不同的可能布局。在布局选项上移动时,图表布局将更改为特定的选项。

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.

  1. Click on a Column on the Column Chart.

  2. In the Format Data Series, click on Fill.

  3. Select Picture.

  4. Under Insert picture from, provide the filename or optionally clipboard if you had copied an image earlier.

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

< 50% 的数据为低,50% - 80% 为中等,> 80% 为高。

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 −

  1. East and West Series to Line with Markers.

  2. Low, Medium and High Series to Stacked Column.

change the chart type

您的图表如下所示。

Your chart looks as follows.

chart looks
  1. Click on one of the columns.

  2. Change gap width to 0% in Format Data Series.

formating data series

您将获得带状而不是列。

You will get Bands instead of columns.

bands

让图表更美观 -

To make the chart more presentable −

  1. Add Chart Title.

  2. Adjust Vertical Axis range.

  3. Change the colors of the bands to Green-Yellow-Red.

  4. Add Labels to bands.

最终结果是具有定义边界和跨带状显示调查结果的带状图。可以快速且清楚地从图表中看出,虽然西部地区的调查结果令人满意,但东部地区的调查结果在上一季度下降,需要引起注意。

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 charts

Thermometer Chart

如果需要表示目标值和实际值,你可以轻松地在 Excel 中创建温度计图表,该图表可以直观地显示这些值。

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
  1. Select the data.

  2. Create a Clustered Column chart.

clustered charts

你会观察到,右侧的条形图就是目标。

As you observe, the right side Column is Target.

  1. Click on a Column in the chart.

  2. Click on Switch Row/Column on the Ribbon.

target
  1. Right click on the Target Column.

  2. Click on Format Data Series.

  3. Click on Secondary Axis.

secondary axis

你会观察到主要轴和次要轴的范围不同。

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

  1. Right click the Primary Axis.

  2. In the Format Axis options, under Bounds, type 0 for Minimum and 1 for Maximum.

  3. Repeat the same for Secondary Axis.

primary and secondary axis have different ranges

主要轴和次要轴都将设置为 0% - 100%。目标列隐藏实际列。

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

  1. Right click the visible column (Target)

  2. In the Format Data Series, select No fill for FILLSolid line for BORDERBlue for Color

target column
  1. In Chart Elements, unselect Axis → Primary HorizontalAxis → Secondary VerticalGridlinesChart Title

  2. In the chart, right click on Primary Vertical Axis

  3. In Format Axis options, click on TICK MARKS

  4. For Major type, select Inside

format axis
  1. Right click on the Chart Area.

  2. In the Format Chart Area options, select No fill for FILLNo line for BORDER

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.

  1. Insert a rectangle shape superimposing the blue rectangular part in the chart.

  2. In Format Shape options, select − Gradient fill for FILLLinear for Type1800 for Angle

  3. Set the Gradient stops at 0%, 50% and 100%.

  4. For the Gradient stops at 0% and 100%, choose the color black.

  5. For the Gradient stop at 50%, choose the color white.

format shape
  1. Insert an oval shape at the bottom.

  2. Format shape with same options.

结果是我们开始使用的温度计图表。

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.

在 Excel 中,您可以通过自定义堆积柱形图类型来创建甘特图,以便它描述任务、任务持续时间和层次结构。Excel 甘特图通常使用天作为水平轴上的时间单位。

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 −

  1. Task represents the Tasks in the project

  2. Start represents number of days from the Start Date of the project

  3. Duration represents the duration of the Task

请注意,任何任务的开始都是前一个任务的开始时间加上持续时间。当任务属于分层级结构时就是这种情况。

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

gantt chart
  1. Select the data.

  2. Create Stacked Bar Chart.

stacked bar chart
  1. Right-click on Start Series.

  2. In Format Data Series options, select No fill.

format data series
  1. Right-click on Categories Axis.

  2. In Format Axis options, select Categories in reverse order.

select categories
  1. In Chart Elements, deselect LegendGridlines

  2. Format the Horizontal Axis to Adjust the rangeMajor Tick Marks at 5 day intervalsMinor Tick Marks at 1 day intervals

  3. Format Data Series to make it look impressive

  4. Give a Chart Title

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 提供瀑布图类型。如果您仍使用较早版本的 Excel,则可以使用堆积柱形图创建瀑布图。

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
  1. Prepare the data for Waterfall Chart

  2. Ensure the column Net Cash Flow is to the left of the Months Column (This is because you will not include this column while creating the chart)

  3. Add 2 columns – Increase and Decrease for positive and negative cash flows respectively

  4. Add a column Start - the first column in the chart with the start value in the Net Cash Flow

  5. Add a column End - the last column in the chart with the end value in the Net Cash Flow

  6. Add a column Float – that supports the intermediate columns

  7. Compute the values for these columns as follows

compute values
  1. In the Float column, insert a row in the beginning and at the end. Place n arbitrary value 50000. This just to have some space to the left and right of the chart

数据将如下所示。

The data will be as follows.

float column
  1. Select the cells C2:H18 (Exclude Net Cash Flow column)

  2. Create Stacked Column Chart

stacked column chart
  1. Right click on the Float Series.

  2. Click Format Data Series.

  3. In Format Data Series options, select No fill.

select no fill
  1. Right click on Negative Series.

  2. Select Fill Color as Red.

negative series
  1. Right click on Positive Series.

  2. Select Fill Color as Green.

positive series
  1. Right click on Start Series.

  2. Select Fill Color as Grey.

  3. Right click on End Series.

  4. Select Fill Color as Grey.

  5. Delete the Legend.

delete legend
  1. Right click on any Series

  2. In Format Data Series options, select Gap Width as 10% under Series Options

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.

  1. Select the data for which you want to add Sparklines.

  2. Keep an empty column to the right side of the data for the Sparklines.

sparkline

快速分析按钮显示在您选定数据的右下角。

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

quick analysis button at bottom
  1. Click on the Quick Analysis button. The Quick Analysis Toolbar appears with various options.

quick analysis toolbar options

单击 SPARKLINES 。显示的图表选项基于数据,可能有所不同。

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

click sparklines

单击 Line 。每行的折线图显示在数据右侧的列中。

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

  1. A PivotTable.

  2. A Data Table as a standalone without PivotTable.

PivotChart from PivotTable

遵循以下步骤创建枢纽图表 −

To create a PivotChart follow the steps given below −

  1. Click the PivotTable.

  2. Click ANALYZE under PIVOTTABLE TOOLS on the Ribbon.

  3. Click on PivotChart. The Insert Chart dialog box appears.

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.

  1. Click the Region Filter Control option. The Search Box appears with the list of all Regions. Check boxes appear next to Regions.

  2. Select East and South options.

filter

筛选后的数据显示在枢纽图表和数据透视表上。

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

pivotchart without pivottable

PivotChart without a PivotTable

您可以在不创建数据透视表的情况下创建单独的枢纽图表。

You can create a standalone PivotChart without creating a PivotTable.

  1. Click the Data Table.

  2. Click the Insert tab.

  3. Click PivotChart in Charts group. The Create PivotChart window appears.

  4. Select the Table/Range.

  5. Select the Location where you want the PivotChart to be placed.

您可以在现有工作表本身的单元格中,或者在新的工作表中进行选择。单击确定。

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
  1. Choose the Fields to be added to the PivotChart

  2. Arrange the Fields by dragging them into FILTERS, LEGEND (SERIES), AXIS (CATEGORIES) and VALUES

  3. Use the Filter Controls on the PivotChart to select the Data to be placed on the PivotChart

Excel 将自动创建一个耦合的数据透视表。

Excel will automatically create a coupled PivotTable.

coupled pivottable

Excel Data Analysis - Data Validation

数据验证是 Excel 中一个非常有用、易于使用的工具,使用它可以在输入工作表的数据上设置数据验证。

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

  1. Display an input message on what needs to be entered into it.

  2. Restrict the values that get entered.

  3. Provide a list of values to choose from.

  4. Display an error message and reject an invalid data entry.

考虑以下风险跟踪器,该跟踪器可用于输入和跟踪已识别的风险信息。

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.

  1. Probability

  2. Impact

  3. Risk Category

  4. Risk Source

  5. Status

“风险敞口”列将具有计算值,您不能输入任何数据。甚至连 S. No. 列都设置为具有计算值,即使您删除了一行,这些计算值也会进行调整。

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 −

  1. Start with a blank worksheet.

  2. Put the header in Row 2.

  3. Put the column headers in Row 3.

  4. For the column headers Probability, Impact and Risk Exposure − Right click on the cell.Click on Format Cells from drop down.In the Format Cells dialog box, click on Alignment tab.Type 90 under Orientation.

  5. Merge and Centre the cells in Rows 3, 4, and 5 for each of the column headers.

  6. Format Borders for the cells in Rows 2 – 5.

  7. Adjust the row and column widths.

您的工作表将如下所示 −

Your worksheet will look as follow −

worksheet result

Set Valid Values for Risk Category

在 M5 - M13 单元格中输入以下值(M5 为标题,M6 - M13 为值)

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

  1. Click the first cell under the column Risk Category (H6).

  2. Click DATA tab on the Ribbon.

  3. Click Data Validation in the Data Tools group.

  4. Select Data Validation… from the drop-down list.

select data validation

数据验证对话框出现。

The Data Validation dialog box appears.

  1. Click the Settings tab.

  2. Under Validation criteria, in the Allow: drop-down list, Select the option List.

select list
  1. Select the range M6:M13 in the Source: box that appears.

  2. Check the boxes Ignore blank and In-cell dropdown that appear.

check boxes

Set Input Message for Risk Category

  1. Click the Input Message tab in the Data Validation dialog box.

  2. Check the box Show input message when cell is selected.

  3. In the box under Title:, type Risk Category:

  4. In the box under Input message: Choose the Category of the Risk from the List.

show input message

Set Error Alert for Risk Category

要设置错误警报,请执行以下操作:

To set error alert −

  1. Click the Error Alert tab in the Data validation dialog box.

  2. Check the box Show error alert after invalid data is entered.

  3. Select Stop under Style: dropdown

  4. In the box under Title:, type Invalid Entry:

  5. In the box under Error message: type Choose a value from dropdown list.

  6. Click OK.

set error alert

Verify Data Validation for Risk Category

对于风险类别下的选定的第一个单元格,

For the selected first cell under Risk Category,

  1. Data Validation criteria is set

  2. Input message is set

  3. Error alert is set

现在,您可以验证设置。

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.

  1. Click on the dropdown button on the right side of the cell. The drop-down list appears with the values that can be selected.

  2. Cross-check the values in the drop-down list with those that are used to create the drop-down list.

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.

在单元格中键入 People,然后按 Enter。系统将显示您为该单元格设置的错误消息。

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

error message displayed
  1. Verify the Error message.

  2. You have an option to either Retry or Cancel. Verify both the options.

您已成功为该单元格设置了数据验证。

You have successfully set the Data Validation for the cell.

Note − 查看您消息的拼写和语法非常重要。

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 −

  1. You need to set the criteria for maximum number of cells that are possible to be used. In our example, it can vary from 10 – 100 based on where the worksheet will be used.

  2. You should not set the criteria for unwanted range of cells or for the entire column. This will unnecessarily increases the file size. It is called excess formatting. If you get a worksheet from an outside source, you have to remove the excess formatting, which you will learn in the chapter on Inquire in this tutorial.

按照以下步骤操作 −

Follow the steps given below −

  1. Set the validation criteria for 10 cells under Risk Category.

  2. You can easily do this by clicking on the right-bottom corner of the first cell.

  3. Hold on the + symbol that appears and pull it down.

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.

  1. Click in the first cell under the column Risk Source (I6)

  2. Click the DATA tab on the Ribbon

  3. Click Data Validation in the Data Tools group

  4. Select Data Validation… from the drop-down list.

将出现数据验证对话框。

Data Validation dialog box appears.

  1. Click the Settings tab.

  2. Under Validation criteria, in the Allow: drop-down list, select the option List.

  3. Type Internal, External in the Source: box that appears.

  4. Check the boxes Ignore blank and In-cell dropdown that appear.

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 −

  1. Data Validation criteria is set

  2. Input message is set

  3. Error alert is set

现在,您可以验证设置。

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.

  1. Click the drop-down arrow button on the right side of the cell. A drop-down list appears with the values that can be selected.

  2. Check if the values are the same as you typed – Internal and External.

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.

在单元格中键入财务并按 Enter。你会看到设置到该单元格的错误消息。

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

type financial
  1. Verify the Error message. You have successfully set the Data Validation for the cell.

  2. Set valid criteria for the Risk Source Column

  3. Apply the Data Validation criteria to the cells I6 - I15 in the Risk Source 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 Risk Source is complete.

Set Validation Values for Status

  1. Repeat the same steps that you used for setting Validation values for Risk Source.

  2. Set the List values as Open, Closed.

  3. Apply the Data Validation criteria to the cells K6 - K15 in the Status 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 status is complete.

Set Validation Values for Probability

风险概率分数值在范围 1-5 内,1 为低,5 为高。此值可以是 1 和 5 之间的任意整数(包括 1 和 5)。

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.

  1. Click in the first cell under the column Risk Source (I6).

  2. Click the DATA tab on the Ribbon.

  3. Click Data Validation in the Data Tools group.

  4. Select Data Validation… from the drop-down list.

数据验证对话框出现。

The Data Validation dialog box appears.

  1. Click the Settings tab.

  2. Under Validation criteria, in the Allow: drop-down list, select Whole number.

data validation
  1. Select between under Data:

  2. Type 1 in the box under Minimum:

  3. Type 5 in the box under Maximum:

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,

  1. Data Validation criteria is set.

  2. Input message is set.

  3. Error alert is set.

现在,您可以验证设置。

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.

在单元格中输入介于 1 和 5 之间的整数。它会出现在单元格中。

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.

在单元格中键入 6,然后按 Enter。将显示为该单元格设置的错误消息。

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.

  1. Set valid criteria for the Probability Column.

  2. Apply the Data Validation criteria to the cells E6 - E15 in the Probability 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 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.

将数据验证准则应用于“影响”列中的单元格 F6 - F15(即与“风险类别”列相同的范围)。

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

在单元格 G6 中键入 =E6*F6,然后按 Enter。

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

set column risk exposure

由于 E6 和 F6 为空,因此单元格 G6 中将显示 0。

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

将公式复制到单元格 G6 – G15 中。单元格 G6 - G15 中将显示 0。

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.

  1. Select cells G6-G15

  2. Right-click and in the dropdown list that appears, select Format Cells. The Format Cells dialog box appears.

  3. Click the Protection tab.

  4. Check the option Locked.

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.

  1. Click OK.

  2. Shade the cells G6-G15 to indicate they are calculated values.

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.

在单元格 B6 中输入 =row()-5,然后按 Enter 键。

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

format serial number values

1 会显示在单元格 B6 中。将此公式复制到单元格 B6-B15 中。会显示值 1-10。

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

values appear

对单元格 B6-B15 进行阴影填充。

Shade the cells B6-B15.

Wrap-up

你的项目几乎就完成了。

You are almost done with your project.

  1. Hide Column M that contains Data Category values.

  2. Format Borders for the cells B6-K16.

wrapup
  1. Right-click on the worksheet tab.

  2. Select Protect Sheet from the menu.

select protect sheet

“保护工作表”对话框随即显示。

The Protect Sheet dialog box appears.

  1. Check the option Protect worksheet and contents of locked cells.

  2. Type in a password under Password to unprotect sheet − Password is case sensitiveProtected sheet cannot be recovered if password is forgottenIt is a good practice to keep a list of worksheet names and passwords somewhere

  3. Under Allow all users of this worksheet to: check the box Select unlocked cells.

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.

Confirm Password ”对话框显示。

The Confirm Password dialog box appears.

confirm password
  1. Re-enter the password.

  2. Click OK.

已设置好数据验证的单元格的工作表可以使用了。

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

worksheet with data validation

Excel Data Financial Analysis

你可以轻松地使用 Excel 执行财务分析。Excel 为你提供了多个财务函数,例如 PMT、PV、NPV、XNPV、IRR、MIRR、XIRR 等,使你可以快速得出财务分析结果。

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 −

  1. A positive number represents cash received.

  2. A negative number represents cash paid out.

Present Value of a series of Future Payments

现值为未来一系列付款现在价值的总和。可以使用 Excel 函数计算现值 -

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 −

  1. PV − Calculates the present value of an investment by using an interest rate and a series of future payments (negative values) and income (positive values). At least one of the cash flows must be positive and at least one must be negative.

  2. NPV − Calculates the net present value of an investment by using a discount rate and a series of periodic future payments (negative values) and income (positive values).

  3. XNPV − Calculates the net present value for a schedule of cash flows that is not necessarily periodic.

Note that -

Note that

  1. PV cash flows must be constant whereas NPV cash flows can be variable.

  2. PV cash flows can be either at the beginning or at the end of the period whereas NPV cash flows must be at the end of the period.

  3. NPV cash flows must be periodic whereas XNPV cash flows need not be periodic.

在本部分中,您将了解如何使用 PV。您将在后面的章节中了解 NPV。

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

Example

假设您正在购买冰箱。销售人员告诉您冰箱的价格为 32000,但您可以选择在 8 年内支付这笔款项,年利率为 13%,年付款为 6000。您还可以选择在每年的年初或年末付款。

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.

您可以使用 Excel 函数 PV -

You can use Excel function PV −

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

要计算每一年的末尾支付的现值,请省略 type 或指定 type 的 0。

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

要计算每年末尾支付的现值,请为类型指定 1。

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,

  1. If you make the payment now, you need to pay 32,000 of present value.

  2. If you opt for yearly payments with payment at the end of the year, you need to pay 28, 793 of present value.

  3. If you opt for yearly payments with payment at the end of the year, you need to pay 32,536 of present value.

您可以清楚地看到,选项 2 对您有好处。

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

What is EMI?

Investopedia 将等额分期付款 (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

在 Excel 中,您可以使用 PMT 函数计算贷款的 EMI。

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

假设您想获得一笔年利率为 11.5%、贷款期限为 25 年的 5000000 的房屋贷款。您可以按照以下步骤计算您的 EMI−

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 −

  1. Calculate interest rate per month (Interest Rate per Annum/12)

  2. Calculate number of monthly payments (No. of years * 12)

  3. Use PMT function to calculate EMI

use pmt function

如您所见,

As you observe,

  1. Present Value (PV) is the loan amount.

  2. Future Value (FV) is 0 as at the end of the term the loan amount should be 0.

  3. Type is 1 as the EMIs are paid at the beginning of each month.

您将获得以下结果−

You will get the following results −

present and future value

Monthly Payment of Principal and Interest on a Loan

EMI 包括利息和一部分本金还款。随着时间的推移,EMI 的这两个组成部分会发生变化,从而减少余额。

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

  1. The interest part of your monthly payments, you can use the Excel IPMT function.

  2. The payment of principal part of your monthly payments, you can use the Excel PPMT function.

例如,如果您以年利率 16% 借入了一笔 1,000,000 的贷款,期限为 8 个月。您可以获得 EMI 的值、递减的利息金额、递增的本金偿还金额以及过去 8 个月的递减贷款余额。在 8 个月结束时,贷款余额将为 0。

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 − 计算 EMI 如下。

Step 1 − Calculate the EMI as follows.

calculate emi

得出EMI为13261.59卢比。

This results in an EMI of Rs. 13261.59.

emi result

Step 2 −如下所示,接下来计算8个月中EMI的利息和本金部分。

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.

  1. Compute the cumulative interest paid between 2nd and 3rd months using the CUMIPMT function.

  2. Verify the result summing up the interest values for 2nd and 3rd months.

  3. Compute the cumulative principal paid between 2nd and 3rd months using the CUMPRINC function.

  4. Verify the result summing up the principal values for 2nd and 3rd months.

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

假设你贷款了100,000卢比,并且希望以不超过12000卢比的月供,在15个月内还完贷款。你可能会想知道需要支付多少的利率。

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.

使用Excel RATE函数,找出利率−

Find the interest rate with the Excel RATE function −

calculating interest rate

你将会得到8%的结果。

You will get the result as 8%.

calculating interest rate result

Calculating Term of Loan

假设你以10%的利率贷款了100,000卢比。你想设置不超过15,000卢比的月供。你可能会想知道多久才能还清贷款。

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.

用NPER的Excel函数找出付款笔数

Find the number of payments with Excel NPER function

excel nper function

你将会得到12个月的结果。

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.

首先,我们来看 regular, periodical cash flows 的情况。

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

在n年中的不同时间点收到的现金流的净现值(n可以是分数)为 1/(1 + r)n ,其中的r是年利率。

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.

考虑以下在3年时间段范围内的两种投资。

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

decisions on investments

从表面上看,投资 1 看起来比投资 2 好。然而,只有当你了解截至今天的投资的真实价值时,你才能决定哪项投资更好。你可以使用 NPV 函数来计算回报。

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

  1. At the end of every year.

  2. At the beginning of every year.

  3. In the middle of every year.

NPV 函数假设现金流在年底发生。如果现金流在不同的时间发生,则你必须在 NPV 计算中考虑到特定因子。

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.

假设现金流在年底发生。然后你可以直接使用 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

正如你观察到的,投资 2 的 NPV 高于投资 1 的 NPV。因此,投资 2 是一个更好的选择。你之所以得到这个结果,是因为与投资 1 相比,投资 2 的现金流出在以后的期间。

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

假设现金流在每年的年初发生。在这种情况下,你不应在 NPV 计算中包含第一个现金流,因为它已经表示当前价值。你需要将第一个现金流添加到从其余现金流中获得的 NPV 中以获得净现值。

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

假设现金流在每年的年中发生。在这种情况下,你需要将从现金流中获得的 NPV 乘以 $\sqrt{1+r}$ 以获得净现值。

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.

但是,在 Excel 中,你可以使用 XNPV 函数轻松进行此类计算。

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

  1. Arrange your data with the dates and the cash flows.

Note − 数据中的第一个日期应该是所有日期中最早的日期。其他日期可以按任何顺序出现。

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

  1. Use the XNPV function to calculate the net present value.

cash flows at irregular intervals

您将获得以下结果−

You will get the following results −

cash flows at irregular intervals result

假设今天的日期是 2015 年 3 月 15 日。正如你所观察到的,所有现金流日期都是以后的日期。如果你想找出今天的净现值,请在数据顶部包含它,并为现金流指定 0。

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)

一项投资的内部收益率 (IRR) 是 NPV 为 0 时的利率。它是正现金流的现值正好补偿负现金流的利率值。当贴现率为 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.

考虑以下现金流、不同的利率和对应的 NPV 值。

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

internal rate of return

正如你在利率 10% 和 11% 的值之间观察到的,NPV 的符号发生变化。当你将利率微调到 10.53% 时,NPV 几乎为 0。因此,IRR 为 10.53%。

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

可以使用Excel函数IRR计算现金流的IRR。

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

calculate irr

如你之前看到的那样IRR是10.53%

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

对于给定的现金流,IRR可能会-

For the given cash flows, IRR may −

  1. exist and unique

  2. exist and multiple

  3. not exist

Unique IRR

如果IRR存在并且唯一,则可用于在若干种可能性中选择最佳投资。

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

  1. If the first cash flow is negative, it means the investor has the money and wants to invest. Then, the higher the IRR the better, since it represents the interest rate the investor is receiving.

  2. If the first cash flow is positive, it means the investor needs money and is looking for a loan, the lower the IRR the better since it represents the interest rate the investor is paying.

要判断IRR是否是唯一的,就改变猜测值并计算IRR。如果IRR保持不变,那么它是唯一的。

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

正如你所观察的那样,IRR对不同的猜测值具有唯一的一个值。

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

unique value

Multiple IRRs

在某些情况下,你可能有许多IRR。考虑以下现金流。使用不同的猜测值计算IRR。

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

你可以看到有两种IRR—— -9.59%和216.09%。你可以通过计算净现值来验证这两个IRR。

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

calculating npv

对于 -9.59%和216.09%,净现值都是0。

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

No IRRs

在某些情况下,你可能没有IRR。考虑以下现金流。使用不同的猜测值计算IRR。

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

no irrs

对于所有猜测值,你都将得到结果#NUM。

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

no irrs result

结果#NUM表示所考虑的现金流没有IRR。

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

Cash Flows Patterns and IRR

如果现金流中只有一个符号变化,例如从负到正或从正到负,那么就保证有一个唯一的IRR。例如,在资本投资中,第一个现金流将会是负值,而其余现金流将是正值。在这种情况下,会出现唯一的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.

如果现金流中有多个符号变化,IRR可能就不存在。即使存在,也可能不唯一。

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

许多分析师更喜欢使用IRR,并且它是一个流行的盈利能力衡量标准,因为作为百分比,它易于理解并且易于与所需回报进行比较。然而,使用IRR做决策时存在一些问题。如果你按IRR排序,并根据这些排名做出决策,你最终可能会做出错误的决策。

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.

你已经看到净现值将使你能够做出财务决策。然而,当项目相互排斥时,IRR和净现值并不总是会导致同样的决策。

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 是那些选择一个项目排除接受另一个项目。当被比较的项目相互排斥时,净现值和IRR之间可能出现排名冲突。如果你必须在项目A和项目B之间进行选择,净现值会建议接受项目A,而IRR可能建议项目B。

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.

由于以下原因之一可能会出现 NPV 和 IRR 之间此类型的冲突 -

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

  1. The projects are of greatly different sizes, or

  2. The timing of the cash flows are different.

Projects of significant size difference

significant size

如果您想通过 IRR 做出决策,则项目 A 的收益率为 100,项目 B 的收益率为 50。因此,投资项目 A 看起来很划算。但是,由于项目规模不同,这是一个错误的决定。

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 −

  1. You have 1000 to invest.

  2. If you invest entire 1000 on project A, you get a return of 100.

  3. If you invest 100 on project B, you will still have 900 in your hand that you can invest on another project, say project C. Suppose you get a return of 20% on project C, then the total return on project B and project C is 230, which is way ahead in profitability.

因此,在这些情况下,NPV 是做出决策的更好方法。

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

Projects with different cash flows timings

different cash flows

同样,如果您考虑通过 IRR 来决策,项目 B 将会是选择。但是,项目 A 具有更高的 NPV,并且是理想的选择。

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)

有时您的现金流可能是间隔无规律。在这种情况中,您不能使用 IRR,因为 IRR 需要间距相等的间隔。您可以使用 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

得到的内部收益率为 26.42%。

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

internal rate

Modified IRR (MIRR)

考虑当您的融资利率与再投资率不同的时候。如果您通过 IRR 计算内部收益率,它假设融资和再投资的利率相同。此外,您也可能获得多个 IRR。

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

正如您所看到的,NPV不止一次为 0,导致多个 IRR。此外,再投资率未被考虑在内。在这些情况下,您可以使用修正后的 IRR (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

您将获得以下显示的 7% 的结果 -

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

modified irr result

Note - 与 IRR 不同,MIRR 始终是唯一的。

Note − Unlike IRR, MIRR will always be unique.

Working with Multiple Sheets

在某些情况下,你可能需要

In certain situations, you might have to

  1. Set up workbooks in which several worksheets have a similar format or structure.

  2. Get information for these worksheets from another worksheet.

  3. Summarize the results from these worksheets into a summary worksheet.

例如,你可能需要按区域明智和按月明智在单独的工作表中跟踪销售信息。每个产品价格都是从公司中独立的工作表中设置的产品目录中提取的。最后,你必须将所有区域的结果汇总到一个汇总表格中。

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.

在本章中,你将学习如何通过简单的步骤完成此操作。你将汇总 2015 年 4 月至 2016 年 3 月(即 2015-16 财政年度)的结果。

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 −

  1. Start with a blank workbook.

  2. Set up product catalog worksheet with products and prices.

  3. Name the worksheet Product Catalog.

  4. Assume the catalog is revised on the first of every month.

  5. Provide a place holder for last updated on.

销售时产品的价格由产品的当前成本决定。

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.

  1. Add 4 blank worksheets.

  2. Name the worksheets East, North, South and West.

multiple worksheets with same structure

这四个工作表应该具有相同的结构。

These four worksheets should have the same structure.

  1. Click the tab East. The East worksheet opens.

  2. Press the shift key and click on the tab West. All the 4 tabs will be selected.

select tabs

现在,您在 East 工作表中所做的任何编辑都将自动反映在其他三个选中的工作表中。

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

在 East 工作表中,

In the East worksheet,

  1. Add the column headers – S. No., Month, Product, Price, No. of Units, Total Amount.

  2. Add the S. No., Month April and the 4 Product Names.

  3. Format the Table.

east worksheet

相同结构出现在其他工作表 North、South 和 West 中。

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 −

  1. Define names for the price values of the products in the product catalog worksheet.

  2. Set the Scope as Workbook for all the names.

create formula
  1. Once again select all the four worksheets – East, North, South and West.

  2. In the East worksheet, for each product, in the price column, give the formula as the Price Value Name.

正如我们之前定义的一样,产品价格按照每月 1 日更新的产品目录设定。

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
  1. Repeat the same steps for each Month

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 −

  1. Fill No. of Units sold.

  2. Calculate the corresponding Total Amount as Price*No. of Units.

calculate total amount

在每个工作表(东部、北部、南部和西部)中,按月计算小计——

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

calculate subtotals

Note ——您可以在单个工作表中使用小计,但不能在多个工作表中使用。因此,您必须对北部、南部和西部工作表重复此步骤。

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

单击大纲级别 2。您将获得全部按月计算的总计。

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.

  1. Add a worksheet and name it Summary.

  2. Create the structure for Summary worksheet.

summarizing data

在列 Total Sales 中,在单元格 C3 中,键入 = sum(

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

total sales
  1. Select the worksheet East.

  2. Select the cell G7.

  3. With East tab pressed, click the tab West.

  4. The tabs East to West get selected.

  5. The formula in the formula bar appears as

=sum(‘East:West’!G7)

=sum(‘East:West’!G7)

select worksheet east

请注意,您仍处于 East 工作表中。按 Enter 键。

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

您将进入 Summary 工作表。在公式栏中,您将看到公式为

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

=SUM(East:West!G7)

=SUM(East:West!G7)

计算值显示在单元格 C3 中。

The calculated value appears in the cell C3.

calculated value in cell
  1. Copy the formula to the cells C4 to C14.

  2. Click Show Formulas in the Formula Auditing group under the FORMULAS tab.

将显示“Total Sales”列中的所有公式。

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.

  1. Click in the cell C15.

  2. Type =sum(C3:C14)

summarize results

您的汇总结果已在“Summary”工作表中准备好。

Your summarized results are ready in the Summary worksheet.

summarized results ready

Excel Data Analysis - Formula Auditing

您可能想要检查公式的准确性或找出错误的根源。Excel 公式审计命令为您找到以下内容提供了简便的方法

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

  1. Which cells are contributing in the calculation of a formula in the active cell.

  2. Which formulas are referring to the active cell.

这些发现通过箭头线使用图形方式显示,让可视化变得容易。您可以使用单一命令显示活动工作表中的所有公式。如果您的公式引用不同工作簿中的单元格,同时也打开该工作簿。Excel 不能转到未打开的工作簿中的单元格。

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.

  1. Click FILE > Options.

  2. In the Excel Options dialog box, click Advanced.

  3. In Display options for the workbook − Select the workbook.Check that under For objects, show, All is selected.

  4. Repeat this step for all the workbooks you are auditing.

setting the display options

Tracing Precedents

先决单元格是活动单元格中引用公式的那些单元格。

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

在以下示例中,活动单元格是 C2。在 C2 中,您有公式 =B2*C4

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

B2 和 C4 是 C2 的先决单元格。

B2 and C4 are precedent cells for C2.

tracing precedents

若要追踪单元格 C2 的先决单元格,

To trace the precedents of the cell C2,

  1. Click in the cell C2.

  2. Click the Formulas tab.

  3. Click Trace Precedents in the Formula Auditing group.

trace precedents

一条从 B2 到 C2 的箭头,另一条从 C4 到 C2 的箭头将显示,追踪先决单元格。

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.

  1. Click in a cell that does not contain a formula or click in an empty cell.

  2. Click Trace Precedents in the Formula Auditing group.

您将收到一条消息。

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.

在下面的示例中,C2 的公式为 =B2*C4 。因此,C2 是单元格 B2 和 C4 的一个相关单元格

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

tracing dependents

要追踪单元格 B2 的相关单元格

To trace the dependents of the cell B2,

  1. Click in the cell B2.

  2. Click the Formulas tab.

  3. Click Trace Dependents in the Formula Auditing group.

trace dependents in formula auditing

会出现从 B2 到 C2 的箭头,表示 C2 依赖于 B2。

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

要追踪单元格 C4 的相关单元格

To trace the dependents of the cell C4 −

  1. Click in the cell C4.

  2. Click the Formula tab > Trace Dependents in the Formula Auditing group.

会出现从 C4 到 C2 的另一个箭头,表示 C2 也依赖于 C4。

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

trace dependents of cell

单击公式审核组中的 Remove Arrows 。工作表中的所有箭头都会消失。

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

Note - 要追踪单元格的相关单元格,该单元格应由另一个单元格中的公式引用。否则,您将收到错误消息。

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.

  1. Click in the cell B6 is not referenced by any formula or click in any empty cell.

  2. Click Trace Dependents in the Formula Auditing group. You will get a 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
  1. Click in a cell under Pass Category in Exam Results table.

  2. Click Trace Precedents. The cell to its left (Marks) and the range E4:F8 will be mapped as the precedents.

  3. Repeat for all the cells under Pass Category in Exam Results table.

exam results table
  1. Click in a cell under Pass Category in Student Grades table.

  2. Click Trace Dependents. All the cells under Pass Category in Exam Results table will be mapped as the dependents.

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
  1. Click the FORMULAS tab on the Ribbon.

  2. Click Show Formulas in the Formula Auditing group. The Formulas in the worksheet will appear, so that you will know which cells contain formulas and what the formulas are.

show formula
  1. Click in a cell under TotalSales.

  2. Click Trace Precedents. A worksheet icon appears at the end of the arrow. The worksheet icon indicates that the precedents are in a different worksheet.

click trace precedents

双击箭头。一个 Go TO 对话框会出现,显示先例。

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.

  1. Click a reference of one of the precedents.

  2. The reference appears in the Reference box.

  3. Click OK. The worksheet containing that precedent appears.

Evaluating a Formula

要逐个步骤了解单元格中复杂公式的工作原理,您可以使用求值公式命令。

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

考虑单元格 C14 中的公式 NPV(年中)。公式是

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

=SQRT (1 + C2)*C10

=SQRT (1 + C2)*C10

  1. Click in the cell C14.

  2. Click the FORMULAS tab on the Ribbon.

  3. Click Evaluate Formula in the Formula Auditing group. The Evaluate Formula dialog box appears.

evaluating formula

Evaluate Formula 对话框中,该公式显示在求值下的框中。通过多次单击 Evaluate 按钮,可以逐个步骤对公式进行求值。带下划线的表达式将始终是接下来要执行的表达式。

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

此处,C2 在公式中带下划线。所以,它在下一步中求值。单击 Evaluate

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

click evaluate button

单元格 C2 的值为 0.2。因此,C2 将被求值为 0.2。 1+0.2 带下划线,表明它是下一步。单击 Evaluate

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 将被求值为 1.2。 SQRT(1.2) 带下划线,表明它是下一步。单击 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) 将评估为 1.09544511501033。 C10 带有下划线表示为下一步。单击 Evaluate

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

evaluate sqrt

C10 将评估为 4976.8518518515。

C10 will be evaluated as 4976.8518518515.

1.09544511501033*4976.8518518515 带有下划线表示为下一步。单击 Evaluate

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

restart button

1.09544511501033*4976.8518518515 将评估为 5,451.87。

1.09544511501033*4976.8518518515 will be evaluated as 5,451.87.

没有要评估的表达式,这是答案。 Evaluate 按钮将改为 Restart 按钮,表示评估完成。

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

单元格中的计算结果为错误 #DIV/0!。

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

  1. Click in the cell C5.

  2. Click the FORMULAS tab on the Ribbon.

  3. Click the arrow next to Error Checking in the Formula Auditing group. In the drop-down list, you will find that Circular References is deactivated, indicating that your worksheet has no circular references.

  4. Select Trace Error from the drop-down list.

select trace error

蓝色箭头指示计算活动单元格所需的单元格。

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

activate cell
  1. Click Remove Arrows.

  2. Click the arrow next to Error Checking.

  3. Select Error Checking from the drop-down list.

select error checking

将显示 Error Checking 对话框。

The Error Checking dialog box appears.

error checking dialog box

观察以下内容 −

Observe the following −

  1. If you click Help on this error, Excel help on the error will be displayed.

  2. If you click Show Calculation Steps, Evaluate Formula dialog box appears.

  3. If you click Ignore Error, the Error Checking dialog box closes and if you click Error Checking command again, it ignores this error.

  4. If you click Edit in Formula Bar, you will be taken to the formula in the formula bar, so that you can edit the formula in the cell.

Excel Data Analysis - Inquire

你可以使用 Inquire 来−

You can use Inquire to −

  1. Compare two workbooks.

  2. Analyze a workbook for problems or inconsistencies.

  3. View the links between workbooks.

  4. View the links between worksheets.

  5. View the relationships between cells.

  6. Clean excess cell formatting.

  7. Manage passwords.

INQUIRE 选项卡将位于功能区中。如果你在功能区上找到了 INQUIRE 选项卡,则可以跳到下一部分。

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

如果你在功能区上找不到 INQUIRE 选项卡,请激活 Inquire 加载项。

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

  1. Click File > Options.

  2. In Excel Options window, click on Add-Ins.

  3. In Manage box, click on COM Add-ins.

  4. Click Go.

inquire tab

将显示 COM 加载项对话框。

COM Add-Ins dialog box appears.

com addins
  1. Check the Inquire box.

  2. Click OK. Now, Inquire Add-In is active. You will find the INQUIRE tab on the Ribbon.

INQUIRE Commands

我们来了解一下 INQUIRE 命令。

Let us learn about the INQUIRE commands.

单击 INQUIRE 选项卡。您将找到以下命令 -

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

  1. Workbook Analysis

  2. Workbook Relationship

  3. Worksheet Relationship

  4. Cell Relationship

  5. Compare Files

  6. Clean Excess Cell Formatting

  7. Workbook Passwords

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 −

  1. Open two workbooks that you want to compare.

  2. Click on INQUIRE tab on the Ribbon.

  3. Click on Compare Files in the Compare group.

comparing two workbooks
  1. The Select Files To Compare dialog box appears.

  2. Check the file names displayed in the boxes next to Compare and To.

select files to compare
  1. If any File name that is displayed is not the one you wanted, click the down-arrow next to that File name.

  2. Only the workbooks that are open will be displayed.

workbooks displayed
  1. Select the File.

  2. Check if the order of Files in Compare and To is OK.

compare file
  1. If the order is not OK, click Swap Files. The order of Files in Compare and To gets changed.

  2. Click Compare.

click compare

比较结果将显示在两个窗格网格中 -

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

  1. The workbook on the left corresponds to the "Compare" file you have chosen.

  2. The workbook on the right corresponds to the "To" file you have chosen.

工作簿对比工作簿中变更的详细信息将显示在这些两个网格下面的窗格中。变更内容将根据变更类型以颜色突出显示。突出显示颜色的图例显示在下左窗格中。

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

单击功能区上的 Resize Cells to Fit 查看比较和到工作簿中的单元格内容。两个工作簿中的单元格均已调整大小,以便内容可见。

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

此时将出现另存为对话框。可以将结果另存为 Excel 工作簿。请注意,仅 .xlsx 文件类型可用。

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

可以使用 Workbook Analysis 命令创建一个交互式报告,该报告可以显示关于工作簿及其结构、公式、单元格、区域和警告的详细信息。

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.

  1. Click the Inquire tab on the Ribbon.

  2. Click Workbook Analysis in the Report group.

workbook analysis

在工作簿分析完成后,将显示报表。

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

workbook analysis completed

该报表包含以下六个类别 −

The Report has the following six categories −

  1. Summary − General information about the structure and content of the workbook.

  2. Workbook (with subcategories) − General workbook statistics.

  3. Formulas (with subcategories) − Specific information about formulae in the workbook.

  4. Cells (with subcategories) − Specific information about cells in the workbook.

  5. Ranges (with subcategories) − Specific information about ranges in the workbook.

  6. Warnings − Several types of warnings about workbook structure and content.

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 −

  1. All formulas are 224 in number.

  2. With numeric values, they are 224 in number.

  3. Click Sub-Category With numeric values.

在结果窗格中,对于带有数字值的公式的每个单元格,将显示工作表名称、单元格地址和公式。

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

results pane

单击 Excel 导出按钮。将出现另存为对话框。

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

excel export button
  1. Save the Report as an Excel file.

  2. Load Export File button appears next to Excel Export button.

  3. Click on Load Export File button.

load export file

保存的报告 Excel 工作簿将打开,您能清晰地查看工作簿的分析结果。

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.

图表中的链接类型可以包括其他工作簿、Access 数据库、文本文档、HTML 页面、SQL Server 数据库和其他数据源。

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

  1. Click the INQUIRE tab on the Ribbon.

  2. Click Workbook Relationship in the Diagram group.

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.

  1. Click the INQUIRE tab on the Ribbon.

  2. Click Worksheet Relationship in the Diagram group.

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.

  1. Click the INQUIRE tab on the Ribbon.

  2. Click Cell Relationship in the Diagram group.

cell relationship

单元格关系图选项对话框出现。

The Cell Relationship Diagram Options dialog box appears.

  1. Check Span sheets and Span workbooks.

  2. Select Trace both under Trace cell precedents and Trace cell dependents.

  3. Under Initial number of expansion levels, select limited and type 5 in the box next to it.

  4. Click OK.

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

当你发现一个工作簿加载得比较慢,或者变为了非常大的大小,它可能应用了不需要的行或列格式(例如,条件格式化包含少于15个值的整个列)。

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).

你可以使用清除多余的单元格格式化命令来删除多余的格式化并大幅减小文件大小。这还可以提升Excel的运行速度。

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.

在清除多余的单元格格式化之前,创建你的Excel文件的备份副本,因为在某些情况下此流程可能增加你的文件大小,并且没有办法撤销更改。

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.

  1. Click the INQUIRE tab on the Ribbon.

  2. Click Clean Excess Cell Formatting in the Miscellaneous group.

cleaning excess cell formattingformatting

清除多余的单元格格式化对话框出现。在 Apply to 框中选择所有工作表。

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.

  1. Click the INQUIRE tab on the Ribbon.

  2. Click Workbook Passwords in the Miscellaneous group.

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 提供了几种命令、功能和工具,这些命令、功能和工具可以轻松完成复杂的数据分析任务。借助 Excel,您可以轻松执行各种复杂的计算。在本教程中,您将了解 Excel 中多功能的数据分析工具。您将逐步了解数据分析,其中包含相关示例、说明以及每一步的操作截图。

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

您可能必须合并来自各种源的数据并展示一份报告。数据可以位于同一工作簿或不同工作簿的工作表中。借助 Excel 数据工具“合并”,您可以用一些简单的步骤执行此操作。

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 −

  1. Find the input values that result in a specified value. The result could be set up as a formula with the input values as variables. By varying the values of the input variables, Excel provides the solution with the Goal Seek Tool.

  2. Find the possible output values by varying the values of one or two variables. The result could be set up as a formula with one or two input values as variables. By varying the values for the input variables, Excel provides the solution with the Data Table Tool.

  3. Find the possible output values that are a result of varying the values of more than two variables. The result could be set up as a formula with the input values as variables. By varying the values for the input variables, Excel provides the solution with the Scenario Manager Tool.

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 具有一个求解器加载项,它可以帮助您解决此类复杂问题。

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

Importing Data into Excel

您的数据分析可能依赖于各种外部数据源。在 Excel 中,您可以从不同数据源导入数据,例如 Microsoft Access 数据库、Web 页面、文本文件、SQL Server 表、SQL Server 分析立方体、XML 文件等。

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.

您可以同时从数据库导入任意数量的数据表。当您从关系数据库(例如 Access)导入多个表时,表之间现有的关系也会保留在 Excel 中。在导入数据的同时,您还可以选择基于该数据创建数据透视表、数据透视图或 Power View 报表。

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.

您可以只创建与数据源的数据连接,或将数据导入到 Excel 中。如果您将数据导入到 Excel 中,则这些数据表将被添加到 Excel 中的数据模型中。

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

Excel 中的数据模型用来集成当前工作簿中的多个表的数据和/或来自导入数据的表的数据和/或通过数据连接连接到工作簿的数据源的数据。数据模型在数据透视表、数据透视图、PowerPivot 和 Power View 报告中以透明的方式使用。

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.

  1. You can create a Data Model while importing data, or from the Excel tables in the workbook.

  2. The data tables in the Data Model can be viewed either in Data View or Diagram View.

  3. With a Data Model, you can create relationships among the data tables.

  4. You can either use the Create Relationship command or just click and drag and connect the fields in the two tables that define the relationship in the diagram view of the Data Model.

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.

您可以使用多个表中的字段创建一个数据透视表,前提是这些表已经定义了关系。如果不存在关系,Excel 会提示您创建一个,并且您可以从数据透视表本身创建。您定义的这个关系反映在数据模型中。

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

您可以使用 PowerPivot 访问、分析和报告来自各种数据源的数据。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 为您提供了管理数据模型、将 Excel 表添加到数据模型、在数据表中添加计算字段、定义 KPI 等命令。

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 提供对大型数据的交互式探索、可视化和分析。由于其多功能可视化选项,您一定可以找到为您的数据提供完美平台的数据,您可以在其中探索数据、汇总和报告。

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.

从表格到地图,它只是可视化您的数据,对其进行筛选、分析和交互式报告的玩法。此外,您可以在同一 Power View 工作表上有多个可视化效果,当您单击其中任何一个数据点的某个数据点时,这些效果会反映和突出显示值。

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.

您可以使用表格、矩阵、卡片、不同类型的图表、倍数、地图和磁贴在 Power View 中探索数据。一旦您获得实际经验,您将对这些不同视图的多功能性着迷。这是因为它很容易制作突出显示重要值并动态切换视图的交互式报告。

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

如果您的数据具有层次结构,它们可以在 Power View 中反映的数据模型中定义,或在 Power View 本身中构建层次结构。

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

您可以根据要在 Power View 中显示的内容来制定报告布局。您可以添加反映公司徽标或企业视图的背景图像。或者,您可以设置报告的背景格式,使其看起来更优雅。

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)

关键绩效指标通常用于评估绩效。在 Excel 中,您可以在 PowerPivot 或 Power View 中定义和描绘 KPI。KPI 的图形化呈现会提升您的报表。

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.

您需要知道:在任何时候,如何设置一个合并来自您设置的数据源的汇总工作表。在 Excel 中,您可以使用 Data Tool – Consolidate 轻松完成此任务,仅需几个步骤。

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 −

  1. Each range of data is on a separate worksheet.

  2. Each range of data is in list format, with labels in the first row.

  3. Additionally, you can have labels for the categories, if applicable, in the first column.

  4. All the ranges of data have the same layout.

  5. All the ranges of data contain similar facts.

  6. There are no blank rows or columns within each range.

在数据源是外部的情况下,确保将预定义的布局用作 Excel 模板的形式。

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 −

  1. One worksheet per region – i.e. four worksheets with names East, North, South, and West. These could be in the same workbook or different workbooks.

  2. Each worksheet has same layout, representing the details of product, number of units, and amount.

  3. You need to consolidate the data product wise. Hence, ensure that the column with the label Product is the first column and it contains the Product labels.

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 − 确保每个地区的数据位于单独的工作表上。

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

separate worksheet

Step 2 − 添加一个新工作表并将其命名为“Summary”。

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

Step 3 − 单击“Summary”工作表。

Step 3 − Click the Summary worksheet.

Step 4 − 单击要放置汇总结果的单元格。

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

Step 5 − 单击功能区上的 DATA 选项卡。

Step 5 − Click the DATA tab on the Ribbon.

Step 6 − 单击 Data Tools 组中的 Consolidate 按钮。

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

Consolidate 对话框会出现。

The Consolidate dialog box appears.

consolidate dialog box

Step 7 − 从 Function 下面的下拉列表中选择 Sum

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

Step 8 − 如下所示从每个工作表中选择数据。

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

  1. Click the icon in the box under Reference.

  2. Select the worksheet – East.

  3. Select the data range.

  4. Again, click the icon in the box under Reference.

选定的范围显示在参照方框中 −

The selected range appears in the Reference box −

reference box

Step 9 − 点击方框右边的 Add 按钮。在 All References 下的方框中显示选定的数据范围。

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 − 对剩余数据工作表(北方、南方和西方)重复步骤 1-5。合并对话框如下所示。

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

您会看到数据范围按照 All references 下的方框中的字母顺序以工作表的形式显示。

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

Step 11 − 选中 Use labels in 下的方框 Top rowLeft column 。点击确定。

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 − 选中合并对话框中的方框 - Create links to 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 − 单击包含名为香皂的产品值的行的轮廓上的“+”号,您可以看到新列包含按区域划分的每组产品值合并值。

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 − 打开包含相应数据的工作簿,例如,工作簿 - East-Sales、North-Sales、South-Sales和West-Sales。

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

Step 2 − 打开一个新工作簿。

Step 2 − Open a new workbook.

Step 3 − 在新的工作簿上,点击您希望摘要显示的单元格。

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

Step 4 − 点击功能区上的数据标签。

Step 4 − Click the DATA tab on the Ribbon.

Step 5 − 在数据工具方框中点击“合并”。

Step 5 − Click Consolidate in the Data Tools box.

Consolidate 对话框出现。在合并对话框中 −

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

  1. Select Sum from the dropdown list in the box under Function.

  2. Click the icon in the box under Reference.

  3. Select the workbook – East-Sales.xlsx.

  4. Select the data range.

  5. Again, click the icon in the box under Reference.

  6. Click the Add button to the right.

合并对话框显示如下 −

The Consolidate dialog box looks as follows −

consolidate
  1. Click the icon to the right of the box under References.

  2. Select the workbook – North-Sales.xlsx.

  3. Select the data range.

  4. Again, click the icon to the right of the box under References.

  5. Click Add.

Step 6 − 重复步骤 1-6 以从工作簿 – South-Sales.xlsx 和 West-Sales.xlsx 添加数据范围。

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

Step 7 − 在 Use labels in 中,勾选以下方框。

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

  1. Top row.

  2. Left column.

Step 8 − 勾选 Create links to source data 方框。

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 是更改单元格中的值的过程,以查看这些更改如何影响工作表上公式的结果。你可以在一个或多个公式中使用多组不同的值来探索所有不同的结果。

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 分析在进行数据分析时在许多情况下很有用。例如 −

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

  1. You can propose different budgets based on revenue.

  2. You can predict the future values based on the given historical values.

  3. If you are expecting a certain value as the result from a formula, you can find different sets of input values that produce the desired result.

Excel 为你提供了可以根据你的数据分析需求使用的以下 what-if 分析工具 −

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

  1. Data Tables

  2. Scenario Manager

  3. Goal Seek

数据透视表和场景采用输入值集并向前预测,以确定可能的结果。目标寻求与数据透视表和场景不同,因为它采用一个结果并向后预测以确定产生该结果的可能输入值。

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.

在本章中,你将了解可以使用 what-if 分析工具的可能情况。有关这些工具的用法详细信息,请参阅本教程后面的章节。

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

Data Table 是一个单元格范围,你可以在其中更改一些单元格中的值,并提出解决问题的不同答案。例如,你可能想通过分析不同的贷款金额和利率来了解你能负担得起多少房屋贷款。你可以将这些不同的值与数据表中的 PMT 函数放在一起并获得所需结果。

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.

数据表仅适用于 one or two variables ,但它可以接受这些变量的许多不同值。

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

有关数据表的详细信息,请参阅本教程中的章节 – What-If Analysis with Data Tables

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

Scenario Manager

场景是 Excel 保存并可以在工作表的单元格中自动替换的一组值。

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

主要功能 −

The key features are −

  1. You can create and save different groups of values on a worksheet and then switch to any of these new scenarios to view different results.

  2. A scenario can have multiple variables, but it can accommodate only up to 32 values.

  3. You can also create a scenario summary report, which combines all the scenarios on one worksheet. For example, you can create several different budget scenarios that compare various possible income levels and expenses, and then create a report that lets you compare the scenarios side-by-side.

  4. Scenario Manager is a dialog box that allows you to save the values as a scenario and name the scenario.

有关方案的详细信息,请参阅本教程中的第 What-If Analysis with Scenario Manager 章。

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

Goal Seek

如果您知道从公式中想要的结果,但无法确定公式需要什么输入值才能得到该结果,那么目标寻值将很有用。例如,如果您想借一笔贷款,并且您知道贷款金额、贷款期限以及可以支付的等额每月分期付款 (EMI),那么可以使用目标寻值来找到可以获得该贷款的利率。

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.

有关如何使用目标寻值,请参阅本教程中的第 What-If Analysis with Goal Seek 章。

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

Solver

求解器作为加载项随 Excel 提供。您可以使用求解器找到工作表上称为目标单元格的单元格中公式的最佳值。

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.

有关如何使用 Excel 求解器加载项,请参阅本教程中的第 Optimization with Excel Solver 章。

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

使用 Excel 中的数据表,您可以轻松地改变一个或两个输入并执行假设分析。数据表是一组单元格,您可以在其中更改某些单元格中的值,并针对问题想出不同的答案。

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 −

  1. One-variable Data Tables

  2. Two-variable Data Tables

如果您的分析问题中有多个变量,您需要使用 Excel 的情景管理器工具。有关详细信息,请参阅本教程中的章节 - What-If Analysis with Scenario Manager

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

有一笔 5,000,000 美元的贷款,期限为 30 年。您想了解不同利率的每月还款 (EMI)。您可能还想知道第二年支付的利息和本金金额。

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 - 设置所需的背景。

Step 1 − Set the required background.

Step 2 - 创建数据表。

Step 2 − Create the Data Table.

Step 3 - 执行分析。

Step 3 − Perform the Analysis.

让我们仔细了解这些步骤:

Let us understand these steps in detail −

Step 1: Set the required background

  1. Assume that the interest rate is 12%.

  2. List all the required values.

  3. Name the cells containing the values, so that the formulas will have names instead of cell references.

  4. Set the calculations for EMI, Cumulative Interest and Cumulative Principal with the Excel functions – PMT, CUMIPMT and CUMPRINC respectively.

您的工作表应如下所示:

Your worksheet should look as follows −

set required background

您可以看到,C 列中的单元格的名称与 D 列相应单元格中给出的名称相同。

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

  1. Type the list of values i.e. interest rates that you want to substitute in the input cell down the column E as follows −

create data table
  1. Type the first function (PMT) in the cell one row above and one cell to the right of the column of values. Type the other functions (CUMIPMT and CUMPRINC) in the cells to the right of the first function. Now, the two rows above the Interest Rate values look as follows −

type functions
below data table

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

  1. Select the range of cells that contains the formulas and values that you want to substitute, i.e. select the range – E2:H13.

  2. Click the DATA tab on the Ribbon.

  3. Click What-if Analysis in the Data Tools group.

  4. Select Data Table in the dropdown list.

do analysis

出现 Data Table 对话框。

Data Table dialog box appears.

  1. Click the icon in the Column input cell box.

  2. Click the cell Interest_Rate, which is C2.

data table

您可以看到列输入单元格被视为 $C$2。单击确定。

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

如果您能支付 54,000 的 EMI,您可以观察到 12.6% 的利率适合您。

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

有一笔 50,000,000 的贷款。您想知道利率和贷款期限的不同组合将如何影响每月还款额 (EMI)。

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 - 设置所需的背景。

Step 1 − Set the required background.

Step 2 - 创建数据表。

Step 2 − Create the Data Table.

Step 3 - 执行分析。

Step 3 − Perform the Analysis.

Step 1: Set the required background

  1. Assume that the interest rate is 12%.

  2. List all the required values.

  3. Name the cells containing the values, so that the formula will have names instead of cell references.

  4. Set the calculation for EMI with the Excel function – PMT.

您的工作表应如下所示:

Your worksheet should look as follows −

set background

可以看到,列 C 中的单元格被命名为列 D 中相应单元格中的名称。

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

  1. Type =EMI in cell F2.

type emi
  1. Type the first list of input values, i.e. interest rates down the column F, starting with the cell below the formula, i.e. F3.

  2. Type the second list of input values, i.e. number of payments across row 2, starting with the cell to the right of the formula, i.e. G2. The Data Table looks as follows −

type input values

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

  1. Select the range of cells that contains the formula and the two sets of values that you want to substitute, i.e. select the range – F2:L13.

  2. Click the DATA tab on the Ribbon.

  3. Click What-if Analysis in the Data Tools group.

  4. Select Data Table from the dropdown list.

perform analysis

“数据表格”对话框将出现。

Data Table dialog box appears.

  1. Click the icon in the Row input cell box.

  2. Click the cell NPER, which is C3.

  3. Again, click the icon in the Row input cell box.

  4. Next, click the icon in the Column input cell box.

  5. Click the cell Interest_Rate, which is C2.

  6. Again, click the icon in the Column input cell box.

column input cell box

您将看到,行输入单元格取为 $C$3,而列输入单元格取为 $C$2。单击确定。

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

如果您能支付 54,000 的 EMI,那么利率为 12.2%,288 期 EMI 适合您。这意味着贷款期限将为 24 年。

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

每次包含数据表的电子表格重新计算时,即使数据表没有更改,也会对数据表重新计算。若要加快包含数据表的工作表的计算速度,则需要更改计算选项,在下一部分中将为此提供说明,以 Automatically Recalculate 工作表,但是不更改数据表。

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 −

  1. From Excel Options.

  2. From the Ribbon.

From Excel Options

  1. Click the FILE tab on the Ribbon.

  2. Select Options from the list in the left pane.

“Excel 选项”对话框出现。

Excel Options dialog box appears.

  1. From the left pane, select Formulas.

  2. Select the option Automatic except for data tables under Workbook Calculation in the Calculation options section. Click OK.

excel options

From the Ribbon

  1. Click the FORMULAS tab on the Ribbon.

  2. Click the Calculation Options in the Calculations group.

  3. Select Automatic Except for Data Tables in the dropdown list.

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 −

  1. Varying as many as 32 input sets.

  2. Merging the scenarios from several different worksheets or workbooks.

如果你想分析超过 32 组输入,并且这些值仅代表一到两个变量,你可以使用数据表。尽管它仅限于一到两个变量,但数据表可以包含任意数量不同的输入值。请参阅本教程中的 What-If Analysis with Data Tables

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

情景是一组由 Excel 保存的可以在工作表中自动替换的值。你可以在工作表上将不同组的值创建并保存为情景,然后在这些情景之间切换以查看不同的结果。

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 −

  1. That incorporates information from all the scenarios.

  2. That lets you compare the scenarios side-by-side.

Scenario Manager

情景管理器是 Excel 中的假设分析工具之一。

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 − 定义初始值的集合,并找出您想要改变的输入单元格,称为可变单元格。

Step 1 − Define the set of initial values and identify the input cells that you want to vary, called the changing cells.

Step 2 − 创建每个情景,命名情景,并为该情景的每个可变输入单元格输入值。

Step 2 − Create each scenario, name the scenario and enter the value for each changing input cell for that scenario.

Step 3 − 选择您想要跟踪的输出单元格,称为结果单元格。这些单元格包含初始值集合中的公式。这些公式使用可变输入单元格。

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 −

  1. Define the cells that contain the input values.

  2. Name the input cells appropriately.

  3. Identify the input cells with constant values.

  4. Specify the values for the constant inputs.

  5. Identify the input cells with changing values.

  6. Specify the initial values for the changing inputs.

  7. Define the cells that contain the results. The result cells contain formulas.

  8. Name the result cells appropriately.

  9. Place the formulas in the result cells.

考虑前面的贷款示例。现在,按照以下步骤进行 -

Consider the previous example of loan. Now, proceed as follows −

  1. Define a cell for Loan Amount. This input value is constant for all the scenarios. Name the cell Loan_Amount. Specify the value as 5,000,000.

  2. Define the cells for Interest Rate, No. of payments and Type (Payment at the beginning or end of the month). These input values will be changing across the scenarios. Name the cells Interest_Rate, NPER and Type. Specify the initial values for the analysis in these cells as 12%, 360 and 0 respectively.

  3. Define the cell for the EMI. This is the result value. Name the cell EMI. Place the formula in this cell as − =PMT (Interest_Rate/12, NPER, Loan_Amount, 0, Type)

您的工作表如下所示 -

Your worksheet looks as shown below −

define cells

您会看到输入单元格和结果单元格在 C 列中,名称如 D 列中给出的那样。

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 −

  1. Click the DATA tab on the Ribbon.

  2. Click What-if Analysis in the Data Tools group.

  3. Select Scenario Manager from the dropdown list.

creating scenarios

将出现“情景管理器”对话框。您会看到其中包含一条消息 -

The Scenario Manager Dialog box appears. You can observe that it contains a message −

“No Scenarios defined. Choose Add to.”

“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 −

  1. Click the Add button in the Scenario Manager Dialog box.

将出现 Add Scenario 对话框。

The Add Scenario dialog box appears.

  1. Under Scenario Name, type Scenario 1.

  2. Under Changing Cells, enter the references for the cells i.e. C3, C4 and C5 with the Ctrl key pressed.

对话框名称更改为“编辑情景”。

The name of the dialog box changes to Edit Scenario.

  1. Edit the text in the Comment as – Initial Values box.

  2. Select the option Prevent changes under Protection and then click OK.

prevent changes

将出现 Scenario Values 对话框。您定义的初始值将出现在每个改变单元格框中。

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

Scenario 1 with the initial values is created.

创建三个不同场景,如下所示,场景中的值各不相同:

Create three more scenarios with varying values in the changing cells as follows −

  1. Click the Add button in the Scenario Values dialog box.

将显示“添加方案”对话框。请注意,“C3、C4、C5”将显示在“变化单元格”框中。

Add Scenario dialog box appears. Note that C3, C4, C5 appear in the Changing cells box.

  1. In the Scenario Name box, type Scenario 2.

  2. Edit the text in the Comment as – Different Interest Rate.

  3. Select Prevent changes under Protection and click OK.

select prevent changes

将显示 Scenario Values 对话框。初始值将显示在改变单元格中。将 Interest_Rate 的值更改为 0.13 ,然后单击 Add

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

将显示 Add Scenario 对话框。请注意,“C3、C4、C5”将显示在“变化单元格”下的框中。

The Add Scenario dialog box appears. Note that C3, C4, C5 appear in the box under changing cells.

  1. In the Scenario Name box, type Scenario 3.

  2. Edit the text in the Comment box as – Different no. of Payments.

  3. Select Prevent changes under Protection and click OK.

scenario name box

将显示“方案值”对话框。初始值将显示在改变单元格中。将 NPER 的值更改为 300,然后单击 Add

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

将显示 Add Scenario 对话框。请注意,“C3、C4、C5”将显示在“变化单元格”框中。

The Add Scenario dialog box appears. Note that C3, C4, C5 appear in the Changing cells box.

  1. In the Scenario Name box, type Scenario 4.

  2. Edit the text in the Comment box as – Different Type of Payment.

  3. Select Prevent changes under Protection and click OK.

add scenario dialog box

将显示 Scenario Values 对话框。初始值将显示在改变单元格中。将“类型”的值更改为 1。单击“确定”,因为您已添加所有要添加的方案。

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

Scenario Manager 对话框出现。在情景下的框中,你将找到你已创建的所有情景的名称。

The Scenario Manager dialog box appears. In the box under Scenarios, You will find the names of all the scenarios that you have created.

  1. Click Scenario 1. As you are aware, Scenario 1 contains the initial values.

Scenario Summary Reports

Excel 提供两种类型的“情景摘要”报表 -

Excel provides two types of Scenario Summary reports −

  1. Scenario summary.

  2. Scenario PivotTable report.

在“情景摘要”对话框中,你可以找到这两个“报表”类型。

In the Scenario Summary dialog box, you can find these two Report types.

选择“报表类型”下的“情景摘要”。

Select Scenario summary under Report type.

select scenario summary

Scenario Summary

Result cells 框中,选择单元格 C6 (在此,我们已放置 PMT 函数)。单击“确定”。

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 −

  1. Changing Cells − Enlists all the cells used as changing cells. As you have named the cells, Interest_Rate, NPER and Type, these appear to make the report meaningful. Otherwise, only cell references will be listed.

  2. Result Cells − Displays the result cell specified, i.e. EMI.

  3. Current Values − It is the first column and enlists the values of that scenario which is selected in the Scenario Manager Dialog box before creating the summary report.

  4. For all the scenarios you have created, the changing cells will be highlighted in gray.

  5. In the EMI row, the result values for each scenario will be displayed.

可以通过显示在创建情景时添加的注释,使报表更有意义。

You can make the report more meaningful by displaying the comments that you added while creating the scenarios.

  1. Click the + button to the left of the row containing the scenario names. The comments for the scenarios appear in the row under the scenario names.

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 −

  1. Assume that the scenarios are in the workbooks, Bank1_Scenarios, Bank2_Scenarios and Bank3_Scenarios. Open the three workbooks.

  2. Open the Master workbook, in which you have the initial values.

  3. Click DATA > What-if Analysis > Scenario Manager in the Master workbook.

出现 Scenario Manager 对话框。

The Scenario Manager Dialog box appears.

scenarios from different sources

正如你所见,没有场景,因为你尚未添加任何场景。单击 Merge

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 −

  1. Book

  2. Sheet

你可以从特定工作簿中选择包含场景的特定工作表,这些场景想要添加到你的结果中。单击 Book 的下拉箭头以查看工作簿。

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 − 对应的文件应在列表中打开以显示。

Note − The corresponding workbooks should be open to appear in this list.

merge scenarios dialog box

选择文件 – Bank1_Scenarios

Select the book – Bank1_Scenarios.

显示 Bank1 工作表。在对话框底部,显示源工作表中找到的场景数。单击确定。

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

单击 Merge 按钮。 Merge Scenarios 对话框将显示。现在,从“文件”框的下拉列表中选择 Bank2_Scenarios

Click the Merge button. The Merge Scenarios dialog box appears. Now, select Bank2_Scenarios from the drop-down list in the Book box.

显示 Bank2 工作表。在对话框底部,显示源工作表中找到的场景数。单击确定。

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

出现 Scenario Manager 对话框。合并到“主”工作簿中的四个场景在“场景”下按列表展示。

The Scenario Manager Dialog box appears. The four scenarios that were merged into the Master workbook are listed under Scenarios.

scenarios

单击 Merge 按钮。 Merge Scenarios 对话框显示。现在,从“文件”框的下拉列表中选择 Bank3_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 工作表。在对话框底部,将显示源工作表中找到的场景数。单击确定。

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.

单击“摘要”按钮。出现 Scenario Summary 对话框。

Click the Summary button. The Scenario Summary dialog box appears.

  1. Select Scenario summary.

  2. In the Result cells box, type C6 and click OK.

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.

  1. Click DATA > What-if Analysis > Scenario Manager from the Data Tools group. The Scenario Manager Dialog box appears. The list of scenarios appear.

  2. Select the scenario you want to display. Click Show.

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.

  1. Click the Summary button in the Scenario Manager Dialog box. The Scenario Summary dialog box appears.

  2. Select the Scenario PivotTable report under Report type.

  3. Type C6 in the Result cells box.

scenario pivottable report

方案数据透视表报告将显示在一个新工作表上。

Scenario PivotTable report appears on a new worksheet.

scenario pivottable report on worksheet

What-If Analysis with Goal Seek

目标寻址是一种 What-If 分析工具,它有助于您找到导致您想要的目标值的一个输入值。 Goal Seek 要求使用输入值,以在目标值中给出结果的公式。然后,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.

目标寻址仅适用于一个变量输入值。如果您有一个以上的输入值要确定,则必须使用求解器加载项。请参阅本教程中的章节– Optimization with Excel Solver

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

假设您想获得 5,000,000 的贷款,您想在 25 年内还清。您可以支付 50000 的 EMI。您想要知道可以借贷什么利率的贷款。

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.

您可以使用 Goal Seek 找到借贷利率,如下所示 −

You can use Goal Seek to find the interest rate at which you can borrow the loan as follows −

Step 1 −按如下步骤设置 Goal Seek 的 Excel 单元格。

Step 1 − Set up the Excel cells for Goal Seek as given below.

goal seek

Step 2 − 在与列 D 对应的列 C 中输入值。单元格 Interest_Rate 保持为空,因为您必须检索该值。此外,虽然您知道您可以支付的 EMI(50000),但您不必使用 Excel PMT 函数就能得出 EMI,因此该值未包含在内。目标寻址需要一个查找结果的公式。PMT 函数被放置在单元格 EMI 中以便 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 使用 PMT 函数计算 EMI。表格现在如下所示 −

Excel computes the EMI with the PMT function. The table now looks like −

computes emi

由于 Interest_Rate 单元格为空,因此 Excel 将该值视为 0 并计算 EMI。您可以忽略结果 -13,888.89

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 − 在功能区上转到 DATA > What If Analysis > Goal Seek

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 - 在 Set cell 框内输入 EMI。此框为公式所在单元格的引用,在这种情况下为 PMT 函数。它是 C6 单元格,您将其命名为 EMI。

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 - 在 To value 框内输入 -50000。在此处,您将获得公式结果,在这种情况下,为您希望支付的 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 - 在 By changing cell 框内输入 Interest_Rate。此框引用包含您希望调整的值的单元格,在这种情况下为利率。它是 C2 单元格,您将其命名为 Interest_Rate。

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 - 目标寻址工具更改的单元格必须由您在“设置单元格”框中指定的单元格内的公式引用。单击“确定”。

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

正如您所看到的,目标寻址工具使用 C6 单元格(包含公式)找到了利率,显示为 C2 单元格中的 12%。单击“确定”。

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

假设有一家书店,库存中有 100 本书。该书的原价为 250,并且已经以该价格售出一定数量的书。稍后,书店宣布对该书提供 10% 的折扣,并清仓了库存。您可能想要知道以原价售出了多少本书,以获得 24,500 的总收入。

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 - 按照以下方式设置工作表。

Step 1 − Set the worksheet as given below.

solving story problems

Step 2 - 转到功能区的 DATA > What If Analysis > Goal Seek

Step 2 − Go to DATA > What If Analysis > Goal Seek on the Ribbon.

将出现“目标寻址”对话框。

The Goal Seek dialog box appears.

Step 3 - 在“设置单元格”框、“目标值”框和“更改单元格”框中分别输入 Revenue, 24500 and Books_OriginalPrice 。单击“确定”。

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

如果以原价出售了 80 本书,收入将为 24500。

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

收入 – 支出 = 0

Revenue – Expenses = 0

您可以在 Excel 中执行 break-even analysis with Goal Seek

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 −

  1. Fixed cost of the store.

  2. Unit cost of the toy.

  3. Number of toys to be sold.

你需要找出他们应该以什么价格售出玩具才能达到收支平衡。

You need to find at which price they should sell the toys to break even.

Step 1 - 按照以下方式设置工作表。

Step 1 − Set the worksheet as given below.

set worksheet

Step 2 − 转到功能区的 DATA > What If Analysis > Goal Seek 。将出现“目标寻求”对话框。

Step 2 − Go to DATA > What If Analysis > Goal Seek on the Ribbon. The Goal Seek dialog box appears.

Step 3 − 分别在“设置单元格”框、“目标值”框和“更改单元格”框中键入 Break_even_Point, 0, and Unit_Price 。单击“确定”。

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

正如你观察到的,目标寻求给出的结果表明,如果单价为 35,商店将收支平衡。

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 是 Microsoft Excel 加载项,可用于优化假设分析。

Solver is a Microsoft Excel add-in program you can use for optimization in what-if analysis.

根据 O’Brien 和 Marakas 所述, optimization 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.

在 Excel 中,可以使用 Solver 查找公式中一个单元(称为目标单元)的 optimal value (最大值或最小值,或某个值),同时还须符合工作表中其他公式单元的值的某些约束或限制。

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 −

  1. Determining the monthly product mix for a drug manufacturing unit that maximizes the profitability.

  2. Scheduling workforce in an organization.

  3. Solving transportation problems.

  4. Financial planning and budgeting.

Activating Solver Add-in

在使用 Solver 查找问题的解决方案之前,请确保 Solver Add-in 已在 Excel 中激活,如下所示 −

Before you proceed with finding solution for a problem with Solver, ensure that the Solver Add-in is activated in Excel as follows −

  1. Click the DATA tab on the Ribbon. The Solver command should appear in the Analysis group as shown below.

activating solver addin

如果您找不到 Solver 命令,请按照以下步骤将其激活 −

In case you do not find the Solver command, activate it as follows −

  1. Click the FILE tab.

  2. Click Options in the left pane. Excel Options dialog box appears.

  3. Click Add-Ins in the left pane.

  4. Select Excel Add-Ins in the Manage box and click Go.

select excel addins

将出现“加载项”对话框。选中 Solver Add-in ,然后单击“确定”。现在,您应该能够在功能区中的“数据”选项卡下找到 Solver 命令。

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 addin

Solving Methods used by Solver

根据问题的类型,您可以选择 Excel Solver 支持的以下三种求解方法之一 −

You can choose one of the following three solving methods that Excel Solver supports, based on the type of problem −

LP Simplex

用于线性问题。在以下条件下, Solver 模型是线性的 −

Used for linear problems. A Solver model is linear under the following conditions −

  1. The target cell is computed by adding together the terms of the (changing cell)*(constant) form.

  2. Each constraint satisfies the linear model requirement. This means that each constraint is evaluated by adding together the terms of the (changing cell)*(constant) form and comparing the sums to a constant.

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 −

  1. Decision Variable Cells

  2. Constraint Cells

  3. Objective Cells

  4. Solving Method

求解器求值基于以下条件 −

Solver evaluation is based on the following −

  1. The values in the decision variable cells are restricted by the values in the constraint cells.

  2. The calculation of the value in the objective cell includes the values in the decision variable cells.

  3. Solver uses the chosen Solving Method to result in the optimal value in the objective cell.

Defining a Problem

假设您正在分析一家制造并销售某个产品的公司的利润。您被要求找到在未来两个季度可以用于广告的最大金额,上限为 20,000。每个季度的广告水平会影响以下内容 −

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 −

  1. The number of units sold, indirectly determining the amount of sales revenue.

  2. The associated expenses, and

  3. The profit.

您可以进行问题定义,如下所示−

You can proceed to define the problem as −

  1. Find Unit Cost.

  2. Find the advertising cost per Unit.

  3. Find Unit Price.

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 −

  1. No. of units available for sale in Quarter1 is 400 and in Quarter2 is 600 (cells – C7 and D7).

  2. The initial values for advertising budget are set as 10000 per Quarter (Cells – C8 and D8).

  3. No. of units sold is dependent on the advertising cost per unit and hence is budget for the quarter / Adv. Cost per unit. Note that we have used the Min function to take care to see that the no. of units sold in ⇐ no. of units available. (Cells – C9 and D9).

  4. Revenue is calculated as Unit Price * No. of Units sold (Cells – C10 and D10).

  5. Expenses is calculated as Unit Cost * No. of Units Available + Adv. Cost for that quarter (Cells – C11 and D12).

  6. Profit is Revenue – Expenses (Cells C12 and D12).

  7. Total Profit is Profit in Quarter1 + Profit in Quarter2 (Cell – D3).

接下来,您可以设置求解器的参数,如下所示:−

Next, you can set the parameters for Solver as given below −

set parameters

如您所见,求解器的参数是−

As you can observe, the parameters for Solver are −

  1. Objective cell is D3 that contains Total Profit, which you want to maximize.

  2. Decision Variable cells are C8 and D8 that contain the budgets for the two quarters – Quarter1 and Quarter2.

  3. There are three Constraint cells - C14, C15 and C16. Cell C14 that contains total budget is to set the constraint of 20000 (cell D14). Cell C15 that contains the no. of units sold in Quarter1 is to set the constraint of ⇐ no. of units available in Quarter1 (cell D15). Cell C16 that contains the no. of units sold in Quarter2 is to set the constraint of ⇐ no. of units available in Quarter2 (cell D16).

Solving the Problem

下一步是使用求解器来查找解决方案,如下所示:−

The next step is to use Solver to find the solution as follows −

Step 1 − 转到功能区的“数据”>“分析”>“求解器”。将显示“求解器参数”对话框。

Step 1 − Go to DATA > Analysis > Solver on the Ribbon. The Solver Parameters dialog box appears.

solver parameters

Step 2 − 在“设置目标”框中,选择单元格 D3。

Step 2 − In the Set Objective box, select the cell D3.

Step 3 − 选择最大值。

Step 3 − Select Max.

Step 4 − 在 By Changing Variable Cells 框中选择范围 C8:D8。

Step 4 − Select range C8:D8 in the By Changing Variable Cells box.

changing variable cells

Step 5 − 接下来,单击“添加”按钮以添加已确定的三个约束条件。

Step 5 − Next, click the Add button to add the three constraints that you have identified.

Step 6 − 出现“添加约束条件”对话框。设置以下给定的总预算约束条件,然后单击添加。

Step 6 − The Add Constraint dialog box appears. Set the constraint for total budget as given below and click Add.

add constraint

Step 7 − 设置以下给定的第一季度总销售单位数约束条件,然后单击添加。

Step 7 − Set the constraint for total no. of units sold in Quarter1 as given below and click Add.

click add

Step 8 − 设置以下给定的第二季度总销售单位数约束条件,然后单击确定。

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 − 在 Select a Solving Method 框中,选择 Simplex LP。

Step 9 − In the Select a Solving Method box, select Simplex LP.

select solving method

Step 10 − 单击求解按钮。求解器结果对话框出现。选择 Keep Solver Solution ,然后单击确定。

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 −

  1. Total Profit – 30000.

  2. Adv. Budget for Quarter1 – 8000.

  3. Adv. Budget for Quarter2 – 12000.

Stepping through Solver Trial Solutions

您可以逐步执行求解器试验求解方法,并查看迭代结果。

You can step through the Solver trial solutions, looking at the iteration results.

Step 1 − 单击求解器参数对话框中的“选项”按钮。

Step 1 − Click the Options button in the Solver Parameters dialog box.

Options 对话框会出现。

The Options dialog box appears.

Step 2 − 选中“显示迭代结果”框,然后单击确定。

Step 2 − Select the Show Iteration Results box and click OK.

show iteration

Step 3Solver Parameters 对话框出现。单击 Solve

Step 3 − The Solver Parameters dialog box appears. Click Solve.

Step 4Show Trial Solution 会出现一个对话框,并显示消息 - Solver paused, current solution values displayed on worksheet

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 - 单击继续。

Step 5 − Click Continue.

Show Trial Solution 对话框出现在每一步中,最终在找到最佳解决方案后,求解器结果对话框出现。你的工作表在每一步都更新,最终显示结果值。

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 −

  1. You can save the last selections in the Solver Parameters dialog box with a worksheet by saving the workbook.

  2. Each worksheet in a workbook can have its own Solver selections, and all of them will be saved when you save the workbook.

  3. You can also define more than one problem in a worksheet, each with its own Solver selections. In such a case, you can load and save problems individually with the Load/Save in the Solver Parameters dialog box. Click the Load/Save button. The Load/Save dialog box appears. To save a problem model, enter the reference for the first cell of a vertical range of empty cells in which you want to place the problem model. Click Save.

saving solver selections
solver parameters set

Importing Data into Excel

你可能需要使用来自不同来源的数据进行分析。在 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 −

  1. Microsoft Access Database

  2. Web Page

  3. Text File

  4. SQL Server Table

  5. SQL Server Analysis Cube

  6. XML File

你可以从数据库同时导入任意数量的表。

You can import any number of tables simultaneously from a database.

Importing Data from Microsoft Access Database

我们将学习如何从 MS Access 数据库导入数据。按照以下步骤进行操作:

We will learn how to import data from MS Access database. Follow the steps given below −

Step 1 − 在 Excel 中打开一个新的空白工作簿。

Step 1 − Open a new blank workbook in Excel.

Step 2 − 点击功能区上的“数据”选项卡。

Step 2 − Click the DATA tab on the Ribbon.

Step 3 − 在“获取外部数据”组中点击 From Access 。将出现 Select Data Source 对话框。

Step 3 − Click From Access in the Get External Data group. The Select Data Source dialog box appears.

from access

Step 4 − 选择要导入的 Access 数据库文件。Access 数据库文件的扩展名为 .accdb。

Step 4 − Select the Access database file that you want to import. Access database files will have the extension .accdb.

select access database

将出现“选择表”对话框,显示 Access 数据库中找到的表。你可以一次性导入数据库中的所有表,也可以仅根据数据分析需求导入选定的表。

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 − 选中“启用多表选择”框并选择所有表。

Step 5 − Select the Enable selection of multiple tables box and select all the tables.

enable selection

Step 6 − 点击“确定”。将出现 Import Data 对话框。

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 −

  1. Table

  2. PivotTable Report

  3. PivotChart

  4. Power View Report

你还有一个选项 - only create connection 。此外,默认选中“数据透视表报告”。

You also have an option - only create connection. Further, PivotTable Report is selected by default.

Excel 也允许你将数据放在工作簿中 −

Excel also gives you the options to put the data in your workbook −

  1. Existing worksheet

  2. New worksheet

你将会发现另一个已选择但已禁用的复选框 – Add this data to the Data Model 。每当你将数据表导入到工作簿时,它们都会自动添加到工作簿中的数据模型中。你将在后续章节中了解到更多关于数据模型的信息。

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 −

  1. If you select Table, Existing worksheet option gets disabled, New worksheet option gets selected and Excel creates as many worksheets as the number of tables you are importing from the database. The Excel tables appear in these worksheets.

  2. If you select PivotTable Report, Excel imports the tables into the workbook and creates an empty PivotTable for analyzing the data in the imported tables. You have an option to create the PivotTable in an existing worksheet or a new worksheet. Excel tables for the imported data tables will not appear in the workbook. However, you will find all the data tables in the PivotTable fields list, along with the fields in each table.

  3. If you select PivotChart, Excel imports the tables into the workbook and creates an empty PivotChart for displaying the data in the imported tables. You have an option to create the PivotChart in an existing worksheet or a new worksheet. Excel tables for the imported data tables will not appear in the workbook. However, you will find all the data tables in the PivotChart fields list, along with the fields in each table.

  4. If you select Power View Report, Excel imports the tables into the workbook and creates a Power View Report in a new worksheet. You will learn how to use Power View Reports for analyzing data in later chapters. Excel tables for the imported data tables will not appear in the workbook. However, you will find all the data tables in the Power View Report fields list, along with the fields in each table.

  5. If you select the option - Only Create Connection, a data connection will be established between the database and your workbook. No tables or reports appear in the workbook. However, the imported tables are added to the Data Model in your workbook by default. You need to choose any of these options, based on your intent of importing data for data analysis. As you observed above, irrespective of the option you have chosen, the data is imported and added to the Data Model in your workbook.

Importing Data from a Web Page

有时,你可能必须使用网站上刷新的数据。你可以将网站上的表格中的数据导入到 Excel 中。

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 − 在 Excel 中打开一个新的空白工作簿。

Step 1 − Open a new blank workbook in Excel.

Step 2 − 点击功能区上的“数据”选项卡。

Step 2 − Click the DATA tab on the Ribbon.

Step 3 − 单击 Get External Data 组中的 From WebNew Web Query 对话框将出现。

Step 3 − Click From Web in the Get External Data group. The New Web Query dialog box appears.

new web query

Step 4 − 在地址旁边的框中输入你想要从中导入数据网站的网址,然后单击转到。

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 − 网站上的数据将会出现。可以导入的表格数据旁边会有黄色箭头图标。

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 − 单击黄色图标选择你想要导入的数据。这会将黄色图标变成带有对勾的绿色方框,如下面的屏幕截图所示。

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 − 选择想要导入的内容后单击导入按钮。

Step 7 − Click the Import button after you have selected what you want.

click import button

Import Data 对话框将出现。

The Import Data dialog box appears.

import data dialog box appears

Step 8 − 指定你想要放置数据的位置,然后单击确定。

Step 8 − Specify where you want to put the data and click Ok.

Step 9 − 整理数据以作进一步分析和/或展示。

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 − 插入新工作表。

Step 1 − Insert a new worksheet.

Step 2 − 复制网页中的数据并将其粘贴到工作表中。

Step 2 − Copy the data from the web page and paste it on the worksheet.

Step 3 − 使用粘贴的数据创建一个表格。

Step 3 − Create a table with the pasted data.

copypasting data

Importing Data from a Text File

如果您在 .txt.csv.prn 文件中有数据,则可以将数据从这些文件中导入,并将它们视为文本文件。按照以下步骤操作 −

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 − 在 Excel 中打开一个新工作表。

Step 1 − Open a new worksheet in Excel.

Step 2 − 点击功能区上的“数据”选项卡。

Step 2 − Click the DATA tab on the Ribbon.

Step 3 − 单击获取外部数据组中的 From TextImport Text File 对话框随即出现。

Step 3 − Click From Text in the Get External Data group. The Import Text File dialog box appears.

importing data from text file

您可以看到接受 .prn, .txt and .csv 扩展名文本文件。

You can see that .prn, .txt and .csv extension text files are accepted.

Step 4 − 选择文件。所选文件名出现在文件名框中。打开按钮将更改为导入按钮。

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 − 单击导入按钮。 Text Import Wizard – Step 1 of 3 对话框随即出现。

Step 5 − Click the Import button. Text Import Wizard – Step 1 of 3 dialog box appears.

Step 6 − 单击选项 Delimited 以下选择文件类型,然后单击下一步。

Step 6 − Click the option Delimited to choose the file type and click Next.

delimited

Text Import Wizard – Step 2 of 3 对话框随即出现。

The Text Import Wizard – Step 2 of 3 dialog box appears.

Step 7 − 在分隔符下选择 Other

Step 7 − Under Delimiters, select Other.

Step 8 − 在其他旁边的框中,键入 |(您正在导入文本文件中的分隔符)。

Step 8 − In the box next to Other, type | (That is the delimiter in the text file you are importing).

Step 9 − 单击下一步。

Step 9 − Click Next.

text import wizard

Text Import Wizard – Step 3 of 3 对话框随即出现。

The Text Import Wizard – Step 3 of 3 dialog box appears.

Step 10 − 在此对话框中,您可以为每列设置列数据格式。

Step 10 − In this dialog box, you can set column data format for each of the columns.

set column data format

Step 11 − 完成列的数据格式化设置之后,单击完成。 Import Data 对话框随即出现。

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 −

  1. Table is selected for view and is grayed. Table is the only view option you have in this case.

  2. You can put the data either in an existing worksheet or a New worksheet.

  3. You can select or not select the check box Add this data to the Data Model.

  4. Click OK after you have made the choices.

数据显示在你指定的电子表格中。已将数据从文本文件导入到 Excel 工作簿中。

Data appears on the worksheet you specified. You have imported data from Text file into Excel workbook.

Importing Data from another Workbook

你可能必须使用其他 Excel 工作簿中的数据进行数据分析,但其他工作簿是由其他人来维护的。

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 - 单击功能区上“连接”组中的 DATA > Connections

Step 1 − Click DATA > Connections in the Connections group on the Ribbon.

出现 Workbook Connections 对话框。

The Workbook Connections dialog box appears.

workbook connections

Step 2 - 单击工作簿连接对话框中的“添加”按钮。出现 Existing Connections 对话框。

Step 2 − Click the Add button in the Workbook Connections dialog box. The Existing Connections dialog box appears.

existing connections

Step 3 - 单击 Browse for More… 按钮。出现 Select Data Source 对话框。

Step 3 − Click Browse for More… button. The Select Data Source dialog box appears.

browse more

Step 4 - 单击 New Source button 。出现 Data Connection Wizard 对话框。

Step 4 − Click the New Source button. The Data Connection Wizard dialog box appears.

data connection wizard

Step 5 - 从数据源列表中选择 Other/Advanced ,然后单击“下一步”。出现数据链接属性对话框。

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 - 设置数据链接属性如下:

Step 6 − Set the data link properties as follows −

  1. Click the Connection tab.

  2. Click Use data source name.

  3. Click the down-arrow and select Excel Files from the drop-down list.

  4. Click OK.

出现 Select Workbook 对话框。

The Select Workbook dialog box appears.

select workbook

Step 7 - 浏览到位于要导入工作簿的位置。单击“确定”。

Step 7 − Browse to the location where you have the workbook to be imported is located. Click OK.

出现具有“选择数据库和表”的 Data Connection Wizard 对话框。

The Data Connection Wizard dialog box appears with Select Database and Table.

Note - 在此情况下,Excel 会将每个要导入的工作表都当作一个表。表名称将是工作表名称。因此,为了使表名称具有实际意义,请根据需要对工作表进行命名/重命名。

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 - 单击“下一步”。出现具有“保存数据连接文件并完成”的 Data Connection Wizard 对话框。

Step 8 − Click Next. The Data Connection Wizard dialog box appears with Save Data Connection File and Finish.

save and finish

Step 9 - 单击“完成”按钮。 Select Table 对话框随即出现。

Step 9 − Click the Finish button. The Select Table dialog box appears.

select table dialog box appears

正如你所见,名称是作为 TABLE 类型导入的工作表名称。单击“确定”。

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 为你提供了选择其他各种数据源的选项。你可以按几个步骤从中导入数据。

Excel provides you options to choose various other data sources. You can import data from these in few steps.

Step 1 − 在 Excel 中打开一个新的空白工作簿。

Step 1 − Open a new blank workbook in Excel.

Step 2 − 点击功能区上的“数据”选项卡。

Step 2 − Click the DATA tab on the Ribbon.

Step 3 - 单击“获取外部数据”组中的 From Other Sources

Step 3 − Click From Other Sources in the Get External Data group.

importing data from other sources

带有各种数据源的下拉列表随即出现。

Dropdown with various data sources appears.

dropdown

你可以将任何一种这些数据源中的数据导入到 Excel 中。

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 - 单击功能区中的“数据”选项卡。

Step 1 − Click the DATA tab on the Ribbon.

Step 2 - 单击“获取外部数据”组中的 Existing Connections 。“现有连接”对话框随即出现。

Step 2 − Click Existing Connections in the Get External Data group. The Existing Connections dialog box appears.

Step 3 - 选择你希望从中导入数据且单击“打开”的连接。

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 - 转到功能区上的 DATA > ConnectionsWorkbook Connections 对话框随即出现。

Step 1 − Go to DATA > Connections on the Ribbon. The Workbook Connections dialog box appears.

Step 2 - 选择希望重命名的连接,并单击“属性”。

Step 2 − Select the connection that you want to rename and click Properties.

renaming data connections

Connection Properties 对话框随即出现。现有的名称显示在“连接名称”框中 -

The Connection Properties dialog box appears. The present name appears in the Connection name box −

connection properties

Step 3 - 编辑“连接名称”,并单击“确定”。数据连接将具有你所给出的新名称。

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

如你在上述部分中所见,当你将你的 Excel 工作簿连接到外部数据源时,你会希望保留工作簿中的数据,并且反映随时间对外部数据源所做的更改。

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 - 单击功能区中的“数据”选项卡。

Step 1 − Click the DATA tab on the Ribbon.

Step 2 − 单击连接组中的 Refresh All

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.

  1. If you click Refresh, the selected data in your workbook is updated.

  2. If you click Refresh All, all the data connections to your workbook are updated.

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 − 单击包含指向导入数据文件链接的表中的任意单元格。

Step 1 − Click any cell in the table that contains the link to the imported data file.

Step 2 − 单击功能区的“数据”选项卡。

Step 2 − Click the Data tab on the Ribbon.

Step 3 − 单击连接组中的“全部刷新”。

Step 3 − Click Refresh All in the Connections group.

data connections

Step 4 − 从下拉列表中选择“全部刷新”。工作簿中的所有数据连接都将得到更新。

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 − 单击包含指向导入数据文件链接的表中的任意单元格。

Step 1 − Click any cell in the table that contains the link to the imported data file.

Step 2 − 单击“数据”选项卡。

Step 2 − Click the Data tab.

Step 3 − 单击连接组中的“连接”。

Step 3 − Click Connections in the Connections group.

此时将显示“工作簿连接”对话框。

The Workbook Connections dialog box appears.

automatically refresh data

Step 4 − 单击“属性”按钮。此时将显示“连接属性”对话框。

Step 4 − Click the Properties button. The Connection Properties dialog box appears.

click properties button

Step 5 − 单击“使用”选项卡。

Step 5 − Click the Usage tab.

click usage tab

Step 6 − 选中选项 - 打开文件时刷新数据。

Step 6 − Check the option - Refresh data when opening the file.

你还有另一个选项,即 Remove data from the external data range before saving the workbook 。你可以使用此选项保存工作簿,内容包括查询定义但不包括外部数据。

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 − 单击“确定”。每当你打开工作簿时,最新数据将加载到你的工作簿中。

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 − 单击包含指向导入数据文件链接的表中的任意单元格。

Step 1 − Click any cell in the table that contains the link to the imported data file.

Step 2 − 单击功能区的“数据”选项卡。

Step 2 − Click the Data tab on the Ribbon.

Step 3 − 单击连接组中的“连接”。

Step 3 − Click Connections in the Connections group.

此时将显示“工作簿连接”对话框。

The Workbook Connections dialog box appears.

automatically refresh data at regular intervals

Step 4 −单击“属性”按钮。

Step 4 − Click the Properties button.

click the properties button

将出现“连接属性”对话框。设置如下属性−

The Connection Properties dialog box appears. Set the properties as follows −

  1. Click the Usage tab.

  2. Check the option Refresh every.

  3. Enter 60 as the number of minutes between each refresh operation and click Ok.

refresh every

你的数据将每60分钟(即每小时)自动刷新一次。

Your Data will be automatically refreshed every 60 min. (i.e. every one hour).

Enabling Background Refresh

对于非常大的数据集,请考虑运行后台刷新。这可以将 Excel 的控制权还给你,而不是让你等待几分钟或更长的时间来完成刷新。当你在后台运行查询时,可以使用此选项。但是,在此期间,你无法为为数据模型检索数据的任何连接类型运行查询。

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.

  1. Click in any cell in the table that contains the link to the imported data file.

  2. Click the Data tab.

  3. Click Connections in the Connections group. The Workbook Connections dialog box appears.

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
  1. Click Enable background refresh.

  2. Click OK. The Background refresh is enabled for your workbook.

Advanced Data Analysis - Data Model

Data Model 可用于 Excel 2013 及更高版本。在 Excel 中,您可以使用数据模型来整合当前工作簿中多个表的数据和/或来自导入的数据和/或通过数据连接连接到工作簿的数据源。

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.

使用数据模型,您可以在数据表之间创建关系。数据模型在数据透视表、数据透视图、PowerPivot 和 Power View 报告中以透明的方式使用。

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

当您从包含多个相关数据表的关系数据库(例如 Microsoft Access 数据库)中导入数据时,如果您一次导入多张表,则会自动创建数据模型。

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 −

  1. Relational databases, one table at a time

  2. Text Files

  3. Excel Workbooks

例如,当您从 Excel 工作簿导入数据时,您可以观察到 Add this data to the Data Model 选项,它具有启用的复选框。

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

可以使用 PowerPivot 命令使用 Excel 表创建数据模型。您将在后面的章节中详细学习 PowerPivot。

You can create the Data Model from Excel tables using PowerPivot commands. You will learn PowerPivot in detail in later chapters.

所有数据模型命令均在功能区的 PowerPivot 选项卡中提供。您可以使用这些命令将 Excel 表添加到数据模型。

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.

考虑以下销售数据工作簿,其中您有一个产品目录工作表,其中包含产品、产品 ID 和价格。您有四张工作表用于四个地区 - 东部、北部、南部和西部。

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 −

  1. Start with creating the Data Model.

  2. Click in the Product Catalog worksheet.

  3. Click the POWERPIVOT tab on the Ribbon.

  4. Click Add to Data Model. The Create Table dialog box appears.

  5. Select the table range.

  6. Check the box My table has headers. Click OK.

desired results

一个新窗口 - PowerPivot for Excel - <你的 Excel 文件名> 出现。

A new window – PowerPivot for Excel - <your Excel file name> appears.

以下消息出现在空白窗口的中央−

The following message appears in the center of the blank window −

message appears

您添加到数据模型的产品积压表显示为 PowerPivot 窗口中的一个工作表。表中的每一行都是一个记录,您可以使用窗口底部的左右箭头按钮来回返回记录。

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
  1. Click the Linked Table tab in the PowerPivot window.

  2. Click Go to Excel Table.

excel table

Excel 数据窗口出现。

The Excel data window appears.

  1. Click the worksheet tab – East.

  2. Click the POWERPIVOT tab on the Ribbon.

  3. Click Add to Data Model.

另一个工作表显示在 PowerPivot 窗口中,显示东部表。

Another sheet appears in the PowerPivot window displaying the East table.

对北、南和西工作表重复进行操作。总之,你已向数据模型中添加了五个表。你的 PowerPivot 窗口如下所示:

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.

  1. Click the Home tab on the Ribbon in the PowerPivot window. As you can observe, the tables are displayed in the Data View.

  2. Click Diagram View.

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.

  1. Resize each table to show all the fields in that table.

  2. Drag and arrange the tables so that all are displayed.

drag and arrange table
  1. In the East table, click on Product ID.

  2. Click the Design tab on the Ribbon.

  3. Click Create Relationship. The Create Relationship dialog box appears.

click create relationship

在“表”下面的方框中,显示“东”。在“列”下面的方框中,显示“产品 ID”。

In the box under Table, East is displayed. In the box under Column, Product ID is displayed.

  1. In the box under Related Lookup Table, select Product Catalog.

  2. Product ID appears in the box under Related Lookup Column.

  3. Click the Create button.

click create button

表示“东”表与产品积压之间的关系的线出现。

Line representing Relationship between the tables East and Product Backlog appears.

relationship between tables
  1. Repeat the same steps for the tables – North, South and West. Relationship Lines appear.

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.

  1. Click the Home tab.

  2. Click PivotTable.

  3. Select PivotTable from the drop-down list.

select pivottable

在 Excel 表窗口中,“创建数据透视表”对话框随即出现。选择“新建工作表”。

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
  1. Select Product ID from Table 1 (Product Catalog).

  2. Select Total Amount from the other four tables.

  3. For each of fields in ∑ Values, change the Custom Name in Value Field Settings to display the region names as column labels.

change custom name

总金额的总和将由你给予的标签代替。汇总了来自所有数据表的数值的 PivotTable 向你展示所需结果。

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.

  1. Click the DATA tab on the Ribbon.

  2. Click Existing Connections in the Get External Data group. The Existing Connections dialog box appears.

  3. Click the Tables tab. The names of all the tables in the workbook will be displayed.

  4. Click the name of the table you want to add to the Data Model.

adding data to data model

单击打开按钮。将显示导入数据对话框。

Click on the Open button. The Import Data dialog box appears.

open button

正如你所了解的,在导入数据表时,它会自动添加到数据模型中。新添加的表格显示在 PowerPivot 窗口中。

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 −

  1. Open a new blank workbook in Excel.

  2. Click the DATA tab on the Ribbon.

  3. Click From Access in the Get External Data group. The Select Data Source dialog box appears.

  4. Select the Access database file.

create pivottable
  1. Click the Open button. The Select Table dialog box appears, displaying the tables in the database. Access database is a relational database and the tables will be similar to Excel tables, with the exception that relationships exist among those tables.

  2. Check the box Enable selection of multiple tables.

  3. Select all the tables. Click OK.

select tables

Import Data 对话框出现。选择动态数据透视表。该选项将表导入您的 Excel 工作簿并创建一个动态数据透视表来分析导入的表。

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

您可以在短短几步内使用动态数据透视表分析来自导入的多个表的,并获得您想要的特定报表。这是因为源数据库中的表之间存在预先的关联。当您同时从数据库中导入所有表时,Excel 会在其数据模型中重新创建关联关系。

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,

  1. Click on the arrow next to that table in the PivotTable Fields list.

  2. The fields in that table will be displayed.

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 −

  1. Data for five disciplines - Archery, Diving, Fencing, Figure Skating and Speed Skating.

  2. Regions that scored more than 80 medals in these 5 disciplines.

  3. The count of medals in each of the five disciplines in each of these regions.

  4. Total count of medals for the five disciplines in each of these regions.

您可以看到,只需几个步骤即可轻松创建此报表。

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 −

  1. Drag the NOC_CountryRegion field from the Medals table to the COLUMNS area.

  2. Drag Discipline from the Disciplines table to the ROWS area.

  3. Filter Discipline to display only the five disciplines for which you wanted the report. This can be done either in the PivotTable Fields area, or from the Row Labels filter in the PivotTable itself.

  4. Drag Medal from the Medals table to the VALUES area.

  5. Drag Medal from the Medals table to the FILTERS area.

您将获得以下透视表 −

You will get the following PivotTable −

drag medal

正如您所看到的,将显示所有区域中及您选择的五项学科的奖牌数。接下来,您必须微调此报表,以便仅显示奖牌总数超过 80 的那些区域。

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.

  1. Click the arrow button to the right of Column Labels.

  2. Click Value Filters in the drop-down list that appears.

  3. Select Greater Than… from the drop-down list that appears.

greater than

将出现“值筛选器”对话框。

Value Filters dialog box appears.

value filters

正如您所看到的,奖牌数和大于将显示在 Show items for which 下方的框中。在包含大于的框旁边的框中输入 80,然后单击“确定”。

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

现在,透视表将仅显示在选定的五个科目中奖牌总数大于 80 的那些区域。

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.

向工作簿中添加包含 Sport 和 SportID 字段的新工作表。

Add a new worksheet with a table that contains Sport and SportID fields to your workbook.

sport and sportid
  1. Name the table - Sports.

  2. Click ALL in the PivotTable Fields list in the PivotTable worksheet.

sports table

您会看到新添加的表 - “运动”也在“透视表字段”列表中可见。

You can see that the newly added table- Sports is also visible in the PivotTable Fields list.

接下来,还将字段 Sport 添加到透视表,如下所示 −

Next, add the field Sport also to the PivotTable as follows −

  1. Drag the field Sport from the table Sports to ROWS area. The Sport values appear as Row labels in the PivotTable.

  2. A message will appear in the PivotTable Fields list that Relationships between tables may be needed. A CREATE button appears next to the message.

message to create relations

单击“创建”按钮。将出现“创建关系”对话框。

Click the CREATE button. The Create Relationship dialog box appears.

create relationship dialog box
  1. Select Medals under Table.

  2. Select Sport under Column.

  3. Select Sports under Related Table. Sport appears under related column.

  4. Click OK.

select sports

将学科拖到 Sport 中的 ROWS 中。这是为了定义数据透视表中的层次结构。数据透视表显示运动及其相应学科组。

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 是一个易于使用的从 Excel 中直接使用的 Data Analysis 工具。您可以使用 PowerPivot 访问和混合任何数据源中的数据。使用 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.

您可以通过 Ribbon 中的 PowerPivot 选项卡访问 PowerPivot 命令。点击 Ribbon 中的 PowerPivot 选项卡。PowerPivot 命令将显示在 Ribbon 中。您会注意到与数据模型有关的命令也将显示在这里。

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

如果您导入了表格,它们将添加到数据模型中。您可以通过 PowerPivot Ribbon 管理数据模型。您可以使用 PowerPivot 如下所示向数据模型中添加表格−

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 −

  1. Insert a new worksheet in your workbook.

  2. Copy data from the web page and paste it on the worksheet.

  3. Create a table with the pasted data.

  4. Name the table as Hosts.

  5. Rename the worksheet as Hosts.

adding tables to data model
  1. Click the table Hosts.

  2. Click the POWERPIVOT tab on the Ribbon.

  3. Click Add to Data Model in the Tables group.

tables group

表格将添加到数据模型中。PowerPivot 窗口会出现。您可在数据模型表格中找到名为 Hosts 的表格。

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

  1. Click on the POWERPIVOT tab on the Ribbon.

  2. Click on Manage in the Data Model group.

viewing tables in data model

PowerPivot 窗口将以数据视图显示。

PowerPivot window appears, in Data View.

PowerPivot 有两种视图−

PowerPivot has two views −

  1. Data View − It displays all the tables in the Data Model with fields displayed in columns and data as records in the rows, with a calculation area below each table. The table tabs look similar to the Excel worksheet tabs with names. You can move from table to table by clicking on the tabs.

  2. Diagram View − It displays all the tables as boxes with table name as caption and the fields listed in the box. You can drag the tables to align them, resize them to make all the fields visible, and create relationships by just clicking on the fields and connecting them with lines.

您将在后面的章节中更详细地了解图表视图和关系。

You will understand the Diagram View and the Relationships in detail in the later sections.

在此处,请注意 PowerPivot 窗口中显示数据模型中的所有表,无论它们是否作为工作簿中的工作表存在。

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.

您可以在 PowerPivot 窗口中的图表视图中查看表之间的关系。

You can view the relationships between tables from the diagram view in the PowerPivot window.

  1. Click Diagram View in the View group.

  2. Resize the diagram using the scroll bar so that you can see all the tables in the Data Model in the diagram.

数据模型中的所有表均显示其字段列表。表之间的关系由连接它们的线条表示。

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

您可能希望在 Medals 和 Events 表之间创建关系。为此,表中应具有一个公共字段,并且该字段在其中一个表中包含唯一值。首先,您需要验证这一点。

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.

  1. Click the Data View in the View group.

  2. Click the Events tab to view the Events table.

creating relationships

您可以观察到“事件”表中的 DisciplineEvent 字段具有唯一值(无重复值)。

You can observe that the field DisciplineEvent in the Events table has unique values (no duplicate values).

单击“奖牌”选项卡以查看“奖牌”表。DisciplineEvent 字段也可在 Medals 表中获得。因此,您可以使用 DisciplineEvent 字段创建关系,如下所示:

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 −

  1. Click Diagram View in the View group.

  2. Rearrange the tables in the view by dragging them so that Events table and Medals table are close to each other.

  3. Resize the tables so that all the fields are visible.

resize tables

单击“事件”表中的 DisciplineEvent 字段,并将其拖到“奖牌”表中的 DisciplineEvent 字段。

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 支持互动式数据探索、可视化和演示,鼓励直观的即席报告。可以使用通用可视化工具即时分析大型数据集。数据可视化也可以进行动态处理,从而便于使用单个 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.

Microsoft Excel 2013 中引入了 Power View。在使用 Power View 开始数据分析之前,请确保已启用 Power View 加载项并且该加载项在功能区中可用。

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.

单击功能区上的“插入”选项卡。Power View 应在“报表”组中可见。

Click the INSERT tab on the Ribbon. Power View should be visible in the Reports group.

power view

Creating a Power View Report

您可以从数据模型中的表创建 Power View 报表。

You can create a Power View report from the tables in the Data Model.

  1. Click the INSERT tab on the Ribbon.

  2. Click Power View in the Reports group.

Opening Power View 消息对话框会显示一个水平滚动的绿色状态栏。这可能需要一些时间。

Opening Power View message box appears with a horizontal scrolling green status bar. This might take a little while.

opening power view

Power View 表单在您的 Excel 工作簿中创建为工作表。它包含一个空 Power View 报表、过滤器占位符以及显示数据模型中的表的 Power View 字段列表。Power View 作为功能区上的一个选项卡显示在 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 −

  1. Disciplines

  2. Events

  3. Medals

假设您想显示每个国家赢得的奖牌数。

Suppose you want to display the number of medals that each country has won.

  1. Select the fields NOC_CountryRegion and Medal in the table Medals.

这两个字段将显示在“区域”中的“字段”下。Power View 将显示为一张表,其中两个选定的字段作为列。

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

Power View 显示了每个国家赢得的奖牌。要显示每个国家赢得的奖牌数,需要对奖牌进行计数。要获得奖牌计数字段,您需要在数据模型中进行计算。

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.

  1. Click PowerPivot tab on the Ribbon.

  2. Click Manage in the Data Model group. The tables in the Data Model will be displayed.

  3. Click the Medals tab.

  4. In the Medals table, in the calculation area, in the cell below the Medal column, type the following DAX formula Medal Count:=COUNTA([Medal])

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.

您会收到一条 Power View 消息,指出数据模型已更改,并且如果您单击“确定”,该更改将反映在您的 Power View 中。单击“确定”。

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

在 Power View 表单中的 Power View 字段列表中,您可以看到以下内容 −

In the Power View Sheet, in the Power View Fields list, you can observe the following −

  1. A new field Medal Count is added in the Medals table.

  2. A calculator icon appears adjacent to the field Medal Count, indicating that it is a calculated field.

  3. Deselect the Medal field and select the Medal Count field.

Power View 表按每个国家/地区显示奖牌数量。

Your Power View table displays the medal count country wise.

newly added calculated field

Filtering Power View

可以通过定义筛选器条件筛选在 Power View 中显示的值。

You can filter the values displayed in Power View by defining the filter criteria.

  1. Click the TABLE tab in the Filters.

  2. Click Medal Count.

  3. Click the icon Range file mode that is to the right of Medal Count.

  4. Select is greater than or equal to from the drop-down list in the box below Show items for which the value.

  5. Type 1000 in the box below that.

  6. Click apply filter.

在字段名称“奖牌数量”下方会出现“大于或等于 1000”。Power View 将仅显示那些奖牌数量大于或等于 1000 的记录。

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

在 Power View 工作表中,功能区上会显示两个选项卡:“POWER VIEW”和“设计”。

In the Power View sheet, two tabs – POWER VIEW and DESIGN appear on the Ribbon.

单击“ DESIGN ”选项卡。您将在功能区上的“切换可视化效果”组中找到多个可视化命令。

Click the DESIGN tab.You will find several visualization commands in the Switch Visualization group on the Ribbon.

power view visualizations

利用 Power View,您可以快速创建许多适合您的数据的不同数据可视化效果。可能的可视化效果包括表、矩阵、卡片、地图、图表类型(例如,条形图、柱形图、散点图、折线图、饼图和气泡图),以及成套的多张图表(具有相同轴的图表)。

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).

若要使用这些可视化效果来探索数据,您可以在 Power View 工作表上开始创建一个表(默认可视化效果),然后轻松地将其转换为其他可视化效果,以找到最能说明您的数据的另一种可视化效果。您可以通过从功能区上的“切换可视化效果”组中选择一种可视化效果来将一种 Power View 可视化效果转换为另一种可视化效果。

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.

在同一张 Power View 工作表上还可以有多种可视化效果,以便您可以重点突出重要字段。

It is also possible to have multiple visualizations on the same Power View sheet, so that you can highlight the significant fields.

在以下部分中,您将了解如何通过两种可视化效果(矩阵和卡片)来探索数据。您将在后续章节中详细了解如何通过其他 Power View 可视化效果来探索数据。

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 −

  1. It can be collapsed and expanded by rows and/or columns.

  2. If it contains a hierarchy, you can drill down/drill up.

  3. It can display totals and subtotals by columns and/or rows.

  4. It can display the data without repeating values.

在 Power View 中同时进行表可视化和矩阵可视化并排查看同一数据侧时,您可以看到这些视图中的差异。

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.

  1. Choose the fields – Sport, Discipline and Event. A Table representing these fields appears in Power View.

exploring data with matrix visualization

正如您所观察到的,每一项运动都有多个学科和每一项学科都有多个赛事。现在,按照以下步骤在该表格可视化的右侧创建另一个 Power View 可视化元素:

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 −

  1. Click the Power View sheet in the space to the right of the Table.

  2. Choose the fields – Sport, Discipline and Event.

表示这些字段的另一个表显示在 Power View 中,位于之前的表右侧。

Another Table representing these fields appears in Power View, to the right of the earlier Table.

choose fields
  1. Click the right Table.

  2. Click the DESIGN tab on the Ribbon.

  3. Click Table in the Switch Visualization group.

  4. Select Matrix from the drop-down list.

table represents fields

Power View 中右侧的表格被转换为矩阵。

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.

现在,您可以浏览数据以找出获得 300 枚以上奖牌的国家/地区。您还可以找出相应的运动并进行小计。

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.

  1. Select the fields NOC_CountryRegion, Sport and Medal Count in both the Table and Matrix Visualizations.

  2. In the Filters, select the filter for the Table and set the filtering criteria as is greater than or equal to 300.

  3. Click apply filter.

  4. Set the same filter to Matrix also. Click apply filter.

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.

  1. Click the Matrix Visualization that is on the right side in the Power view.

  2. Click Table in the Switch Visualization group.

  3. Select Card from the drop-down list.

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

工作簿可以包含以下数据模型和 Power View 组合。

A workbook can contain the following combinations of Data Model and Power View.

  1. An internal Data Model in your workbook that you can modify in Excel, in PowerPivot, and even in a Power View sheet.

  2. Only one internal Data Model in your workbook, on which you can base a Power View sheet.

  3. Multiple Power View sheets in your workbook, with each sheet based on a different Data Model.

如果您在工作簿中有多个 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

可以按照以下步骤在 Power View 工作表中创建和/或修改工作簿中的数据模型 -

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
  1. Create a table from the range of data in the Salesperson worksheet and name it Salesperson.

  2. Create a table from the range of data in the Sales worksheet and name it Sales.

您的工作簿中有两个表格 - Salesperson 和 Sales。

You have two tables – Salesperson and Sales in your workbook.

  1. Click the Sales table in the Sales worksheet.

  2. Click the INSERT tab on the Ribbon.

  3. Click Power View in the Reports group.

click power view

将创建 Power View 工作表放入您的工作簿中。

Power View Sheet will be created in your workbook.

您可以在 Power View 字段列表中看到,显示工作簿中的两个表格。但是,Power View 中只会显示活动表格(销售)字段,因为只有活动数据表格字段在字段列表中被选中。

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

您可以在 Power View 中看到显示销售人员 ID。假设您希望改显示销售人员姓名。

You can observe that in the Power View, Salesperson ID is displayed. Suppose you want to display the Salesperson name instead.

在 Power View 字段列表中,进行以下更改。

In the Power View Fields list, make the following changes.

  1. Deselect the field Salesperson ID in the Salesperson table.

  2. Select the field Salesperson in the Salesperson table.

由于工作簿中没有数据模型,因此这两个表格之间不存在关系。Power View 中不会显示任何数据。Excel 会显示指导您执行相关操作的消息。

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.

Create Relationship 对话框在 Power View 表格中自身打开。

The Create Relationship dialog box opens in the Power View Sheet itself.

create relationship
  1. Create a relationship between the two tables using the Salesperson ID field.

不用离开 Power View 表格,您已经成功创建以下内容:

Without leaving the Power View sheet, you have successfully created the following −

  1. The internal Data Model with the two tables, and

  2. The relationship between the two tables.

“销售人员”字段随销售数据一起显示在 Power View 中。

The field Salesperson appears in Power View along with the Sales data.

sales data
  1. Retain the fields Region, Salesperson and ∑ Order Amount in that order in the area FIELDS.

  2. Convert the Power View to Matrix Visualization.

  3. Drag the field Month to the area TILE BY. Matrix Visualization appears as follows −

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

在 Power View 中,您有许多图表选项:饼图、柱状图、条形图、折线图、散点图和气泡图。Power View 中的图表是交互式的。如果您单击一张图表中的一个值:

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 −

  1. That value in that chart is highlighted.

  2. That value in all the other charts in Power View is also highlighted.

  3. All the tables, matrices and tiles in Power View are filtered to that value.

因此,Power View 图表可用作交互式的图片式数据分析工具。此外,这些图表在演示环境中也是交互式的,这使您可以突出显示分析结果。

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.

Exploring with Line Charts

您可以使用折线图来比较一个或多个数据系列中的数据点。折线图均匀地沿着水平(分类)轴分布分类数据,沿着垂直(值)轴分布所有数值数据。

You can use Line charts for comparing data points in one or more data series. Line charts distribute category data evenly along a horizontal (category) axis, and all numerical value data along a vertical (value) axis.

假设您想要显示每个国家的奖牌数。

Suppose you want to display the Medal Count for each country.

  1. Create a Power View with the fields NOC_CountryRegion and Medal Count selected. By default, Table will be displayed.

  2. Click the Table.

  3. Click Other Chart in the Switch Visualization group.

  4. Select Line from the drop-down list. Line Chart will be displayed in the Power View.

exploring with line charts
  1. Click on the Line or the Category (x-axis) axis.

  2. Drag to left or right. The Categories to the left or right will be displayed and Line chart will be displayed accordingly.

  3. Place the cursor on any of the data points on the line.

与该数据点对应的值将显示在该点上。

The values corresponding to that data point will be displayed at that point.

data point

Exploring with Bar Charts

您可以使用条形图来比较一个或多个数据系列中的数据点。在条形图中,类别沿着垂直轴组织,而值沿着水平轴组织。在 Power View 中,有三种条形图子类型 −

You can use Bar charts for comparing data points in one or more data series. In a Bar chart, categories are organized along the vertical axis and values along the horizontal axis. In Power View, there are three Bar chart subtypes −

  1. Stacked Bar.

  2. 100% Stacked Bar.

  3. Clustered Bar.

您可以按以下方式将表可视化转换为条形图可视化:

You can convert a Table Visualization to Bar Chart Visualization as follows −

  1. Create two Table visualizations side-by-side.

  2. Click the right Table.

  3. Click Bar Chart in the Switch Visualization group.

  4. Click Stacked Bar.

exploring with bar charts

右边的表可视化会转换为条形图可视化。您会注意到,y 轴值按升序排列类别值。

The Table Visualization on the right gets converted to Bar Chart Visualization. As you observe, the y-axis values are sorted by the category values in ascending order.

bar chart visualization
  1. Take the cursor above the Bar chart. You will find – sort by NOC_CountryRegion asc.

  2. Click NOC_CountryRegion. It is changed to Medal Count.

  3. Click asc. It is changed to desc. You will find that the Bar Chart is sorted by descending Medal Count.

medal count
  1. Click the Bar with Category GER. Only that Bar will be highlighted.

  2. With Ctrl key pressed, click the Bars with Categories FRA and ITA. The Bars for GER, FRA and ITA will be highlighted.

  3. The Table on the left also shows values for these three Categories only.

ger category

在这两个可视化中,单击 Power View 字段列表中的性别字段。

In both the visualizations, click the Gender field also in the Power View Fields list.

power view fields

单击条形的左侧部分 - GER。它会高亮。在表中,只会显示 GER 和 Men 的信息。

Click the left portion of the Bar – GER. It is highlighted. In the Table, only the information for GER and Men will be displayed.

Note - 在这种情况下,您无法进行多重选择。

Note − You cannot make multiple selections in this case.

fra

Exploring with Column Charts

您可以使用柱状图来显示一段时间内的变化数据,或说明项目之间的比较。在柱状图中,类别沿水平轴,值沿垂直轴。

You can use Column charts for showing data changes over a period of time or for illustrating comparison among items. In Column charts, categories are along the horizontal axis and values along the vertical axis.

在 Power View 中,有三种柱状图子类型 -

In Power View, there are three Column chart subtypes −

  1. Stacked Column.

  2. 100% Stacked Column.

  3. Clustered Column.

您可以如下将表格可视化转换为柱状图可视化 -

You can convert a Table Visualization to Column Chart Visualization as follows −

  1. Create two Table visualizations side-by-side.

  2. Click the right Table.

  3. Click Column Chart in the Switch Visualization group.

  4. Click Stacked Column.

exploring with column charts

右侧的表格可视化转换为条形图可视化。正如您所观察到的,x 轴值按升序排列类别值。

The Table Visualization on the right is converted to Bar Chart Visualization. As you observe, the x-axis values are sorted by the category values in ascending order.

column chart visualization
  1. Take the cursor to above the Column chart. You will find – sort by NOC_CountryRegion asc.

  2. Click on NOC_CountryRegion. It gets changed to Medal Count.

  3. Click on asc. It gets changed to desc. You will find that the Column Chart is sorted by descending Medal Count.

click asc

单击类别 GER 的条形下部。它将被突出显示。

Click on the lower portion of the Bar with Category GER. It gets highlighted.

在表格中,将仅显示 GER 和男子部分的信息。

In the Table, only the information for GER and Men will be displayed.

ger information

Exploring with Simple Pie Charts

Power View 中的饼图是简单或复杂的。您将在本节中学习简单的饼图。您将在下一节学习复杂的饼图。

Pie charts in Power View are simple or sophisticated. You will learn simple Pie charts in this section. You will learn sophisticated Pie charts in the next section.

从如下创建饼图开始 -

Start with creating a Pie chart as follows −

  1. Resize the Stacked Column chart and move it upwards.

  2. Create another Table visualization below the Stacked Column chart.

  3. Click the new Table.

  4. Click Other Chart in the Switch Visualization group.

  5. Select Pie.

exploring with simple pie charts

堆叠柱形图下方的表格可视化转换为饼图可视化。正如您所观察到的,饼图中有太多切片,因为有许多类别(国家)。请注意,只有当类别数少于或等于 8 时,饼图才有用。

The Table Visualization below the Stacked Column chart is converted to Pie Chart Visualization. As you observe, there are too many slices in the Pie chart as there are many categories (countries). Note that Pie charts work well only when the number of categories is 8 or less.

pie chart visualization

您可以如下通过筛选值来减少类别的数目 -

You can reduce the number of categories by filtering the values as follows −

  1. Set the filtering as Medal Count is greater than or equal to 1300 in − Table VisualizationColumn Chart VisualizationPie Chart Visualization

Note - 您必须分别定义和应用筛选,以便可视化。

Note − You have to define and apply filtering to each of the visualizations separately.

visualizations

现在,您有一个简单的饼状图可视化,其中奖牌数量由饼大小显示,国家/地区由颜色显示。

Now, you have a Simple Pie Chart Visualization, wherein the count of Medals are shown by the Pie size, and countries by colors.

单击一个饼状图切片。该切片将高亮显示,而其他切片将变灰。柱状图中的相应列也将高亮显示。在表格中,只会显示与突出显示的饼状图切片对应值。

Click on a Pie slice. That slice is highlighted and others get grayed. The corresponding column in the Column chart also is highlighted. In the table, only the values corresponding to the highlighted Pie slice will be displayed.

click pie slice

Exploring with Sophisticated Pie Charts

您可以通过添加更多功能来使饼状图可视化变得复杂。您可以创建一个饼形图 -

You can make your Pie Chart Visualization sophisticated, by adding more features. You can make a pie char that −

  1. Drills down when you double-click a slice, or

  2. Shows sub-slices within the larger color slices.

A Pie chart that drills down when you double-click a slice

  1. In the Pie chart, in the Power View Fields list, drag the field Gender to COLOR area, to below the field NOC_CountryRegion. This means you have two categories.

  2. In the Table, include Gender also in the Fields list.

您的 Power View 如下所示 -

Your Power View looks as follows −

exploring with sophisticated pie charts

您观察到,对于每个类别都有一个单一切片和一种颜色 - 国家/地区。

As you observe, there is a single slice with one color for each category - country.

在饼状图上,双击美国切片。

On the Pie chart, double-click on the USA slice.

您的 Power View 中的饼状图将更改为显示按性别(即第二个类别)针对所选类别(美国)的值。饼状图的颜色现在显示第二个字段的百分比,即按您双击的饼状颜色进行筛选的性别。换句话说,饼状图已下钻。您观察到饼状图的右上角出现一个小箭头。如果您将鼠标悬停其上,箭头会高亮显示,并会显示上钻。

The Pie chart in your Power View will be changed to show values by Gender, which is the second category, for the selected category (USA). The colors of the pie chart now show the percentages of the second field, i.e., Gender, filtered for the pie color you doubleclicked. In other words, the Pie chart was drilled down. As you observe, a small arrow appears on the top right corner of the Pie chart. If you place the mouse over it, the arrow is highlighted and Drill up will be displayed.

click usa slice

单击上钻箭头。饼状图返回其前一个状态。

Click the drill up arrow. The Pie Chart returns to its previous state.

A Pie chart that shows sub-slices within the larger color slices

在饼状图中,在 Power View 字段列表中,将字段性别从颜色区域拖到切片区域。

In the Pie chart, in the Power View Fields list, drag the field Gender from COLOR area to SLICES area.

您的 Power View 如下所示 -

Your Power View looks as follows −

power view result

您会看到,在饼状图中,对于类别美国,有两个相同颜色的切片。

As you can see, in the Pie chart, there are two slices of same color for the category USA.

单击其中一个切片。

Click on one of these slices.

您将能够在 Power View 中看到以下更改 -

You will be able to see the following changes in Power View −

  1. The selected slice is highlighted and other slices are grayed or deactivated.

  2. The bar for the category USA displays the medal count for the selected slice.

  3. The Table shows the values for the selected slice.

highlighted selected slice
  1. Click the other slice. You can observe the changes as given above for this selected slice.

click slice

Exploring with Scatter Charts

您可以使用散点图在一张图表中显示许多相关数据。在散点图中,x 轴显示一个数值字段,y 轴显示另一个字段,从而便于查看图表中所有项目的两个值之间的关系。

You can use Scatter charts to display many related data in one chart. In Scatter charts, the x-axis displays one numeric field and the y-axis displays another, making it easy to see the relationship between the two values for all the items in the chart.

要创建散点图可视化效果,请执行以下操作:

To create a Scatter Chart Visualization, proceed as follows −

  1. Add the fields Sport, Medal Count and Event to Table.

  2. Click the arrow next to Event in the Power View Fields list. Click Count (Distinct). The field Event changes to the numeric field Count of Event. Therefore, you have one category field – Sport and two numeric fields – Medal Count and Count of Event.

  3. Click Other Chart in the Switch Visualization group.

  4. Click Scatter.

exploring with scatter charts

您将获得散点图可视化效果,数据点显示为相同大小的圆圈,显示每个运动的项目计数和奖牌数值之间的关系。

You will get the Scatter Chart Visualization, with the data points displayed as circles of same size, showing how the Count of Event and Medal Count values are related for each sport.

scatter chart visualization
  1. Click the LAYOUT tab on the Ribbon.

  2. Click Data Labels in the Labels group.

  3. Select Right from the drop-down list. The Data labels appear for the data points.

data labels

与在较少项目中获得更多奖牌的水上运动相比,摔跤运动在更多项目中获得的奖牌较少。

The sport Wrestling has less number of medals in more number of events as compared to the sport Aquatics that has more number of medals in less number of events.

Exploring with Bubble Charts

您可以使用气泡图在一张图表中显示许多相关数据。在气泡图中,x 轴显示一个数值字段,y 轴显示另一个字段,从而便于查看图表中所有项目的两个值之间的关系。第三个数值字段控制数据点的大小。

You can use Bubble charts to display many related data in one chart. In Bubble Charts, the x-axis displays one numeric field and the y-axis displays another, making it easy to see the relationship between the two values for all the items in the chart. A third numeric field controls the size of the data points.

要创建气泡图可视化效果,请执行以下操作:

To create a Bubble Chart Visualization, proceed as follows −

  1. Drag Medal Count to Size.

  2. Drag NOC_CountryRegion to ∑ X-VALUE. The Scatter chart is converted to Bubble chart.

exploring with bubble charts

如同您所观察到的,每个气泡的大小显示奖牌数。数据标签显示运动。

As you observe, the size of each bubble shows the medal count. The data labels show the Sport.

Exploring with Colors

您还可以按类别为气泡着色,如下所示:

You can also color the bubbles by a category as follows −

  1. Drag the field NOC_CountryRegion to COLOR area in the Power View Fields list.

  2. Drag the field DiscipleEvent to ∑ X-VALUES.

exploring with colors

正如你所观察到的,图例会显示处于彩色区域的分类值和各自的颜色。数据标签对应于详细信息区域的分类。数据点的尺寸由面积和尺寸进行衡量。

As you observe, Legend shows the values of the category that is in COLOR area and the respective colors. The data labels correspond to the category in DETAILS area. The size of the data points is by the area ∑ SIZE.

接下来,你可以看到图例中选择分类如何改变可视化程度——

Next, you can see how selecting a category in Legend changes the visualization −

点击图例中的一个值。此时,仅会突出显示该颜色的数据点(即,对应于该值的数据点)。所有其他数据点均会停用。

Click on a value in the Legend. Only the data points of that color (i.e., corresponding to that value) will be highlighted. All the other data points will be deactivated.

deactivate data points

正如你所观察到的,与所选国家相对应的所有运动都会显示出来,每个气泡的尺寸都代表奖牌数量。

As you observe, all the sports corresponding to the selected country are displayed and the size of each bubble represents the medal count.

如果你想了解单个数据点的详细信息——

If you want to know the details of a single data point −

  1. Highlight the data point by just clicking on that bubble.

  2. Place the cursor on that data point.

此时,只有该气泡会突出显示,而其余气泡都会变为灰色。关于该数据点的所有信息都会显示在数据点旁边的一个框内。

Only that bubble is highlighted and the rest of the bubbles get grayed. All the information about that data point will be displayed in a box next to the data point.

bubble highlighted

Exploring with Play Axis

你可以使用播放轴,按照以下步骤对一段时间的的数据更改进行可视化:

You can visualize the data changes over a period of time using Play Axis as follows −

  1. Drag the field Edition in the Power View Fields list to PLAY AXIS area.

一条播放按钮时间轴会插入到气泡图可视化中。你可以通过在筛选器中筛选 Edition 字段值来调整时间轴。如果你想关注某个特定的时间范围,或时间轴太宽,这会很有用。

A timeline with a Play button is inserted in your Bubble chart visualization. You can adjust the timeline by filtering the Edition field values in the Filters. This would be useful if you want to focus on a particular time range or if the timeline is too wide.

  1. Adjust the timeline by filtering Edition field in Filters and choosing a span of time values.

exploring with play axis
  1. Click the Play button. The bubbles travel, grows and shrink to show how the values change based on the play axis. A small vertical line appears on the timeline that moves across the timeline. The time at that point also is displayed.

click play button

你可以在任何点暂停以更详细地研究数据。

You can pause at any point to study the data in more detail.

Exploring Data with Power View Maps

你可以使用地图在地理环境中显示你的数据。Power View 中的地图使用必应地图磁贴,因此你可以像使用其他任何必应地图一样进行缩放或平移。为了使用地图,Power View 必须通过一个安全网络连接向 Bing 发送数据,以便进行地理编码。因此,它会要求你启用内容。添加位置和值会在地图上放置点。值越大,圆点越大。当你添加一个多值系列时,你会在地图上获得饼图,其大小显示总大小。

You can use maps to display your data in the context of geography. Maps in Power View use Bing map tiles, so you can zoom and pan as you would with any other Bing map. To make maps work, Power View has to send the data to Bing through a secured web connection for geocoding. So, it asks you to enable content. Adding locations and values places dots on the map. The larger the value, the bigger the dot. When you add a multivalue series, you get pie charts on the map, with the size of the pie chart showing the size of the total.

Exploring Data with Geographic Fields

如果你的数据含有一个地理字段,如国家/地区、州/省或城市,则你可以创建一个 Power View 地图可视化。

You can create a Power View Map Visualization if your data has a geographic field such as Country/Region, State/Province, or City.

要按国家/地区对奖牌数量创建一个地图可视化,请执行以下操作:

To create a map visualization for the medal count, country wise proceed as follows −

  1. Create a new Power View sheet from INSERT tab on the Ribbon.

  2. Drag the fields NOC_CountryRegion and Medal Count in the Power View Fields list to the Power View. A Table with these two fields are created.

exploring data with geographic fields

然后,你有一个地理字段和一个数字字段。

So, you have a geographic field and a numeric field.

  1. Click the DESIGN tab on the Ribbon.

  2. Click Map in the Switch Visualization group.

表视觉效果转换为地图视觉效果。

The Table Visualization converts into Map Visualization.

map visualization

正如您观察到的那样,Power View 创建了一个地图,圆点表示每个地理位置。圆点的尺寸是相应数字字段的值,在这种情况下是奖牌数量。此外,在 Power View 栏位列表中,地理栏位将位于“位置”区域,而数字栏位将位于“∑ 大小”区域。

As you observe, Power View creates a map with a dot representing each geographic location. The size of the dot is the value of the corresponding numeric field, which is the medal count in this case. Further, in the Power View Fields list, the Geographic field will be in the Locations area and the Numeric field will be in the ∑ SIZE area.

若要显示有关数据点的更多信息,您可以执行以下操作之一:

To display more information about a data point, you can do one of the following −

  1. If you place the cursor on a dot on the map, a box appears displaying the geographic location name and the corresponding numeric value.

  2. If you click on a dot on the map, that particular dot gets highlighted.

Pie Charts as Data Points

假设您还希望在地图视觉效果中添加另一个字段。例如,您可能希望显示奖牌的详细信息,例如奖牌类型——金牌、银牌和铜牌。您可以按以下方法进行操作:

Suppose you want to add another field also to the map visualization. For example, you might want to display the details about the medals, viz. the medal types – Gold, Silver and Bronze. You can do it as follows −

  1. Drag the field Medal from the Power View Fields list to the COLOR area.

圆点将转换为饼图。“奖牌”图例会显示奖牌类型和各自颜色。也就是说,饼图中的每种颜色都代表奖牌的类型。

The dots are converted to Pie charts. A Legend for Medal appears displaying the types of medals and respective colors. i.e., each color in the Pie chart represents the type of the medal.

medals

您可以观察到,饼图的大小与奖牌数量相对应,而饼图中每个扇区的大小与该类型奖牌的数量相对应。

You can observe that the size of a Pie chart corresponds to the medal count and the size of each slice in the Pie chart corresponds to the count of that medal type.

Highlighting a Data Point

现在,您可以过滤数据并突出显示重要数据点,如下:

Now, you can filter your data and highlight a significant data point as follows −

  1. In the Filters area, set the Medal Count to display only the values greater than or equal to 300.

  2. Apply the filter. The map zooms and displays only the filtered values.

highlighting data point

将鼠标光标放在代表大不列颠的圆点上。圆点会被突出显示和放大。饼图的详细信息将显示。

Place the cursor on the dot representing Great Britain. The dot gets highlighted and zoomed. The details of the Pie chart will be displayed.

cursor represents great britain

正如您所看到的,大不列颠的金牌数量为 514。您可以通过将鼠标光标放在那些扇区上找到银牌和铜牌的数量。

As you can see, the medal count for gold for Great Britain is 514. You can find the medal counts for silver and bronze by placing the cursor on those slices.

Highlighting a Pie Slice in a Data Point

接下来,您可能需要突出显示大不列颠的金牌数量。

Next, you might want to highlight the gold medal count of Great Britain.

  1. Place the cursor on the slice with red color (as you can make out that red represents gold in the Legend). Click it.

该饼图扇区将被突出显示。该饼图中的其他扇区和所有其他饼图都将停用。

That Pie Slice will be highlighted. The other slices in that Pie chart and all the other Pie charts will be deactivated.

highlighting pie slice

再次将光标放在点上。点被放大。代表金牌的部分将被突出显示。该部分的详细信息将被显示。

Place the cursor on the dot again. The dot is zoomed. The slice representing gold will be highlighted. The details of the slice will be displayed.

slice details

Exploring Data with Power View Multiples

倍数,也称为格子图,是一系列具有相同 X 和 Y 轴的图表。可以将倍数并排放置,以便轻松比较许多不同的值。

Multiples, also called Trellis Charts are a series of charts with identical X and Y axes. You can arrange Multiples side by side, to compare many different values easily at the same time.

  1. You can have Line charts, Pie charts, Bar charts and Column charts as Multiples.

  2. You can arrange the Multiples horizontally or vertically.

Line Charts as Multiples

你可能希望按各个区域每年显示奖牌数。首先,需要有年字段。为了获得此字段,需要有如下所示的计算列:

You might want to display the medal count by year for each Region. Firstly, you need to have the field Year. To get this field, you need to have a calculated column as follows −

  1. Click the Medals tab in the Data View of the Data Model (in the PowerPivot window).

  2. Click in the first cell in the right most column with the header Add Column.

  3. Type =YEAR ([Edition]) in the formula bar and press Enter.

line charts as multiples

使用对应于 Edition 列中 Year 值的值创建一个带有标题 CalculatedColumn1 的新列。

A new column with header CalculatedColumn1 is created with values corresponding to the Year values in Edition column.

calculatedcolumn1 created

单击标题并将其重命名为 Year。

Click on the header and rename it as Year.

rename year
  1. Close the PowerPivot window. The Data Model gets updated. The new field - ∑ Year appears in the Power View Fields list.

  2. Create a Table in Power View with fields NOC_CountryRegion, Count of Year and Medal Count, by dragging the fields.

create table in power view
  1. Convert Table into a Line chart in Power View.

  2. Remove the field NOC_CountryRegion. A Line chart appears with Medal Count by Year.

remove field

正如你所观察到的,Year 在 POWER VIEW 字段列表中的 AXIS 区域中,而奖牌数在 ∑ VALUES 区域中。在折线图中,Year 值在 X 轴上,奖牌数在 Y 轴上。

As you can observe, Year is in AXIS area and Medal Count is in ∑ VALUES area in Power View Fields list. In the Line chart, Year values are on X-axis and Medal count on Y-axis.

现在,可以创建带有折线图的倍数可视化,如下所示:

Now, you can create Multiples visualization with Line charts, as follows −

  1. Drag the field NOC_CountryRegion to VERTICAL MULTIPLES area in the Power View Fields list.

  2. Click the tab LAYOUT on the Ribbon.

  3. Click Grid Height in the Multiples group.

  4. Click a value in the dropdown list.

create multiples visualization
  1. Click Grid Width in the Multiples group.

  2. Click on a value from the dropdown list.

您将得到一个倍数可视化,其中折线图被安排为一个网格,每条折线图代表一个国家(NOC_CountryRegion)。

You will get the Multiples Visualization with Line charts arranged as a grid, with each Line chart representing a country (NOC_CountryRegion).

arrange multiple visualization as grid

Vertical Multiples

您知道,您已经将“NOC_CountryRegion”字段放在“垂直倍数”区域中。因此,您已经得到的可视化是垂直倍数可视化。您可以在上面的图表中观察到以下内容。

As you are aware, you have placed the NOC_CountryRegion field in the VERTICAL MULTIPLES area. Hence, the visualization that you have got is the Vertical Multiples visualization. You can observe the following in the chart given above.

  1. One Line chart per category that is placed in VERTICAL MULTIPLES area, in this case – the country.

  2. The grid height and grid width that you have chosen determine the number of rows and number of columns for the Multiples.

  3. A common x-axis for all the multiples.

  4. A similar y-axis for each row of the multiples.

  5. A vertical scroll bar on the right side that can be used to drag the rows of Line charts up and down, so as to make the other Line charts visible.

Horizontal Multiples

您还可以如下获得水平倍数的倍数可视化 -

You can have the Multiples Visualization with Horizontal Multiples also as follows −

  1. Drag the field NOC_CountryRegion to VERTICAL MULTIPLES area.

  2. Click the Layout tab on the Ribbon.

  3. Select the values for Grid Height and Grid Width in the Multiples group.

您将得到如下所示的水平倍数可视化 -

You will get the Horizontal Multiples visualization as follows −

horizontal multiples

您可以在上面的图表中观察到以下内容 -

You can observe the following in the above chart −

  1. One Line chart per category that is placed in HORIZONTAL MULTIPLES area, in this case – the country.

  2. The grid height that you have chosen determines the height of the Line charts, unlike the number of rows of Line charts as is the case in the VERTICAL MULTIPLES. In other words, there is a single row of Line charts with the height determined by the Grid Height that is chosen.

  3. The grid width that you have chosen determines the number of columns of Line charts in the row.

  4. A common x-axis for all the multiples.

  5. A common y-axis for all the multiples.

  6. A horizontal scroll bar at the bottom, below the x-axis, that can be used to drag the row of Line charts to the left and the right, so as to make the other Line charts visible.

Pie Charts as Multiples

如果你想在倍数中探索/可视化多个类别,饼图是一种选择。假设你想探索每个国家的奖牌类型获得的奖牌数。按以下步骤操作:

If you want to explore / visualize more than one category in Multiples, Pie charts is an option. Suppose you want to explore the medal count by medal type for each of the countries. Proceed as follows −

  1. Click the Design tab.

  2. Select Pie from the dropdown under Other Chart.

  3. Drag Medal to the area SLICES.

你会得到带有饼图的水平倍数可视化,因为你在 HORIZONTAL MULTIPLES 区域有 NOC_CountryRegion 字段。

You will get the Horizontal Multiples visualization with Pie charts, as you have the field NOC_CountryRegion in the area HORIZONTAL MULTIPLES.

pie charts as multiples

正如你观察到的,每个国家/地区的奖牌数都以饼状图的形式显示,饼状图的切片代表了奖牌类型,颜色如图例所示。

As you can observe the medal-count for each country is displayed as a Pie chart with the slices representing the medal types with the color as given in the Legend.

假设你想突出显示所有国家的金牌数。你可以按以下步骤一次性完成:

Suppose you want to highlight the count of gold medals for all the countries. You can do it in a single step as follows −

单击其中一个饼图的蓝色切片(根据图例,蓝色代表金牌)。在所有饼图中,只有蓝色切片高亮显示,其他切片显示为灰色。

Click on the blue color slice one of the Pie charts (as blue is color for Gold as per the Legend). In all the Pie charts, only the blue slices are highlighted and other slices are grayed.

click blue color slice

正如你观察到的,这提供了一种快速探索和比较各国金牌数的方法。

As you can observe, this gives a fast way of exploring and comparing the count of gold medals across the countries.

你可能希望在可视化中显示更多数量的饼图。你可以通过简单地切换到垂直倍数可视化并为网格高度和网格宽度选择正确的值来实现此目的,以获得正确的显示效果。

You might want to display more number of Pie charts in a visualization. You can do it by simply switching over to Vertical Multiples Visualization and choosing the right values for Grid Height and Grid Width for a proper display.

gold medals across country

单击其中一个饼图上的蓝色切片。所有饼图中的蓝色切片都高亮显示,以便你比较各国金牌数。

Click on the blue slice on one of the Pie charts. The blue slices in all the Pie charts are highlighted so that you can compare the gold medal counts across the countries.

highlight blue color slice

Bar Charts as Multiples

你也可以为倍数可视化选择条形图。

You can choose Bar charts also for Multiples visualization.

  1. Switch over to Stacked Bar visualization.

  2. Adjust the Grid Height and Grid Width to get a proper display of the Bar charts.

使用网格高度为 6 和网格宽度为 2,你将获得:

With Grid Height of 6 and Grid Width of 2, you will get the following −

bar charts as multiples

你也可以为此可视化选择聚类条形图。

You can have Clustered Bar charts also for this visualization.

clustered bar

Column Charts as Multiples

你也可以为倍数可视化选择柱状图。

You can choose Column charts also for Multiples visualization.

  1. Switch over to Stacked Column visualization.

  2. Adjust the Grid Height and Grid Width to get a proper display of the Column charts.

当网格高度为 2、网格宽度为 6 时,您将获得以下结果:

With Grid Height of 2 and Grid Width of 6, you will get the following −

column charts as multiples

对于此可视化,您也可以选择簇状柱形图。

You can have Clustered Column charts also for this visualization.

clustered column charts

Wrap-up

您选择字段取决于您想要探索、分析和展现的内容。例如,在上述所有可视化中,我们对代表按奖牌类型分析奖牌数量的切片的奖牌选择了“切片”,您可能希望按性别来探索、分析和展现数据。在这种情况下,选择性别字段作为“切片”。

The fields you choose depend on what you want to explore, analyze and present. For example, in all the visualizations above, we have chosen Medal for Slices that helped to analyze medal count by medal type. You might want to explore, analyze and present the data gender-wise. In such a case, choose the field Gender for Slices.

同样,合适的可视化还取决于您要显示的数据。如果您不确定适用性如何,您可以自行尝试选择合适的可视化,因为在 Power View 中快速而简单地切换可视化。此外,您还可以在演示视图中执行此操作,以便在演示过程中回答任何可能出现的问题。

Once again, the visualization that is suitable also depends on the data you are displaying. If you are not sure about the suitability, you can just play around to choose the right one as switching across the visualizations is quick and simple in Power View. Moreover, you can also do it in the presentation view, in order to answer any queries that can arise during a presentation.

Exploring Data with Power View Tiles

假设您有很多数据要使用不同的数据点显示,在这种情况下,您可能需要在 Power View 可视化中频繁滚动才能找到您要查找的数据。这会很繁琐,并且在您展示结果时可能也不太流畅。

Suppose you have lot of data to display with significant data points at varied places. In such a case, you might have to scroll very often in your Power View visualizations to find the data you are looking for. This would be tedious and also might not be smooth when you are presenting the results.

您可以使用 Power View 中的图块功能克服这种繁琐的任务。使用图块,您可以更快地从数据中获得见解。图块充当导航条,每个可能的字段值都有一个单独的图块。当您单击图块时,只会显示与该字段值相关的数据。由于在导航条中滚动值很容易,并且会动态改变可视化中相应的值,因此,图块成为您易于使用的工具。

You can overcome this drudgery, using the tile feature in Power View. With tiles, you can gain insights from your data much more quickly. Tiles act as navigation strips, with a single tile for each possible field value. When you click on a tile, only data related to that field value is displayed. As it is easy to scroll the values in the navigation strip that dynamically changes the corresponding values in the visualization, tiles become an easy to use tool for you.

您可以在表、矩阵、卡片或图表可视化中使用图块。您可以在 Power View 中组合这些图块并使用图块对其进行筛选。图块可以是简单的文本或图像。

You can have Tiles in a Table, Matrix, Card or Chart visualization. You can have a combination of these in Power View and get them filtered with Tiles. A Tile can be simple text or an image.

Table with Tiles

按以下步骤从表可视化开始:

Start with a Table Visualization as follows −

  1. Drag the fields NOC_CountryRegion, Sport and Medal Count to Power View. As you observe, as the number of rows is large, it is difficult to scroll up and down to highlight values.

  2. Drag the field Sport from FIELDS area to TILE BY area in the Power View Fields list.

导航条出现在表的顶部。

Navigation Strip appears at the top of the Table.

table with tiles

您可以观察到以下内容 −

You can observe the following −

  1. By default, the first Tile in the Navigation Strip is selected.

  2. In the Table, the values are filtered to that of the Tile selected. In this case, the Sport that is selected.

  3. There are arrow buttons at the left and right edges of the Navigation strip to enable scrolling.

您可以按以下步骤选择不同的图块:

You can select a different Tile as follows −

  1. Scroll the Navigation Strip to display the Tile representing the Sport you are looking for, for e.g. Badminton.

  2. Click the Tile – Badminton. The values in the Table are filtered to those of Badminton.

select different tile

您可以观察到,还会显示奖牌计数总数。您可以选择从功能区打开或关闭总数。您还可以通过用图像代替文本,使图块更具吸引力和更有意义。

You can observe the medal count Total is also displayed. You have an option to turn Totals on or off from the Ribbon. You also can make the Tiles more appealing and meaningful by having images in place of Text.

  1. Include a column that has hyperlinks to the image files corresponding to each of the Sports.

  2. Include that field, for e.g. Discimage in TILE BY. You will get the Tiles as images, portraying each sport.

include field

Tile Navigation Strip - Tab Strip

Excel 中有两种导航条——图块流和选项卡条。

There are two types of navigation strips in Excel - Tile Flow and Tab Strip.

在选项卡条中,您可以观察到以下内容:

In a Tab strip, you can observe the following −

  1. Tab strip displays the navigation strip across the top of the Visualization.

  2. By default, the first Tile in the navigation strip that is the leftmost is selected.

  3. There are arrow buttons at the left and right edges of the navigation strip to enable scrolling.

  4. You can scroll to the left or right to display the Tiles.

  5. The highlighted Tile moves to the left or right as you scroll the tab strip. It can also go out of view, while scrolling.

  6. You can click on a Tile to select it. The Tile gets highlighted at the same position as it was before.

  7. In the Table, the values are filtered to that of the Tile selected. In this case, the Sport that is selected.

Tile Navigation Strip - Tile Flow

您可以按如下操作将导航条从选项卡条转换为图块流:

You can covert the navigation strip from tab strip to tile flow as follows −

  1. Click a Tile on the navigation strip.

  2. Click the DESIGN tab on the Ribbon.

  3. Click Tile Type in the Tiles group.

  4. Click Tile Flow in the dropdown list.

tile navigation strip

导航条移至表格底部。

The navigation strip shifts to the bottom of the Table.

navigation strip shifts to bottom

在图块流中,您可以观察到以下内容:

In a Tile Flow, you can observe the following −

  1. Tile flow displays the navigation strip across the bottom of the Visualization.

  2. By default, the first Tile in the navigation strip is selected. It will be displayed at the center of the tile flow.

  3. There are no arrow buttons for scrolling.

  4. You can scroll to the left or right by clicking on any of the Tiles to the left or right of the center Tile.

  5. The Tiles flow to the left or right and the center Tile will always get highlighted.

  6. You can click on a Tile to select it. The Tile gets highlighted and moves to the center of the Tile flow.

  7. As the selected Tile is always the center Tile, the following happens − Selected Tile does not go out of view. When you scroll to the left or right, the Tile that comes to the center position gets automatically selected and highlighted. The original selection disappears. The Visualization, Table in this case, automatically is updated to the Tile in the center of the Tile flow.

  8. In the Table, the values are filtered to that of the Tile selected. In this case, the Sport that is selected.

values filtered

Matrix with Tiles

假设您想要根据奖牌类型(金牌、银牌和铜牌)以及某个选定运动的国家/地区来统计奖牌数量,则可以在矩阵平铺可视化效果中显示结果。

Suppose you want the medal count by medal type – Gold, Silver and Bronze and also the total medal count, by country for a selected sport, you can display the results in a Matrix Tile visualization.

  1. Switch Visualization to Matrix.

  2. Add the field Medal to Matrix.

您将获得以下所需结果:-

You will get the desired results as follows −

matrix with tiles

Stacked Bar Chart with Tiles

你可以通过将可视化切换为堆叠条形图平铺可视化来使所探索的结果更加清晰−

You can make your explored results more conspicuous by switching your visualization to Stacked Bar Chart Tile Visualization −

stacked bar chart with tiles

Maps with Tiles

你也可以切换到地图平铺可视化,因为你的数据包含地理位置−

As your data contains geographic locations, you can also switch over to Map Tile Visualization −

maps with tiles

Exploring Data with Hierarchies

如果您的数据具有更高级别,您能够使用层次结构来轻松浏览和展示数据。对于层次结构中的任何数据值,您能够向下钻取以显示更多详细信息,或向上钻取获得一个全面的视图。

If your data more number of levels, it would be easy for you to explore and present it with Hierarchies. For any data value in your Hierarchy, you can drill down to display more details or drill up to have a holistic view.

如果您的数据模型具有层次结构,您能够在 Power View 中使用它。否则,您能够在 Power View 中使用几个简单的步骤创建层次结构。

If your data model has a hierarchy, you can use it in Power View. Otherwise, you can create a hierarchy in the Power View itself with few easy steps.

Creating a Hierarchy in Power View

在 Power View 中,最好在矩阵可视化中描绘层次结构。按照如下方式在矩阵可视化中创建层次结构 −

In Power View a Hierarchy is best depicted in Matrix visualization. Create a Hierarchy in Matrix visualization as follows −

  1. Drag the fields NOC_CountryRegion, Sport, Discipline, Year and Medal – in that order to ROWS area.

  2. Drag the field Medal Count to ∑ VALUES. The order of the fields in the ROWS area defines the Hierarchy in Power View.

  3. If you are not sure about the order of fields, start with any order and then rearrange them in the ROWS area by dragging them up and down, while looking at the display in the Power View.

你将获得显示以下五个层次结构级别的矩阵可视化效果 −

You will get the following Matrix visualization showing the five Hierarchy levels −

creating hierarchy in power view

如你所观察,这些层次是嵌套的。

As you observe, the levels are nested.

Drilling Up and Drilling Down the Hierarchy

你可以钻取层次结构,以便一次只显示一个级别。你可以钻取详细信息和生成摘要。

You can drill up and drill down the hierarchy such that you can show just one level at a time. You can drill down for details and drill up for summary.

要启用钻取功能,首先按照以下方式设置显示级别选项 −

To enable drill up and drill down, first set up show levels option as follows −

  1. Click the DESIGN tab on the Ribbon.

  2. Click Show Levels in the Options group.

  3. Select Rows – Enable Drill Down One Level at a Time from the drop-down list.

矩阵会折叠,仅显示 1 级数据。

The Matrix collapses to display only Level 1 data.

drilling down

如你所观察,当你单击各个数据项时,该项右侧会显示一个向下箭头,表示钻取。

As you observe, when you click on each of the data items, a downward arrow appears on the right side for that item indicating drill down.

现在,你可以按以下方式一次钻取一层数据 −

Now, you can drill down the data one level at a time as follows −

  1. Click Level 1 data item for which you want further details. For example, click AUS. As you observe, Medal Count for AUS is 1079.

  2. Click on the arrow to the right side of it. Alternatively, you can double click on the data item.

  3. Level 2 data pertaining to AUS will be displayed.

drilling up and down

如你所观察,第一个项的左侧会出现一个向上箭头,表示向上钻取,当你单击各个数据项时,该项右侧会显示一个向下箭头,表示向下钻取。

As you observe, an upward arrow appears on the left side of the first item, indicating drill up and when you click on each of the data items, a downward arrow appears on the right side for that item indicating drill down.

现在,你可以按以下方式再向下钻取一层数据 −

Now, you can drill down the data one more level as follows −

  1. Click Level 2 data item for which you want further details. For example, click Aquatics. As you observe, the medal count for Aquatics is 354.

  2. Click on the arrow to the right side of it.

  3. Level 3 data pertaining to Aquatics will be displayed.

display diving

如你所观察,第一个项的左侧会出现一个向上箭头,表示向上钻取,当你单击各个数据项时,该项右侧会显示一个向下箭头,表示向下钻取。

As you observe, an upward arrow appears on the left side of the first item, indicating drill up and when you click on each of the data items, a downward arrow appears on the right side for that item indicating drill down.

现在,你可以按以下方式再向下钻取一层数据 −

Now, you can drill down the data one more level as follows −

  1. Click Level 3 data item for which you want further details. For e.g. click on Diving. As you observe, the medal count for Diving is 17.

  2. Click on the arrow to the right side of it.

  3. Level 4 data pertaining to Diving will be displayed.

drill up and down

如你所观察,第一个项的左侧会出现一个向上箭头,表示向上钻取,当你单击各个数据项时,该项右侧会显示一个向下箭头,表示向下钻取。

As you observe, an upward arrow appears on the left side of the first item, indicating drill up and when you click on each of the data items, a downward arrow appears on the right side for that item indicating drill down.

现在,你可以按以下方式再向下钻取一层数据 −

Now, you can drill down the data one more level as follows −

  1. Click on the Level 4 data item for which you want further details. For example, click on 2008. As you observe, the medal count for 2008 is 3.

  2. Click on the arrow to the right side of it.

  3. Level 5 data pertaining to 2008 will be displayed.

drill down data

如您所观察到的,对于第一个第 5 级数据项,左侧出现一个向上箭头,表示向上钻取。右侧不显示数据项的下钻箭头,因为存在要下钻到的其他级别。

As you observe, for the first Level 5 data item an upward arrow appears on the left side indicating drill up. Drill down arrows do not appear on the right side for the data items as there are further levels to drill down.

现在,您可以逐级向上钻取数据,方法是单击每个级别第一个项目左侧的向上箭头。

Now, you can drill up the data one level at a time by clicking on the upward arrow to the left side of the first item at each Level.

Exploring a Hierarchy in Stacked Bar Chart

您可能想要以重要方式突出显示层次结构中的某些值。在这种情况下,您可以使用图表可视化,例如,堆叠条形图如下 −

You might want to highlight certain values in a hierarchy in a significant way. In such a case, you can use a chart visualization, such as Stacked Bar chart as follows −

  1. Click the Matrix visualization and switch to Stacked Bar Chart.

  2. Drag the field Medal to LEGEND area.

您将获得以下堆叠条形图可视化 −

You will get the Stacked Bar chart visualization as follows −

exploring hierarchy in stacked bar

在这种情况下,您需要双击条形图才能下钻。

In this case, you need to double-click on a Bar to drill down.

双击代表 AUS 的条形图。图表已下钻以显示层次结构中下一级的数据。

Double-click on Bar representing AUS. The chart is drilled down to display the next level of data in the hierarchy.

chat drilled down

如您所观察到的,图表右上角会出现一个表示向上钻取的向上箭头。

As you can observe, an upward arrow indicating drill up appears at the top-right corner of the chart.

通过双击“Aquatics Bar”,向下钻取一个级别。图表已下钻以显示层次结构中下一级的数据。

Drill down one more level by double-clicking on Aquatics Bar. The chart is drilled down to display the next level of data in the hierarchy.

aquatics bar

您可以通过双击条形图下钻,或者单击图表右上角的向上钻取箭头向上钻取。

You can drill down by double-clicking on a Bar or drill up by clicking on the drill up arrow on the top-right corner of the chart.

这还使您可以在演示过程中交互式地浏览数据。

This gives you an interactive exploration of data during presentation also.

Aesthetic Power View Reports

在本文档的前面章节中,你已学习如何使用 Power View 交互探索数据。每个 Power View 图表依次可用作交互式报告。要使 Power View 报告更具吸引力,你可以选择 Power View 提供的主题、图表色板、字体和背景色。

You have learnt how to explore data interactively using Power View in the earlier chapters of this tutorial. Each Power View sheet can in turn be used as an interactive report. To make the Power View report more appealing, you can choose any of the themes, chart palettes, fonts and background colors that Power View provides you.

更改主题时,新主题将应用于报告中的所有 Power View 可视化效果。此外,你可以添加背景图像、选择背景格式、设置数字格式,并更改字体或文本大小。

When you change the theme, the new theme applies to all the Power View visualizations in the report. Further, you can add background images, choose background formatting, format numbers, and change the Font or the text size.

Report Layout Finalization

与任何其他报告一样,你首先需要决定要报告什么,以及最好的布局是什么,以便突出显示显著的数据点。

As with any other report, you need to first decide on what you are going to report and the best layout so that you can highlight the significant data points.

假设你需要报告澳大利亚在水下项目中赢得的奖牌的详细内容。据你所知,详细信息包括水下项目的种类、奖牌数量和奖牌类型(金牌、银牌和铜牌)。

Suppose you need to report the details of the medals won by Australia in aquatics. As you are aware, the details include the disciplines in aquatics, medal count, and the medal types (Gold, Silver and Bronze).

对于此案例中的数据点,可以在报告中采用以下这三种视图来获得最佳展示效果:

You can have three views in the report for the best portrayal of the data points in this case −

  1. Matrix that contains the data - country, sport, and medal count.

  2. Card that contains the data – country, sport, discipline and medal Count.

  3. Stacked Bar chart that contains the data that is drilled down to discipline, medal and medal count.

report layout finalization

正如你所见,矩阵和卡片中的数据已滚动,以便

As you can observe, the data in the Matrix and Card is scrolled so that −

  1. Matrix displays the details of Australia for all sports and aquatics got 354 medals.

  2. Card displays Australia – sport aquatics, disciplines Diving, Swimming and Water polo and medal count in each of them.

  3. Stacked Bar chart displays the medal count by medal type in these three disciplines.

现在报告的布局已经准备就绪,您可以开始使其具有吸引力。但是,在执行此任务期间,您需要记住两点−

Now that the report layout is ready, you can start making it appealing. However, you need to keep two points in mind during this task −

  1. The look of the report should be based on the audience (Managers / Top Management / Clients).

  2. Do not get over bored with the different formatting options. Just keep it simple and highlight the data points that require attention.

在以下章节中,您将了解如何利用以下选项进行示例报告 −

In the following sections, you will understand how to arrive at a sample report with the following options −

  1. Selecting the Background.

  2. Selecting the Theme.

  3. Changing the Font.

  4. Changing the Text Size.

Selecting the Background

您的 Power View 报告可以有背景颜色。默认情况下,它是白色。您可以通过 Background 命令更改它。

You can have a background color for your Power View Report. By default, it is white. You can change it with the Background command.

  1. Click the POWER VIEW tab on the Ribbon.

  2. Click Background in the Themes group.

  3. Click Light1 Center Gradient. (You can choose the one that best suits your report).

背景色更改为选定的颜色。

The background color changes to the selected one.

selecting background

您甚至可以设置背景图像。例如,您可以放置公司徽标或公司设施的视图。

You can even set a background image. For e.g. you can put your company logo or a view of your company facility.

Selecting the Theme

Power View 支持多种主题。选择最适合您的报告的主题,如下所示−

Power View supports several themes. Choose the one that suits your report as follows −

  1. Click on the POWER VIEW tab on the Ribbon.

  2. Click on Themes in the Themes group.

您将获得许多可供选择的选项。如果您不确定合适的主题,只需尝试一些主题来查看显示效果。

You will get many options to choose from. If you are not sure about the appropriate one, just play around with some to find how the display looks.

  1. Click on the theme Aspect.

您的报告将显示在所选主题中。

Your report will be displayed in the selected theme.

selecting theme

Changing the Font

正如您所观察到的,报告中的文本并不明显。您可以按如下方式更改字体 −

As you can observe, the text in the report is not conspicuous. You can change the font as follows −

  1. Click on the POWER VIEW tab on the Ribbon.

  2. Click on Font in the Themes group.

  3. Click on Verdana in the dropdown list of fonts. (You can choose the one that best suits your report).

接下来,您需要使文本显示得更大一些。

Next, you have to make the text display a bit larger.

Changing the Text Size

按如下方式更改文本大小 −

Change the text size as follows −

  1. Click on the POWER VIEW tab on the Ribbon.

  2. Click on Text Size in the Themes group.

  3. Click on 150% in the dropdown list. (You can choose the one that best suits your report).

  4. Adjust the widths of the columns in Matrix.

  5. Adjust the size of each view in the report.

changing text size

您的样本报告现已准备就绪。

Your sample report is ready.

Key Performance Indicators

关键绩效指标 (KPI) 是一组可量化的衡量标准,组织使用它们来衡量其随着时间的绩效。KPI 通常用于评估整个组织或部门(例如销售、财务等)的成功。你需要根据组织目标定义 KPI,并时常监控它们以跟踪进度。

Key Performance Indicators (KPI) are a set of quantifiable measures that an organization uses to measure its performance over time. KPIs are normally used to evaluate the success of an organization as a whole or department-wise (e.g. sales, finance, etc.). You need to define the KPIs based on the organization objectives and monitor them from time to time to track the progress.

根据你的要求,有许多类型的 KPI 可供选择。示例包括−

There are a number of KPI types to choose from based on your requirements. Examples include −

  1. Income and Expenses

  2. Rate of Return

  3. Average Purchase Value

  4. Customer Lifetime Value

  5. Working Capital

请注意,KPI 是一种涉及以下活动的交流形式−

Note that KPIs are a form of communication involving the following activities −

  1. Identifying the KPIs based on the organization’s objectives.

  2. Monitoring and reporting the KPIs.

  3. Altering the KPIs as the organization progresses and / or the organization’s goals change.

Identifying the KPIs

在 KPI 分析中,第一步也是最重要的一步是确定能有效监控组织中所需趋势的 KPI。这需要对目标有完全的了解,并要求分析师与负责实现目标的人员之间有适当的沟通渠道。

The first and the most crucial step in KPI analysis is to identify the KPIs that effectively monitor the required trends in the organization. This requires complete understanding of the objectives and requires proper communication channels between the analysts and those who are responsible for fulfilling the objectives.

有很多 KPI 可供选择,但监控的成功取决于选择与目标相关的那些 KPI。KPI 因组织而异,也因部门而异,并且只有当它们能提升绩效时才有效。

There are a number of KPIs to choose from, but the success in monitoring relies on the right choice of those that are relevant to the objectives. The KPIs differ from organization to organization and from department to department and will be effective only when they lead to improvement in the performance.

你可以使用 SMART 标准来评估 KPI 的相关性,即 KPI 应该是*明确的 (S)、可衡量的 (M)、可实现的 (A)、相关的 ® 和有时间限制 (T)*。换句话说,所选择的 KPI 应满足以下标准−

You can evaluate the relevance of a KPI using the SMART criteria – i.e. the KPI should be *S*pecific, *M*easurable, *A*ttainable, *R*elevant and *T*ime-bound. In other words, the KPI chosen should meet the following criteria −

  1. The KPI reflects your *S*pecific objective.

  2. The KPI enables you to *M*easure progress towards that goal.

  3. The goal for which the KPI is being defined is realistically *A*ttainable.

  4. The goal that the KPI is targeting is *R*elevant to the organization.

  5. You can set a time-frame for achieving the goal so that the KPI reveals how near the goal is as compared to the time that is left.

需要定时评估已定义的 KPI,以随着时间的推移了解其相关性。如果需要,需要定义和监控不同的 KPI。只有这样,您的 KPI 监控才会与当前组织需求相关。

The defined KPIs are to be evaluated from time to time to find their relevance as the time progresses. If required, different KPIs need to be defined and monitored. Only then, your KPI monitoring will be relating to the current organization needs.

根据分析需要,您必须选择相关的 KPI,以下是一些示例:

Based on the analysis needs, you have to choose the relevant KPIs, and examples include the following −

  1. Sales department might use a KPI to measure monthly gross profit against projected gross profit.

  2. Accounting department might measure monthly expenditures against revenue to evaluate costs.

  3. Human resources department might measure quarterly employee turnover.

  4. Business professionals frequently use KPIs that are grouped together in a business scorecard to obtain a quick and accurate historical summary of business success or to identify trends or to identify performance improvement opportunities.

本章中使用的示例具有指示性,旨在帮助您了解如何在 Excel 中定义和监控 KPI。根据目标识别 KPI 的唯一决定权在于您,以便与目标相比反映当前情况。

The examples used in this chapter are indicative so as to help you in understanding how you can define and monitor KPIs in Excel. The sole discretion of identifying the KPIs lies with you based on the objectives so as to reflect the current scenario as compared to the targets.

KPIs in Excel

  1. You can analyze performance against the set target with PowerPivot. For e.g., a PowerPivot KPI could be used to determine for each year and salesperson how his actual sales compared to his sales target.

  2. You can explore and visualize the same KPI with Power View.

  3. You can also define new KPIs and /or edit them in Power View.

  4. You can produce aesthetic reports with KPIs in Power View.

Defining a KPI in Excel

KPI 分析的第一步是定义已识别的 KPI。这需要定义 KPI 的三个参数,如下所示:

The first step in KPI analysis is to define the identified KPI. This requires defining the three parameters for the KPI as follows −

Base Value

基本值由计算出的字段定义,该字段解析为一个值。该计算字段表示表中该行中项目的当前值。例如,销售汇总、某一段时间的利润等。

A Base Value is defined by a calculated field that resolves to a value. The calculated field represents the current value for the item in that row of the table. E.g., aggregate of sales, profit for a given period, etc.

Target Value/ Goal

目标值(或目标)由计算出的字段定义,该字段解析为一个值,或一个绝对值。它是用于评估当前值的数值。这可以是一个固定数字,例如适用于所有员工的平均病假天数,或一个计算字段,即为每一行产生不同的目标,例如,组织中每个部门的预算。

A Target Value (or Goal) is defined by a calculated field that resolves to a value, or by an absolute value. It is the value against which the current value is evaluated. This could be a fixed number, for example, average number of sick-leave days that is applicable to all the employees, or a calculated field, which results in a different goal for each row, for example, budget of each department in the organization.

Status

状态是值的一个指标。如果您将其设置为可视化指标,它将会非常引人注目。在 Excel 的 Power View 中,您可以编辑 KPI,选择要使用的指标和触发每个指标的值。

Status is the indicator of the value. It would be striking if you set it as visual indicator. In Power View in Excel, you can edit the KPI, choosing which indicators to use and what values to trigger each indicator.

例如,假设您希望监控销售某一产品的组织中销售人员的销售目标。分析目的是识别达到销售目标金额的最佳表现者。您可以继续按如下方式定义 KPI:

For example, suppose you want to monitor the Sales targets of the Salespersons in an organization who are selling a product. The objective of the analysis is to identify the best performers who are meeting the target Sales Amount. You can proceed to define the KPI as follows −

  1. Base Value − Current Value of the Sales Amount for each salesperson.

  2. Target Value / Goal − This is fixed for all the salespersons so as to enable comparison between the salespersons. Assume that the Target Sales Amount is 3500. Note that for a different analysis you could vary the target values for the salespersons.

  3. Status − The Status is to be displayed with a graphic to easily determine the status of the Base Value compared to the Target Value.

KPIs in PowerPivot

你可以在 PowerPivot 中定义 KPI,如下所示 −

You can define KPIs in PowerPivot as follows −

  1. Start with two tables SalesPerson and Sales. SalesPerson table contains SalesPerson ID and SalesPerson Name.Sales table contains the sales information salesperson-wise and month-wise.

  2. Add the two tables to Data Model.

  3. Create a relationship between the two tables using the field SalesPerson ID.

kpis in powerpivot

要设置基础值,你需要一个销售额计算字段。

To set the Base Value, you need a calculated field for Sales Amount.

  1. Add the calculated field in the Sales table for Sales Amount column in the Data Model as follows −

Total Sales:= sum([Sales Amount])

Total Sales:= sum([Sales Amount])

set base value
  1. Click on PivotTable on the Ribbon in the PowerPivot window.

  2. Select New Worksheet in the Create PivotTable dialog box.

pivottable dialog box
  1. Add the field Salesperson to ROWS area in the PivotTable.

  2. Click on the POWERPIVOT tab on the Ribbon.

  3. Click on KPIs in the Calculations group.

  4. Click on New KPI in the dropdown list.

click new kpi

关键绩效指标 (KPI) 对话框会出现。

Key Performance Indicator (KPI) dialog box appears.

  1. Select Total Sales in the KPI base field (value) box.

  2. Under KPI Status, have the following options − Under Define target value, select Absolute value and type 3500 in the box. Under Define status thresholds, adjust the vertical bars representing the percentages to 40 and 80. Under Select icon style, select the first option.

kpi dialog box

单击确定按钮。你可以在数据透视表字段列表中的 Sales 表中观察到以下内容 −

Click on the OK button. You can observe the following in the Sales table in PivotTable Fields list −

  1. Total Sales field is a KPI and is depicted by the icon .

  2. The three KPI parameters – Value, Goal and Status appear as fields under Total Sales KPI.

kpi parameter
  1. Select the three KPI parameters – Value, Goal and Status under Total Sales.

  2. The three columns appear in the PowerPivot, with the Status column displaying the icons as per the corresponding value.

此外,你还可以通过值而不是百分比定义 KPI 阈值。要修改已定义的 KPI,请按以下步骤操作:

You can also define the KPI thresholds by values instead of percentages. To modify a defined KPI, proceed as follows −

  1. Click on KPIs in the Calculations group on the Ribbon.

  2. Click on Manage KPIs in the dropdown list.

click manage kpis

管理 KPI 对话框显示。

Manage KPIs dialog box appears.

manage kpis dialog box
  1. Click on the KPI – Total Sales.

  2. Click on the Edit button.

关键绩效指标 (KPI) 对话框会出现。

Key Performance Indicator (KPI) dialog box appears.

key performance indicator
  1. Under Define status thresholds, adjust the vertical bars to 1500 and 3000.

  2. Retain the rest of the earlier options.

  3. Click on OK.

adjust vertical bars

你会注意到状态图标反映了更改的阈值。

As you can observe, the status icons reflect the changed thresholds.

KPIs in Power View

可以在 Power View 中创建包含 KPI 的美观报告。可以使用以前在数据模型中定义的 KPI,也可以在 Power View 中添加 KPI。

You can create aesthetic reports with KPIs in Power View. You can either use the prior defined KPIs in Data Model or you can add KPIs in Power View.

要在 Power View 中添加或编辑 KPI,请执行以下步骤:

To add or edit a KPI in Power View, proceed as follows −

  1. In the Power View Sheet, click on the PowerPivot tab.

kpis in power view

PowerPivot 功能区将显示,已在上一部分中使用过该功能区。

The PowerPivot Ribbon appears, which you had used in the previous section.

  1. Click on KPIs in the Calculation group.

  2. Click on New KPI to add a KPI.

  3. Click on Manage KPIs to edit a KPI.

步骤与上一节相同。

The steps are the same as in the previous section.

您可以按照如下步骤在 Power View 中使用 KPI 创建销售绩效美学报告 −

You can create an aesthetic report of Sales Performance with KPIs in Power View as follows −

  1. Click on DATA tab on the ribbon.

  2. Click on Power View in the Reports group.

Power View 工作表出现。

Power View sheet appears.

  1. Add a Table with the fields – Salesperson, Total Sales and Total Sales Status.

  2. Add a second Table with the fields – Salesperson, Total Sales and Total Sales Goal.

  3. Convert the second Table to 100% Stacked Bar.

  4. Add a third Table with the fields – Salesperson, Region, Total Sales and Total Sales Status.

  5. Convert the third Table to Card. Drag the field Region to Tile By.

  6. Add the Title – Sales Performance.

  7. Change the font.

  8. Increase the Text Size.

  9. Resize Table, 100% Stacked Bar and Card appropriately.

您的销售绩效报告已准备就绪 −

Your Sales Performance report is ready −

sales performance

正如您所观察到的,在 Power View 中,您可以按如下方式描绘结果 −

As you can observe, in the Power View you could portray the results as follows −

  1. Table with icons for KPI status is similar to the PowerPivot report.

  2. 100% Stacked Bar depicts the percentage achieved with respect to the Goal. You can also notice that it gives a clear comparison of the performance of all.

  3. Card depicts the KPI status of the Salespersons along with the Region they belong to. You can interactively scroll through the Tiles to display results for different Regions that would give scope to assess performance region-wise also.