Вы находитесь на странице: 1из 29

Martin Strbak

25 October 2012

Excel selection of useful functions

2009 IBM Corporation


Purpose of this presentation

This presentation is designed for absolvents of MS Excel: Most useful functions


course
It provides self-study material for better utilization of knowledge gained in the
course
Contents:
Comma and semicolon difference
List separator, .csv file
Viewing options
Useful shortcuts
Function COUNTIF
Data validation
Functions VLOOKUP, HLOOKUP
Function OFFSET
Dynamic ranges
Pivot tables
Functions ISNA, ISERR

2009 IBM Corporation


2
Student requirements

For the most effective learning experience, make sure you


have sufficient level of understanding of the following:

Basic orientation, selecting a cell or a range of cells, copy,


paste, paste special, "Find" function (ctrl+f)

Basic graphical makeup (cell background color, font color, font


size, weight), borders

Cell format - General, number, percentage, currency, date,


time

Cell format - alignment, font color, cell background color,


borders

Autofilter, sorting data

Basic graphs, selection of graph type, selection of source data,


graphical changes to graphs

Basic formulas such as "=1+2", reference to cell content such


as "=A1"

Basic functions such as SUM, AVG, COUNT, MIN, MAX, IF, AND,
OR

2009 IBM Corporation


3
Coma and semicolon in functions
The list separator symbol can be different at different language settings in
Windows.
This may lead to errors in formulas or when importing data.

If you have English, you will need to type a comma , by default between parameters in
functions.
If you have Czech lang. settings, type semicolon ;. In case of another lang. setting, make
sure to check this detail when encountering an error.
Example:
English settings: =MIN(1,2,3)
Both will result in 1
Czech settings: =MIN(1;2;3)appearing in the cell

You can find your language settings in Windows in the


menu
Start Control panel Regional and Language options
Regional Options
It is possible to change this list separator there.

2009 IBM Corporation


4
Coma and semicolon in functions - example

Micros oft Excel


Works heet

Follow the instructions in the worksheet above.

In one of the cases, an error occurs and in one case, number 3 appears.
If the number appears when using semicolon, then your list separator is set
to semicolon.
If the number appears when using comma, then your list separator is set to
comma.

Other symbols may also be set as list separators, but comma and semicolon
are the most common.

2009 IBM Corporation


5
Data import from .csv
The .csv file is a format often used by programs and web applications to export
data.
A common error occurs when importing these data into excel. See below.

The file extension .csv stands fro comma-separated values. That means that the contents
are separated by a symbol (delimiter), usually comma or a semicolon.
If the data do not align in the cells correctly, try changing the separator (see next slide).

If you opened csv file in a


notepad, it could look like
this: Correct import:

Incorrect import:

2009 IBM Corporation


6
Data import from .csv, slide 2

In case the Excel does not open csv file


correctly, you can import the data into new
worksheet and specify the delimiter and other
parameters in menu Data Import External
Data Import Data

2009 IBM Corporation


7
Data import from .csv example

Comma separated Semicolon


separated
Micros oft Office Micros oft Office
Excel Comma Separated V Excel Comma Separated V

Try to open the two .csv files above.


One will look ok, the other will group all text from one row
into the first column.
Try to find a solution so both look the same in Excel
To see the solution, double-click on the worksheet below

Micros oft Excel


Works heet

2009 IBM Corporation


8
Window/view functions

This slide describes basic ways of


viewing the data

Window Arrange arranges all excel windows in


tiles, next to each other (in left-right or top-bottom
order), or in a cascade
Window Split separates the screen into
halves/quarters depending on the position of active
cell. Provides two/four different views on the same
spreadsheet
Window Freeze panes keeps the row(s) and
column(s) on the place, depending on the position
of an active cell. Good for keeping the table headers
in view when scrolling through large amount of data
Window Hide/Unhide Useful when you need to
make some row or column disappear for some time
(but not delete). The selection then excludes the
hidden cells. Only the whole column or row can be
hidden.
Data Group and outline allows you to quickly
hide and unhide columns/rows. Useful when you
need to navigate quickly through a large worksheet.

2009 IBM Corporation


