Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Lecture 9

Uploaded by

Anon son
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lecture 9

Uploaded by

Anon son
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ST 1012 - Basic Statistical Computing

 Create an Excel table in a worksheet

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.

To create a table by using the default table style, do this:

1. Select the range of cells you want included in the table. The cells can be empty or can contain
data.

2. Click Insert > Table.

Keyboard shortcut You can also press Ctrl+T or Ctrl+L.

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

DSPT November 2020


ST 1012 - Basic Statistical Computing

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.

 Create a table in the style you want

1. Select the range of cells you want included in the table.


2. On the Home tab, click Styles > Format as Table.

When you use Format as Table, Excel automatically inserts a table.

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

DSPT November 2020


ST 1012 - Basic Statistical Computing

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

DSPT November 2020


ST 1012 - Basic Statistical Computing

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?

1. Click the filter drop-down and select UK.

Result. Broccoli is our main export product 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.

1. Click any cell inside the Sum of Amount column.

2. Right click and click on Value Field Settings.

3. Choose the type of calculation you want to use. For example, click Count. Click OK.

Two-dimensional Pivot Table


If you drag a field to the Rows area and Columns area, you can create a two-dimensional pivot table.
First, insert a pivot table. Next, to get the total amount exported to each country, of each product, drag
the following fields to the different areas.
1. Country field to the Rows area.

2. Product field to the Columns area.

3. Amount field to the Values area.

4. Category field to the Filters area.

Below you can find the two-dimensional pivot table.


Category (All)

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

DSPT November 2020


ST 1012 - Basic Statistical Computing

 Creating a reference to another sheet in Excel


When writing a formula that refers to cells in another worksheet, you can of course type that
other sheet name followed by an exclamation point and a cell reference manually, but this
would be a slow and error-prone way.

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:

1. Start typing a formula either in a destination cell or in the formula bar.


2. When it comes to adding a reference to another worksheet, switch to that sheet and select
a cell or a range of cells you want to refer to.
3. Finish typing the formula and press the Enter key to complete it.
For example, if you have quantity sold in sheet 1 and the unit price in sheet 2. You want to
calculate the sales value for each product sheet1 , proceed in the following way:

 Start typing the formula =B2*Sheet2!B2 in cell B2 on sheet 1.


 Switch to sheet Sheet 2, and click on cell B2 there. Excel will immediately insert an
external reference to that cell, as shown in the following screenshot:
A B C
1 Qty Total
2 Apples 12 7200 =B2*Sheet2!B2
3 Oranges 15 11250
4 Grapes 10 12000
5 Bananas 10 1000
Sheet 1
A B
1 Unitprice
2 Apples 600.00
3 Oranges 750.00
4 Grapes 1200.00
5 Bananas 100.00
Sheet2
 Press Enter to complete the formula.

DSPT November 2020


ST 1012 - Basic Statistical Computing

 How to reference another workbook in Excel


In Microsoft Excel formulas, external references to another workbook are displayed in two
ways, depending on whether the source workbook is open or closed.

External reference to an open workbook

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

DSPT November 2020

You might also like