1
LONDON SCHOOL OF HYGIENE & TROPICAL MEDICINE | SEP 2016
Excel 2016 INTRODUCTION: FORMULAE, FUNCTIONS & FORMATTING
CONTENTS
CREATING A NEW WORKBOOK ............................................................................................................... 1
ADDING AND NAMING WORKSHEETS .................................................................................................. 1
To name a worksheet .............................................................................................................................. 1
To change the tab colours ...................................................................................................................... 1
ENTERING DATA ............................................................................................................................................ 2
ADJUSTING COLUMN WIDTHS AND ROW HEIGHTS ....................................................................... 2
SELECTING ROWS AND COLUMNS, CELLS, AND WORKSHEETS ................................................ 2
Selecting rows and columns .................................................................................................................. 2
Selecting cells .............................................................................................................................................. 2
Select a worksheet .................................................................................................................................... 3
WRAPPING TEXT ........................................................................................................................................... 3
TO CLEAR THE CONTENTS OF A CELL .................................................................................................. 3
INSERTING AND DELETING COLUMNS AND ROWS ........................................................................ 3
FIXING ROWS AND COLUMNS .................................................................................................................. 4
HIDING ROWS AND COLUMNS ................................................................................................................. 4
MOVING AND COPYING SHEETS .............................................................................................................. 4
FORMATTING DATA ..................................................................................................................................... 5
AUTOFILL .......................................................................................................................................................... 5
Autofill days and months ....................................................................................................................... 5
Autofill a number series ......................................................................................................................... 6
Other autofill options ............................................................................................................................... 6
BORDERS AND SHADING ............................................................................................................................ 6
To add shading to a data range ............................................................................................................ 6
To add a border to a data range........................................................................................................... 6
TRANSPOSING DATA .................................................................................................................................... 7
CALCULATING WITH FORMULAE ........................................................................................................... 7
Copying formulae ...................................................................................................................................... 8
CALCULATING WITH FUNCTIONS .......................................................................................................... 8
Autosum ...................................................................................................................................................... 10
RELATIVE AND ABSOLUTE CELLS AND RANGES ........................................................................... 10
Absolute cells and ranges ..................................................................................................................... 10
Mixed cells and ranges .......................................................................................................................... 10
Naming cells and ranges ....................................................................................................................... 11
SORTING AND FILTERING ........................................................................................................................ 11
Autofilter .................................................................................................................................................... 12
SPLITTING CELL CONTENTS ................................................................................................................... 13
MORE FUNCTIONS ....................................................................................................................................... 14
Trim .............................................................................................................................................................. 14
Concatenate ............................................................................................................................................... 14
CountA ......................................................................................................................................................... 15
CountIF ........................................................................................................................................................ 15
IF .................................................................................................................................................................... 15
1
CREATING A NEW WORKBOOK
A workbook is an Excel file with the file extension .xlsx
To create a new workbook:
Open Excel 2016 and click on BLANK WORKBOOK.
ADDING AND NAMING WORKSHEETS
Worksheet tabs are displayed in the bottom left of the screen.
By default there is a single sheet displayed in all new workbooks.
To add a new worksheet press the ‘+’ sign next to the Sheet1 tab.
To name a worksheet
Right click on the sheet tab and select RENAME.
To change the tab colours
Right click on the sheet tab and select TAB COLOUR.
2
ENTERING DATA
You can either type directly into a cell or click on the cell and enter information into the
formula bar (see below).
ADJUSTING COLUMN WIDTHS AND ROW HEIGHTS
Click on the lines between the columns – you should see a cross that looks like this
Click on the cross, then hold down the left mouse button while you drag the cross to the
width/height you want. Double click on the cross to ‘autofit’ to contents.
SELECTING ROWS AND COLUMNS, CELLS, AND WORKSHEETS
Selecting rows and columns
To select an entire row or column click on the column heading or row label, then hold down
the CONTROL key to select further ranges.
e.g. Select column A, then hold down the
CONTROL key to select column C.
Selecting cells
To select a single cell simply click once in the cell. To select multiple cells, click once in the
first cell, then hold down the CONTROL key while selecting additional cells.
3
Select a worksheet
To select an entire worksheet, click on the triangle in the top left hand corner of the sheet
WRAPPING TEXT
If you type more than a few letters/numbers of text into a cell the contents will disappear
once they have reached the edge of the cell. To ‘wrap text’ (i.e. to have the cell expand so you
can see all of the text) click in the cell and select WRAP TEXT on the HOME tab.
TO CLEAR THE CONTENTS OF A CELL
To clear the contents of a cell (or cells) click on the cell (on a group of cells), then RIGHT
CLICK and select CLEAR CONTENTS.
INSERTING AND DELETING COLUMNS AND ROWS
To insert a column or a row into your worksheet first select the column or row next to which
you would like to insert another column or row.
Select a column row by clicking at the top of the columns (on the letter which labels the
column) or on the left of the rows (on the number which labels the row).
Not wrapped Wrapped
4
Once you have selected a column or row, click on the HOME TAB and select INSERT.
NOTE: New rows are inserted above the active row and new columns to the left of the active
column
To delete a column or row, first select it, then click DELETE.
FIXING ROWS AND COLUMNS
You can fix rows and columns in Excel so that they always display on the screen. This is
useful if you want to keep your header row in view when you scroll through a worksheet.
To fix the first row or column click on the View tab and click on FREEZE PANES.
Select either FREEZE TOP ROW or FREEZE FIRST
COLUMN.
To ‘unfreeze’ a column or a row select the frozen
column or row and click on FREEZE PANES. Select
UNFREEZE PANES.
To freeze more than just the top or left pane (e.g. if you
wanted to freeze the top two rows), click on the first
row or column that you don’t want frozen (e.g. if you wanted to freeze the top two rows
then you would click on the third row), then select FREEZE PANES, and select FREEZE
PANES.
HIDING ROWS AND COLUMNS
On a large spreadsheet it can be useful to hide columns or rows of data that you are not
working with.
To hide rows or columns click on the column heading(s)/row label(s) to select the area that
you want to hide. Once the columns or rows you wish to hide have been selected, RIGHT
CLICK and select HIDE.
To unhide rows and columns click and drag on the column headings/row labels to either side
of the hidden area (e.g. if column H is hidden then select the columns to either side: G and I),
then RIGHT CLICK and select UNHIDE.
MOVING AND COPYING SHEETS
To move or copy a worksheet, first select it (see ‘Select a worksheet’ above)
5
On the HOME tab select FORMAT, then select MOVE OR COPY
SHEET.
A Move or Copy pop-up box will appear.
FORMATTING DATA
Cells formatting is automatically set to General which means no
specific formatting is applied.
To format numbers with decimal places, currency, date formats etc,
click on the drop down list next to GENERAL on the HOME tab and
select the appropriate category.
AUTOFILL
Instead of entering data manually on a worksheet, you can use the Auto Fill feature to fill
cells with data that follow a pattern.
Autofill days and months
Excel will automatically fill a series of cells for days and months
if you type the first value
Click in the bottom right hand corner of the cell containing the
first value and use the autofill handle (i.e. this cross ‘+’) to drag
the series values down the column.
To move the worksheet to a new workbook click here
To move the worksheet to a new location in the same workbook click here
Tick this box to make the newly moved worksheet a copy of the original (i.e. there will be two identical worksheets, the original, and the one you have moved)
6
Autofill a number series
To fill a number series type the first value, use the fill handle to
drag the values down the column then select FILL SERIES.
Other autofill options
If you want to autofill according to a more complex pattern e.g.
increment numbers by five or combine letters and numbers, you need to
enter and select enough cells for Excel to recognise the pattern. Once
you have done this select the cells in the series and use the fill handle to
drag down the column.
BORDERS AND SHADING
To add shading to a data range
Select the cells to which you wish to add shading.
Click on the FILL tool on the HOME tab (it looks like a
paint pot).
Select the fill colour you require
To add a border to a data range
Select the cells to which you wish
to add a border.
Click on the BORDERS tool on
the HOME tab.
Choose an option from the drop
down list or select MORE BORDERS to see further options
7
TRANSPOSING DATA
The transpose command allows you to switch your rows and columns.
To transpose a data range, first select the range, then RIGHT CLICK
and select COPY.
Click in the cell where you want the new data range to start.
Click the drop down arrow under PASTE in on the HOME tab.
Select the TRANSPOSE icon.
CALCULATING WITH FORMULAE
A formula is a set of mathematical instructions that can be used in Excel to perform
calculations. Formulae (and functions, see next page) always start with an = sign.
Formulae contain the following:
References: the cells or cell ranges that you want to use in your calculation
Operators: Symbols (+, -, *, / etc.) that specify the calculation to be performed
Constants: numbers or text values that do not change
Operators are as follows:
Subtraction: minus sign ( - ) Addition: plus sign ( + ) Division: forward slash ( / ) Multiplication: asterisk (* ) Exponentiation: caret (^ )
The order of operations is:
Brackets Exponents Division Multiplication Addition Subtraction
To create a basic formula, click in the cell, then type the ‘=’ sign followed by the cell
references and the operators as shown below:
8
Press ENTER.
Formulae can also be typed into the formula bar directly above the worksheet (shown
below). When you click on a cell containing a formula, the formula is always shown here.
Copying formulae
To copy a formula across a column or down a row use the autofill handle (see page 9)
CALCULATING WITH FUNCTIONS
Functions are built in formulae in Excel which allow you to perform specific, often more
complex calculations than formulae. They are grouped logically in the Function Library on
the FORMULAS tab (see below).
9
You can also access a full list of functions by clicking on the Insert Function icon on the
formula bar.
Functions are built using the = sign, the function name/command e.g. SUM, COUNT,
AVERAGE and the cell range(s) usually in parenthesis e.g. = SUM(A10:B20)
Below is an example of using the SUM function to add the contents of two cells.
Click ALL to see a complete list of
functions.
When you select a function using
the INSERT FUNCTION
command, a brief description of
what the function will calculate
appears below the list of
functions.
You can also click on HELP
WITH THIS FUNCTION
for examples of how to use
the function.
10
Autosum
Some of the more popular functions also appear on the HOME tab in the AUTOSUM drop
down menu to the far right of the commands.
You can also access a full list of functions from here.
RELATIVE AND ABSOLUTE CELLS AND RANGES
In the previous examples when you copied formulae and functions the cell ranges which
were calculated adjusted to recalculate the values in the new location e.g. =SUM(A1:A5)
became =SUM(B1:B5) when copied to column B. This is known as relative cell addressing.
In some cases you may want to keep the same cell (or row or column) as a constant in a
formula. In such a case we need to fix the cell (or row or column) which we do in Excel using
the $ sign.
Absolute cells and ranges
To fix a cell or a range use $ signs before the row and the column references
e.g. $A$1 or $A$1:$C:$5
Mixed cells and ranges
To fix a column only use $A1
To fix a row only use A$1
When constructing a function you can also set a cell or a range to absolute by pressing the
F4 key whilst the cell is active.
11
Naming cells and ranges
In Excel you can name a cell or a cell range, rather than using the cell
references. This allows you to go directly to the range (using the
FIND & SELECT, and GO TO. command on the HOME tab). You
can also use named ranges in formulae e.g. =[income]-[expenditure]
To name a cell or a range select the cell or range, type the name in the
Name box to the left of the Formula bar and press Enter (shown
below).
NOTE: Names cannot contain
spaces
To go directly to a named range, on the HOME tab choose FIND & SELECT, and then
select GO TO…
Named ranges in your spreadsheet will appear in a list
SORTING AND FILTERING
You can sort your data using the SORT & FILTER options to the right of
the HOME tab. To sort by a particular column, you need to place your
cursor in the column first.
To sort on multiple columns e.g. first by column A, then by column B use
the CUSTOM SORT... command. Select the initial sort, then choose ADD
LEVEL to add sub-sorts.
12
Autofilter
To filter data click on SORT & FILTER group on the HOME
tab and select the FILTER option. When you do this you will
see small drop-down arrows next to the top of each column.
Click on the drop-down arrow to see the options for filtering
that column.
Use the drop down arrows which appear at the top of
each column to filter according to your criteria.
Click OK
To remove a filter click on the filter drop-down arrow and
select CLEAR FILTER FROM ...
13
SPLITTING CELL CONTENTS
Sometimes you may want to split data in one cell into two or more cells. You can do this
using the Convert text to Columns wizard. Your cell contents must be delimited in some
way e.g. by spaces or commas or fixed width.
First select the column of data, then click on TEXT TO COLUMNS command on the DATA
tab.
Follow the instructions in the wizard.
14
MORE FUNCTIONS
Trim
The Trim function removes all spaces in a text string with the exception of
one space between words.
To use the function first click on the destination cell then select TRIM from
the drop down menu under TEXT in the FORMULAS tab.
Click on the cell reference you wish to trim and click OK
You can copy the formula down a column as necessary.
Concatenate
Concatenate allows you to join text strings together from different cells (it is
kind of the reverse of the converting text to columns command).
To use the concatenate function, click first in the destination cell
then select then select CONCATENATE from the drop down
menu under TEXT in the FORMULAS tab.
Click on the cells you want to join together (concatenate) in the
correct order.
Click OK.
15
CountA
If you need to count the number of numeric values in a cell
range you can use the COUNT function. For non-numeric
values you use the function COUNTA. COUNTA counts
any cells within a range, with the exception of blank cells.
To use COUNTA, click on the destination cell, select the
COUNTA function from the MORE FUNCTIONS
STATISTICAL group on the FORMULAS tab.
Insert the cell range and click OK.
CountIF
COUNTIF allows you to count cells according to a criteria
that you specify e.g. the number of cells which contain the
word ‘yes’ or ‘no’.
To use COUNTIF, click on the destination cell, select the
COUNTIF function from the MORE FUNCTIONS
STATISTICAL group on the FORMULAS tab.
Insert the cell range that you want to evaluate.
In the Criteria box type the value that you want to count and
click OK.
IF
The IF function allows you to perform calculations according to a criteria that you specify
e.g. to calculate a percentage increase on figures over a certain
amount. You can also tell IF to return a text string according to
your criteria such as ‘positive’ or ‘negative’.
To use IF click on the destination cell and select the IF function
from the drop down menu under LOGICAL in the FORMULAS
tab.
16
The LOGICAL_TEST is
the cell you want to
evaluate and the criteria
e.g. J9<350
VALUE_IF_TRUE is
what you want to do if
the cell meets your
criteria (it can be a
calculation or a text
value).
VALUE_IF_FALSE is
what you want to do if the cell does not meet your criteria
Click OK.