9
Useful shortcuts
This slide is about shortcuts, as they can speed up your work:
in case you are repeating certain action often
In case you need to move across data quickly
CTRL+H - Similarly to CTRL+F, CTRL+H also finds the inserted text
within a range, sheet or workbook. Moreover, it gives the option to
replace the text found with another text which we specify.
Under Options, you can also search & replace Format!
Shift + Enter, Shift + TAB Enter moves the cursor one cell down,
Shift + Enter moves it one cell up. Similarly the TAB moves the
cursor to the right and Shift + TAB to the left.
CTRL + arrow selects the last non-blank cell to the right/left/top/bottom
SHIFT + arrow expands the selected range by one cell to the right/left/top/bottom
CTRL + SHIFT + arrow expands the selected range by all non-blank cells to the
right/left/top/bottom
HOME selects a cell in the leftmost column on current row
CTRL + HOME selects a cell in the top left position (usually cell A1, unless hidden)
CTRL + PgUp/PgDown next/previous sheet
ALT + Enter Jump to the next row inside a cell
F2 press F2 to start editing the selected cell (works as double-click in the cell)
2009 IBM Corporation
1
Data formats
Numbers vs text
There are two main types of data Text and Numbers
Text cannot be formatted by right click Format cells nor anyhow calculated!
(even if it looks like a number)
The example on the right is NOT a number!
The decimal separator is in this case full stop
. and not comma ,
Because comma is understood as a letter,
the whole content of the cell is considered text.
Sometimes, space between numbers is also considered
as text.
The solution is to replace commas with full stop
(use function Replace).
Excel automatically aligns numbers to the right
and text to the left.

2009 IBM Corporation


1
Data formats 2
Dates and time

Dates and time are automatically converted when written.


Time 18:00 is actually 0.75 formatted as time.
Date 19-12-2012 is actually 41263 formatted as date.
Therefore calculations like 20-12-2012 19-12-2012 is the same as 41263
41262.
The number representing date is a number of days since the beginning
of 20. century (01-01-1900)
The date can be inserted like 19-12-2012, 19.12.2012, 19/12/2012, 12/19/2012.
Some of those formats are not always accepted. This depends on the computer
language settings.

2009 IBM Corporation


1
Cell reference
There are two types of reference Relative and Absolute (marked with $)

Relative are dependant on the position of the formula


Example: =C1 placed in A1 is actually pointing two cells to the right
When moved or copied to cell B2, it will point two cells to the right, that is
cell D2

Absolute reference always points to the same place


Example: $C$1 placed in A1 will always point to C1, no matter where it
is copied or moved

The symbol $ freezes the letter or number in reference, making it unable to


change when moved or copied.

See the example on the right:


The top-leftmost cell was copied to
9 cells
Notice where the column changes,
where the row changes, and where
it does not

2009 IBM Corporation


1
Function COUNTIF
Function COUNTIF lets you the number of cells matching selected criteria

Function COUNTIF counts how many times repeat cells with content matching the condition
Useful for e.g. finding duplicates

=COUNTIF(A:A;Adam)
Counts how many Adams is in the column A

=COUNTIF(A:A;?????*)
Counts cells with contents at least 5 characters long.

COUNTIF is also very well applicable to cells with numbers,


with conditions such as
=COUNTIF(A:A;">=50") and so on.

Similar to functions COUNT and COUNTA which count the amount of cells with numbers
(COUNT) or numbers and letters (COUNTA)

2009 IBM Corporation


1
Function COUNTIF example

Micros oft Excel


Works heet

Open the file above


There is about 3000 server names
Some of the entries are there more than once filter them out using COUNTIF
To see the solution, double-click on the worksheet below

Micros oft Excel


Works heet

2009 IBM Corporation


1
Data validation
Data validation allows you to specify data that can be entered into a cell

Found in the menu Data Validation


The criteria varies, one of the most used is List. You can name the items you wish to be in
the list, or you can select a range of cells.
Error alert options:
prevent user from inserting data that do not match the criteria Style Stop in the
Error Alert tab
warn the user and ask if he/she wishes to keep the data Style Warning
only inform the user that the data inserted do not match the criteria Style
Information

2009 IBM Corporation


1
Data validation example

Micros oft Excel


Works heet

There is a table with names.


Each person specializes in one OS
Create a drop-down list in column B offering values from column I
To see the solution, double-click on the worksheet below

Micros oft Excel


Works heet

2009 IBM Corporation


1
Function VLOOKUP, HLOOKUP

Good for searching through data in connection to other data.


Function VLOOKUP searches a range for defined value, and, if found, returns a
value from the same row and X columns to the right from where the value was
found.

The formula consists of


the value we are looking for
the range where we are looking for it,
and the column index from which we want the result.
The last parameter defines if excel should look for the closest value, if it did not found
exactly the same. That is usually undesirable, thus we usually put 0 as the last
parameter.

Example formula
=VLOOKUP(Deren;B2:C15;2;0)

2009 IBM Corporation


1
Function VLOOKUP, HLOOKUP, slide 2

In the example on the picture above, we are looking for the value Deren.
We want to return the value from the second column in the range and we do not want to
search for the closest name if Deren is not found.
Note: The column in which we are searching for the value has to be the first column in the
selected range.

