MS Excel (8)
MS Excel (8)
Microsoft Excel
1
INE 214 MS Excel
The following instructions may be a bit different on different versions of MS Excel; however, the
concepts explained are very similar in other versions. More information specific to other versions can be
found in the Excel Help files. Also, Excel files created using earlier versions can be converted to the latest
version by selecting the Convert command at the File tab>>Info page.
Figure 1. Spreadsheets are great tools for tracking data, no matter what the data is!
2
INE 214 MS Excel
There are three possible workbook/worksheet views: Normal (default Excel view), Page Layout
(used to visualize how the worksheet will appear when printed including headers and footers), Page Break
Preview (used to change the location of page breaks in the workbook when printing data).
When a range of cells is selected the range is described by the first (top left) and last cell (bottom
right) in the range separated by a colon such as A1:C5 shown in Figure 4.
1. Determine the row/column setup (what data will be stored in each row and column, number of
rows and columns)
2. Set column headings (use meaningful headings that describe the data in each column)
3. Fill in cells
a. You can click the Enter icon (tick mark) on the formula bar to keep the current cell active.
e. You can Copy (Ctrl+C) (or Cut (Ctrl+X)) and Paste (Ctrl+V) the contents in the cells. For
various types of data and formatting, there are special paste options (Figure 5).
f. You can continue a series by double clicking the Fill Handle that appears on the bottom
right corner of selected cells. You may need to select multiple cells to use the Fill Handle
and if it does not continue series, you will need to choose the Fill Series option from the
box that appears on the bottom right corner of the series.
4. Resize cells where necessary
a. Resize columns to fit the largest cell in that column by double clicking the vertical divider
between two columns.
b. Go to Home tab>>Cells group>>Format, select Row Height or Column Width options to
enter height or width in points where 1 inch is 72 points. You can select AutoFit Height or
AutoFit Width options to fit the rows and columns to the contents automatically.
5. Format cell contents
a. Default formatting is left alignment for text, right alignment for numbers.
b. You can change the alignment by going to Home tab>>Alignment group.
6. Format cell style
a. Text formatting: Click on the cell to be formatted, go to Home tab>>Font group (face, size,
subscript, superscript, color, bold, italicized, underlined), Alignment group (horizontal and
vertical alignment, indentation, Wrap Text for keeping multiple lines of text in a cell), and
Number group (number, currency, date, time, percentage types, decimals).
Note: If you want to constrain the length of text in a cell and type multiple lines instead
of Wrap Text, you need to press Alt+Enter to add a new line of text within the cell.
4
INE 214 MS Excel
b. Cell formatting: Drag mouse over the cells to format and apply formatting, select the
entire row(s) or column(s) to format by clicking on the row button (numbers on the left
side) or column button (letters at the top), select all cells by clicking the Select All button
at the top left corner of the sheet as shown in Figure 7.
Another way to format cells is to select the cells to format, right-click, and select Format
Cells… to bring up the dialog box (Figure 8). You can change the alignment, font, borders
(Figure 9), background fill, etc.
5
INE 214 MS Excel
6
INE 214 MS Excel
• To merge cells, select cells to combine into one cell and go to Home tab>>Alignment
group>>Merge & Center down arrow and click the appropriate option.
7
INE 214 MS Excel
• To delete a sheet right click on the sheet name and select Delete.
• To move or copy a sheet, right-click on the sheet name and select Move or Copy… to open the
Move or Copy dialog box. You can move or copy the sheet within the same workbook or to
another workbook.
8
INE 214 MS Excel
• To unfreeze rows and columns, go to View tab>>Window group and click Unfreeze Panes.
9
INE 214 MS Excel
10
INE 214 MS Excel
Figure 14
• Top/Bottom Rules is to identify and emphasize the highest or lowest values within a range
of cells in a worksheet.
12
INE 214 MS Excel
3 MATHEMATICAL FEATURES
To add an equation to a cell, start typing the equation by putting an equal sign (=) first. The equal
sign defines the content as an equation instead of text or number and the result of the equation is
displayed. If you would like to type text that begins with an equal sign, type an apostrophe (‘) before the
equal sign as shown in Figure 19.
Note: T o view all formulas explicitly in the cells on a sheet, select Formulas tab>>Formula Auditing
group and click Show Formulas button.
Standard mathematical operators are addition (+), subtraction (-), multiplication (*), division (/),
and exponents (^).
1. Relative references: These references are the default Excel references that move with cells as
cells are copied or moved around a worksheet. It is the most flexible cell reference type.
2. Absolute references: These references are fixed and the cell addresses do not change when
formulas are copied or moved. Absolute references are used for constants in formulas and are
displayed with a dollar sign preceding the reference such as $A$1.
3. Mixed references: These references include one relative and one absolute reference as in $A1
or A$1. Column A is fixed in $A1 and row 1 is fixed in A$1.
4. External (3-D) references: These references are used when referencing cells from other
worksheets or workbooks and such references are displayed in the worksheet and formula bar
as [Workbook name]Worksheet name!A1.
The type of a reference can be changed by selecting the cell address and pressing F4 key to switch
cell referencing in the following order:
• Absolute ($A$1)
• Mixed (relative column, absolute row) (A$1)
• Mixed (absolute column, relative row) ($A1)
• Relative (A1)
13
INE 214 MS Excel
The cell referencing scheme can be changed to R1C1 references where each cell address is
represented by the corresponding row and column number such as R5C4 for cell D5. To use this scheme,
click the File tab>>Options>>Formulas and under Working with Formulas, click the R1C1 Reference Style
checkbox.
Cell reference operators used in an address provide the syntax for referencing cell ranges, unions,
and intersections.
• To reference a range, type a colon (:) between the upper-leftmost cell and the lower-rightmost
cell. For example, SUM(C1:E5).
• To reference a union, type a comma (,) (or semicolon(;)) between separate cell references. For
example, SUM(C1, D3, E5).
• To reference an intersection, type a space (press the Spacebar key) between two range-cell
references with common cells. For example, SUM(C1:D5 C4:E5) where C4, C5, D4, and D5 are
common cells as shown in Figure 20.
Instead of using the default address for cells or ranges, they can be named in a descriptive manner
by typing the desired name in the Name box to the left of the Formula bar. Such names are easier to
remember and quicker to reference than the A1-style cell references. You can use this name box drop-
down menu to go to a named cell.
You can even add comments on the names if you select the range of cells to name and click the
Define Name button at the Formulas tab>>Defined Names group. Edit Name dialog box appears and you
can define the name and add comment for the selected cells. When you want to use the named cell(s),
you can start typing its name and it will appear in the list along with the comment you typed.
14
INE 214 MS Excel
Functions are predefined formulas that are used to perform specific tasks. A function consists of
three components:
1. Formula identifier: The equal sign (=) is required at the beginning of the formula.
2. Function name: Each function is identified by its name which is usually an uppercase
abbreviation that is explanatory of the function’s purpose.
3. Arguments: They are the values acted upon by functions to find a result and can be numbers,
cell references, constants, logical values (True/False), or a formula. Arguments are separated
by commas and enclosed in parentheses. The maximum number of arguments a function can
have is 255.
15
INE 214 MS Excel
• Typing a function:
o Select a cell, type an equal sign (=), start typing the function name.
o A list of functions that begin with the typed letters is displayed. Click on a function to
see its description. Double-click on the function you want to use so that the function
name and open parenthesis are inserted in the cell for you.
o Type the required arguments and/or select cell references. Separate arguments with
commas (,). Type the close parenthesis and press Enter (or click Enter tick mark on the
Formula bar).
• Inserting a function:
o Select a cell, go to Formulas tab>>Function Library group and click the relevant function
category button to select a function in that category from the list. To see the
description of a function, point to it.
o Alternatively, select a cell, click the Insert Function button on the Formulas
tab>>Function Library group or press Shift+F3. The Insert Function dialog box shown in
Figure 22 will appear and you can either select a category to find a function from the list
or type a brief description of what you want to do.
o Once a function is selected, its arguments are shown in Function Arguments dialog box,
shown in Figure 23, where you can enter values for the arguments by typing or clicking
cell references. Click OK to complete the function entry.
16
INE 214 MS Excel
17
INE 214 MS Excel
another cell and clicking Trace Precedents (or Trace Dependents) at the Formulas tab>>Formula Auditing
group to view the blue arrows that point to the dependent cell from other cells (that point to other cells
from the precedent cell).
After choosing a table style, use the Format As Table dialog box to confirm the cell range and you
can select “My table has headers” if you already have the header row on your worksheet.
Once you click OK, a table is created with drop-down arrows for each column header. You can
choose one of the columns and select only the information you want to view to filter data. For example,
you can select only two cities, Charlotte and Raleigh, to view records with these names in the City
column as shown in Figure 32.
Note: To remove tables from your worksheet, select any cell in the table, click Convert to Range
command on the Design tab>>Tools group. Click Yes on the dialog box that appears. This will also
remove the filters from headers. (Formatting keeps the same.)
Another way to filter data is by choosing the Filter command at the Data tab>>Sort & Filter group.
A drop-down arrow appears in the header cell for each column. Click on the drop-down arrow for the
column you want to filter and choose the data you want to view. The data will be filtered and the
content that does not match the criteria will be temporarily hidden. You can add multiple filters by
adding criteria in other columns while the data is filtered for previous criteria.
To clear filtering, select Clear Filter From “[Column Header]” option from the drop-down list as
shown in Figure 33.
20
INE 214 MS Excel
• Search for data: In the Filter menu, type a search term in the search box and click OK (Figure 34).
• Text filters: In the Filter menu for a column that holds text, choose one of the Text Filters options,
the Custom AutoFilter dialog box will appear, enter the desired text to the right of the filters and
click OK (Figure 35).
• Date filters: In the Filter menu for a column that holds dates, choose one of the Date Filters
options or enter desired dates in the Custom AutoFilter dialog box (Figure 36).
• Number filters: In the Filter menu for a column that holds numbers, choose one of the Number
Filters, the Custom AutoFilter dialog box will appear, enter the desired numbers to the right of
the filters and click OK (Figure 37).
21
INE 214 MS Excel
22
INE 214 MS Excel
To group rows or columns, select them, click the Group command at the
Data tab>>Outline group.
You will see the Hide Detail button with a minus sign (-) on
top of the grouped columns (or to the left of the grouped
rows).
You can also summarize the grouped data by creating a Subtotal that
creates a hierarchy of groups, called an outline. To use Subtotal, first sort
your column that holds the data you want to subtotal. For example, sort
a list of products by their category if
you want to count the number of
products in each category. Then, click
the Subtotal command at the Data
tab>>Outline group. The Subtotal
dialog box appears. Select the column
heading below “At each change in:”
field. Select the function you want to
use for the “Use function:” field.
Select the column where you want the subtotal to appear in “Add
subtotal to:” field. When satisfied with the selections, click OK. The
data will be outlined into groups with the subtotal listed in new rows
below each group. In the example in Figure 38, data is grouped by
Category ID and the number of products in each category is shown
below each group.
To remove subtotals and ungroup data: Data tab>>Subtotal command>>Subtotal dialog box>>Remove All
To remove groups without removing subtotals: Data tab>>Ungroup drop-down arrow>>Clear Outline
23
INE 214 MS Excel
4.3 CHARTS
Charts allow you to illustrate data graphically and visualize comparisons between different data
series and trends. Excel has many chart options and it is important to use the right type of chart to
represent data to make it easier for the viewer to interpret the charts.
1. Column: Data represented by vertical bars, usually used for comparison of data series
2. Line: Data points are connected with lines, used to show trends in data series
3. Pie: Values are represented as slices of the pie, used to compare proportions/percentages of a
whole
4. Bar: Data represented by horizontal bars, works like Column charts
5. Area: Similar to line charts, areas under the lines are filled
6. Surface: Used to display data across 3-D environment, used with large data sets to display a lot
of information at a glance
4.4 SPARKLINES
Sparklines are mini-charts that can be fit in a cell. These compact charts provide information about
the trends in data without creating entire charts. This saves space and time especially if you have a lot of
data series as well as organizing the visual data representation by keeping charts with the source data.
To insert Sparklines:
• Select the cell range (a row or column of data) that serves as the data source for the first
Sparkline.
24
INE 214 MS Excel
• Choose the desired Sparkline from the Insert tab>>Sparklines group (Line, Column, or
Win/Loss)
• Choose a cell where the Sparkline will be located on the Create Sparklines dialog box.
• Click OK and the Sparkline will be displayed at the cell you selected in the previous step.
• You can then use the Fill Handle to create Sparklines for the other data series on your
worksheet.
You can edit the Sparklines by adding data markers for High and Low points and by changing the
Sparkline style and type from the Design tab.
To create a PivotTable, select the data you want to use and click the
PivotTable command at the Insert tab>>Tables group. Choose your settings
25
INE 214 MS Excel
on the Create PivotTable dialog box and click OK. A blank PivotTable and Field List are created on a new
worksheet.
Select the fields to include in the PivotTable. The selected fields will be added to one of the Filters,
Columns, Rows, or Values areas below the field list. You can also click and drag the fields to one of these
four areas to select them and hold and drag existing fields out of these areas. The PivotTable calculates
and summarizes the selected fields. For example, we can display the total number of units sold for each
product type as shown in Figure 40. You can sort or format the PivotTable like regular spreadsheet data.
To show multiple columns, drag a field from the list to the Columns area. In the example in Figure
41, the total value of sales units for each product type is added to the PivotTable as a column.
26
INE 214 MS Excel
To add a filter to the PivotTable, drag a field to the Filters area, click the drop-down arrow, check
the box for Select Multiple Items and uncheck the box for items to exclude from the PivotTable, as shown
in Figure 42. When you click OK, the PivotTable is updated by excluding the product names you have
unchecked from the summary.
Another way to add filters to PivotTables is selecting Insert Slicers from the Analyze tab>>Filter
group and selecting the field(s) to filter from the Insert Slicers dialog box. Then the slicer appears next to
the PivotTable and you can select or deselect the items to display using the slicer that shows the selected
items highlighted in blue. For example, in Figure 43, Cakes, Cookies, and Pies are selected.
27
INE 214 MS Excel
4.5.1 PivotCharts
PivotCharts are charts that display data from a PivotTable. To insert a PivotChart, select any cell in the
PivotTable and click the PivotChart command from the Insert tab>>Charts group. Select the chart type
and layout and click OK to view the chart. The PivotChart will automatically reflect new data as you make
changes to your PivotTable.
28
INE 214 MS Excel
• On the Goal Seek dialog box, select the cell you want to set to a target value and the cell that will
be changed to achieve that target.
• Click OK and Goal Seek will display the required value to reach the specified goal as in Figure 45.
• Click What-If Analysis command from the Data tab>>Data Tools group and select Scenario
Manager.
• On the Scenario Manager dialog box, click Add.
• On the Add Scenario dialog box, enter Scenario name and choose cells to change.
• On the Scenario Values dialog box, enter values for the cells to change.
• Click OK to complete and see the result of the scenario as in Figure 46.
You can create multiple scenarios with different values for multiple cells and compare their results by
clicking Show or by double-clicking on the scenario name on the Scenario Manager dialog box.
• List the possible values of the two variables in a column for one variable and a row for the other
such that they appear as the row labels and column labels of the Data Table. For example, in
Figure 47, we calculate the revenue from selling 300 cups and 200 plates at $8 and $6 per unit,
respectively, in cell B4. We list possible number of cups in the cell range B5:B10 and possible
number of plates in cell range C4:H4.
• On the upper- left corner of the data table (the corner cell between the variable values), enter the
formula that uses the variables. This cell is B4 in our example.
29
INE 214 MS Excel
• Select the cell range that includes the Data Table. We should select B4:H10 in our example.
• Click What-If Analysis command from the Data tab>>Data Tools group and select Data Table.
• Select the row input cell for the variable that will take the values listed in the top row of the Data
Table and the column input cell for the variable that will take the values listed in the leftmost
column of the Data Table. The row input cell is B3 and column input cell is B2 in our example.
• Click OK and the Data Table will be filled with the results generated for all possible scenarios.
Figure 48 displays the revenue for 25 possible scenarios.
30