Lecture 9
Lecture 9
When you create a table in an Excel worksheet, it's not only easier for you to manage and
analyze its data, but you also get built-in filtering, sorting, and row shading.
1. Select the range of cells you want included in the table. The cells can be empty or can contain
data.
3. If the top row of the selected range contains data you want to use as table headers, check
the My table has headers box
If you don’t check the My table has headers box, table headers with default names like
Column1 and Column2 are added to your table above its data. You can change default header
names at any time.
1. Under Light, Medium, or Dark, click the table style you want to use. If the selected range
contains data you want to use as table headers, click a table style that includes a header row.
You can create your own table style to use in the current workbook. After you create a custom
table style, it's available for the current workbook when you use Format as Table,
under Custom.
Next steps
After you create a table, the Table Tools become available, and you'll see a Design tab. You can
use the tools on the Design tab to customize or edit the table. Note that the Design tab is visible
only when at least one or more cells in the table are selected.
To add a row, select the last cell in the last row of the table, and press Tab.
You also can filter data in an Excel Table
You can convert a table back to a normal range
Pivot Tables
Pivot tables are one of Excel's most powerful features. A pivot table allows you to extract information
that you want from a large, detailed data set.
Example: The following data set consists of data on 5 fields. Order ID, Product, Category, Amount and
Country.
OrderID Product Category Amount Country
1 Carrots Vegetables 4270 UK
2 Broccoli Vegetables 8329 UK
3 Banana Fruit 627 Canada
4 Beans Vegetables 8825 Germany
5 Orange Fruit 2256 Australia
6 Broccoli Vegetables 3610 UK
7 Banana Fruit 9067 Canada
8 Apple Fruit 2417 Australia
9 Apple Fruit 3478 Germany
10 Beans Vegetables 8562 Australia
To insert a pivot table,
1. Click any single cell inside the data set.
2. On the Insert tab, in the Tables group, click PivotTable.
Excel automatically selects the data for you. The default location for a new pivot table is New Worksheet.
3. Click OK.
The PivotTable Fields pane appears. To get the total amount exported of each product, drag the following
fields to the different areas.
1. Product field to the Rows area.
2. Amount field to the Values area.
3. Country field to the Filters area.
You will get the following pivot table.
Country (All)
Row Sum of
Labels Amount
Apple 5895
Banana 9694
Beans 17387
Broccoli 11939
Carrots 4270
Orange 2256
Grand
Total 51441
To get Beans at the top of the list, sort the pivot table.
Click any cell inside the Sum of Amount column. Right click and click on Sort, Sort Largest to Smallest.
* Because we added the Country field to the Filters area, we can filter this pivot table by Country. For
example, which products do we export the most to UK?
Note: you can use the standard filter (triangle next to Row Labels) to only show the amounts of specific
products.
By default, Excel summarizes your data by either summing or counting the items. To change the type of
calculation that you want to use, execute the following steps.
3. Choose the type of calculation you want to use. For example, click Count. Click OK.
Sum of Column
Amount Labels
Grand
Row Labels Apple Banana Beans Broccoli Carrots Orange Total
Australia 2417 8562 2256 13235
Canada 9694 9694
Germany 3478 8825 12303
UK 11939 4270 16209
Grand Total 5895 9694 17387 11939 4270 2256 51441
A better way is point to the cell(s) in another sheet that you want the formula to refer to, and
let Excel take care of the correct syntax of your sheet reference. To have Excel insert a
reference to another sheet in your formula, do the following:
When the source workbook is open, an Excel external reference includes the workbook name in
square brackets (including the file extension), followed by the sheet name, exclamation point
(!), and the referenced cell or a range of cells. In other words, you use the following reference
format for an open workbook reference:
[Workbook_name]Sheet_name!Cell_address
=A2*[test1.xlsx]Sheet1!A2
External reference when the source is not open, the external reference includes the
entire path.
=A2+'C:\Users\Desktop\[test1.xlsx]Sheet1'!B2