2009 IBM Corporation


1
Function VLOOKUP, HLOOKUP example

Micros oft Excel


Works heet

Open the excel file above


Find the corresponding disk space values to the servers on the right
Use VLOOKUP
Solution is in the worksheet below

Micros oft Excel


Works heet

2009 IBM Corporation


2
Function OFFSET

Function OFFSET allows us to select certain range in relation to a


reference cell.
Example: OFFSET(B2;3;1;5;2) would refer to the whole range C5:D9 in the table
below
It starts at the cell B2, goes down three cells and one to the right (that is C5)
and selects five cells down and two to the right (that is C5:D9).
You can of course replace the numbers with references or formulas. When
negative number is inserted, the reference will point up and to the left instead of
down and right OFFSET(B2;-1;0;1;1) would point to the cell B1.
This function is important for the creation of static and dynamic ranges (that is,
when you do not have exactly specified cells from:to such as A1:D5). You can
see the practical example at the slide with dynamic ranges

2009 IBM Corporation


2
Function OFFSET example

Micros oft Excel


Works heet

Sum numbers in the excel above using functions SUM and OFFSET
Solution is in the spreadsheet below

Micros oft Excel


Works heet

2009 IBM Corporation


2
Dynamic ranges
With dynamic ranges, you do not have to change the range of a function or a
graph every time some data are added to or removed from the range.
Requires the knowledge of nested functions, OFFSET

Can be created in the menu Insert Name Define


Example: I want a graph that automatically includes new values in column B.

The function used looks like this: =OFFSET(Cars!$B$2;0;0;COUNTA(Cars!$B:$B)-1;1)


The function OFFSET selects a range, starting at the sheet Cars, cell B2.
Function COUNTA counts non-empty cells in the column B. That is 15 in our case.
That means we will select a range of 15-1 rows (without the title row) and 1 column, starting at
cell B2.
Range Cars is the same, only with column C instead of B. 2009 IBM Corporation
2
Dynamic ranges, slide 2

Lets create a graph with dynamic data input


The axis X of the graph will show the names,
Y will show the number of cars sold.

We will need to tell the graph what is the data source:


That is, we refer to the range by its name, with a name of
the workbook before it:
='Excel lessons.xls'!Cars
The resulting graph will look similar to the one below.
There is nothing special about it, until we add another
person to the table. Then it will automatically add the new person to the graph

2009 IBM Corporation


2
Dynamic ranges - example

Micros oft Excel


Works heet

Create two dynamic ranges and apply them to the graph, so when a new week is
added, a new column automatically appears in the graph
Solution is in the spreadsheet below

Micros oft Excel


Works heet

2009 IBM Corporation


2
Pivot tables
A powerful feature which can, once understood, contribute greatly to your productivity
Allows you to display data in many ways without changing them

The disadvantage is a need for large amount of operational memory.


Also remember to have headers at your table and to have no blank cells in the table, if possible.
You cannot modify the source table by playing with a pivot table, so you do not have to be afraid of experimenting

It is possible to do an average (and more) instead of sum of liters as on the picture.


All possibilities cannot be named in a few slides, just remember to use Pivot table if you
want to summarize any table; especially the large ones.

2009 IBM Corporation


2
Pivot tables - Example

Micros oft Excel


Works heet

Take the source data from the worksheet above and create a pivot table into the sheet Pivot
Put Person ID and Name to the left, sold brand at the top and the number of sold cars into the
data area
Disable Subtotals at the column Person ID so you save some overflowing rows.

Solution is in the spreadsheet below:

Micros oft Excel


Works heet

2009 IBM Corporation


2
Functions ISNA, ISERR

Functions ISNA and ISERR add clarity to the spreadsheet, particularly in


connection with the function IF. They return values TRUE and FALSE (resp. 1 and
0) if the condition is met.

For ISNA, the value of reference has to be #N/A to return TRUE.


For ISERR to return TRUE, the value of reference can be #N/A, #DIV/0, #NAME?, #VALUE!, #REF!,
#NUM! or #NULL.

Example: =IF(ISNA(A2),Not found,A2)


In the example above will appear the words Not found if result of the cell A2 is #N/A. In this case it
is clear that there is no error in calculation and that this situation has been foreseen .

In the picture is an example of common situation in column A and corrected, better-looking column B.
Column C shows the formula used in the column B.

2009 IBM Corporation


2
Functions ISNA, ISERR - example

Micros oft Excel


Works heet

Modify the formulas used in the column N in the worksheet above.


Use combination of functions IF and ISNA to replace #N/A with Not found.
Solution is in the spreadsheet below:

Micros oft Excel


Works heet

2009 IBM Corporation


2

Вам также может понравиться