Lesson 1 - Excel Tutorial
Lesson 1 - Excel Tutorial
Study Notes
1
In Excel, there are many possible operations, for example, selecting a range of data, copy and
paste, filling a series, using functions for calculation etc. These operations sometimes seem
hard and are quite time-consuming; however, there are some shortcuts and hotkeys that could
improve the efficiency of using Excel.
To select a range
o Dragging with your mouse
(1) Click on one corner of the range
(2) Drag to the opposite corner
o Shift key
(1) Click on the uppermost and leftmost cell of the range
(2) Hold down the Shift key AND click on the lowermost and rightmost cell of the
range
9 9 9
1 3 8
8 1 10
7 5 4
5 1 1
5 10 7
2
Excel Example 1.2:
10 13 7 9
1 9 12 7
5 4 1 1
6 12
15 2
13 4 10
To select the ranges B2:C4 and E2:F6, click on B2, hold down the Shift key and click on C4 (so
now the first range is selected), hold down the Ctrl key and click on E2, and finally hold down
the Shift key and click on F6.
3
Excel Example 1.4:
Insert blank columns for sales representatives Ben, Donald, and Eva so that the sales
representatives are in alphabetical order from left to right.
Note: The Alt + I then C shortcut does not work in the embedded Excel spreadsheet below.
Note: Deleting a row/column is not the same as clearing the contents of a row/column.
Clear the content is to make the cell blank. Deleting a row/column is to get rid of the
row/column completely.
• Scientific notation
Try calculating 123456789 x 123456789 in Excel, the answer will be displayed as
1.52416E+16 (or ###### if the column width is not wide enough). But what does
1.52416E+16 mean?
It means 1.52416 x 10 16 = 15,241,600,000,000,000
4
Excel Example 1.6:
Calculate 0.00123 x 0.00123 in Cell A2
Write down the answer with and without using the scientific notation.
1.52416E+16
• Decimal places
What if we want to show more/less decimal places for the answer?
5
• Some basic keyboard shortcuts - cut, copy, paste, undo, redo
Cut, copy, paste, undo and redo are very typical operations. There is a faster way to get
these jobs done - keyboard shortcuts.
6
✓ Microsoft Excel Formulas
• Copy and paste formulas
A frequent task is to enter a formula in one cell and copy it down a row or across a column.
There are several very efficient ways to do this.
(More examples:
http://chandoo.org/wp/2012/01/09/how-to-enter-same-data-into-multiple-cells/)
A B A+B
10 7
6 9
4 9
5 1
2 8
8 10
10 7
This method uses Excel’s built-in intelligence, but it only works in certain situations -
we need to have an adjacent column to indicate the range to be filled up. Using the
7
above example, formula entered in cell C2 can be copied to C3:C8 by double clicking
the fill handle. However, if you enter the formula in column D, double clicking the fill
handle would not work. In the spreadsheet above, copy the formula in C2 down through
C8 by double-clicking the “fill handle”.
Absolute reference and relative references are indicated in formulas by having dollar signs
or not. Note that the dollar signs are relevant only for the purpose of copying or moving;
they have no inherent effect on the formula. For example, in cell B1, the formulas =5*A1
and =5*$A$1 produce the same result. Their difference is relevant only if cell B1 is copied
or moved.
You may type the dollar sign(s) into the formula. An alternative way to do it is the F4 key.
In fact, pressing the F4 key repeatedly cycles through the possibilities: A1 (neither column
A nor row 1 fixed), then $A$1 (both column A and row 1 fixed), then A$1 (only row 1
fixed), then $A1 (only column A fixed), and back again to A1.
Units sold
50 100 150 200
Unit price $3.25
$3.50
$3.75
$4.00
$4.25
8
• Trace precedents and dependents
Checking formulas for accuracy or finding the source of an error may be difficult if formula
uses precedent or dependent cells:
Precedent cells — cells that are referred to by a formula in another cell. For example, if
cell D10 contains the formula =B5, then cell B5 is a precedent to cell D10.
Dependent cells — these cells contain formulas that refer to other cells. For example, if
cell D10 contains the formula =B5, cell D10 is a dependent of cell B5.
To assist you in checking your formulas, you can use the Trace Precedents and Trace
Dependents commands to graphically display and trace the relationships between these
cells and formulas with tracer arrows.
If Excel beeps when you click Trace Dependents Button image or Trace Precedents Button
image, Excel has either traced all levels of the formula, or you are attempting to trace an
item that is untraceable. The following items on worksheets that can be referenced by
formulas are not traceable using the auditing tools:
i. References to text boxes, embedded charts, or pictures on worksheets.
ii. PivotTable reports.
iii. References to named constants.
iv. Formulas located in another workbook that refer to the active cell if the other
workbook is closed.
Excel Example 1.11 (same dataset as example 1.10):
Enter the formula as example 1.15 and trace the precedents and dependents.
Units sold
50 100 150 200
Unit price $3.25
$3.50
$3.75
$4.00
$4.25
9
✓ Microsoft Excel Data Management Skills
• Fill a series
Suppose we would like to have an index in a column, it is obvious that you could type in the
numbers 1, 2, 3, etc. one by one. It might be ok if we have 1 – 20 only, but it could be
extremely time-consuming if we have 1 – 1000 to be filled in cells A1 – A1000. In such
case, the following method would be helpful.
As you can see from the dialog box, some other options (e.g. Growth, AutoFill, etc.) are
available as well. You could experiment with them and see what the effects are.
10
• Sort
Suppose we have a database that have various inputs under a variable, and we want to sort
the database according to some variables. Sorting data is an integral part of data analysis.
You can sort data by text (A to Z or Z to A), numbers (smallest to largest or largest to
smallest), and dates and times (oldest to newest and newest to oldest) in one or more
columns. You can also sort by a custom list you create (such as Large, Medium, and Small)
or by format, including cell color, font color, or icon set.
To sort by a variable
o Data → Sort
(1) To sort in ascending order, click or descending order, click .
(2) If you sort by cell color, font color, or icon set, select On Top for a column sort,
and On Left for a row sort. There is no default cell color, font color, or icon sort
order. You must define the order that you want for each sort operation.
11
• Filter
Filter your Excel data if you only want to display records that meet certain criteria.
To filter variables
o Data → Filter
(1) Click any single cell inside a data set.
(2) On the Data tab, in the Sort & Filter group, click Filter.
• Data tools
When working with dataset, excel provide many useful data tools to help quickly manage
our dataset. We will introduce the following common ones, but keep in mind there are
many more other tools available in excel you can explore.
To separate the contents of one excel cell into separate columns, you can use the convert
text to columns wizard.
Flash fill automatically fills your data when it senses a pattern. For example, you can use
flash fill to separate first and last names from a single column or combine first and last
names from two different columns.
12
Sometimes duplicate data is useful, sometimes it just makes it harder to understand your
data. Use conditional formatting to find and highlight duplicate data. That way you can
review the duplicates and decide if you want to remove them.
Data validation in excel lets you control the data that can be entered in a cell. You can
restrict the user to enter only a specified range of numbers or text or date. You can also use
data validation functionality to create an excel drop down list.
13
Excel Example 1.15 (same dataset as example 1.13):
Split the single column variable car name into multiple columns using convert text to columns
wizard. Then, split only the car brand name into a new column using flash fill. Check number
of unique entries under variable car name using remove duplicates. Finally, define horsepower
200 or above as invalid and circle them using data validation.
14
You can view two areas of a sheet by splitting it into pane. When you split a sheet into separate
panes, you can scroll in both panes independently. By splitting the worksheet, you can scroll
down in the lower pane and still see the top rows in the upper pane.
To Split a sheet into panes
o View → Window → Split
(1) Select below the row where you want the split, or the column to the right of
where you want the split.
(2) On the View tab, in the Window group, click Split. To remove the split panes,
click Split again.
15
✓ Microsoft Excel Functions
• IF function
There are many useful functions in Excel. Below are some basic ones that everyone should
know. Some other functions are given in the file Lesson 1B – Some Useful Functions in
Excel.xlsx in the course website as well.
Note: We capitalize the names of these functions just for emphasis. However, they are
NOT case sensitive in Excel.
=IF function
Enter the formula =IF(condition,expression1,expression2), where condition is any
condition that is either true or false, expression1 is the return value if the condition is
true, and expression2 is the return value if the condition is false
IF function is useful; yet, it could be very complex. For example, IF functions are sometimes
nested if there are more than two possibilities. Excel allows up to seven level of nested IF
functions.
16
• Common errors
If you get an error from the Excel if function, this is likely to be one of the following:
#N/A Occurs if none of the supplied logical_tests evaluate to TRUE.
Occurs if one or more of the supplied logical_tests returns any value
#VALUE!
other than TRUE or FALSE.
Occurs if you are using an older version of Excel, that does not
#NAME?
support the function you are using.
17
✓ Import Dataset into Microsoft Excel
There are two ways to import data from a text file with Excel: you can open it in Excel, or you
can import it as an external data range. To export data from Excel to a text file, use the Save As
command and change the file type from the drop-down menu. You can import or export up to
1,048,576 rows and 16,384 columns. There are two commonly used text file formats:
o Comma separated values text files (.csv), in which the comma character (,) typically
separates each field of text.
o Delimited text files (.txt), in which the TAB character (ASCII character code 009)
typically separates each field of text. Or sometimes comma character (,).
You can change the separator character that is used in both delimited and .csv text files. This
may be necessary to make sure that the import or export operation works the way that you want
it to.
18
Excel Example 1.20:
Import dataset Car_Evaluation.csv, Car_Evaluation_Tab.txt, Car_Evaluation_Comma.txt, and
Car_Evaluation_Fix.txt into excel.
19