Fast Track To Excel-2007
Fast Track To Excel-2007
to
Excel
2007
By Team Digit
Credits
The People Behind This Book
EDITORIAL
Deepak Ajwani Editor
Ram Mohan Rao Writer, Copy Editor
Robert Sovereign-Smith Copy Editor
Nimish Chandiramani Copy Editor
Abey John Writer
Srikanth R Writer
Samir Makwana Writer
Ashfaq Tapia Writer
May 2007
Free with Digit. Not to be sold separately. If you have paid separately for this book, please
e-mail the editor at [email protected] along with details of location of purchase, for
appropriate action.
Introduction
Number Numbness
T hat's what Excel takes care of. Make no mistake: Excel is a very,
very powerful data handler. From cosmetic enhancements to
advanced analysis, Excel does it all.
The latest version—Excel 2007, which this little book covers—has
undergone more changes in this release of the Microsoft Office suite
than have the other programs. With so many of us upgrading to
Office 2007, we felt the need to cover Excel 2007 in detail, even
though we introduced Excel in an earlier Fast Track edition.
Our purpose here is threefold. First, to give you a feel for the new
(2007) interface and functionalities; second, to give you an idea of
much that Excel is capable of doing; and third, to guide you through
some topics in detail, so you can get Excel to work well for you.
After starting off with the basics, we go into the details of data
presentation—that is, formatting, alignment, and such. Next come
several chapters on actually dealing with data, such as dealing with
cell references, sorting, organising data into levels, and such. A chap-
ter on PivotTables exposes you to this wonderfully useful tool. Then
comes the topic of charts, one of the primary uses for Excel—visualis-
ing data.
We've included two little chapters on macros and graphic ele-
ments respectively, and we round off with a chapter on Excel formu-
las and functions.
We candidly admit that because of its complexity, Excel is a hard
topic to cover in perfect detail. You might just find that, for example,
a macro or a formula doesn't work exactly as we've explained. In such
cases, thankfully, there's always Excel's Help pages to refer to. But we
should reiterate that we've striven to make this book such that you'll
need to refer to the Help as little as possible, except in the case of
formulas and functions, which could fill three entire Fast Track edi-
tions!
If you've got data to handle, you need Excel. And if you've got
Excel, you need this book. And if you've got this book, you're on your
way to unleash the capabilities of the best spreadsheet app of all
time—well begun is half done!
CONTENTS
Chapter 1 The Basics 9
1.1 Introduction 10
1.2 The Changes 10
1.3 File Types 16
1.4 Using Fluent 17
1.5 Working With Excel 2007 25
6 FAST TRACK
Chapter 5 Pivot Tables 83
5.1 Creating And Using PivotTables 84
5.2 Analysing Data With PivotTables 87
5.3 Editing And Formatting PivotTables 92
5.4. Creating PivotTables From External Data 94
Chapter 6 Charts 97
6.1 The Chart Group 98
6.2 Types Of Charts 98
6.3 Creating And Customising A Chart 103
6.4 Formatting Chart Elements 104
6.5 Data Labels 107
6.6 Finding Trends In Data 107
6.7 Creating, Re-arranging, 108
And Formatting PivotCharts
Notes 160
FAST TRACK 7
The Basics
1.1 Introduction
10 FAST TRACK
EXCEL 2007
THE BASICS I
The Ribbon is the replacement for all the other menus and tool-
bars. It is a banner that occupies the top of the window. Its design
FAST TRACK 11
I THE BASICS
EXCEL 2007
The icons under each tab are grouped logically into blocks on
the Ribbon, and only the most frequently-used command icons are
displayed. In case more options need to be displayed, a small link
at the bottom of the block can be clicked to pop out a separate win-
dow containing all the options.
12 FAST TRACK
EXCEL 2007
THE BASICS I
1.2.3 Features
Live Preview is a useful feature in the new UI. Unlike earlier ver-
sions where the results of formatting would be visible only after
they were applied, in this version, just hovering the cursor over a
FAST TRACK 13
I THE BASICS
EXCEL 2007
14 FAST TRACK
EXCEL 2007
THE BASICS I
FAST TRACK 15
I THE BASICS
EXCEL 2007
The file format which is optimised for faster saving and load-
ing is XLSB. Unlike XML based files, which use ordinary text to
store data, XLSB files are stored in unzipped, binary format. This
makes it application dependent, unlike the XML based files.
The last new format is XLAM, which is used to save files that
include add-in generated data. Add-ins are sub-applications that
extend the functionality of Excel.
16 FAST TRACK
EXCEL 2007
THE BASICS I
FAST TRACK 17
I THE BASICS
EXCEL 2007
information that may have not been deleted, and may potentially
be misused—for example, comments, annotations, and hidden
text that are only meant for an internal audience. The
Compatibility Checker will reveal features that will be lost if the
document is saved in a format that can be opened in older versions
of Office. The Encrypt Document option can be used to add a pass-
word to a spreadsheet.
18 FAST TRACK
EXCEL 2007
THE BASICS I
Here are the buttons avaiable to you under the Home tab
If there’s something you need to insert into your workbook, find it here
FAST TRACK 19
I THE BASICS
EXCEL 2007
20 FAST TRACK
EXCEL 2007
THE BASICS I
FAST TRACK 21
I THE BASICS
EXCEL 2007
tabs contain the tools to create, modify, and format Smart Art
graphics. Unlike the other tabs mentioned above, the Smart Art
Tools tab and the others that follow are contextual in nature and
appear only when the concerned object is created or selected.
22 FAST TRACK
EXCEL 2007
THE BASICS I
Style options and Table Styles blocks contain the various style
options for the table.
FAST TRACK 23
I THE BASICS
EXCEL 2007
Control print options using the Header and Footer Tools tab
24 FAST TRACK
EXCEL 2007
THE BASICS I
After the function has been inserted, the pop-up displays the
syntax. This makes it easier for the user to input the correct values
or cell references. The parameter deserving attention is displayed
FAST TRACK 25
I THE BASICS
EXCEL 2007
26 FAST TRACK
EXCEL 2007
THE BASICS I
Special option. Here, one can pick and choose which of the con-
tents need to be transferred.
FAST TRACK 27
I THE BASICS
EXCEL 2007
To use the Find function, one can either use [Ctrl] + [F] ([Ctrl]
+ [H] for Find and Replace, though the Find window invariably
carries the Replace tab), or click on the Find option (or Find and
Replace option) under the Find and Select menu. To search for
28 FAST TRACK
EXCEL 2007
THE BASICS I
The Find and Select menu also offers other tools to quickly get
to specific data on a
spreadsheet. In the Find
and Select drop-down,
selecting any of the
e n t r i e s — l i k e
Comments, Formula,
etc.—will highlight
those cells containing
that specific resource.
FAST TRACK 29
I THE BASICS
EXCEL 2007
Go To Special.
30 FAST TRACK
EXCEL 2007
THE BASICS I
FAST TRACK 31
I THE BASICS
EXCEL 2007
32 FAST TRACK
EXCEL 2007
THE BASICS I
FAST TRACK 33
Document
Appearance
2.1 Templates
36 FAST TRACK
EXCEL 2007
DOCUMENT APPEARANCE II
2.2 Styles
Under the Cell Styles drop-down, one can find the different
suggested style options under the “Good, Bad and Neutral”,
“Data and Model”, “Themed Cell Styles”, etc. headings. The
“Good, Bad and Neutral” group lists three cell styles, besides
Normal formatting—Red Font in Red Background, Green Font in
Green Background, and Yellow Font in Yellow Background,
labelled Bad, Good and Neutral respectively. The labelling allows
those styles to be used as colour codes; for example, cells marked
with the “Bad” style can convey the meaning to the user (if using
the same version of Excel) that the particular cell contents met
with disapproval.
FAST TRACK 37
II DOCUMENT APPEARANCE
EXCEL 2007
38 FAST TRACK
EXCEL 2007
DOCUMENT APPEARANCE II
FAST TRACK 39
II DOCUMENT APPEARANCE
EXCEL 2007
2.3 Themes
40 FAST TRACK
EXCEL 2007
DOCUMENT APPEARANCE II
FAST TRACK 41
II DOCUMENT APPEARANCE
EXCEL 2007
named and saved. This custom creation will appear on the Fonts
drop-down, and can be selected. The Effects button lists the differ-
ent colour schemes that can be used for the embedded graphics
objects in the spreadsheet.
The most popular formatting tools are under the Home tab.
42 FAST TRACK
EXCEL 2007
DOCUMENT APPEARANCE II
FAST TRACK 43
II DOCUMENT APPEARANCE
EXCEL 2007
44 FAST TRACK
EXCEL 2007
DOCUMENT APPEARANCE II
FAST TRACK 45
II DOCUMENT APPEARANCE
EXCEL 2007
46 FAST TRACK
EXCEL 2007
DOCUMENT APPEARANCE II
FAST TRACK 47
II DOCUMENT APPEARANCE
EXCEL 2007
To remove the formatting from the cells, one uses the “Clear
Rules” link under CF.
48 FAST TRACK
Calculations
Made Easier
E xcel offers some very powerful features that can help you create
complex spreadsheets with calculations of data spread over
thousands of cells. Get all the dope you need to become an Excel
power user in this chapter!
III CALCULATIONS ON DATA
EXCEL 2007
When you enter cell references into a cell, you will normally
enter the “=” sign first. This will inform Excel that you are about
to perform a calculation. You can either enter it in directly into
the cell or use the formula bar (“fx”) at the top. Generally, for
simple calculations, it may be convenient to enter it in directly
into the cell, and use the formula bar for longer complex cell
references and formulas. In any case, as you enter the references
to various cells in your cell, Excel will automatically highlight
these cells in various colours to help you visually locate where
these cells are located. Try it out by copying the above example
into a worksheet.
50 FAST TRACK
EXCEL 2007
CALCULATIONS ON DATA III
Now, suppose you wanted the total of this list. Instead of giving
a cell range reference [SUM(B3:B6)], you would simply say
SUM(SalesDiv1). This will greatly simplify your tasks, especially in
large, complex sheets, where it will be difficult to keep track of cell
references without getting confused.
A few things to note with named ranges: the name can be any
alphanumeric string of letters or numbers but without any spaces.
If you want to do any mathematical or formula operations on more
than one range, you will have to specify each range individually. In
the above example, if you wanted the totals of all the sales divi-
sions, you would write:
FAST TRACK 51
III CALCULATIONS ON DATA
EXCEL 2007
In the figure, the value for the Marketing Budget (to be entered
in the Sales worksheet, cell B8) is in cell B2 on the Marketing work-
sheet. When referring to another worksheet, the name of the
worksheet followed by an exclamation mark should be prefixed to
the cell reference. In this example, “=Marketing!B2” means, “use
the data in cell B2 in the Marketing worksheet.”
52 FAST TRACK
EXCEL 2007
CALCULATIONS ON DATA III
Budget cell (B8), select “Paste Special…”, and click on “Paste Link”.
The reference to B2 will be pasted into the cell. In either of the two
methods, any changes to the value of B2 (in the Marketing sheet)
will automatically be updated in cell B8 on the Sales sheet.
FAST TRACK 53
III CALCULATIONS ON DATA
EXCEL 2007
figure into a worksheet. Now in cell C2, type, without the quotes,
“=B2*$B$8”, then hit [Enter]. Select cell C2 again and hover over
the bottom right corner of the cell till the mouse pointer changes
to a plus sign. Then click and drag downwards to cell C6.
You can also have a partially absolute reference, that is, the ref-
erence will be absolute for either column or row. Continuing with
the above example, if you use $B8, the reference will be absolute
with reference to Column B but relative with reference to the row.
Similarly, B$8 will be absolute with reference to row 8 but relative
with reference to column B. You can also switch between the ref-
erence types easily: highlight the reference type you want to
change and press [F4] to cycle through relative, partially absolute,
and fully absolute reference modes.
Not only can you refer to another worksheet in the same work-
book, you can also refer to cells and cell ranges in other work-
books. You can merge data from several workbooks into a single
worksheet, use formulas to manipulate the data, and also use rel-
ative or absolute referencing that will change according to how
you move the data in your worksheet.
54 FAST TRACK
EXCEL 2007
CALCULATIONS ON DATA III
When the source workbook file is not open, then the reference
includes the full path to where the workbook is stored, as so:
=SUM(‘D:\Div1\([Sales.xlsx]Annual!B23:B49)
=SUM(Sales.xlsx!SalesDiv1)
You can also control how and when the external links are
updated. If the source and main workbooks are open, any changes
in the source workbook will be automatically reflected in the
main workbook. If, for example, the main workbook is closed and
the data is changed in the source workbook, then when the main
workbook is opened, a security alert will pop up informing you,
“Automatic update of links has been disabled”. To enable it, click
the Options button and select “Enable this content”. As a security
FAST TRACK 55
III CALCULATIONS ON DATA
EXCEL 2007
3.6 3D References
A 3D reference is
where the data is
in the same loca-
tion on multiple
worksheets. For
example, in the
figure, there are
three marketing
budgets for three
departments:
Three similar worksheets
electronics, foods,
and retail. They
are identical, and the data in all the cells refer to the same budg-
et heads.
For example, to get the total for Personnel Budget for all three
departments per month, you can do the following. Click on the
January Personnel Budget cell (B5), type “=”, followed by SUM(), set
the cursor to within the brackets, with the cursor blinking inside
the brackets, click on the first worksheet tab “Marketing Budget -
56 FAST TRACK
EXCEL 2007
CALCULATIONS ON DATA III
Electronics”, hold down the [Shift] key, and click on the last work-
sheet tab “Marketing Budget - Retail”.
FAST TRACK 57
III CALCULATIONS ON DATA
EXCEL 2007
a range, select the range and click on the Table button. A window
asking you to confirm the range (with the option to include table
headers) will pop up. Once you make your selection, a blank table
with default names for columns (column1, column 2, etc.) will be
created, or if you’ve checked the “My table has headers” option, it
will use the first row as the headers. After you create the Table, the
Table Tools become available and the Design tab is displayed.
Whenever you click inside the table, the Table Name will be
shown. Excel will automatically give a table name—Table1, Table2,
etc.—but you can give it a more meaningful description by clicking
on the Table Name in the Properties section of the Design tab. You
can then reference this table in other formulas or data calcula-
tions as required.
Formulas are the basis for all calculation in Excel. They are essen-
tially specialised equations and start with an equals (=) sign. The
formula =7*5+3 will display the result 38 in a cell. This example is
one of the simplest types of formulas you can use.
The other type of formula is where you use the cell, range, 3D
range, name, or table name reference to perform calculations.
Other than the standard arithmetic operators (+, -, *, /) and refer-
ences, you can also use: %, ^, functions, and constants.
58 FAST TRACK
EXCEL 2007
CALCULATIONS ON DATA III
inbuilt formulas you can use. Click on the Formulas tab and
choose the required function from among the given categories.
=CONVERT(3784,”day”,”yr”)
Similarly, you can search for and use other formulas. The
basic principle will remain the same but the possible values will
change. In some functions, a set of core data values will be
required with optional data being included or excluded. The
details of each function and how to use it with examples in most
cases can be found in the help documentation. If you are not
sure about which function to use, click on the Insert Function
button. This will display a dialog box from where you can type a
short description for what you want to do, and Excel will give a
list of closest matching function names, which you can then
review and choose from.
=CONVERT((CONVERT(3784,”day”,”yr”)),”yr”,”day”)
will give you the result 3784 after converting 3784 days to years
and then the resulting years back to days.
FAST TRACK 59
III CALCULATIONS ON DATA
EXCEL 2007
These are: equal to, greater than, less than, greater than or
equal to, less than or equal to, and not equal to, respectively. If you
want to compare the values in two cells using this operator, you
would, for example, enter it as: A1=B1. That is, Excel is asked the
question: Are A1 and B1 equal? The result will be displayed as
TRUE or FALSE depending on the data in these two cells.
There are lots more functions that are available in the Excel.
For example to show you the current date and time in a cell use
the formula, =NOW(). If you want to just see the current date use
=TODAY().
The text operators are also powerful tools that can help you
manipulate text and do advanced functions. For example, you can
use the CONCATENATE function to join text from different cells
into one cell.
You edit formulas by clicking inside the cell and selecting the val-
ues you wish to change or replace. For example, if a cell had the
formula =SUM(A2:A10) and the name of the range A2 to A10 was
TotalCost, you could edit this formula by clicking inside the cell
and replacing A2:A10 with TotalCost. The formula would then
look like: =SUM(TotalCost)
60 FAST TRACK
EXCEL 2007
CALCULATIONS ON DATA III
You use the Cut and Copy commands to move or copy formu-
las respectively. If you use the Cut command, the cell references
will not change whatever be their type—relative, absolute, or par-
tially absolute. If you use the Copy command, the cell references
may change depending on the type of cell reference.
To copy the formula, select the cell with the formula and press
[Ctrl] + [C], or right-click and select Copy. Move the mouse to the
new cell where you want to the formula to be copied, and select
Paste or Paste Special > Link, or use [Ctrl] + [V] to paste the formu-
la into the new cell. Make sure that you verify that the formula is
referencing the correct data cells and that the result is in line with
what is to be expected.
If the data is not as you expected, you can try switching the cell
reference by using the [F4] key as explained earlier. Select the cell
reference you want to change and press [F4] to cycle through the
various possible combinations of cell reference types.
To move the formula, select the cell with the formula and
press [Ctrl] + [X] or right-click and select Cut. Move the mouse to
the new cell where you want to the formula to be copied, and
paste the formula into the new cell.
When you are entering data, you can limit your chances of error
and make data entry easier by defining the valid entries. You can
have Excel automatically validate the entries in a cell based on a
whole number, decimal number, date, time, length of text, or a
custom formula. You can define the upper and lower limits for
valid ranges for the numbers and time units, define a list of items
that must be used, provide a custom message to guide the users
when they try to enter data, and also provide error messages when
they attempt to make a wrong entry.
FAST TRACK 61
III CALCULATIONS ON DATA
EXCEL 2007
If you choose the Custom data type you will have to specify a
formula that will be used in validating the data entry. You will
need to enter a formula that calculates the logical value TRUE or
FALSE.
If you choose List you will need to specify a list on the same
worksheet or a named range on another worksheet. To do this,
first create a list on the same worksheet, or on another worksheet,
and give it a name. Then click on the cell and choose Data
Validation. Select the List option in the Source box, select the cell
range in the same worksheet or enter the name of the range on
62 FAST TRACK
EXCEL 2007
CALCULATIONS ON DATA III
the other worksheet. Specify any custom Input Message and Error
Alert messages you want to show your users and click OK.
The cell can be left blank without data entry if you select the
Ignore Blank checkbox. If you clear this checkbox, you will be
required to enter data.
FAST TRACK 63
III CALCULATIONS ON DATA
EXCEL 2007
When Excel itself reports errors with the formula, they are rel-
atively easy to correct. There are different types of standard error
conditions that will give you a good indication of where exactly to
look to correct the error.
❍ Ensure that all the required values (or “arguments” as they are
called) are entered into the formula. Each formula may have
required values and optional values; at the minimum, the
required values have to be entered to prevent Excel from bring-
ing up an error.
64 FAST TRACK
EXCEL 2007
CALCULATIONS ON DATA III
In the Error Checking Rules section, check or clear all the rules
that you want you want Excel to use to check for errors.
You can also get Excel to check for errors one at a time, much
like a grammar error checker. If you want Excel to recheck all the
errors first, reset the ignored error check. Next, select the work-
sheet you want to check for errors, and on the Formulas tab, in the
Formula Auditing group, click on Error Checking. The Error
Checking dialog box is displayed and it will take you to the first
error in the worksheet. The dialog box will show the formula (or a
part of it if it is too long), a diagnosis of the error, offer a sugges-
tion on what is to be done, provide additional help, and provide
the option to ignore the error or edit in the formula bar. You can
make your choice on what action to take and then click Next to go
to the next error.
If you want Excel to display errors as you work, ensure that the
Enable Background Error checking checkbox is ticked in Excel
Options > Formula. Now when an error occurs with a formula,
Excel will instantly display an icon of a golden-coloured diamond
shape with a red icon inside it. This means there is an error in the
formula and that it needs to be corrected. Clicking on the icon will
FAST TRACK 65
III CALCULATIONS ON DATA
EXCEL 2007
give you a list of options that will help you decide on what action
to take. If you specify Ignore Error, this type of error wont be
checked for again till you reset the error checking.
66 FAST TRACK
EXCEL 2007
CALCULATIONS ON DATA III
To evaluate a cell with a formula, first select the cell and click on
the Evaluate button on the Formula Auditing group in the Formulas
tab. In the resulting dialog box, you’ll be able to see the entire for-
mula first. Click on the Evaluate button, and the first calculation in
the sequence would be calculated. Once you are satisfied with the
result and the logic of the step, click on the Evaluate button again to
go to the next part of the formula to be evaluated… and so on.
This process will help you confirm that there are no incorrect
references and that the logical steps involved in the formula cal-
culation are as you want them to them.
FAST TRACK 67
III CALCULATIONS ON DATA
EXCEL 2007
Next, select the cell whose formula you want to trace. In the
Formulas tab, click on Trace Precedents and/or Trace
Dependants as required. Blue arrows will show the references to
and from the cell if there are no errors. If there are errors, a red
arrow will be shown. If the data is in another worksheet, a work-
sheet icon will be shown.
Tracing the cell reference in this way will help you to visualise
where all the data is coming from, and analyse for logical errors
and inconsistencies.
68 FAST TRACK
Organising And
Interpreting Data
Excel can perform calculations on data, which you know very well.
The fact is, you can also make decisions based on the data: what if
this variable were this much more? It turns out that this is actual-
ly called “What-If Analysis.” This deals with observing exactly how
changes in the input cause changes in the results of a formula.
Now for some rules. The different values that you intend to test
your formula with need to be filled in a single column or row, if only
one input variable is changing. You can’t have them scattered. If two
input variables are changing, the two series of numbers need to be
put in a column and a row. Excel has strict rules about the relative
positions of the rows and columns and the formula-containing cell,
and you need to follow these for the tool to function.
You fire up the Data Table tool from the Data Table Link under
the What-If Analysis drop-down in the Data tab.
70 FAST TRACK
ORGANISING AND
EXCEL 2007 INTERPRETING DATA IV
FAST TRACK 71
ORGANISING AND
IV INTERPRETING DATA EXCEL 2007
will be B1. After the process is done, the cell range B6:G6 will be
populated with the different Interest Values arrived at by changing
the capital values listed in B5:G5.
Now select the cell range A4:G10, and launch the Data Table tool.
The Row input cell is B2 (Rate of Interest) and the Column Input Cell
is B1 (Capital Amount). On completion, the cell range B5:G10 will be
populated with the different Interest amounts.
72 FAST TRACK
ORGANISING AND
EXCEL 2007 INTERPRETING DATA IV
4.2.1 Sorting
To sort a range of cells, you select a cell in
the column to be used as the sorting criteri-
on, and click on the Sort Ascending or
Descending button in the Sort and Filter
Block. Alternatively, you can right-click on
the cell and use the Sort menu to choose
Sort Options
the desired sorting operation. The
Alternative Menu offers more sorting options, like sorting based
on cell colour, font colour, and cell icon (allotted by Conditional
Formatting using Icon Sets).
Since the above allows only one sorting key column, if more
complex sorting rules are to be applied, you can use the Sort button
in the Sort and Filter block. This opens a window that allows
multiple levels of sorting. By default, one level is already presented,
and more can be added by using the Add Level button. Under the
possible Sort Key criteria, you’ll see that Cell Colour, Font Colour,
and Cell Icons can also be used. Under the Order drop-down, you can
specify the sort order.
FAST TRACK 73
ORGANISING AND
IV INTERPRETING DATA EXCEL 2007
74 FAST TRACK
ORGANISING AND
EXCEL 2007 INTERPRETING DATA IV
4.2.2 Filtering
When you use filtering, you
limit the visibility of a table’s
contents to only those entries
that match the criteria specified
in the filter. To perform a
Filtering operation on a range of
cells, select any cell in that range
and click on the Filter button.
This will cause the first row of
the range to be converted into a
header row with each cell con- Filter by Number Options
taining a drop-down menu
that shows the filtering
options. The drop-down con-
tains a few inbuilt filters
that can discriminate
between numbers and
colours of the cells.
Filter by Colour Options
The Number Filters link already offers a few filter criteria like
Above, Below, Greater Than, etc. Selecting any of these will open up
a window to choose the threshold value. This window can also be
used to create a Custom Filter, and you can also use wildcard
characters like “?” and “*”. You can also create a compound criterion
by adding the AND/OR clause and adding another condition. The
Above Average and Below Average filters simply calculates the
average for the column, and displays only those which fulfil the
corresponding condition.
You clear Filters by clicking on the Clear button in the Sort and
Filter Block. The Advanced button allows creating more complex
filter conditions than those already mentioned. Conditions that can
be used under Advanced filtering can include simple mathematical
operations, wildcards, and even functions supported by Excel.
FAST TRACK 75
ORGANISING AND
IV INTERPRETING DATA EXCEL 2007
=“>10”
To specify a compound
condition with an AND, you
use the same row. To specify
a compound condition with
an OR, you use a different
row. For example, to filter Advanced Filtering OR option
cells under the title Cash
whose values are between 50 and 60, you create a Criteria Range
with two columns having “Cash” as title, and insert =”>50” and
=”<60” as values in the same row. To filter values less than 50 or
greater than 60, you use the formulas =”<50” and =”>60” in the
same column, in different rows. You can also create conditions for
all columns simultaneously.
76 FAST TRACK
ORGANISING AND
EXCEL 2007 INTERPRETING DATA IV
FAST TRACK 77
ORGANISING AND
IV INTERPRETING DATA EXCEL 2007
To create Groups and Levels, you have the tools under the
Outline Block in the Data tab. To create a group, select the range of
cells and click on Group. You can then choose whether the group is
to be created row-wise or column-wise. Depending on whether the
grouping was done row-wise or column-wise, a set of controls
appear on the left margin or the top margin of the spreadsheet. A
set of buttons labelled 1 and 2 appears at one end—either the top of
the left margin or the left end of the top margin. This set of buttons
shows the levels of nested groups in the spreadsheet, and allows
quick access to any specific level.
78 FAST TRACK
ORGANISING AND
EXCEL 2007 INTERPRETING DATA IV
new group when all existing groups are collapsed or when the
lowest-level button is active. If two groups overlap, the common
cells in both groups are grouped at the next higher level.
The hidden cells, when the nodes are collapsed, are not
available for use in any formula, and charts prepared from the
visible items will change to reflect the changes in the visibility of
the source range.
The Ungroup button in the same block can ungroup a cell range.
To remove all groups in the spreadsheet, select one cell and use the
Clear Outline option. Auto Outline automates the process of
creating levels, and is used with the Subtotal feature to Summarise
data, as discussed next.
FAST TRACK 79
ORGANISING AND
IV INTERPRETING DATA EXCEL 2007
80 FAST TRACK
ORGANISING AND
EXCEL 2007 INTERPRETING DATA IV
The “Cell Range” is the reference to the range that has the
column containing the value to be looked up as the first column.
FAST TRACK 81
ORGANISING AND
IV INTERPRETING DATA EXCEL 2007
Before VLOOKUP is used in its default mode, the cell range needs
to be sorted in ascending order of the sort key column. If only exact
matches are to be looked up, the sorting is not needed.
82 FAST TRACK
Pivot Tables
T
he PivotTable is one of Excel’s most powerful tools. It helps
you drill down deep into numerical data and see unantici-
pated scenarios, with which you can make better-informed
decisions. It helps you summarise and analyse data, see compar-
isons, patterns, and trends both in tabular form as well as in
PivotChart reports. This chapter will show you how to get the best
out of PivotTables.
V PIVOT TABLES
EXCEL 2007
To create a PivotTable, you need to have your data source ready first.
This could be an Excel Table, a range of cells that contain the data
you require, or an external data source like an Access database.
Click anywhere inside your source data, select the Insert tab,
click the PivotTable button, and select either PivotTable or
PivotChart. If you select PivotChart, it will create a chart based
on your data elements selection (see later in this section for
more on data element selection). However, it is better to create
your PivotTable before delving into charts—this will give a better
idea of how your data looks, and you can fine-tune your data
view before making the charts. The chart option is useful when
you are ready with your data and you are certain about how
your PivotTable should be and all you need to do is quickly make
your chart.
You can also specify a name for the source data range, or con-
vert it into an Excel table and use the table name. Using tables can
be very useful when your source data keeps changing. As data gets
84 FAST TRACK
EXCEL 2007
PIVOT TABLES V
added or deleted from the table you need not change the cell ref-
erence range in your PivotTable, something you’d have to do if you
specified just a cell range or used a name for the range. Because
you are using a table name, Excel will automatically include or
exclude any data rows added or deleted from the Excel Table. See
Chapter 3 to learn about Excel Tables.
Creating a PivotTable
FAST TRACK 85
V PIVOT TABLES
EXCEL 2007
86 FAST TRACK
EXCEL 2007
PIVOT TABLES V
Drag and drop the columns from the main upper window
into any of the four windows. As long as you keep the layout of
the PivotTable report in mind, you will be able to logically decide
on what needs to go where. You can experiment with different
ways of viewing the data by moving the columns around and
watching the data change dynamically. This way you will come
across different ways in which the data can be viewed. Some will
be ways you’ve never thought of before, or wondered about with-
out an idea on how to extract the information from your raw
data. Some selections will turn out to be meaningless, but you
can create powerful and well-designed reports when you use the
correct data elements in their correct places and apply the most
appropriate formula.
FAST TRACK 87
V PIVOT TABLES
EXCEL 2007
In our example, we have used the sales data for a Web hosting
company’s sales for October 2006 for their three departments: Web
Design Sales, Web Hosting Sales, and Bandwidth Sales.
The report now shows the total sales for each customer for
each department. You can change the Row labels to show sales by
date by dragging the Date field to the Row Labels window. This
will then show the data in a nested manner depending on which
data element is first. If the Date filed is below the Customer ID
field then you can see the sales for each customer by their respec-
tive dates.
Nested Data
88 FAST TRACK
EXCEL 2007
PIVOT TABLES V
will help you analyse the data both at the summary and detail
level with the single click of a button.
If you move the Customer ID to the Report Filter area, you will
now see the sales by date. By default, Excel will select all the
Customer IDs for display—denoted by “(All)” in the filter field. You
can then narrow the selection and choose to see the sales data for
a limited set of customers—a minimum of one.
You can select on the “All” checkbox to show all the customers
or select one or more Customer IDs from the list. Make sure that
the “Select Multiple items” checkbox is ticked before selecting
more than one customer. Report filters help you narrow down
data based on criteria you specify. You also click on the drop down
arrow on the Row Labels heading and get access to additional row
level filtering options. Using this option you can select multiple
filtering criteria to narrow down your selection.
Any of the data fields in the four window areas (Report Filter,
Column Labels, Row Labels and Values) can be further manipulated
by simply click on the data field and selecting an option from the
menu which pops up. The first three sets of options enable you to
FAST TRACK 89
V PIVOT TABLES
EXCEL 2007
90 FAST TRACK
EXCEL 2007
PIVOT TABLES V
To create a formula
based on the Calculated Using Calculated Fields
Field click on Options and
in the Tools group select
Calculated Field from the
drop-down of the
Formulas button.
In this example, we
have created a new Field
called Field2, where the
total of Web design and Using Calculated Items
Hosting is shown. To create
a formula based on a Calculated item, click on Options and in the
“Group” section, click on Ungroup and click on the field where
you want to add the calculated item. Then click on the Tools sec-
tion and select Calculate Item. Depending on which cell you have
selected in the PivotTable, the Calculate Item field maybe enabled
or disabled. If it is disabled, Excel will not be able to perform item
level calculation on that field.
FAST TRACK 91
V PIVOT TABLES
EXCEL 2007
Report that shows the total count of the Customer ID A15 for sales
from the three departments.
Finally, you can get a quick view of all the formulas in your
PivotTable by clicking the List of Formulas option in the Formulas
button in the Tools group. Advanced users can also get more fine-
grained control by specifying the order in which you want the for-
mula to be solved by using the Solve Order option in the same
Formulas button drop-down.
You cannot directly edit the cells in a PivotTable, but you can
change the values in the source data, refine the formulas, and
rearrange the data using the Report Filters, Column Labels, etc.
Once you’ve made the changes, you can refresh the PivotTable by
right-clicking and selecting Refresh to get the revised data.
Once you have the data and all the elements you require, you
can format your PivotTable to make it look attractive and enhance
its readability. Using charts is one way to present the data in a
visual form that is easily accessible to the users. To create a chart,
click on the PivotChart button under the Options tab. Choose the
chart type and click OK. You can use the PivotChart Filter Pane to
adjust the look and feel of your graph.
92 FAST TRACK
EXCEL 2007
PIVOT TABLES V
FAST TRACK 93
V PIVOT TABLES
EXCEL 2007
94 FAST TRACK
EXCEL 2007
PIVOT TABLES V
To access the
W o r k b o o k
Connections dia-
log box click on
the Connections
button under the
Connections
group in the Data
tab. Click on the
Add button and
you will see a list
of existing con-
nections that you Get External Data from existing connections
can use.
If this is the first time you are connecting to the external data
source, then depending on the source you are connecting to, you
can use one of the options in the Get External Data group in the
Data tab.
You can click on the Other Sources button if you want to get
access to data from SQL Server, Analytical Services, and XML. You
can also use the Data Connection Wizard and Microsoft Query to
FAST TRACK 95
V PIVOT TABLES
EXCEL 2007
The window will access the Web like a regular browser but
with a difference: a special yellow arrow highlight will tell you
what you can import into Excel. Select the sections you want to see
in Excel by clicking on it. The yellow arrow will change to a green
tick-mark. Once you are satisfied with your selection, click Import.
Excel will ask you where you want to put the data. Choose the
required location and click OK. The import function may not how-
ever work uniformly with all sites—especially sites where data is
being dynamically generated from a database every time you
access it. You can also specify additional conditions like back-
ground refresh where the data will be kept synchronized with the
website. This of course, assumes that you have an always-on
Internet connection.
96 FAST TRACK
Charts
with its sub-types. To view the Chart group, click on the Insert tab
or press [Alt] + [N].
98 FAST TRACK
EXCEL 2007
CHARTS VI
FAST TRACK 99
VI CHARTS
EXCEL 2007
group. Here, select the type of chart you want to create. Then
choose the sub-type and the style.
2. Next, make sure that the data range you want to plot is charted
along the appropriate axis. You can change the data range on
either axis—vertical (X-axis) or horizontal (Y-axis). To perform
this function, select either vertical axis or horizontal axis on the
chart area. To perform this function, select Chart from the
Design tab; in the Data Group, click on Select Data to display the
Select Data Source dialog box and right-click to choose the
Select Data option. Select Data Source. A dialog box will pop up.
3. If you wish, you can switch the view of the data to be charted
from Rows to Columns of the worksheet at the Select Data
Source dialog box. If you’ve know your formulas, you can man-
ually feed the data range in the Chart Data Range box. Click OK
to see the new chart.
4. You can now name the Chart Titles, and the data sets on the X,
Y, and Z axes. The axes can be further customised.
8. If you want to show the Data Table on the chart, select the Data
Table checkbox.
Once you’ve made your chart, you can begin formatting the ele-
ments: Either use the Format tab located under the Chart Tools tab,
or you can select a Chart element, right-click, and select Format.
To change the appearance, select the Design Tab and view the
Gallery of Chart Styles. The other tab groups under the Design Tab
are Type, Data, Chart Layout, and Location.
In the Format menu, you will get the tab groups as Current
Selection, Shape Styles, WordArt Styles, Arrange, and Size. On the
Layout Tab, the tab groups available are Current Selection, Insert
(pictures, shapes, and text box), Labels, Axes, Background,
Analysis, and Properties.
1. Current Selection
Choose the Format Selection Button in the Current Selection Tab
group to customise an element. To reset all the customisations
you’ve made, use the Reset to Match Style option.
2. Shape Styles
Under this tab, you get a variety of options to customise the Shape
The tab groups for changing the layout, under the Layout Tab
Styles of the Chart Title. You can change the shape styles by click-
ing on the More button (the little down arrow), change the fill and
outline, and select various shape effects.
3. WordArt Styles
For text formatting, choose the appropriate buttons from the
WordArt Styles options. You can choose the Shape Styles More to
select colour, Shape Fill to fill colour in the box, Shape Outline for
a new outline colour, and Shape Effects to add effects to the Text
to the Chart Title.
4. Arrange
Using this tab group, you can arrange your selected objects locat-
ed on the Chart. It has three options—Selection Pane, Send to back,
and Bring to front. Choose the Selection Pane option and it will
appear to the left of the worksheet if you want to view the select-
ed objects and change their order and visibility. Also, you can
bring the selected object to front or send it to the back by using
the Bring to Front and Send to Back options.
From the PivotTable Field List, you have three options to customise
the data series:
1. Drag-n-drop the data series in the Area Selections box
2. Check-uncheck the check box of that particular data series, or
To sort the data series listed in the PivotTable Field List, hover
the cursor over it and you will see a small arrow. Click on this for
more sorting options. The PivotTable Field List can be customised
by ticking the different options listed on the top of PivotTable
Fields List. After you’ve customised the options in the PivotTables
Field List, right-click on the PivotChart and select Refresh Data.
You can find the changes you made (if any) in the PivotTable Fields
List on the PivotChart.
Re-arranging a PivotChart
If you want to make life easier, move the PivotChart to the same
worksheet as the corresponding PivotTable. From the PivotChart
Tools Tab, click on Design, and select Move. Go to Move Chart >
New Sheet. Click OK and open the new chart sheet with your
PivotChart. The drop-down list of the PivotChart Filter options can
be used to represent data any way you want. Choose one of the two
drop-down buttons available: Axis Fields filter the categories
charted along the vertical axis, while Legend Fields filter the data
series shown in columns, bars or lines in the chart body identified
by chart legend.
Formatting a PivotChart
Although PivotCharts are created from PivotTables, formatting a
PivotChart is almost identical to the process with a regular chart.
Just use the Design Tab to select the chart type and the sub-type.
The Layout of the PivotChart can be customised by changing Chart
Titles, Text Boxes, and Gridlines. Use Format to change the look of
the graphics and the background. You might find a few options
missing while formatting PivotCharts.
Macros that get recorded are stored (as VBA code) in one of three
places—as part of the workbook you’re using right then, as part of
a different workbook (which you can specify), or in a globally
accessible workbook called the Personal Macro Workbook. This
workbook is called PERSONAL.XLSB, and is in the XLSTART (in
C:\Program Files\Microsoft Office\Office 12) folder.
At the point of creation of the macro, you specify its name, and
what the keyboard shortcut will be. Shortcut keys can be [Ctrl] along
with a letter (from A through Z), or [Ctrl] + [Shift] along with a letter.
No other types of names are allowed, such as [Ctrl] + [Alt] + [-].
➠ View Macros: This will open the Macro dialog box, where you
select a macro to run or edit.
➠ Record Macro: This will opens the Record Macro dialog box,
where you define the settings for a new macro and then start
the macro recorder.
➠ Use Relative References: When this is depressed, Excel will, of
course, use relative references when recording the macro. This is
important. When, for example, your cursor is in cell A1, and your
macro consists of typing in “Digit”, there are two possibilities:
(a) With the “Use Relative References” button not depressed, run-
ning the macro will produce the text “Digit” in whichever cell
you are in at the time you run the macro, say H16.
(b) With the button depressed, the macro will record the relative
position. So if your cursor was in cell A1 when you began record-
ing, and you typed in “Digit” in cell A2, then, when you run the
macro with your cursor in cell H20, you’ll get “Digit” in cell H21.
Use “Show Developer tab in the Ribbon” from the Office Button, as explained
When you turn on the macro recorder—say from the Developer tab—
you’ll need to first press Start Recording, and choose whether you
want to use relative cell references. Then do whatever you need to be
recorded. For example, you could choose to enter 23, 34, and 35 in a
range of cells, then sum them up. But before you do this, it’s a good
idea to give the macro a name more descriptive than “Macro1”. You
cannot use spaces in the name, and the name must begin with a let-
ter. Next, you enter the shortcut key, which is pretty intuitive—except
for the small fact that you shouldn’t overwrite inbuilt functions by,
say, using [Ctrl] + [V] (paste) as a shortcut. Next, select what location to
store the macro in, the options for which we’ve already talked about.
After any of
these three
actions, Excel will
open the Macro
dialog box. It will
list the names of
all the macros in
the current work-
book and in your
Personal Macro
Workbook. Click
the name of the
macro you want
to run and click
the Run button The Macro dialog box. You’ll use this often
If you want to see the code of a macro you entered, you’ll need to
open its “code” window—open the Visual Basic Editor by pressing
[Alt] + [F11], then from the left, double-click the appropriate “mod-
ule” that contains the code, and the code window will come up on
the right. (We won’t go into what Modules are, because you won’t
need it right now.)
Like we said, any macro you record gets stored as VBA code.
What we’re telling you now is, you don’t necessarily need to record
a macro: you can write it out directly. Here is an example of how
you can write a macro entirely in the VBA editor. We’re including
this here just so you can feel comfortable with what’s going on,
and what on earth the VBA editor is!
So here goes: open the VBA editor by pressing [Alt] + [F11]. Then
go to the Project Explorer at the top left, and select “VBAProject”.
There, right-click and insert a “Module”, or go to “Module 1” (for
example) if it’s already there.
Now, the following code will copy a range of cells and paste
them in the current cell:
The lines that begin with a single quote are ignored. The range
here is C24 to C35. You run the macro using the procedure we
already described.
Sub Squares()
For x = 5 To 8
Cells(x, 4).Select
Selection.Value = x^2
Next x
End Sub
These four numbers were generated by one click. It could have been four hundred
You’ll often be using the for… next loop in Excel, because many
things need to be done repetitively across cells.
Now about help: say you see, in your macro, which you recog-
nise by name, you see something like “ActiveCell”. You don’t know
what it does. Simply highlight it, and press [F1], and you’ll get
help—you’ll see what “ActiveCell” means, in what contexts it’s
used, and so on.
the View tab. (If you can’t find it, press [Alt] > [W] > [U].) The Unhide
dialog box will open, showing the PERSONALB workbook in its
Unhide Workbook list box. Click PERSONALB in the list box and
press [Enter].
You know what the macro will do—when you press the short-
cut key, it will bring up that text in that style in that location
(unless you used a relative location). Now, open the VBE, and in the
appropriate module, find the code for the macro, which will be
something like this:
Sub Macro2()
’
’ Macro2 Macro
’ Macro recorded 01/01/1970 by digit_fan
’
’ Keyboard Shortcut: Ctrl+Shift+A
’
ActiveCell.FormulaR1C1 = “I am recording a macro.”
Range(“A1”).Select
With Selection.Font
.Name = “Cambria”
.FontStyle = “Regular”
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleSingle
.ColorIndex = 53
End With
End Sub
Now what do all the above mean? It’s easy to see that you can
edit the size to be something other than 14; it’s easy to see that you
can edit the font to whatever you want. “ColorIndex”, too, can be
played around with. But for all the rest, you’ll need to use Excel’s
inbuilt help. Like, what is “OutlineFont”? What is “Shadow”?
3. If you want to write your own macros for all kinds of stuff:
we hate to tell you this, but VBA is a vast topic—we could use
a couple of Fast Track editions just for that! For now, down-
load Microsoft’s Office 2003 Editions: Excel VBA Language
Reference, if you’re interested, from www.microsoft.com/
downloads/details.aspx?familyid=2204a62e-4877-4563-8e83-
4848dda796e4&displaylang=en (http://tinyurl.com/56rj5).
Unlike its predecessors, Excel 2007 allows you to add all kinds of
pictures to your worksheet. All image file extensions are sup-
ported, including the Macintosh PICT and WordPerfect Graphics
formats! What is so special about it? The fun starts as soon as you
add a picture or make a shape. You see a new menu item open up
inside the ribbon called Picture Tools > Format, which allows
you to format the image in ways that will make your colleagues
jealous!
You can play around with the brightness and contrast or make your
image greyscale, sepia, or any other colour you want it to be. If you
happen to go overboard with these Adjust settings, you can always
reset your picture to its original by clicking on Reset Picture.
8.3.1 Click Insert > Shapes and choose the smiley under Basic
Shapes.
8.4 WordArt
among various options under Drawing Tools > Format > Shape
Styles, and keep experimenting with all the options there.
❍ Go to Insert > WordArt (at the extreme right) and choose the
style that you want from the drop-down list.
❍ In the new window that appears, enter “Think Digit!”
❍ Now in Drawing Tools > Format > Shape Styles, you can tweak
either Shape Fill or Shape Outline or Shape Effects to create a
style completely your own... Congratulations! Your skill in using
Excel 2007 has increased a notch!
8.6 SmartArt
still do charts the traditional way, you can edit ready-made charts
using the SmartArt functionality.
To do this Press
Insert a new SmartArt graphic [Alt] + [N] + [M]
Move from the Text pane to the Ribbon, [Ctrl] + [Shift] + [F2] to move
which is a part of the Microsoft Office to the SmartArt graphic, and
Fluent user interface then press [Alt] to move to the
Ribbon
Select multiple shapes in the Text pane Select a line of text in the Text
pane, and then press [Shift] +
[Down Arrow] to select the
additional shapes
Resize the shape in very small increments [Ctrl] + [Shift] + [Up Arrow],
[Down Arrow], [Right Arrow],
or [Left Arrow]
All formulas and functions start with the “=” sign. This indi-
cates to Excel that what follows is a calculation. Calculations are
done using operators. In many cases the operators themselves are
sufficient to obtain the required results, without having to
depend on functions. There are four types of operators in Excel
2007: arithmetic, comparison, text, and reference.
When two operators are of the same level, Excel will calculate
from left to right. For example, “=2*3/4” will cause the multiplica-
tion to be done first, and then the division.
When you are using complex formulas where you may have
multiple parentheses nested one within another, you will need to
ensure that for each open bracket there is a closing bracket. If you
make a mistake, Excel will bring up aan error and automatically
suggest corrections. For example, the formula “=SUM(SUM(A4:C4),
SUM(A5:C5)” has the final outer bracket missing. Excel will detect
this and suggest corrections, at which point you should review
your formula and make corrections if needed.
You also have the “fx Insert” function button that enables you
to search for and select a function. Click on the button, and in the
pop-up window, you’ll have multiple choices.
First, you can type in a brief description of what you are look-
ing for in the function, and Excel will give you a list of possibili-
ties based on matching keywords. Of course, this means you will
need to be as precise and accurate as possible in the terminolo-
gy you use. The search feature is useful when you do not know
which category the function belongs to: if you do know the cate-
gory, you can select one from the category drop-down list, and
ing it manually or by
referring to a cell ref-
erence or a cell range
reference. There are
two ways of entering
arguments in the
Function arguments
window—manually
or by selection. For
manual entry, you Manual or Drag-and-Select entry of function
type in the cell refer- arguments
ence or values directly into the Function Arguments box, or you
can have Excel automatically fill in the reference for you. To do
that, click inside in the field where you want to fill in the refer-
ences automatically. Move the Function Arguments window to the
side till you are able to select your cell range. Drag and select the
cell range that contains the values you need. The range reference
will be automatically entered into the selected field.
Excel has seven logical functions: AND, FALSE, IF, IFERROR, NOT, OR,
TRUE. All these functions, except for the IFERROR function, will
show either logical TRUE or logical FALSE after evaluating all these
values in the function. Here is a brief overview of the functions.
Example: =AND(A3=B6,F5<>234)
Excel will here check to see if the values in A3 and B6 are equal,
if they are not then Excel will display (return) the value FALSE. If
A3 and B6 are equal, then Excel will evaluate the next argument.
It will check to verify whether F5 is not equal to 234. If this is
TRUE, then Excel will return the value TRUE. If it F5 is equal to
234, Excel will return FALSE.
Example: =NOT(A3=A4)
Example: =OR(A3=A4,B5<190)
To work with date and time values, you would normally for-
mat the cells where the data is being entered. That is, if you wish
to display the date and time in dd/mm/yyyy format and time in
12-hour format, you would select the cell, right-click, and select
Format Cells, then use the Date and Time sections in the Number
tab to select from pre-defined date and time formats. Or, you may
use the Custom section to specify any non-standard date and
time formats.
Excel normally displays the date and time based on the region-
al settings of the computer you are working on. This will be the
default display for date and time. On most computers, the default
date setting is usually in the American format mm/dd/yyyy, where
the display will show month first followed by day and year. The
Indian format is, of course, to have the date first followed by
month and year i.e. dd/mm/yyyy. You can change the default dis-
play to this format by changing the Regional Settings in the
Control Panel.
will display the date and time 12th May, 2006 7:18 PM and 34
seconds in the following manner:
If you omit the AM/PM, then the time will be displayed in 24-hour
format irrespective of how it is entered. Also note that you need
not enter the day. You just enter the date and time and Excel will
automatically pick up the correct day. Similarly, if you leave out
the time, Excel will assume it is 00:00 (midnight). Also, if you
leave out the year, Excel will assume you are talking about the
current year. Thus, for the above format, if you wanted to enter 6
February 2007 with no reference to the time, you could simply
enter 6/2 or 6 Feb. Excel will automatically apply the above date
format and display:
With this basic idea of how Excel treats date and time functions
we can go on to doing date and time calculations. The most com-
mon calculation you’ll use dates for is to find out the elapsed days
or times between two dates. For example, if you want to find out
the number of days between 14th April 2007 and 22nd May 2000,
do the following:
Enter the above dates into two cells, say A1 and B1 respec-
tively. Now you can simply type in, say, cell C1 “= A1—B1”. The
result, however, may be shown in the date format, since Excel
“sees” dates in both the cells and assumes that the format for the
result should also be in date format. To change it to the number
format, right click on cell C1, select Format cells, and choose the
Number option on the Number tab. This will then show the num-
ber of days between the two dates. Likewise if you want to find
out, say, the date 25 days prior to 14th April, you can use a for-
mula as in the figure below. In this case, the result will directly
show you the date.
TODAY()
Of all the date functions, the easiest has to be the TODAY function.
Entered as “=TODAY()”, it has no arguments, and returns the cur-
rent date in the cell. Note that the date in the cell will keep chang-
ing every time the workbook is opened on different dates. This
function should not be used if you want the date to remain fixed
DATE(year,month,day)
Example:
=DATE(A1,A2,A3)
This combines the val-
ues in the arguments
into a single cell. Thus if
you have the year,
month, and date and The date function
separate cells, you can use this function to combine it into a single
cell and display it in the date format.
DATEVALUE(date_text)
Example: =DATEVALUE(A1) where A1 = ‘5/12/2006
When you use the apostrophe sign before a number or date, Excel
stores the value as text.
Normally, you will not be
able to perform any of
the calculations because
it is internally referenced
as text. You use the DATE-
VALUE function to con-
The “DATEVALUE” function
vert the text version of
the date into an Excel number for the corresponding date. You can
then use this number to perform calculations.
DAY(serial_no)
Example: DAY( ((DATE(07,03,25)))
The serial_no argument returns any day of the month between 1
and 31. In the above example, the DATE function is nested inside
the DAY function. Hence, the value returned by the DAY function
will be 25, since the DATE function contains the value 2007 for the
year, 03 for the month, and 25 for the day.
WEEKDAY(serial_no,return_type)
Example: WEEKDAY((DATE(07,03,25)),2)
The serial_no argument returns any day of the week between 1
and 7 or 0 and 6. The return_type argument is a number between
1 and 3. It specifies how the weekday should be handled. If the
return_type is 1, then 1=Sunday and 7=Saturday. If the
return_type is 2, then 1=Monday and 7=Sunday. If the return _type
is 3, then 0=Monday and 6=Sunday. In the above example, we want
to find out the day for the second return type where 1=Monday
and 7=Sunday. The value returned will be 1.
MONTH(serial_no)
Example: MONTH((DATE(07,03,25)))
The serial_no argument returns any day of the month between 1
and 12. In the above example, the value returned will be 3.
YEAR(serial_no)
Example: YEAR((DATE(15,03,25)))
The serial_no argument returns any year between 1900 and 9999.
Note that in the above example, the DATE function specifies the
year as 15, which Excel will refer to recognise as 1915. If you want
Excel to recognize to 21st century years, you will need to enter the
full year in the following format: YEAR((DATE(2015,03,25)))
DAYS360(start_date,end_date,method)
Example: DAYS360(A1,B2,FALSE)
This function calculates the number of days given the start_date
Similar to the date functions, there are some useful time func-
tions as well.
NOW()
Like the TODAY date function, the NOW time function does not
take any arguments. It simply returns the current system time
into the cell, along with the date. Again, like with the TODAY func-
tion, you should note that the value stored in the cell keeps chang-
ing every time you open or calculate the sheet.
TIME(hour,minute,second)
Example: =TIME(A1,B1,C1)
Combines the time values for hour, minute, and second from dif-
ferent values or cells into a single cell. It’s similar to the DATE
TIMEVALUE(time_text)
Example: =TIMEVALUE(A1) where A1=’8:15:46 PM
Similar to DATEVALUE, if the time is entered as a text in Excel by
using the apostrophe before the time, then this function will con-
vert it into the time format.
HOUR(serial_number)
Example: =HOUR(A1) where A1=9:30:24 PM
Extracts only the hour portion in the time value specified. In the
above example, Excel will return the value 21, which is the value
for 9 PM in the 24-hour format. Similarly, the functions
MINUTE(serial_number) and SECOND(serial_number) extract the
minutes and seconds in a specified time value respectively.
PV(rate,nper,pmt,[fv],[type])
RATE: This is the interest rate for a given period, usually annual.
FV: This is the principal plus interest that you want to earn
after having made your last payment. If you do not enter this
value, Excel assumes that FV=0.
For example, in the figure above, the annual rate for a loan is
10.25%. This has been divided by 12 to arrive at the per-month
value for the RATE in the next column. The annual rate is con-
verted into a monthly rate because the payment periods (NPER)
and payments (PMT) are monthly. In the two examples, for a pay-
ment per month of Rs 1,500, the PV will be Rs 43,318.19. For a
future value of Rs 45,000, the PV will be Rs 33,130.96. To calculate
the PV on your investment, whip out your investment documents
and punch in the figures! (Make sure you enter negative values
for payments.)
NPV Calculations
NPV(rate,value1,value2,…,value13)
NPV (Net Present Value) is calculated on the basis of the rate and a
series of cash flows represented by the arguments value1 to
value13. These arguments denote a series of payments and
income—negative values for payments and positives for income—
which are equal and made at the end of each payment period. In
calculating NPV, the argument value1 should exclude your initial
payment, that is, value 1 starts from the second payment.
Note that Excel will only take numerical entries in the inter-
national format, so 1 lakh will always be represented as one hun-
dred thousand (100,000), 1 crore as ten million (10,000,000), and
so on.
FV(rate,nper,pmt,[pv],[type])
The FV shows you the Future Value of an investment; the argu-
ments are the same as in PV, the only difference being that you
will have to specify the PV value in this case. For example, if you
are 30 and plan to retire by 60, you can calculate the Future Value
if you make an investment of Rs 30,000 a year.
PMT(rate,nper,pv,[fv],[type])
When you know the rate, the number of payments to be made, and
the present value or future value, you can use the PMT function to
calculate the amount you will have to pay for each payment peri-
od (the instalment). For example, you can find out the instalment
on a loan of Rs 45,000 where you know the interest rate (7.58%) and
the number of payments to be made (48). You can reduce the down
payment from PV and see how that will affect your instalment or
vary the number of instalment months.
ROUND(number,num_digits)
Excel takes the number argument and rounds it to the number of
decimal places specified in the num_digits argument. If the
num_digits argument is a positive number, then Excel rounds off
the value to the specified number of digits. If the num_digits is a
negative value, it rounds off the number to that many places left
of the decimal point.
Note that the default rounding by Excel would have given the
first result as 1.43 and the second result as 2.57.
CEILING(number,significance)
When you want to round up to a specific unit then the CEILING
function is the one to use. This can be best explained by means of
an example. Assume you have a Excel shopping list of many items
with the varying prices especially in the decimal portion—that is,
you have one item for Rs. 102.35, another for Rs. 74.85 and so on.
Now assume that for reasons of tidiness or totalling ease you
either want it all to be either rounded to the nearest 50 paise or
rupee. The CEILING function will do it for you.
TRUNC(number,num_digits)
If you want to just display the number to a specified number of
decimal places without any rounding, you can use the Truncate
function. If you want to simply specify just the portion without
with the decimal places (the integer portion), do not enter any-
thing for the num_digits argument.
EVEN(number), ODD(number)
POWER(number,exponential)
This is the same as using the caret sign (^) to calculate the expo-
nential of a given number. For example: =2^8 and =POWER(2,8)
will both give the result 256.
SQRT(number)
Calculates the square root of the number. Example: =SQRT(150)
will give the result 12.2474487139159. You cannot use negative
values with the Square Root function. If you do have a negative
value whose square root you want to find, you’ll need to use the
absolute value function (ABS) to calculate it. Example: for a value
of -234, you would enter
=SQRT(ABS(-234))
SUM(number1,number2,…)
This is by far the most popular and most widely used of all
functions in Excel. Select the last cell in a list of numbers and click
on the AutoSum button (Formulas tab, Functionl Library group) to
automatically total up the column or row. You can also manually
specify a range, a named range, a range in another worksheet or
even one in another workbook.
Example: =SUM(B1:B34,Sheet4!A12:C34)
This will total up the cells B1 to B34 in the current worksheet and
the cells A12 to C34 in Sheet4. Note that there is a maximum of 30
arguments separated by commas that you can use in a SUM func-
tion. If the number of arguments exceed 30 then you may need to
break up the SUM function into two parts.
SUMIF(range,criteria,[sum_range])
For those of you plain bored out by SUM and looking for some-
thing more powerful, check out the SUMIF function. The SUMIF
function or conditional summing, as its often called, allows you to
total up a list based on specific criteria. The range argument spec-
ifies the range of cells that you want Excel to evaluate in the sum
operation. The criteria argument, as the name implies, is the spe-
cific set of criteria that you want to apply to the sum operation,
and the sum_range argument is optional, but indicates the range
of cells that should be used in the sum function. If the sum_range
argument is not specified, Excel will sum the entire range speci-
fied in the range argument after applying the criteria argument.
This can be better understood by an example.
=SUMIF(D2:E58,”=comics”,E2:E58)
=SUMIF(D2:E58,”=Thriller/Mystery”,E2:E58)
=SUMIF(D2:E58,”=romance”,E2:E58)
The SUMIF function is great when you have just one criterion
to work with, but what if you need to use multiple criteria? This is
where the Conditional Sum Wizard comes in.
First you need to activate this Wizard from the Add-ins dialog
box. To do that, open the Excel option for it by clicking on the
Office Button and then on the
Add-ins section. At the bottom
of the window next to
“Manage:”, select Excel Add-in
from the drop-down list and
click “Go…” Check the
“Conditional Sum Wizard”
and click OK. Excel will add
this Wizard to the Solutions
group in the Formula tab.
Click on it to start.
In step three, you can decide whether you want to copy the
result to a single cell or copy the formula and its conditional val-
ues also. We’ve selected to do the latter. Click Next.
In step four, you select or type in the cell reference where you
want the result to appear. Make your selection and click Next.
Excel will now ask you to select the locations where you want to
place the conditional text values you have specified. Depending on
the number of conditions specified, Excel will ask you for the loca-
tions to place each of them. When you are done, click Finish.
Similarly, you can run the Wizard again and build a list of
totals based on conditions that you have specified.
The COUNT and COUNTA functions count the cells that contain
data. The difference between COUNT and COUNTA is that COUNT
will only count those cells with numeric entries, while COUNTA
will count both numeric and text entries. The COUNTBLANK func-
tion, as the name suggests, will count only the blanks in the list.
COUNTIF(range, criteria)
Similar to the SUMIF function, the COUNTIF function counts the
cell in a range based on specified criteria. The range argument as
the name suggests requires you to specify a range of cells over
which you will apply the criteria argument. The range argument
=COUNTIF(A1:D10,7)
Counts all the cells in the range A1 to
D10 with the number 7
=COUNTIF(A1:D10,”Delhi”)
Counts all the cells in the range with the An Example of COUNT
functions
text Delhi. Any text or expression should be
enclosed in quotes—e.g.: “<13”, “<>234”,”Digit” etc
=COUNTIF(A1:D10,C7)
Counts all the cells in the range which matches the contents of
the cell C7.
=COUNTIF(A1:D10,”<>”&C7)
When you want to use operators other than equality then you
need to use quotes for the operator and join it to the cell reference
using the & (ampersand) symbol. Thus in the above expression
Excel will return a count of all the cells where the content “is not
equal to” the content in cell C7.
=COUNTIF(A1:D10,”*milk”)
=COUNTIF(A1:D10,”*orange*”)
=COUNTIF(A1:D10,”??eat”)
float, etc. In the third example, Excel searches for all cells that
contain the word ending in “eat”—e.g. treat. Note that with the
wild card “?” words like meat and feat will fail, since there are two
question marks specified in the search criteria, so only words with
two letters and ending in “eat” will be counted.
In most cases, for whatever you are trying to do, there is a good
likelihood that you can achieve your result by using one function
or a combination of functions. If you juggle a lot with numbers
and text, taking the time to get familiar with Excel’s functions and
formulas has the potential to leapfrog your productivity and save
you time.
Notes
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
.................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
.................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................
................................................................................................................................................................................................