Академический Документы
Профессиональный Документы
Культура Документы
If Excel 2007 or a later version is your first exposure to Excel, you will love it.
However, if you are used to Excel 2003 or an earlier version, you will have
some unlearning and relearning to do. Several big changes were made in Excel
2007, along with many smaller changes. The changes made in Excel 2010 and
later versions were much less dramatic, so moving from Excel 2007 to 2010 or
a later version is quite easy. The text boxes below indicate the primary
changes in each of the post-2003 versions of Excel.
1. The Office button was replaced by the File menu for accessing the
backstage view, and the layout of this backstage view changed slightly.
2. You can now customize ribbons, although there are quite a few
restrictions on what you are allowed to change.
4. Two new buttons were added to the Developer ribbon for quick access
to "regular" or COM add-ins.
1. The style of the user interface changed yet again. Now the tabs are no
long all in uppercase, and the bar at the top is all green. (This can be
changed to dark gray or white from the Office Theme options in the
General tab of Excel Options.) Also, the layout of the backstage view
(from the File menu) changed once again.
2. The Insert ribbon has several new items in the Charts group. The new
chart types include histograms, box and whisker plots, tree maps,
sunburst charts, waterfall charts, and combo charts.
3. The Data ribbon contains a new Forecast Sheet item for forecasting
time series automatically, using exponential smoothing.
4. The Data ribbon contains a new Get & Transform group for querying
external data sources. These actually implement Power Query,
Microsoft's querying add-in, part of its Power BI (Business Intelligence)
2. The Insert ribbon has several new items in the Charts group. The new
chart types include histograms, box and whisker plots, tree maps,
sunburst charts, waterfall charts, and combo charts.
3. The Data ribbon contains a new Forecast Sheet item for forecasting
time series automatically, using exponential smoothing.
4. The Data ribbon contains a new Get & Transform group for querying
external data sources. These actually implement Power Query,
Microsoft's querying add-in, part of its Power BI (Business Intelligence)
suite of tools.
5. The other Power BI add-ins, Power Pivot, Power View, and Power Map
are all part of Excel 2016, available as COM add-ins, with slightly different
interfaces than before. However, these are not available in all versions of
Excel. If you plan to use these tools, you should check carefully before
you purchase Office (or Office 365).
lookup_value lookup value is the input value or input cell in this function
ideally the look up value any blank cell anywhere in the sheet apart from table array
col_index no is the coloum no from the table array from where we fetch the value
Starting in Excel 2007, Microsoft completely reorganized the user interface of the
Office products. Instead of the old menus and toolbars, there are now tabs and
ribbons. Each tab (Home, Insert, Page Layout, etc.) has an associated ribbon that is
similar to the old toolbars. (See to the right for the ribbons in Excel 2016. Those in
Excel 2007, 2010, and 2013 are similar.) For example, if you click the Formulas tab,
you get a ribbon with buttons that are useful for working with formulas. Each ribbon
has several groups of buttons. For example, the Formulas ribbon has one group
called Defined Names for manipulating range names. There is only one way to learn
these ribbons: by practicing and experimenting. Eventually, you will appreciate that
the ribbons are more logically organized than the old menus.
If you are using Excel 2007, you can’t customize the new ribbons; they are built in
and fixed. (Well, that isn't quite true. You can use the RibbonX technology, not
covered here, to customize them.) However, you can customize the ribbons fairly
easily in post-2007 versions. This is explained in another topic of this tutorial.
With the old menus gone, what about the keyboard shortcuts many of you like to
use? Most of them still work. For example, you can still press Ctrl+s to save a file or
Ctrl+p to print.
If you are a mouse person, hover the mouse above any tab and move the scroll
wheel. This will cycle through all of the tabs. Also, if you prefer keyboarding to
mousing, here's something you will like. Press the Alt key. In the ribbon area, you will
see a shortcut key for each tab. For example, M is for Formulas. Press any of these
shortcut keys to see the corresponding ribbon, and each one of its buttons will have
a shortcut key. Press the one you want, which is equivalent to clicking the button. To
make these shortcut keys disappear, press the Alt key again.
Try it! Use the Alt method to open the Name Manager on the Formulas ribbon.
A few of the new tabs are not visible until you select an appropriate object. For
example, when you select a chart, two Chart Tools tabs (Design, Format) become
visible. (There were three Chart Tools tabs in previous versions.) Or when you select
an Excel table, a Table Tools Design tab becomes visible.
If you need more space, you can right-click any ribbon and select Collapse the
Ribbon. You can then restore it in the same way. Also, note that depending on the
width of the Excel window, some ribbons might not show fully, but everything is still
available.
In general, Excel 2007 and later versions are more intelligent about context. In the
context of what you are doing, if something is relevant, it is likely to appear.
Otherwise, it remains hidden.
Home Ribbon
Insert Ribbon
Formulas Ribbon
Data Ribbon
Review Ribbon
View Ribbon
Developer Ribbon
Customize Ribbon dialog b
Customizing Ribbons
Starting in Excel 2010, Microsoft made a welcome change that allows you
to customize the built-in ribbons. You might recall that in Excel 2003 and
earlier versions, you could change the menu structure to your liking fairly
easily. Then came the new ribbons in Excel 2007, which were pretty
much fixed (unless you were willing to use the rather obscure RibbonX
technology with XML code). Evidently, Microsoft received enough
complaints about the fixed ribbons that it returned to customizable
ribbons in Excel 2010. Fortunately, customizing is quite easy.
To do so, right-click any ribbon and select Customize the Ribbon. This
opens the dialog box to the right. (This dialog box is also available from
the Excel Options group.) From here, the options are straightforward. You
can create a new tab, create a new group under a given tab, and rename
either of these. Then you can move buttons from the left pane to the
right. As an example, the screenshot to the right illustrates how you
could create a new Tables group under the Data tab and then populate it
with PivotTable and Table buttons. This would allow you to get pivot
tables or tables from either the Insert ribbon or the Data ribbon.
Note that the Reset button lets you restore all of the ribbons or a
particular ribbon to its original state.
Note: The changes described above are the easy "point and click"
changes. If you are more ambitious, you can use RibbonX technology to
make more extensive changes by writing XML code. Do a Web search for
RibbonX if you're interested.
Customize Ribbon dialog box
File Menu
Just as users were getting used to the Office button in Office 2007 for getting into
"backstage view," Microsoft replaced it with the File menu in Office 2010, and this
has remained in later versions. The File menu in Excel 2016 leads to slightly different
options than in earlier versions, as shown to the right. In each of these versions of
Excel, the File menu (or Office button) takes you to the backstage view where you
can perform file operations, and it is where you can open the Excel Options dialog
box. There are too many options to explain here, so it is best to experiment. You
shouldn't have any trouble finding what you want. For example, to see exactly which
version of Excel you have, click the Account option.
To leave backstage view, simply click the back arrow at the top left.
Backstage view in Excel 2016
QAT
Quick Access Toolbar (QAT)
Starting in Excel 2007, there is a Quick Acess Toolbar (QAT) at the top left of QAT Customize list
the Excel window. You can put your favorite buttons on this toolbar so that
they are always visible and available. The QAT comes with a few favorite
buttons, but you can add more. The one shown to the right contains several
favorite buttons in addition to the default buttons.
Click the dropdown arrow to the right of your QAT. You will see the list to the
right of the most commonly used buttons, which you can then check to add
them to your QAT. You can also click the More Commands item in this list to
see the dialog box to the far right. If contains a huge number of other buttons
you can add to your QAT. In fact, if you create your own macros to perform
common tasks, you can place buttons to run them on your QAT.
In Excel 2010 or later, you can get to the Customize dialog box by clicking the
File button, then Options, and then Quick Access Toolbar. Or in any of these
versions, you can simply right-click any QAT button and select the Customize
Quick Access Toolbar option.
You can also right-click any button on the visible ribbon and select Add to
Quick Access Toolbar to add this button to your QAT. Similarly, a quick way to
delete a button from your QAT is to right-click any of its buttons and select
Remove from Quick Access Toolbar.
Try it! Add some of your favorite buttons to the QAT. Fortunately, you will have
to do this only once on any given PC.
QAT Customize list QAT Customize dialog box
Excel Options
Excel has many options for changing the software's behavior. To get to it,
click the File button in the upper left corner of the screen and then
Options. As shown to the right, you will see that the options are grouped
in categories: General, Formulas, and others. You might have to hunt a
while, but you will eventually find what you are looking for among the
large number of options available.
Try it! Under the General group, change the default number of worksheets
in a new file from 3 to 1. (Why have 3 when you usually need only 1? If
you need more, you can always add them. Note that Microsoft seems to
have changed the default to 1 in Excel 2016.)
Try it! Under the Advanced group, the first Editing option lets you choose
the direction you want the cursor to move when you press Enter. Change
it to the direction you prefer.
Try it! Excel makes some automatic changes for you when you type certain
characters. For example, if you type (c), it automatically changes this to a
copyright symbol. If you find this annoying, you can change it through the
AutoCorrect Options button in the Proofing group. Similarly, add an
abbreviation for your name or company through AutoCorrect Options so
that whenever you type the abbreviation, the full name appears.
Note that most of the options are for Excel as a whole, not for any
particular workbooks or worksheets you might have open. However, there
are a few that are workbook-specific or worksheet-specific. For example,
in the Advanced group, there are two sets of options, "Display options for
this workbook" and "Display options for this worksheet" that can be varied
from one workbook or worksheet to another.
File types (under Save As
File Extensions
Note that if you save your file as an .xlsx file, users with Excel 2003 won’t
be able to open it unless they download and install a free file format
converter from Microsoft. (Search the Web for Microsoft Office
Compatibility Pack to find this free download.) In the other direction, if
you save a file created in Excel 2007 or a later version as an .xls file, it will
probably work fine, and it will be readable by users with older versions of
Excel, but it won't be able to take advantage of changes in post-2003
versions. In fact, some new elements such as sparklines won't appear at
all.
There are a few other new file extensions you might see, including the
following:
.xlsm: If your Excel file has associated VBA macros, and you want to save
it in the post-2003 XML format, you must save it as an .xlsm file ("m" for
macro). You might also see files with an .xlam extension. These are Excel
add-ins. In pre-2007 versions, add-ins had an .xla extension.
.xltx: This is a template file ("t" for template). Templates are discussed in
the Templates topic of this tutorial.
.xlsb: This is a binary file ("b" for binary). The only file you will probably
see with this extension is the Personal.xlsb file, used for storing your
favorite macros. See the Recording Macros topic in this tutorial for more
about this special file, your "Personal Macro Workbook."
Try it! Open a new workbook in Excel 2007 or a later version and do a
Save As. You will see the list of file types to the right. Because you are in
Excel 2007 or later, the default type is the top one, .xlsx. But if you wanted
to give this to a colleague with Excel 2003, you could save it as an Excel
97-2003 .xls workbook. (You could even save it as an Excel 5.0/95 .xls
workbook, but let's hope those days are over!) Alternatively, if your file
contained macros, you could store it in the new format as an .xlsm file, or
you could store it in the old 97-2003 .xls format.
97-2003 .xls workbook. (You could even save it as an Excel 5.0/95 .xls
workbook, but let's hope those days are over!) Alternatively, if your file
contained macros, you could store it in the new format as an .xlsm file, or
you could store it in the old 97-2003 .xls format.
File types (under Save As)
Going Home to Cell A1
When you are working on a large worksheet, you often want to reorient yourself
by going back to cell A1, the "home" cell. This is easy. Just press Ctrl+Home from
anywhere in a worksheet, and you will go to cell A1.
Try it! Scroll way down and way across to the right. Then press Ctrl+Home.
61
Splitting the Screen 95
33
It is often useful to split the screen so that you can see more data.
49
To split the screen: 10
Select the cell where you want the split to occur and then click the Split button on the 14
View ribbon. This provides four panes that operate independently. Once you have 21
these panes, practice scrolling around in any of them, and see how the others react. 8
Try it! Split the screen so that you can see the top left cell and the bottom right cell in 94
the data set to the right. Then remove the splits by clicking the Split button again. 84
Actually, if you want to remove only one of the splits, horizontal or vertical, you can 62
drag the split line to the right or down to the edge of the window.
16
Note: Prior to Excel 2013, you could drag buttons next to the scrollbars to split either 93
vertically or horizontally. Perhaps these buttons were too difficult to locate, so they 6
were eliminated in Excel 2013.
28
66
56
3
33
34
80
53
77
64
39
75
58
56
5
80
6
52
83
8
55
51
39
50
42
48
54
15
28
28
99
24
19
21
30
93
32
35
82
23
59
17
4
67
17
71
48
29
58
64
14
67
90
83
21
14
38
64
10
53
79
90
60
67
22
80
86
41
8
58
9
21
64
59
18
17
22
72
56
10
72
72
94
44
4
44
80
41
21
35
44
38
45
47
64
79
25
47
2
73
97
62
22
48
63
59
23
73
87
25
87
1
25
3
21
46
41
74
8
64
60
24
66
5
51
80
69
44
36
90
29
87
80
67
78
59
50
91
36
93
31
32
36
10
51
54
18
20
84
2
80
6
55
6
6
48
49
89
82
29
11
43
17
100
65
26
85
27
74
90
81
87
85
63
8
14
70
35
24
66
75
47
75
62
90
9
58
87
5
71
40
77
62
75
68
68
60
38
13
65
11
100
93
99
47
62
36
50
71
33
68
80
82
70
95
24
1
91
100
58
45
21
53
5
35
53
51
35
22
4
8
75
5
13
31
98
6
97
67
16
49
6
81
55
79
7
97
68
26
91 84 8 3 62 11 33 83 70 84
8 14 68 33 23 13 12 3 100 42
93 80 5 60 30 13 34 23 57 56
47 37 41 56 38 46 50 100 40 59
65 46 42 52 90 37 31 56 29 78
69 15 73 11 75 77 36 66 32 97
80 46 93 35 95 35 95 27 25 39
74 24 77 9 92 46 28 100 22 31
33 56 88 51 73 22 39 93 77 39
17 60 87 32 46 100 61 83 71 93
79 43 80 11 9 24 52 22 58 80
29 76 6 90 32 40 62 94 34 34
54 2 11 82 33 18 31 42 58 13
39 52 66 33 2 23 49 87 46 75
91 57 78 29 82 24 88 45 3 30
28 57 51 87 44 99 18 32 34 71
100 36 48 46 60 71 33 30 26 38
34 87 45 45 76 85 86 28 100 70
13 50 83 53 20 83 13 7 27 92
55 3 9 67 99 25 33 93 18 92
45 89 83 23 31 12 14 27 75 89
96 54 41 100 1 28 21 29 68 76
57 38 52 44 94 46 72 50 83 56
86 26 30 35 69 52 28 48 27 67
28 43 41 27 86 76 44 12 47 79
97 99 71 66 63 42 63 15 91 40
14 66 95 35 18 41 32 29 35 46
58 57 81 48 63 27 54 97 81 34
99 11 59 7 8 84 56 76 54 23
67 47 99 77 50 42 90 92 86 59
22 30 3 40 19 67 32 57 49 8
100 67 91 27 59 11 72 12 79 9
32 19 90 44 22 100 11 18 68 91
51 93 30 28 55 97 60 46 59 77
21 30 49 5 26 1 16 86 85 86
88 93 61 96 88 59 68 44 95 13
97 37 14 25 17 44 69 92 16 86
80 41 96 76 49 43 27 73 88 11
73 4 25 21 30 74 44 68 36 69
60 26 34 87 79 62 96 39 45 13
12 31 66 87 68 48 34 46 29 50
63 54 42 15 32 73 11 91 96 14
41 18 72 18 36 54 96 3 50 58
15 100 28 4 9 94 43 56 98 80
3 52 27 39 60 4 18 63 56 22
32 55 62 100 30 82 17 79 11 41
28 46 73 83 78 96 39 32 42 45
31 14 78 87 14 49 85 75 84 43
76 53 91 46 94 2 64 34 41 41
98 84 86 97 9 98 94 44 61 47
54 80 51 59 62 6 8 29 4 30
32 25 34 37 83 51 54 45 52 57
86 46 28 54 56 26 57 3 67 91
94 71 95 56 37 97 84 7 68 8
62 88 21 2 57 19 66 65 32 89
19 95 63 4 99 93 50 100 2 28
62 36 55 37 49 11 62 7 70 31
58 54 91 39 76 25 22 55 23 23
41 21 18 24 6 65 10 83 45 42
8 45 90 1 34 11 60 21 93 63
41 36 7 69 54 5 9 46 46 60
97 30 76 59 85 39 96 30 40 26
15 37 56 25 71 3 78 83 65 98
66 57 26 39 63 17 46 76 99 14
48 78 6 72 26 1 84 26 48 29
56 76 7 97 89 44 99 19 73 67
97 41 63 79 20 90 95 87 92 71
17 24 75 31 11 98 72 91 5 65
32 27 46 59 22 82 12 65 48 24
27 3 62 48 39 43 8 81 19 36
87 57 5 39 100 56 61 5 62 84
15 57 23 94 63 96 6 54 27 1
24 39 52 80 100 28 88 21 15 62
10 66 31 7 99 48 21 85 20 63
70 94 39 66 37 7 78 57 92 31
19 84 3 4 48 34 91 41 11 41
59 36 83 90 42 45 17 64 83 9
9 71 3 84 2 95 44 67 18 14
53 52 45 50 20 39 23 68 48 12
17 94 59 82 93 50 47 67 46 19
16 44 67 60 14 38 99 57 37 53
46 51 42 50 52 38 16 49 60 66
66 13 63 76 23 58 1 70 47 15
52 88 11 35 21 57 6 14 82 3
10 80 57 97 49 89 1 5 83 24
23 18 11 83 7 50 96 3 33 46
79 96 60 21 49 80 80 80 52 4
93 64 38 26 71 1 66 39 49 58
54 3 25 10 80 46 49 26 52 92
49 70 22 71 98 81 44 23 94 46
24 96 90 79 26 13 63 60 59 38
62 35 54 98 13 94 56 28 85 44
81 96 90 42 44 88 33 37 61 67
95 47 39 40 74 48 72 44 83 30
77 68 43 75 89 23 27 53 55 59
46 33 91 76 68 54 82 74 73 26
62 70 62 1 71 46 49 90 97 12
16 63 96 93 42 98 36 32 31 92
78 4 57 89 63 14 63 11 40 87
53 42 63 53 73 15 21 38 47 62
8 23 12 57 71 55 48 77 6 80
77 13 57 84 1 92 13 19 73 93
28 20 14 34 77 12 47 30 32 43
79 17 53 48 31 52 29 16 42 32
19 27 44 81 54 47 8 24 67 7
82 78 93 9 49 1 20 76 63 63
91 77 37 45 46 5 71 47 15 18
24 39 50 25 65 52 71 14 24 94
36 57 8 7 85 97 6 16 11 84
62 44 21 75 43 58 44 84 64 99
11 56 79 80 68 68 25 21 63 85
1 96 34 33 30 92 70 17 3 22
65 45 17 6 16 19 61 9 23 37
21 96 87 87 33 95 99 19 92 88
29 26 8 25 35 27 30 69 28 63
31 48 1 100 11 71 77 87 38 88
42 23 87 55 73 89 22 73 27 67
12 99 78 21 25 58 88 4 39 15
62 60 7 95 7 9 20 37 63 33
83 41 52 33 77 59 28 78 49 16
53 55 94 79 73 53 45 93 69 6
85 62 26 65 82 48 55 5 82 50
76 44 15 5 76 8 73 54 18 3
36 61 5 95 95 55 44 81 51 39
49 6 24 96 32 90 43 43 36 37
65 3 98 88 93 52 26 76 97 51
7 5 62 60 41 36 43 94 66 60
15 36 21 81 37 48 67 87 79 56
88 92 53 26 82 74 30 71 37 57
8 27 24 80 66 74 33 76 70 91
32 70 57 7 68 37 55 84 29 57
5 50 73 14 35 70 87 65 56 85
52 77 79 18 82 17 29 56 56 56
28 1 99 41 63 89 69 97 26 50
75 59 23 50 98 8 91 84 25 59
32 42 22 45 40 78 92 9 76 58
100 97 47 89 46 89 73 33 29 43
21 61 56 43 59 39 19 41 82 2
11 13 49 60 16 15 94 67 91 32
38 15 55 84 4 68 40 85 2 68
59 95 21 59 78 9 59 36 68 21
43 36 99 84 57 72 11 93 84 75
96 63 2 69 5 56 70 66 65 75
35 33 45 100 95 30 23 92 15 64
11 97 85 100 17 81 87 5 71 57
99 83 90 96 54 33 56 59 32 34
41 1 99 56 87 85 74 85 29 6
86 89 90 17 97 64 6 43 23 3
98 73 2 43 55 81 46 6 58 18
7 61 27 45 25 32 47 66 95 22
65 6 73 62 5 96 69 65 21 72
58 44 11 100 82 50 28 26 93 81
92 28 37 38 4 30 99 17 88 37
31 27 55 85 54 65 94 90 56 4
42 27 37 83 42 5 43 24 68 57
76 74 40 8 61 46 73 31 92 79
13 30 44 71 60 83 68 76 20 8
72 34 68 46 1 35 84 32 34 98
41 64 66 64 25 66 21 38 45 31
51 44 70 39 66 38 21 74 64 99
22 68 19 62 49 31 98 76 84 89
36 76 29 14 36 22 14 68 87 89
81 83 45 67 76 65 53 76 100 39
32 35 35 77 100 51 81 67 46 93
80 49 44 55 44 25 53 58 86 24
73 48 54 20 12 73 27 82 47 50
88 39 92 91 88 70 97 86 53 95
14 68 28 42 87 68 86 16 68 5
85 2 88 9 46 3 68 30 79 3
82 90 87 29 56 68 54 49 100 34
16 70 33 38 89 89 38 22 56 2
65 76 38 66 65 90 52 67 74 77
96 81 70 57 16 56 37 50 6 73
39 13 40 71 72 68 55 21 65 45
49 96 18 36 30 71 10 51 32 27
21 73 40 37 28 24 4 14 56 65
77 29 50 77 10 53 30 55 77 79
87 58 88 19 44 54 82 62 18 84
56 63 89 78 60 49 39 34 92 15
50 7 90 32 25 80 80 9 77 47
4 11 95 8 72 16 30 36 6 38
34 52 95 58 72 88 48 92 13 86
50 36 79 4 91 62 30 79 44 2
4 53 74 9 37 100 77 22 19 16
67 18 3 36 41 24 51 89 8 90
10 62 20 81 35 2 71 26 27 50
30 97 86 13 26 91 11 80 60 98
71 10 68 99 9 92 4 75 99 24
18 40 81 20 19 21 59 12 4 72
23 86 50 65 69 52 75 28 71 32
68 65 22 38 67 79 97 13 88 93
20 39 36 60 83 62 69 11 42 51
42 69 77 10 87 33 4 55 91 52
34 71 48 48 54 45 82 35 14 54
35 7 53 28 9 82 61 82 66 43
61 39 77 63 54 89 92 56 91 73
83 38 56 55 5 96 90 75 65 80
32 49 76 59 48 40 29 33 60 20
2 31 1 86 96 41 11 89 62 22
4 60 71 6 49 33 19 31 56 25
47 83 28 10 39 15 71 84 84 65
29 30 76 72 11 91 2 71 60 9
37 65 32 8 44 42 90 84 68 76
55 13 82 26 58 53 81 39 6 99
27 2 33 73 3 87 10 58 82 100
90 32 82 40 62 49 32 60 4 72
31 22 48 69 66 28 54 3 58 56
7 75 57 36 24 65 72 21 69 79
54 34 43 18 89 25 1 94 64 86
17 81 73 51 24 99 49 99 95 22
53 39 63 39 49 52 66 37 69 88
44 18 1 14 6 88 7 8 87 51
2 66 24 33 64 9 73 50 100 33
78 33 93 61 75 81 47 24 10 8
74 100 95 33 87 58 14 10 41 85
79 1 30 38 38 2 52 10 76 34
77 58 4 76 71 79 10 7 40 73
39 52 60 13 65 16 90 12 57 57
15 65 34 2 49 3 68 46 42 32
100 64 94 41 79 3 11 9 23 40
37 100 34 96 54 46 34 58 61 7
30 8 81 33 75 76 68 2 39 38
63 57 70 12 93 83 29 96 51 85
54 72 49 3 68 38 97 81 6 37
32 91 5 34 66 31 25 69 89 35
89 86 36 50 78 81 78 8 4 51
22 53 19 14 39 86 50 13 62 91
43 74 72 45 41 13 42 87 34 42
33 7 76 39 88 55 64 16 37 35
70 27 78 78 36 85 79 50 15 27
42 24 11 41 78 58 7 51 27 59
26 84 65 71 15 32 95 79 31 75
79 78 99 41 89 12 77 90 48 41
12 65 57 60 52 37 25 71 26 11
98 2 43 82 3 26 52 86 28 100
50 29 23 18 59 79 48 63 97 17
25 43 25 98 79 6 30 89 48 13
51 1 1 36 34 51 17 93 73 53
83 10 62 46 46 82 47 97 46 92
25 29 1 97 7 45 16 62 83 26
24 71 78 75 40 97 97 69 39 89
4 69 90 27 70 16 15 56 96 48
80 64 22 36 66 3 14 81 69 35
54 13 100 97 23 71 46 63 52 11
88 74 93 53 84 2 55 10 2 22
28 66 58 48 87 30 12 83 27 91
35 40 86 85 56 79 20 7 86 34
5 86 97 42 43 21 71 86 70 58
64 50 32 28 86 46 98 2 36 54
67 43 64 41 72 95 83 92 44 61
64 79 7 7 94 92 40 25 88 51
55 34 5 19 89 58 38 82 66 35
43 50 69 37 11 16 79 92 17 18
79 76 21 85 12 67 18 32 68 90
82 70 80 13 44 70 57 27 70 26
83 5 79 15 91 92 29 50 79 67
84 67 96 65 88 82 98 12 30 63
13 37 12 100 57 68 80 27 71 32
51 75 17 89 44 22 34 62 95 25
60 8 51 74 41 84 1 38 82 80
29 35 1 37 65 88 99 45 100 96
29 86 53 36 26 23 83 19 63 68
43 93 34 93 35 17 6 99 55 7
94 30 49 86 7 18 39 54 4
23 85 57 84 89 53 25 57 97
82 3 62 89 17 6 28 99 26
34 22 37 39 24 64 31 5 86
88 67 62 23 32 72 65 32 98
51 41 90 79 49 16 49 75 78
33 93 81 44 4 88 50 19 1
97 78 79 17 62 1 69 26 74
51 75 63 6 63 31 7 55 24
74 34 52 4 26 55 60 27 51
41 93 77 33 8 38 89 95 20
91 57 9 49 93 62 45 7 62
20 20 58 23 16 69 51 15 70
58 95 64 9 8 100 60 65 68
36 90 61 40 12 19 89 39 34
54 65 39 72 94 59 47 24 86
78 44 4 59 90 43 100 9 70
72 45 7 49 10 21 27 54 43
43 19 59 8 91 55 42 23 11
16 9 95 61 27 11 5 36 4
99 9 46 3 51 38 24 33 63
44 97 68 7 19 6 5 58 66
12 29 60 65 93 60 21 8 47
62 52 39 46 20 82 66 58 1
46 32 58 36 71 83 52 40 39
1 68 95 2 61 97 54 39 61
96 80 77 31 34 12 49 70 96
12 85 9 66 69 72 40 83 90
33 77 7 2 2 19 80 23 27
59 94 24 17 90 11 46 62 32
63 64 10 34 41 80 87 45 58
27 31 20 25 54 5 13 91 100
99 41 92 91 19 30 18 86 8
45 7 12 6 57 47 28 83 98
100 90 83 1 63 61 64 84 67
18 81 23 31 28 35 80 70 59
68 83 22 89 64 80 60 12 26
79 6 16 40 73 91 36 4 86
98 35 16 18 54 88 24 57 41
91 85 3 47 50 2 16 61 94
88 14 43 47 47 90 15 46 73
29 64 78 57 91 27 89 65 24
89 69 40 42 5 10 90 97 7
86 71 40 15 90 70 18 61 100
66 36 51 18 29 14 33 53 55
86 87 71 67 93 38 54 44 71
66 2 7 87 67 4 45 69 90
63 48 88 61 71 20 71 58 32
26 17 44 46 100 63 29 24 7
37 24 28 75 84 24 96 11 4
63 63 77 3 11 68 60 60 52
4 41 22 37 31 48 24 53 36
83 73 74 6 54 46 32 19 80
51 24 19 55 32 8 2 67 19
11 58 49 47 38 28 49 39 31
34 92 64 34 58 32 14 27 14
11 67 64 54 37 90 40 81 97
66 74 49 57 66 3 23 17 76
84 57 73 25 58 52 26 91 48
88 93 15 18 40 35 16 98 26
90 18 3 10 84 79 47 67 41
36 82 50 80 68 96 82 17 97
46 78 59 25 9 28 74 1 62
37 30 96 5 76 49 65 52 50
43 21 16 65 24 16 82 99 56
47 34 84 85 42 95 78 91 97
50 68 16 50 17 53 37 33 94
100 75 83 59 92 40 73 19 70
83 93 88 84 64 85 41 63 49
76 57 69 70 52 39 10 16 39
84 11 3 80 49 5 24 37 67
58 23 46 28 58 84 17 80 4
70 91 48 36 56 15 88 39 93
37 20 86 24 81 78 89 69 6
47 61 93 13 91 62 70 41 3
40 59 2 100 33 74 81 81 44
66 92 37 83 58 31 4 66 40
12 31 77 11 53 7 56 47 7
5 79 51 73 41 45 37 15 44
28 23 33 4 62 29 27 44 15
48 92 63 14 15 52 50 92 43
4 10 61 75 62 89 19 47 48
11 25 50 14 88 49 16 14 94
30 59 11 72 82 26 50 63 41
65 32 94 90 63 6 76 15 56
95 22 99 54 46 36 63 38 7
6 2 96 16 42 51 15 38 59
11 42 23 50 40 57 84 62 14
36 2 14 22 82 9 61 72 77
84 7 72 88 46 64 51 68 71
35 22 25 50 83 60 85 94 24
97 88 39 57 66 70 97 30 77
11 88 12 51 21 40 12 10 37
93 97 12 78 55 78 89 6 20
36 73 89 67 83 56 62 87 85
66 95 46 21 56 46 19 80 14
61 50 100 58 92 31 3 37 63
30 61 73 2 83 83 55 41 20
10 30 39 51 55 34 74 72 58
23 62 19 5 96 95 80 4 56
63 34 38 75 73 65 62 50 41
13 72 10 45 43 66 64 68 9
59 89 24 56 64 44 26 47 31
29 99 56 63 14 30 28 94 59
84 28 77 28 76 27 96 84 6
77 16 95 82 15 8 4 41 50
46 36 8 63 8 15 28 32 30
59 63 65 31 93 16 71 88 3
28 95 38 72 50 5 84 15 2
80 70 84 97 90 3 93 96 47
79 37 69 82 95 100 71 26 58
59 5 36 3 39 52 1 45 7
48 20 20 40 75 65 42 17 70
4 57 79 9 84 2 41 9 13
84 25 27 3 4 44 79 55 61
82 92 100 100 32 59 7 1 72
74 73 32 35 100 22 60 37 62
5 10 51 64 23 93 67 3 84
60 25 59 91 15 76 44 28 70
17 13 92 8 77 38 83 41 91
55 98 4 99 58 5 92 23 45
68 83 6 32 7 84 77 76 56
40 51 87 91 87 50 92 62 81
13 30 54 49 1 31 100 16 40
56 47 79 51 14 2 55 93 38
42 54 3 84 69 53 19 95 95
24 100 23 72 92 42 63 99 96
50 52 6 49 61 93 86 70 67
38 79 52 81 29 93 50 46 53
60 83 26 92 63 37 72 38 66
5 82 48 26 40 20 7 84 34
51 54 75 88 27 35 13 20 28
43 30 82 39 9 11 36 50 33
30 9 44 38 9 19 25 64 74
21 50 94 4 32 36 13 71 60
32 44 50 57 98 55 18 18 88
46 41 83 59 75 66 65 88 32
73 84 3 11 36 69 53 10 33
65 21 89 53 90 23 79 75 37
46 3 49 96 43 66 16 68 85
98 28 28 43 75 15 15 46 97
56 15 80 83 32 36 100 78 96
10 97 100 60 1 52 42 8 90
41 25 55 7 30 61 71 5 68
87 40 30 39 55 79 98 85 23
56 17 12 94 57 99 20 35 92
73 40 42 65 73 22 7 7 99
74 60 9 26 83 36 58 66 35
96 91 86 93 2 100 15 54 54
31 61 93 26 3 67 9 3 38
10 27 58 29 28 35 27 68 2
15 33 49 62 75 50 5 45 20
90 1 77 59 61 73 66 32 39
3 84 8 56 20 9 91 72 19
97 67 13 41 20 38 39 11 46
87 18 8 70 43 40 74 98 73
48 25 58 33 53 72 18 12 41
27 52 51 8 16 61 6 68 43
34 17 4 83 1 60 22 74 33
18 98 18 51 87 36 70 19 46
100 96 9 25 81 17 67 34 71
5 42 37 65 87 48 98 10 82
47 28 59 9 22 39 98 65 19
8 83 32 57 16 16 71 27 37
87 48 65 79 38 7 90 6 23
73 76 6 98 65 19 51 78 92
13 61 27 56 89 25 88 73 49
12 97 43 44 78 72 71 82 28
77 14 12 10 13 29 6 30 35
93 31 39 85 87 70 67 32 69
22 71 10 74 95 96 34 99 53
95 88 25 10 67 89 69 42 2
11 82 8 78 66 30 97 83 68
30 73 36 83 50 28 39 57 91
8 26 2 45 59 81 53 1 75
78 7 74 71 47 1 30 27 76
48 25 70 87 64 15 15 72 32
10 61 51 76 97 63 47 53 29
100 19 90 16 86 11 76 81 39
84 5 91 13 8 39 81 4 61
31 51 87 63 27 45 49 50 65
93 91 28 46 23 88 85 35 40
18 39 47 58 8 15 90 15 32
51 66 27 68 38 35 85 43 24
100 27 59 4 52 3 43 57 17
100 5 12 62 10 44 48 71 75
27 76 20 63 11 98 3 100 16
10 49 30 29 55 16 28 9 72
22 93 40 35 2 82 85 97 87
60 39 88 93 51 32 82 69 51
51 51 17 89 70 63 68 73 42
34 36 50 48 7 7 34 32 16
15 62 12 7 66 38 41 87 41
11 40 58 23 97 30 5 84 59
90 67 21 39 41 13 30 75 20
69 83 17 19 16 84 43 31 27
18 42 64 31 92 65 83 1 33
82 56 87 70 7 74 16 95 60
57 67 77 13 42 76 76 89 48
22 19 1 2 64 87 74 46 91
78 72 3 68 36 88 8 32 71
16 94 72 12 82 42 65 93 9
14 79 7 33 35 21 24 85 16
49 77 14 10 50 64 21 88 100
91 83 14 45 6 43 87 6 7
55 97 83 7 32 75 92 65 48
21 100 94 12 94 24 6 14 83
23 10 34 14 47 66 30 97 91
86 25 92 19 34 22 52 51 8
32 5 74 4 19 3 26 66 68
3 86 44 78 43 88 5 38 94
54 35 92 35 1 72 78 79 69
9 90 16 28 65 6 91 29 41
54 21 94 85 70 86 71 1 55
63 5 14 72 9 39 98 56 94
28 82 89 37 68 86 9 97 62
26 6 95 19 27 41 83 90 16
35 80 19 43 13 70 22 74 9
76 41 47 40 73 65 63 98 15
63 60 39 27 18 16 6 19 28
51 55 90 20 49 94 56 53 17
25 64 36 1 18 78 31 90 51
77 22 5 57 15 39 90 19 14
35 11 65 31 14 52 19 42 12
56 39 15 59 88 100 9 38 72
20 88 51 91 14 81 34 27 21
8 63 47 72 79 86 48 37 83
99 84 81 23 29 16 2 96 28
31 4 32 63 94 50 10 95 74
71 66 93 74 40 99 13 81 49
88 8 78 17 63 6 20 69 68
46 39 87 34 73 95 48 44 54
19 5 95 71 17 1 90 40 22
31 70 14 88 34 26 41 73 23
2 10 75 78 3 73 5 25 37
61 39 85 83 56 27 95 58 16
79 80 1 15 35 94 85 44 59
95 53 51 21 88 93 34 27 24
22 63 28 60 26 91 1 48 62
37 36 79 93 56 75 94 87 58
5 79 8 35 38 75 6 94 63
1 24 33 27 52 25 19 13 79
5 9 64 2 45 80 64 47 74
60 47 59 76 77 10 81 3 22
35 39 48 4 93 9 84 74 63
53 26 36 10 46 67 80 84 42
2 63 86 81 17 8 33 79 31
29 73 6 5 10 92 65 39 20
95 100 81 98 51 36 17 77 22
62 3 12 77 12 62 23 90 83
22 59 50 50 36 14 35 52 34
48 59 87 55 93 88 7 82 96
56 13 51 45 14 71 53 31 89
19 28 49 60 12 52 46 48 54
14 67 63 24 34 94 30 31 1
74 10 13 15 92 27 19 19 43
87 90 22 41 37 46 25 88 44
38 95 69 58 74 11 81 99 50
66 66 59 30 19 86 51 6 44
95 64 35 84 26 90 96 8 6
58 5 46 37 11 18 32 63 71
88 10 83 19 26 36 84 78 48
42 29 55 37 95 65 59 47 95
Selecting a Range with Key Combinations
If you favor keystrokes to mouse clicks, you can try the methods on this worksheet
for selecting large ranges or for moving around in them. Four types of keystroke
combinations are illustrated here: (1) Ctrl+Arrow combinations, (2) End, Arrow
combinations, (3) Ctrl+End, and (4) Ctrl+a. The first two are basically for moving to
corners of a data range, usually one that doesn't fit on a screen. Just be aware that
if you use either of the first two, the active cell moves from corner to corner, but
nothing in between is selected. To select, you need to hold the Shift key.
Ctrl+Arrow Combinations
It is often useful to zoom to the bottom, top, right, or left corner of a data range.
You can do this easily with the Ctrl+Arrow combinations.
Select some cell in the data range, usually the upper left cell. Then press the Ctrl
key and the appropriate Arrow key simultaneously. For example, press Ctrl+Right
Arrow to go to the right corner of a range.
Try it! Starting at the gray cell to the right, move around to the other corners of
the large data range. You should end back in the gray cell.
Try it again! This time hold the Shift key. Then the Ctrl+Down Arrow combination
followed by the Ctrl+Right Arrow combination selects the entire range.
Try it again! Starting in the blue cell in the small data set above, use the
Ctrl+Arrow combinations to see how they are affected by blank cells.
Try it! Do the same exercises as above but now with End, Arrow combinations.
Try it! Do the same exercises as above but now with End, Arrow combinations.
Ctrl+End combination
Another possibility is to use the Ctrl+End combination. Starting from any cell, this
selects the bottom right nonempty cell in the worksheet. If you hold the Shift key,
this selects the range from the active cell to the bottom right nonempty cell in the
worksheet.
Try it! Select the large data range to the right with the Shift+Ctrl+End combination.
You should start with the upper left cell in the data range.
This key combination often comes in handy when files much larger than you think
they should be. For example, you might see that the size of your "small" file is
1MB or more. It could be that junk is somewhere way down in a worksheet. If you
press Ctrl+End and it takes you way down or across, well beyond your data, this is
a sure sign of junk that you can then delete.
Ctrl+a combination
A last quick way to select a data range, even one with some blanks as in the small
data set above, is to select any of the cells in the range and press Ctrl+a . (No Shift
key is necessary.) You can think of "a" as an abbreviation for "all".
Try it! Use Ctrl+a to select either the small data set or large data set to the right.
You will note that every cell "surrounding" the selected cell is selected, even the
labels above the data sets. This is why labels such as these are often separated by
blank rows from the real data ranges.
This is another combination that you can use to locate junk, as described in the
previous text box.
Small data set with missing cells
8 1 1
5 5 7
10 5 3 10
10 10 9
4 3 4
7 4 5 1
2 9 10
In Excel, you usually select a range and then do something to it, such as enter a
formula in it, format it, delete its contents, and so on. Therefore, it is extremely
important to be able to select a range efficiently.
First, it is important to realize that a rectangular range is defined by its upper left
cell and its bottom right cell. For example, the range address A1:D10 indicates that
the upper left cell is A1 and the bottom right cell is D10. So an easy way to select a
range is to click its upper left cell, hold the Shift key, and click its bottom right cell.
Click the upper left cell of the range and drag to the bottom right cell.
Or:
Click the upper left cell, hold the Shift key, and click the bottom right cell.
Try it! Select the small data range to the right by each of these methods. They are
both easy because the range is so small.
Selecting a range with the top-left/bottom-right method is trickier if you can’t see
the whole range on the screen. Dragging, the method most users seem to use,
can be frustrating because things scroll by too quickly. You scroll too far, then not
far enough, then too far again, and so on. To avoid this endless scrolling , use the
following method instead.
Split the screen horizontally and vertically. To do this, select any cell in the data
range and click the Split button on the View ribbon. Then in the bottom right
pane, press Ctrl+Down Arrow and then Ctrl+Right Arrow to zoom to the bottom
right cell of the data range. Now that you can see the upper left and bottom right
cells of the range, click the upper left cell, hold the Shift key, and click the bottom
right cell. Then you can remove the split.
Try it! Select the entire data range with the method just described. With a little
practice, you should be able to do it in a few seconds.
Try it! Select the entire data range with the method just described. With a little
practice, you should be able to do it in a few seconds.
Small range that fits on the screen
9 2 10
1 3 8
8 1 10
7 5 4
5 1 1
5 10 7
Suppose you want to format more than one range in a certain way. The quickest
way is to select all ranges at once and then format them all at once.
Select the first range, press the Ctrl key, select the second range, press the Ctrl
key, select the third range, and so on.
For example, to select the top two ranges to the right, select cell K3, hold the
Shift key and select cell L5 (so now the first range is selected), hold the Ctrl key
and select cell N3, and release the Ctrl key. Finally, hold the Shift key and select
cell O7.
Note that in Excel 2007, the highlighting is sometimes hard to see. The shading
isn’t as dark as in previous versions of Excel, so you might be fooled into thinking
you haven’t really selected multiple ranges. But the above method definitely
works, exactly as it always has. (This shading problem was fixed in Excel 2010, so
that the selection is now much more apparent.)
10 13 7 9
1 9 12 7
5 4 1 1
6 12
15 2
13 4 10
Paste Special Options
When you do a "regular" paste with Ctrl+v or one of the equivalent methods
discussed in the Copying and Pasting topic of this tutorial, several things are
pasted to the paste range: (1) if a copied cell has a value or text, it is pasted;
(2) if a copied cell has a formula, the formula is pasted, adjusted for relative
and absolute addresses; (3) the number formatting of any copied cell is
pasted; (4) other formats of the copied cell, including font, background color,
and border, are pasted. This is what you expect, and this is why you usually
use Ctrl+v or an equivalent method to paste.
However, Excel contains many paste variations in its Paste Special options.
One of the most common is to copy formulas and paste them as values, but
there are quite a few other options.
The Paste Special user interface has evolved over recent versions of Excel, but
the options remained about the same. Is it more user-friendly now than in the
past? You can be the judge of that. However, one really nice feature
introduced in Excel 2010 is that if you copy a range, select a paste range, and
then hover your mouse over any of the Paste Special icons, you immediately
see what the pasted version will look like, without committing to the paste.
Before continuing, be aware that one other way to get to Paste Special
options is to copy and then right-click. This option was available in pre-2007
versions of Excel, and it continues to be available. In addition, starting in Excel
2007, you can go directly to the Paste Special dialog box with the Ctrl+Alt+v
shortcut.
The rest of this worksheet explains and illustrates some of the Paste Special
options, using both the Paste Special dialog box and the gallery of icons under
the Paste dropdown. Note that one Paste Special option, transposing, is
discussed in the Transposing a Range topic of the tutorial.
A lot of users are not too happy with the Excel 2013 (or 2010) gallery of Paste
Special icons. Although you get tool tips when you hover the mouse over any
of them, they are fairly small icons, and they can certainly be confusing.
Therefore, many users jump right to the Paste Special dialog box where
everything is spelled out in words. You might want to do this as well, but you
might also want to learn what these new icons do. They are explained briefly,
row by row, to the right. For more details on any of them, see the cell
comments in column N.
Many of these icons have the same functionality as the corresponding items in
the Paste Special dialog box. However, the dialog box has some items with no
corresponding icons and vice versa. In any case, there is no need to memorize
of them, they are fairly small icons, and they can certainly be confusing.
Therefore, many users jump right to the Paste Special dialog box where
everything is spelled out in words. You might want to do this as well, but you
might also want to learn what these new icons do. They are explained briefly,
row by row, to the right. For more details on any of them, see the cell
comments in column N.
Many of these icons have the same functionality as the corresponding items in
the Paste Special dialog box. However, the dialog box has some items with no
corresponding icons and vice versa. In any case, there is no need to memorize
all of the options. The ones illustrated below are the ones you will probably
use most often, and you can always return to this worksheet or online help for
others you might occasionally use.
By the way, the options you see depend on what is currently copied. For
example, if nothing is copied, the entire Paste button is disabled. If a range of
cells (or a single cell) is copied, all of the icons are shown. If a chart or a shape
(a text box, a rectangle, a picture, etc.) is copied, only three of the icons are
shown.
You often have a range of cells that contain formulas, and you would like to
replace the formulas with the values they produce. Usually, you paste these
values over the copy range, that is, you overwrite the formulas with values.
However, it is also possible to select another range for the paste range. This is
totally up to you.
Copy the range with formulas with Ctrl+c, and select the range where you
want to paste the values, often the same as the copy range. Then select the
Paste dropdown on the Home ribbon, and select one of the "Paste Values"
options in the third row of icons. Alternatively, press Ctrl+Alt+v to open the
Paste Special dialog box and select one of the "Values" options.
Try it! Copy the top gray range to the right and paste it over itself as values.
Then check that the paste range contains values, not formulas.
Try it again! Copy the bottom gray range to the right and select a cell in
column O for pasting. Then hover the mouse over the three "Paste Values"
options in the third row of Paste Special icons. You should see clearly how
they differ. Eventually, click the one you prefer.
Here is something interesting about the examples you just tried. In the first
example, it doesn't matter which of the three icons in the third row you
choose. The gray background and dollar formatting are retained because they
start this way, and pasting special doesn't change them. However, in the
second example, when you paste the bottom gray range to a range that starts
with plain formatting, it does matter which "Paste Values" option you choose.
Shortcut tip: If you paste values over formulas frequenty, as many users do,
there is a quick keyboard shortcut you might want to memorize. It is actually
based on the menu system from Excel 2003, but it still works fine. First, press
Ctrl+c to copy. Then press Alt+e and then s to open the Paste Special dialog
box. Finally, press the Down Arrow key twice and then Enter to choose
Values option. Here is the entire keystroke sequence. With some practice,
you'll be able to do it in your sleep!
Sometimes you want to paste formulas to a range, but you don't want to change
the formatting of the paste range. You can do this in Excel 2010 or 2013 with the fx
icon in the first row of Paste Special icons, or you can do it in the Paste Special
dialog box with the Formulas option.
Try it! The gray range to the right contains formulas and various formatting. Paste
these formulas to column O, but don't paste the formats. Again, it is instructive to
copy the formulas, select a cell in column O for pasting, and hover the mouse over
the options in the first row of the Paste Special icons to see their differences.
One rather long way to do this is to select the range, press Ctrl+c, select the
paste range, and select either the first icon from the fourth row of the Paste
Special icons or the Formats option from Paste Special dialog box.
However, a quicker alternative to this method, and one that you should
definitely use, is to use the Format Painter button next to the Paste dropdown,
shown to the right. Select a cell with the format you want to copy, click the paint
brush, and click a cell (or drag a range) that you want to format. Note that if you
double-click the paint brush, you can copy the format multiple times. Press the
Esc key when you are finished.
Try it! Copy the formats (numbers formats, font, background, and border) in
column K to column M. Don't copy the values, just the formats. Then enter some
values in column M to check that the formatting is correct.
Paste Special: Multiplying (or Adding, Subtracting, Dividing) by a Constant
Sometimes you would like to multipy each number in a range by a constant. For
example, if you have revenues expressed in thousands of dollars, you might
want to multiply each value by 1000 so that they are expressed in dollars.
Fortunately, you do this without any formulas!
Enter the constant in a blank cell, and copy this cell. Then select the range of
values to multiply and select Multiply from the Paste Special dialog box.
This same method can also be used to add, subtract, or divide by a constant.
However, note that you do need to do this from the Paste Special dialog box.
These options aren't available on the Paste icon gallery.
Try it! Multiply each value in the range to the right by 1000. Then restore them
to their original values by dividing each value by 1000. Notice that no formulas
are involved; the numbers simply change. So once you are finished, you can
delete the multiplier from the cell where you entered it.
Paste dropdown
Format painter
$47.65
$44.20
$37.68
$31.34
$89.36
$68.15
$28.57
147
173
217
178
120
203
137
217
153
Transposing a Range with Paste Special
Often you set up a spreadsheet and then decide that you would rather have a
portion of it transposed. That is, you would like to “turn it on its side,” so that
rows become columns and vice versa. This is simple with one of Excel’s Paste
Special options.
To transpose a range:
Copy a range that you want to transpose with Ctrl+c. Then select the upper
left cell of the range where you want the transposed version, click the Paste
dropdown, and select the Transpose option circled to the right. Alternatively,
you can click Paste Special to open the Paste Special dialog box, and then
select its Transpose option.
Make sure there is enough room for the transposed version. For example, if
the original range has 3 rows and 5 columns, the transposed version will have
5 rows and 3 columns. If you select cell D5, say, as the upper left cell for the
transposed version, everything in the range D5:F9 will be overwritten by the
transposed version.
Try it! Transpose the range K19:O23 to a range with upper left cell K25. Note
that the gray cells contain formulas. Do the corresponding pasted cells still
have formulas? Are they still correct? Does the number formatting get pasted?
What about other formatting?
1. Select the entire range where you want the result to go. For example, if you
are transposing a range with 3 rows and 5 columns, select a blank range with
5 rows and 3 columns for the result.
3. Press Ctrl+Shift+Enter (all three keys at once), not just Enter. You always use
this key combination to enter an array formula.
Try it! Use the TRANSPOSE function, starting in cell K40, to transpose the
range to the right. After you press Ctrl+Shift+Enter, look at the formula bar.
You will see that there are curly brackets around the formula. You do not
actually type these curly brackets. They simply indicate that this is an array
formula.
also work.)
3. Press Ctrl+Shift+Enter (all three keys at once), not just Enter. You always use
this key combination to enter an array formula.
Try it! Use the TRANSPOSE function, starting in cell K40, to transpose the
range to the right. After you press Ctrl+Shift+Enter, look at the formula bar.
You will see that there are curly brackets around the formula. You do not
actually type these curly brackets. They simply indicate that this is an array
formula.
At least for this example, the TRANSPOSE function method has a couple of
disadvantages. First, the formatting is lost. Second, you will see a 0 in the
upper left cell of the transpose range. This is because the upper left cell of the
copied range is blank. Unfortunately, you can't delete this 0 (although you
could paint it white). The result of TRANSPOSE comes as a "package," and you
can't delete or move any part of the package; you can only delete or move the
whole thing.
However, there is one place where the TRANSPOSE function is really useful,
namely, when you perform matrix multiplication (which is discussed in the
Array Formulas topic of this tutorial). Then you often need to use TRANSPOSE
so that the matrix multiplication is well-defined. For example, you aren't
allowed to multiply a 3x1 column by a 3x3 matrix. But you can multiply a 1x3
row (the column's transpose) by a 3x3 matrix.
Transpose icon Paste Special dialog box
But how many other shortcuts do you know? And how many can you
possibly remember? If you do a Web search for "shortcut keys in Excel",
you will get plenty of hits. For example, the three sites shown in the
hyperlinks to the right list more shortcuts than anyone could ever
remember. Of course, most of these shortcuts are the same for 2007 and
later versions, and many are relevant for pre-2007 versions of Excel. But to
say the least, these lists can be overwhelming. Therefore, only a very
subjective list has been included here, and you will find a few of these,
plus a few others, in other topics in this tutorial.
Conventions: The plus sign, as in Ctrl+a, means to press both keys at the
same time. Also, an uppercase F followed by a number, such as F12, refers
to one of the "function" keys near the top of the keyboard.
By the way, if you remember the old menu shortcut keys from pre-2007
versions of Excel, such as Alt+e and then d for deleting selected rows or
columns, you can probably continue to use them. Old habits die hard, so
Microsoft kept most of these for backward compatibility. However, they
are not listed here.
Ctrl+Home: go to cell A1
Ctrl+Arrow Key: move in the direction of the arrow to the last nonblank
cell (if the next cell is nonblank) or to the next nonblank cell (if the next
cell is blank)
Page Down or Page Up: move one screen down or one screen up
Ctrl+Home: go to cell A1
Ctrl+Arrow Key: move in the direction of the arrow to the last nonblank
cell (if the next cell is nonblank) or to the next nonblank cell (if the next
cell is blank)
Page Down or Page Up: move one screen down or one screen up
Alt+Page Down or Alt+Page Up: move one screen to the right or one
screen to the left
End: turns "end" mode on, and then arrow keys work just like with
Ctrl+Arrow Keys listed above
Ctrl+a: select the range of data surrounding the active cell, or press twice
to select the entire worksheet
Shift+Arrow Key: extend the selection by one cell in the direction of the
arrow
Ctrl+Shift+Arrow Key: extend the selection to the last cell nonblank cell in
the direction of the arrow
Ctrl+c: copy
Ctrl+x: cut
Ctrl+v: paste
Ctrl+Alt+v: open the Paste Special dialog box (if clipboard is nonempty)
Formatting
F4: enter dollar signs for an absolute address (or keep pressing to cycle
through relative/absolute possibilities)
Ctrl+a: display the Function Window after starting a formula and typing a
function name
Shift+F3: display the Insert Function dialog box (same as clicking the f x
button)
Miscellaneous
F2: display the formula in a selected cell (instead of looking the Formula
bar)
Ctrl+Enter: press after entering something in a cell to stay in the same cell
(This shortcut combination can also be used to copy; see the Copying and
Pasting worksheet.)
Alt+Enter: press while entering text in a cell to force a new line (for long
labels)
Worksheets are where you place your data and formulas in Excel. Many
people call them "sheets" but this isn't exactly accurate. Strictly speaking, a
worksheet is a sheet that has rows and columns--a rectangular grid of cells.
There is another kind of sheet, called a chart sheet. This type of sheet has no
rows or columns, only a chart. The discussion here is mainly about
worksheets, not chart sheets. The actions discussed below are things you will
do every day, so you need to know how to do them efficiently.
Renaming a Worksheet
The name of a worksheet appears in its tab at the bottom of the screen.
To rename a worksheet:
Try it! Rename this worksheet as Worksheet Tasks. Then change its name
back to Topic.
Click the button to the right of your rightmost worksheet tab, the one
shown to the right. (It was a different icon in Excel 2007 and 2010.) This
creates a new worksheet to the right of the rightmost sheet with a generic
name such as Sheet3, which you can then rename.
In some situations, you might not want the new sheet to be way out to the
right. There is another option. You can right-click a worksheet tab, select
Insert, and select a blank worksheet as the item to add. The new
worksheet will be placed to the left of the tab you right-clicked.
Try it! Create a new worksheet to the left of this one and rename it
Practice1.
Selecting One or More Worksheets
You can select one or more worksheets. The active worksheet is the one
you are viewing. Its tab is boldfaced. But others can be selected as well. If
you do anything to the active worksheet, such as format a cell or enter a
value, the same thing is done to all of the selected worksheets. This can
save a lot of time with common labels, formulas, and formatting.
Click the tab of the leftmost of these, hold down the Shift key, and click
the tab of the rightmost of these.
Click the tab of any of them, hold down the Ctrl key, and click the other
tabs you want to select.
When multiple worksheets are selected, one will be active, but the tabs
of the others will also be highlighted, indicating that they are selected.
(In Excel 2013, the active sheet's tab is green; the others are black.) They
will remain selected until you click the tab of some other worksheet.
There is one exception to this. If all of the worksheets are selected, you
can click any other worksheet tab to activate it and deselect all of the
others.
Try it! You should already have a Practice1 worksheet. Create several
more new worksheets to its right and rename them Practice2, Practice3,
and so on. Then select them all and enter the label "This is practice" in
cell A1 of the active worksheet, Practice1. By viewing the other Practice
worksheets, you should see that they all have this label in cell A1. Finally,
activate the worksheet you are reading now (Topic). This deselects the
Practice worksheets.
You can delete one or more worksheets. However, if you try to delete all of
the worksheets, Excel will warn you that at least one has to remain.
Select the ones you want to delete, as explained in the previous text box.
Then right-click any of the selected tabs. This brings up a context-sensitive
menu, which has a few options you might want to try. For now, select
Delete.
Note that if the worksheets have any contents, you will be asked if you really
want to delete them. Deleting worksheets can be dangerous because it
cannot be undone. So be careful!
menu, which has a few options you might want to try. For now, select
Delete.
Note that if the worksheets have any contents, you will be asked if you really
want to delete them. Deleting worksheets can be dangerous because it
cannot be undone. So be careful!
You can also move or copy a worksheet. You can do this in one of two
ways: by dragging tabs or through the Move or Copy menu item. The first
way is easier; the second gives you more options.
Drag the worksheet's tab right or left to the position you want. If you
hold down the Ctrl key while you are dragging, you will make a copy of
the worksheet.
Try it! Move this worksheet to some other position, and then move it
back again. Next, make a copy of this worksheet, just to the right of its
current position. The copy will have the name Topic (2), which you can
then rename if you want. For now, delete the copy.
Right-click the worksheet's tab and select Move or Copy, as shown to the
right. This brings up the Move or Copy dialog that lets you select the Move or Copy menu item
workbook you want to move or copy to, including a new workbook, the
position within that workbook, and whether you want to create a copy. If
you select a different workbook and don't check the latter option, the
worksheet will be removed from the current file; it will move to the other
workbook. So be careful.
Try it! If necessary, create a new worksheet called Practice and enter
some data in it. Then move it to a new workbook. It will disappear from
this workbook and appear in a new one. You can then close the new
workbook without saving to delete it.
Finally, you can hide or unhide a worksheet. For example, you might
want to hide, but not delete, a worksheet that contains technical data
used in formulas in other worksheets. Of course, you might receive such
a file, with formulas you can't figure out because they refer to data on a
hidden worksheet. If you sense that something mysterious is going on,
check whether there are any hidden worksheets!
To hide a worksheet:
To hide a worksheet:
To unhide a worksheet:
Note: It is possible that there is at least one hidden worksheet even if the
Unhide option is disabled. By using a macro, it is possible to set the
status of a worksheet to "very hidden." Such worksheets can be
unhidden only through another macro. Software companies sometimes
create very hidden worksheets because they know these worksheets
would only confuse users, or because they don't really want users to see
their contents.
In pre-2013 versions of Excel, there are two buttons at the lower left corner
of the Excel window for going to the left through the worksheets. The second
takes you to the previous worksheet, and the first takes you the whole way
back to the first (leftmost) worksheet. Similarly, there are two buttons for
going to the right. Starting in Excel 2013, there are only two buttons, one for
going to the previous worksheet and one for going to the next worksheet.
Fortunately, if you press the Ctrl key and one of these newer buttons, it takes
you to the first or last worksheet. This can save plenty of scrolling if you have
dozens of worksheets, so it is definitely a tip worth remembering!
New Sheet button
Move or Copy menu item Move or Copy dialog box
A-Z and Z-A buttons on Da
Simple Sorting with A-Z or Z-A
The usual situation is that you have a data set such as the one to the
right. If you want to perform a simple sort on any of its columns, select Person
any single data cell in this column and click the A-Z or the Z-A button. You 1
can find these buttons under the Sort & Filter dropdown on the Home 2
ribbon, and they are also on the Data ribbon. But because they are used
so often, you probably ought to add them to your Quick Access Toolbar 3
so that they are always available. 4
5
Try it! Sort on any of the columns to the right, either in A-Z or Z-A order.
Note that when you sort on any column such as Salary, the other columns 6
change accordingly. That is, each row remains intact. Of course, this is the 7
behavior you would expect and want. 8
You can undo a sort, but just in case, it is often nice to have an "ID" 9
column with consecutive integers, 1, 2, 3, etc. This is the role of the 10
Person column in this data set. No matter how many sorts you do, you
can return to the original sort order by sorting (A-Z) on Person. 11
12
13
14
15
16
17
18
19
Sorting the Correct Range
20
The above instructions said to select a single cell before you click A-Z or Z-A. If 21
you select a range, such as the entire State column, and then click A-Z or Z-A, 22
you will be asked if you want to expand the selection (meaning to the full data
set) or continue with the current selection. You almost always want to expand
the selection. If you continue with the current selection, only the Salary values
will be sorted, and the sorted salaries will not correspond to the right people.
Excel gives you many more sort possibilities with its Custom Sort item
under the Sort & Filter items (on both the Home and Data ribbons). When
you click either of these, you seel the Custom Sort dialog box to the right
where, among other things, you can add levels. The data set above
illustrates why you might want to do this. Suppose you want to sort so
that all of the females are at the top. Then within each gender, you would
like to sort in A-Z order on State. Then if there are multiple people of a
given gender in the same state, you would like to sort them in decreasing
order of Salary. This is possible only with a custom sort with three levels:
first Gender, then State, then Salary. The correct settings for this sort are
shown to the right.
under the Sort & Filter items (on both the Home and Data ribbons). When
you click either of these, you seel the Custom Sort dialog box to the right
where, among other things, you can add levels. The data set above
illustrates why you might want to do this. Suppose you want to sort so
that all of the females are at the top. Then within each gender, you would
like to sort in A-Z order on State. Then if there are multiple people of a
given gender in the same state, you would like to sort them in decreasing
order of Salary. This is possible only with a custom sort with three levels:
first Gender, then State, then Salary. The correct settings for this sort are
shown to the right.
Try it! Sort the above data set as explained in the previous paragraph.
Check that it works as intended.
Try it again! This time have the three levels be Salary, then State, then
Gender. Do you see the difference? There are no ties on Salary, so once
Salary is sorted, no more sorting takes place. In general, the lower levels
apply only when there are ties in the levels above them.
Grade
Sorting Text A+
A
Sorting columns of text can be tricky, especially when non-alphabetic
symbols are present. For example, sort in A-Z order on the Grade column A-
to the right. Is this what you expected? Probably not. (See the next text B+
box for a fix.) B
What about the Name column to the right, where some names are upper B-
case and some are lower case? By default, the sort order is case-insentive, C+
that is, case doesn't matter. Try sorting on Name with the A-Z button. They C
are indeed sorted in alphabetical order, except that the Name label got
sorted too. (Press Ctrl+z to undo this sort.) To prevent the label getting C-
sorted, bring up the Custom Sort dialog box and check the "My data has D+
headers" option.
D
While you are in Custom Sort dialog box, note the Options button at the D-
top. One option is to check or uncheck the "Case sensitive" box. It is F
probably unchecked by default. However, check it and then sort on the
Name column to the right. It is still sorted in alphabetical order, ignoring
case. This appears to be a bug in Excel, or at least it's unexpected.
Order
Creating a Custom List for Sorting 1
2
Sometimes you want to sort in a "natural" order, such as months in a year 3
(Jan, Feb, etc.) or days of the week (Sun, Mon, etc.). You can do this with
a custom list. To get to this option, bring up the Custom Sort dialog box, 4
click the Order dropdown, and select Custom List. (You can also get to the 5
Custom Lists dialog box from the Advanced group in Excel Options.) As
shown to the right, you will see several custom lists built into Excel: the 6
months of the year and the days of the week, either three-letter
abbreviations or written out. You can also click NEW LIST and enter your
own custom list. This new custom list is remembered on your PC for later
uses.
Sometimes you want to sort in a "natural" order, such as months in a year
(Jan, Feb, etc.) or days of the week (Sun, Mon, etc.). You can do this with
a custom list. To get to this option, bring up the Custom Sort dialog box,
click the Order dropdown, and select Custom List. (You can also get to the
Custom Lists dialog box from the Advanced group in Excel Options.) As
shown to the right, you will see several custom lists built into Excel: the
months of the year and the days of the week, either three-letter 7
abbreviations or written out. You can also click NEW LIST and enter your 8
own custom list. This new custom list is remembered on your PC for later
uses. 9
10
You will probably create custom lists for sorting only for lists you use 11
frequently. For example, if you are an instructor and typically have a list
of possible grades as in the Grade range above, you might want to create 12
a custom list with the grades in the "natural" order. But if this is a list you 13
need only once, it is easier to enter the grades manually in the order you 14
want them.
15
Try it! Sort on Day, using the built-in custom list. Then create a new 16
custom list with items Morning, Afternoon, Evening, in this order, and
sort on Time using this custom list. 17
18
19
20
21
22
23
24
25
A-Z and Z-A buttons on Data ribbon
You can experiment with the print options. You do have a lot of control
over what is printed and how it looks on the paper. For example, you can
select the bottom dropdown in the dialog box to the right and select Fit
Sheet on One Page to get everything on a single piece of paper.
Note: You might sometimes find that certain objects like text boxes,
buttons, and arrows do not get printed. To remedy this, right-click any
such object, select Size and Properties, and click the Properties tab. This
contains a "Print object" option that you can check or uncheck.
Page tab on Page Setup dialog box Sheet tab on Page Setup dialog box
Reasons for Relative/Absolute Addressing
2. There is never any need to type the dollar signs. You can do it with the
F4 key. This is explained in more detail below.
Enter a cell reference such as =B3 in a formula. Then press the F4 key.
In fact, if you press the F4 key repeatedly, you cycle through the
possibilities: B3 (neither row nor column fixed), then $B$3 (both column B
and row 3 fixed), then B$3 (only row 3 fixed), then $B3 (only column B
fixed), and back again to B3.
Try it! Enter the appropriate formula in cell L35 and copy across to O35.
(Scroll to the right to see the answer.)
Units sold
50 100 150 200
Unit price $3.25
$3.50
$3.75
$4.00
$4.25
Fixed cost
Variable cost
Month
Units produced
Total cost
Unit price
$50
$2
Units sold
50 100 150 200
$3.25 $162.50 $325.00 $487.50 $650.00
$3.50 $175.00 $350.00 $525.00 $700.00
$3.75 $187.50 $375.00 $562.50 $750.00
$4.00 $200.00 $400.00 $600.00 $800.00
$4.25 $212.50 $425.00 $637.50 $850.00
Defined Names group in F
Basics of Named Ranges
Range names are used for one basic purpose: to make your formulas
more readable. After all, which formula do you prefer: =B20-B21 or
=Revenue-Cost? Efficient use of range names takes some experience, but
this worksheet provides a few useful tips.
A range name can be applied to a single cell or to any range of cells. There
are a few rules for the names you can use. The most important are that
(1) the names cannot include a few "illegal" characters, the most common
being spaces, and (2) they can't look like cell addresses. For example,
DAN37 is illegal because DAN37 is a cell address.
You can definitely go overboard in the use of named ranges, and you can
err in the other direction by refusing to use them. You should use some
discretion (and possibly company policy) when deciding how extensively
to use range names.
Range names have been available for many years, but they are more
prominent in Excel 2007 and later versions. Their functionality is in the
Defined Names group, right in the middle of the Formula ribbon, as
shown to the right.
The easiest and best-known way to name a range is to use the Name box,
just to the left of the Formula bar. This is shown to the right, where the
Name box originally contains a cell address.
Select a range you want to name, which can be a single cell, click in the
Name box, type a range name, and press Enter. Don't forget to press Enter
after typing the range name or the name you type won't "stick." 71
15
Try it! Name the gray range to the right Data. 14
The Name box is also useful for finding named ranges. To do so, click the 40
dropdown arrow in the Name box to see a list of all range names, and click 28
one of them. This will select the corresponding range. 41
28
You get much more control of named ranges by clicking the Name Manager
on the Formulas ribbon. This displays the dialog box to the right. It shows a
Name Manager dialog box
Using the Name Manager
You get much more control of named ranges by clicking the Name Manager
on the Formulas ribbon. This displays the dialog box to the right. It shows a
list of all range names in your workbook, the values in these ranges, and the
corresponding range addresses. You can select any range name and then Edit
or Delete it. (Delete doesn't delete the contents of the range; it only deletes
the range name.) You can also click the New button to create a new named
range. In this case, you need to supply a name and an address.
Try it! Rename the above gray range of numbers MyData. Then delete the
MyData range name. Then use the Name Manager to create the Data range
name again.
Suppose you have the labels such as Revenue, Cost, and Profit in some
range, and you would like the adjacent cells (which will contain the values
of revenue, cost, and profit) to have these range names. There is a very Create Names from Selecti
quick way to do this.
Select the range consisting of the labels and the cells to be named. Then
click the Create from Selection button in the Defined Names group on the
Formulas ribbon. In the resulting dialog box, make sure the appropriate
option (in this case, Left Column) is checked, and click OK. Excel tries,
usually successfully, to guess where the labels are that you want to use as
range names. You can always override its guess.
Try it! Name each of the colored ranges to the right (but not the totals)
with the labels above them. You will notice that Excel guesses Top row and
Left column. You can uncheck Left column unless you want the rows to be
named by the month names.
If you create range names and then create formulas that reference these
ranges, Excel uses the range names automatically. Sometimes, however,
you do it in the opposite order. That is, you enter a formula using cell
addresses, such as =B20-B21, and later you name B20 as Revenue and
B21 as Cost. The formula does not change to =Revenue-Cost
automatically. However, you can make it change, and hence become more
readable, as follows.
Select Apply Names from the Define Name dropdown in the Defined
Names group, as shown to the right. Then select all range names that you
want to apply to any cell formulas. For example, if you select all range
you do it in the opposite order. That is, you enter a formula using cell
addresses, such as =B20-B21, and later you name B20 as Revenue and
B21 as Cost. The formula does not change to =Revenue-Cost
automatically. However, you can make it change, and hence become more
readable, as follows.
Select Apply Names from the Define Name dropdown in the Defined
Names group, as shown to the right. Then select all range names that you
want to apply to any cell formulas. For example, if you select all range
names in the list, all formulas that reference any of these named ranges
will change to show the corresponding range names.
Try it! You should now have the range names UnitsSold and Revenue for
the red and orange ranges to the above right. Apply these to all formulas
that reference them, that is, to the SUM formulas in darker red and
orange cells.
If you have many range names, it is often useful to show a list of them and
the range addresses they apply to. This is easy.
Select a cell with plenty of blank space below it, select the Use in Formula
dropdown in the Defined Names group, and click the Paste Names option, as
shown to the right.
Try it! Paste a list of all range names, starting in the gray cell to the right.
Defined Names group in Formulas ribbon
31 9 69 5
74 46 84 27
49 25 38 83
43 20 75 83
72 30 92 75
56 90 89 73
81 43 81 61
Name Manager dialog box
The SUM function is probably the most used Excel function of all. It sums
all values in one or more ranges.
Actually, it is possible to include more than one range in a SUM formula, Jan
separated by commas. (This can also be done with the COUNT, COUNTA, Feb
AVERAGE, PROLDUCT, MAX, and MIN functions, among others.) For Mar
example, =SUM(B5,C10:D12,Revenues) is allowable, where Revenues is
a range name. The result is the sum of the numeric values in all of these Apr
ranges combined. Again, if any cells in any of these ranges are
nonnumeric or blank, they are ignored. Total cost
Here is a shortcut, which works for any function that takes multiple
ranges, separated by commas. Hold the Ctrl key and then drag the
ranges, one after the other. The commas will be entered for you
automatically.
Try it! Use the SUM function in the above gray cell to calculate the total
of all costs. (Scroll to the right for the answer.)
Student ID
AVERAGE function (Statistical Category) 1533
8031
The AVERAGE function averages all of the numeric cells in a range.
9859
To use the AVERAGE function: 9106
3535
Enter the formula =AVERAGE(range) where range is any range. This
produces the average of the numeric values in the range. 8192
6102
Note that the AVERAGE function ignores labels and blank cells. So, for 6774
example, if the range C3:C50 includes scores for students on an exam, but
cells C6 and C32 are blank because these students haven’t yet taken the 7558
exam, then =AVERAGE(C3:C50) averages only the scores for the students 314
who took the exam. (It does not automatically average in 0s for the two
who didn’t take the exam.) 9082
2397
Try it! Use the AVERAGE function in the two gray cells to the right to 2517
calculate the averages indicated. (For the formula in the lower gray cell,
replicate the exam scores in column M and make some changes. Scroll to 2432
the right for the answers.) 6016
Try it! Use the AVERAGE function in the two gray cells to the right to
calculate the averages indicated. (For the formula in the lower gray cell,
replicate the exam scores in column M and make some changes. Scroll to
the right for the answers.)
5269
4847
6537
9922
4525
1491
7897
PRODUCT function (Math & Trig Category)
4088
You certainly know the SUM function for summing, but you might not be 166
aware that there is a PRODUCT function for multiplying. It works exactly like 7925
the SUM function, that is, all of its arguments are multiplied together. Any
blank or text cells are ignored in the product. Specifically, they are not treated 6405
as 0s. 802
2931
Try it! Find the product of the first six exam scores to the right, including the
Absent value. Then delete the Absent value, that is, make its cell blank. Does 7625
this change the product? 2628
5417
7804
3994
394
8847
7855
8668
3738
5534
6965
8863
8762
6466
6100
1878
5970
9691
8666
4865
6198
8554
6753
9574
3891
8186
1306
6835
3136
4938
4807
4421
able of costs for units produced in one month (along side)
or use in another month (along top)
Exam score Average (only for students who took the exam)
68
74
80 Average (giving 0s to students who were absent)
63
72
Absent
85
70
64
72
81
75
80
73
63
80
88
71
73
71
71
68 Product
82
76
75
81
76
83
67
67
92
72
69
85
78
81
Absent
77
70
71
69
73
60
76
74
67
62
77
91
81
87
76
77
81
Absent
73
83
59
74
74
78
Total cost $47,500
Student IDxam score With 0s Average (only for students who took the exam)
1533 68 68 74.75862
8031 74 74
9859 80 80 Average (giving 0s to students who were absent)
9106 63 63 71.08197
3535 72 72
8192 Absent 0
6102 85 85
6774 70 70
7558 64 64
314 72 72
9082 81 81
2397 75 75
2517 80 80
2432 73 73
6016 63 63
5269 80 80
4847 88 88
6537 71 71
9922 73 73
4525 71 71
1491 71 71
7897 68 68 Product
4088 82 82 1.83E+09
166 76 76
7925 75 75
6405 81 81
802 76 76
2931 83 83
7625 67 67
2628 67 67
5417 92 92
7804 72 72
3994 69 69
394 85 85
8847 78 78
7855 81 81
8668 Absent 0
3738 77 77
5534 70 70
6965 71 71
8863 69 69
8762 73 73
6466 60 60
6100 76 76
1878 74 74
5970 67 67
9691 62 62
8666 77 77
4865 91 91
6198 81 81
8554 87 87
6753 76 76
9574 77 77
3891 81 81
8186 Absent 0
1306 73 73
6835 83 83
3136 59 59
4938 74 74
4807 74 74
4421 78 78
udents who took the exam)
The COUNT function counts all of the cells in a range with numeric
values. The COUNTA function counts all nonblank cells in a range. For
example, if cells A1, A2, and A3 contain Month, 1, and 2, respectively,
then =COUNT(A1:A3) returns 2, whereas =COUNTA(A1:A3) returns 3. Student
1
To use the COUNT function:
2
Enter the formula =COUNT(range), where range is any range. This 3
returns the number of numeric values in the range.
4
To use the COUNTA function: 5
6
Enter the formula =COUNTA(range), where range is any range. This
returns the number of nonblank cells in the range. 7
8
The COUNTBLANK function counts all blank cells in a range. 9
To use the COUNTBLANK function: 10
11
Enter the formula =COUNTBLANK(range), where range is any range. This 12
returns the number of blank cells in the range.
13
Try it! Use the COUNT, COUNTA, and COUNTBLANK functions to fill in the 14
gray cells to the right. (Scroll to the right for the answers.)
15
Note: Excel uses somewhat different terms on the status bar. If you 16
select a range and right-click the status bar, you will see the two options 17
"Count" and "Numerical Count." The first corresponds to the COUNTA
function, and the second corresponds to the COUNT function. 18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Exam score Number enrolled
62
73
74 Number who took exam
77
57 Number who were absent
67
90
77
83
71
75
72
82
68
86
77
68
86
80
81
84
71
76
81
99
72
78
67
89
70
77
83
74
87
75
86
77
73
74
79
80
77
72
77
71
70
68
79
75
80
73
61
62
68
92
85
77
79
86
83
83
76
89
72
69
66
71
80
61
Number enrolled
72 or
There are several Excel functions that allow you to count values, or sum or
average values, subject to conditions. Until Excel 2007, this was possible only
for a single condition, such as all people younger than 35 years old, and there
were only two functions available, COUNTIF and SUMIF. In response to
customer demand, Microsoft added four new functions in Excel 2007: Student
AVERAGEIF (for a single condition), and COUNTIFS, SUMIFS, and AVERAGEIFS 1
(for multiple conditions). These are all handy functions, and you should learn
how to use them. 2
3
4
5
6
7
COUNTIF Function (Statistical Category) 8
9
The COUNTIF function counts all values in a specified range that satisfy a 10
certain condition.
11
To use the COUNTIF function: 12
13
Enter the formula =COUNTIF(criterion_range,criterion) in any cell, where
criterion is any expression that evaluates to TRUE or FALSE. This counts 14
all values in criterion_range that satisfy the condition. 15
The criterion can be tricky to specify. If you want a specific value, such as 16
Male, you can specify it as "Male" (double quotes required), or you can 17
use a cell reference such as Q8. Also, if you want a specific inequality, 18
such as younger than 20, you can specify it literally as "<20" (again,
double quotes required). But if you want it to be younger than the value 19
in cell Q9, you need to piece it together as a literal part, "<", and a 20
variable part, whatever is in cell Q9. The correct syntax is "<"&Q9. The 21
ampersand (&) symbol concatenates (pieces together) the two parts. For
example, if you want to count the number of students who are older 22
than then the value in cell Q9, the correct formula is 23
=COUNTIF(M9:M80,">"&Q9). 24
Try it! Use COUNTIF in the top gray cell to the right to find the number of 25
students who scored at least as high as the value in cell Q10. (Scroll to 26
the right for the answer.)
27
28
29
30
31
32
33
34
35
SUMIF Function (Math & Trig Category) 36
37
The SUMIF function sums values in one range where a condition in a
corresponding range is satisfied. Usually, the setup is like the example to
the right, where you want to sum or average scores in one column (N), but
only for rows that satisfy a condition in another column (L or M).
Sum of sco
Sum of sco
Sum of sco
Average of
Average of
Average of
6
2660
2527
2733
78.235
76.576
75.917
Background on ...IFS Functions
The "plural" functions discussed here, COUNTIFS, SUMIFS, and AVERAGEIFS, were added in
Excel 2007. They allow you to impose multiple conditions, such as male and younger than
some value. Their arguments, described in more detail below, include any number of pairs of
criterion ranges and criteria, such as L9:L80,"Male".
The COUNTIFS function counts the number of rows that satisfy all of the conditions.
To use the COUNTIFS function:
Try it! In the top gray cell to the right, find the number of students with the gender in cell
Q8 and age younger than the age cutoff in cell Q9 who scored less than or equal to the
score cutoff in cell Q10. (Scroll to the right for the answer.)
The SUMIFS function is similar in concept to SUMIF, but its syntax is different. (Microsoft
chose this syntax instead of the original SUMIF syntax for logical reasons, but they didn't
want to change the SUMIF syntax because it would have broken too many existing
spreadsheets.) Now the range to sum comes first, and the criteria ranges and criteria
come last.
=SUMIFS(sum_range,criterion_range1,criterion1,criterion_range2,criterion2,...)
Again, the setup is typically like the example to the right. There is a column such as
exam score to sum. The criteria impose conditions on other columns, or even the same
column. Only those rows that meet all of the conditions are part of the sum.
Try it! In the middle gray cell to the right, calculate the total of all scores made by the
gender in cell Q8 and ages younger than the age cutoff in cell Q9. (Scroll to the right for
the answer.)
Try it! In the middle gray cell to the right, calculate the total of all scores made by the
gender in cell Q8 and ages younger than the age cutoff in cell Q9. (Scroll to the right for
the answer.)
The AVERAGEIFS function works just like the SUMIFS function, except that it averages the
values in the the average_range argument.
Try it! Calculate the average in the bottom gray cell to the right, using the same criteria as in
the SUMIFS exercise above. (Scroll to the right for the answer.)
ded in
than
f pairs of
38 Male 18 75
39 Male 20 86
40 Male 21 77
41 Male 20 73
42 Male 20 74
43 Female 20 79
44 Male 18 80
s the 45 Male 20 77
46 Female 21 72
ria as in 47 Male 19 77
48 Male 19 71
49 Female 23 70
50 Female 19 68
51 Female 24 79
52 Male 19 75
53 Male 18 80
54 Female 19 73
55 Female 21 61
56 Female 21 62
57 Male 19 68
58 Male 19 92
59 Female 20 85
60 Male 22 77
61 Female 19 79
62 Male 20 86
63 Female 19 83
64 Male 19 83
65 Male 18 76
66 Female 24 89
67 Female 18 72
68 Female 21 69
69 Male 23 66
70 Male 24 71
71 Male 20 80
72 Female 18 61
COUNTIFS
SUMIFS qu
AVERAGEIF
18
1342
70.632
SUMPRODUCT Function (Math & Trig Category)
There are many times when you need to sum products of values in two
(or possibly more than two) same-size ranges. Fortunately, there is a
SUMPRODUCT function that sums products quickly.
By the way, if you are tempted to write the formula without the
SUMPRODUCT function as the sum of nine products, as many beginning
users tend to do, imagine how long your formula would be if there were
10 plants and 50 cities! The SUMPRODUCT function is extremely
efficient, so get used to using it.
Unit shipping costs City1 City2 City3
Plant1 1.25 1.35 1.55
Plant2 1.15 1.45 1.25
Plant3 1.35 1.45 1.15
Total cost
Total cost 1609.5
Basic IF Function (Logical Category)
IF functions are very useful for performing logic, and they vary from simple
to complex. A few typical examples are illustrated here. For each product, if the en
enough units are ordered t
To enter a basic IF function:
units of that product are o
Enter the formula =IF(condition,expression1,expression2), where condition
is any condition that is either true or false, expression1 is the value of the Product
formula if the condition is true, and expression2 is the value of the formula
if the condition is false. 1
2
A simple example is =IF(A1<5,10,“NA”). Note that if either of the 3
expressions is text, as opposed to a numeric value, it should be enclosed in
double quotes. 4
Try it! Use a nested IF function to get the grades in column M. (Scroll to
the right for answers.)
Try it! Use an IF function with an AND condition to fill in the gray range
for selling to the right. Make sure you use double quotes for text. (Scroll
to the right for answers.) Any student who scores at
which is 1% of their total s
To use an OR condition in an IF function:
The key to writing (and reading) such complex formulas is to pay careful
attention to the parentheses. Fortunately, Excel helps you by color-
coding pairs of parentheses. From now on, pay close attention to this
color coding. You will come to depend on it!
For each product, if the end inventory is less than or equal to 50 units,
enough units are ordered to bring stock back up to 200; otherwise, no
units of that product are ordered
Each student gets an A (if score is 90 or above), S for satisfactory (if score
is 60 or above but less than 90) or U for unsatisfactory if score is below 60
Score Grade
70
95
55
80
60
90
Investor sells stock only if its price has gone up three consecutive days
(including the current day)
Any student who scores at least 95 on any of the exams gets a bonus
which is 1% of their total score.
Grade
S
A
U
S
S
A
Sell?
No
No
Yes
No
Bonus
0
3.2
3.29
3.53
0
0
Concatenating, CONCATENATE Function (Text Category)
To concatenate, you start with two or more pieces of text and “piece them
together.” For example, you might concatenate “Bob” and “Jones” into “Bob
Jones”. There are two equivalent ways to concatenate: with the ampersand Bob
(&) symbol and with the CONCATENATE function. Both are described here. Stephen
Andy
Suppose cells A1 and B1 contain text such as a first name and a last name.
To concatenate them with the ampersand symbol, you enter the formula John
=A1&B1 in some other cell such as cell C1. Literal text, such as a comma Kathy
and a space, can also be included, such as =A1&“, ”&B1. In this case, if cell Karen
A1 contains “Jones” and cell B1 contains “Bob”, then cell C1 will contain
“Jones, Bob”. This concatenates the last name, the literal comma and space, Tom
and the first name. In general, you separate the pieces with ampersands, Peter
and you surround literal text with double quotes.
Ted
To concatenate the text in cells A1 and B1 with the CONCATENATE function, Jason
you enter the formula =CONCATENATE(A1,”, “,B1). In words, you enter the
“pieces” you want to concatenate, separated by commas. These pieces can
be cell references or literal text. In the latter case, they should be
surrounded with double quotes.
Try it! Concatenate the first names, middle initials, and last names in
columns K, L, and M with the ampersand symbol so that full names of the
form Jones, Bob E. appear in column N. Do this with again with the
CONCATENATE function in column O. (Scroll to the right for answers.)
Ampersand CONCATENATE
E Jones
C Davis
T Thompson
F Wilson
C Fredericks
D Williams
T Smith
F Jennings
R Benson
E Samson
Ampersand CONCATENATE
Bob E. Jones Bob E. Jones
Stephen C. Davis Stephen C. Davis
Andy T. Thompson Andy T. Thompson
John F. Wilson John F. Wilson
Kathy C. Fredericks Kathy C. Fredericks
Karen D. Williams Karen D. Williams
Tom T. Smith Tom T. Smith
Peter F. Jennings Peter F. Jennings
Ted R. Benson Ted R. Benson
Jason E. Samson Jason E. Samson
Parsing with Text to Columns
Parsing text, that is, separating it into its pieces, is sometimes easy, and it
is sometimes difficult. The text functions illustrated in the other parsing
topic in this tutorial are for the difficult cases, but this topic discusses an
easy tool that is worth trying first. Suppose you import data from a
legacy system or a Web site, and everything gets imported to a single
column, such as in column K to the right. The pattern is pretty clear: each
cell contains five numbers, all separated by commas. To parse these into
five columns with one number per cell, you can use the Text to Columns
button on the Data ribbon shown to the right. This launches a fairly
simple wizard (basically, the same wizard used for importing a text file),
where you can indicate that the "delimiter" is a comma.
Try it! Select the data in column K and try the Text to Columns wizard.
Note that it places the results in columns K-O, replacing the original data
in column K. If you want to keep the original data for some reason, you
should first make a copy in column L and then parse the copy.
Note: You might see little green triangles in the cells in column K. These
indicate errors, or at least what Excel thinks are errors. If you select any
of these cells, or all of them, you will see a dropdown to the left, which
provides options for dealing with the "errors," including ignoring them.
(They should be ignored in this example.) More generally, if you don't
want Excel to enter these error warnings in the first place--in any of your
workbooks--you can go to the Formulas section of Excel Options and
uncheck the "Enable error background checking" option.
Text to Columns button on Data ribbon
606,360,516,1757,371
1631,1337,1260,1855,2823
904,749,486,1852,1612
2463,1324,1889,2597,312
1256,1839,1745,244,1508
2159,2917,1699,1351,974
1084,2379,1791,1933,507
1686,2454,1954,256,1068
1274,2330,2334,343,255
303,2128,578,824,1714
2989,2317,2196,642,2812
1743,2122,2428,871,2701
2817,2330,1217,407,327
894,1893,1963,1641,2533
2747,1952,243,2832,1487
358,2674,1660,1006,1249
1032,939,2172,2112,347
2639,2489,2905,412,2877
730,696,639,454,1591
1774,2506,2690,2498,2407
2406,493,1457,1317,2993
1359,894,2281,2454,1239
2847,1432,381,1518,941
1597,313,1231,596,702
2838,2547,846,868,1753
2049,558,201,1034,351
1395,1314,1004,489,275
2628,2596,1901,2114,381
1439,1574,2318,277,1202
918,2177,621,1777,2106
867,2906,2844,2173,1370
2314,236,1387,1586,1106
1316,1475,1791,1494,2405
1006,795,1804,861,979
General Approach to Parsing with Text Functions
Suppose that someone has given you a spreadsheet with a list of names
such as the one to the right. Each cell in column K has a last name, then a
comma and a space, and then a first name. Your job is to parse (that is,
separate) these names as indicated for the name in cells L10 and M10.
That is, column L should have all of the first names and column M should
have all of the last names. If this sounds easy, imagine that there are
10,000 names in column K. What would you do? If you just start typing,
you will be busy for a long time, and you will undoubtedly make mistakes
along the way!
Fortunately, there is a much better way. The key is to look for patterns. In
this example, note that every name has a comma and a space. The first
name comes after the comma and space, and the last name comes before
it. For the name "Jones, Bob", there are 10 characters, including the
comma and space, and the comma and space are characters 6 and 7. So
the first name is the rightmost 3 characters and the last name is the
leftmost 5 characters. In any parsing operation, this is the first and the
most crucial step: discover the pattern.
Once you discover the pattern, you can then exploit it with a number of
useful text functions. The ones discussed here are FIND, LEN, RIGHT, LEFT,
and MID. If you want to learn about other text functions, click the Text
dropdown list on the Formulas ribbon.
For example, =LEN("Bobby Jones") returns 11. This includes the space.
These functions return the left, right, or middle characters from a piece of
text, where you indicate the number of characters to return.
Enter the formula =RIGHT(text, n), where n is an integer. This returns the
right n characters in text. (If n is greater than the number of characters in
text, it returns the entire text.)
LEFT, RIGHT, MID Functions (Text Category)
These functions return the left, right, or middle characters from a piece of
text, where you indicate the number of characters to return.
Enter the formula =RIGHT(text, n), where n is an integer. This returns the
right n characters in text. (If n is greater than the number of characters in
text, it returns the entire text.)
Enter the formula =LEFT(text, n), where n is an integer. This returns the
left n characters in text. (If n is greater than the number of characters in
text, it returns the entire text.)
The last example is trickier. As the next text box indicates, the FIND
function in this formula returns 6, the position of the comma, so this
formula is equivalent to =MID("Jones, Bob",8,1). Note that the starting
position is 8, not 7, because of the space.
The FIND function returns the position of the first occurrence of a string
of characters (which could be a single character) in a piece of text.
1. In cell L107, find the length of the text in cell K107 with the LEN
function. This results in 10 in cell L107 because cell K107 has 10
characters, including the comma and space.
2. In cell M107, find the position of the comma with the FIND function.
This results in 6 in cell M107 because the comma in Jones, Bob is the 6th
character.
3. In cell N107, add 1 to find the position of the space after the comma.
This results in 7 in cell N107 because the space is the character right after
the comma.
4. In cell O107, find the first name with the RIGHT function, using the
rightmost (10-7) characters. Make sure you use cell references to enable
copying down.
5. In cell P107, find the last name with the LEFT function, using the
leftmost (6-1) characters. Again, use cell references to enable copying.
The beauty of this method is that you have to do it only once, in the first
row. Then you can copy all of the formulas down for the rest of the
names, even if there are thousands of them!
Try it! Enter the formulas as indicated in the above steps and copy them
down. (Scroll to the right for the correct answers.)
Now try a tougher one. The names to the right either have a middle
initial, a first initial, or no initial. See if you can parse these names into
four pieces: Last name, Used name, Initial, and Middle initial, where:
Used name is the name (first or middle) the person goes by.
Initial is the single initial character, if any, or is blank if there is no initial.
Middle initial is "Yes" if the initial is a middle initial, "No" if it is a first
initial, and blank if there is no initial.
Hints: (1) FIND returns an error if it can't find the requested text. (2)
Used name is the name (first or middle) the person goes by.
Initial is the single initial character, if any, or is blank if there is no initial.
Middle initial is "Yes" if the initial is a middle initial, "No" if it is a first
initial, and blank if there is no initial.
Hints: (1) FIND returns an error if it can't find the requested text. (2)
There is an ISERROR function that can check whether a cell contains an
error. Scroll to the right for a solution.
OK, this one is not easy, and it requires some careful planning and logic.
But it sure beats typing a long list of hundreds or thousands of names!
Excel 2013 introduced a new Flash Fill tool that eliminates the need for some
(but not all) of these complex parsing formulas. You can read about Flash Fill in
the Text Functions section of the tutorial.
Jones, Bob Bob Jones
Davis, Stephen
Thompson, Andy
Wilson, John
Fredericks, Kathy
Williams, Karen
Smith, Tom
Jennings, Peter
Benson, Ted
Samson, Jason
Full name Length Comma Space First name Last name
Jones, Bob
Davis, Stephen
Thompson, Andy
Wilson, John
Fredericks, Kathy
Williams, Karen
Smith, Tom
Jennings, Peter
Benson, Ted
Samson, Jason
Has Excel become a mind reader with the new Flash Fill tool introduced in
Excel 2013? You might think so after you read this topic. However, it's not
really about mind reading but rather about the ability to recognize
patterns.
Method 1. Try it! Type the first name in the top row: Bob in cell L7. Then
select Flash Fill from the Fill dropdown on the Home ribbon. Pretty
amazing, isn't it? Now you could repeat with the other columns. Note that
right after doing a flash fill, you get a mini dropdown that provides several
options, such as undoing the flash fill.
Method 2. Try it! Type the middle initial and period in the top row: E. in
cell M7. Then start typing the next initial in the second row: T. in cell M8.
Pretty soon, Excel will guess the pattern and show it for all rows in light
font, at which time you can press Enter to accept the results. Again, you
could now repeat with the other columns.
Method 3. Try it! Type the last name in the top row: Jones in cell N7. Then
with any gray cell in column N selected, use the Flash Fill shortcut key
combination, Ctrl+e. Now repeat this method for the other columns.
By the way, as you do any of these, you might see text appear in row 6,
not just in the gray range. This is because Flash Fill is also parsing the
Names to parse label in cell K6!
Note how Flash Fill can recognize many patterns, such as the initials in
column Q and even the lower case name in column R. However, if names
don't fit the pattern, Flash Fill will likely fail. For example, if the bottom
two names were replaced with Lincoln, Abe and Fitzgerald, F. Scott, Flash
Fill wouldn't get everything correct. (You might want to verify this.) As this
indicates, Flash Fill can't completely take the place of text functions for all
parsing tasks.
Flash Fill also works on certain patterns of numbers and dates, as you can
check on the examples to the right. However, except for the year column
on the dates, only methods 1 and 3 seem to work; method 2 doesn't
work. It isn't clear why method 2 works in some situations but not in
others, and you’ll probably have to experiment to see which method
works best for you. In any case, the Flash Fill tool can often save you from
entering a lot of complex text formulas.
entering a lot of complex text formulas.
Results for a typical name
Roberts, Julie T. Julie T. Roberts Julie Roberts Julie T. Roberts JTR
Names to parse
Jones, Bob E. Bob
Davis, Stephen T.
Thompson, Andy S.
Wilson, John T.
Kelley, Jennifer B.
Williams, Karen S.
Smith, Tom F.
Jennings, Peter R.
Benson, Ted A.
Samson, Jason T.
21
Date and Time functions
Dates and Times in Excel
We tend to take dates and times for granted, but they appear in many, if
not most, real-world business spreadsheets. They can actually be quite
tricky to work with, and a complete treatment of dates and times could
fill a long chapter of a book. This tutorial can't cover all of the intricacies
of Excel-based dates and times, but it does illustrate some of the most
useful methods for working with them, including several of the functions
listed to the right.
The first thing to realize is that a date-time value that appears in a cell as
something like 3/14/2004 4:30 PM is really stored as a number. Excel
refers to this number as the serial value. The serial value corresponding
to this particular date-time happens to be 38060.688. The value to the
left of the decimal is the number of days since a “base” date (January 1,
1900), and the decimal part indicates the fraction of time through the
day, starting right after midnight. In this example 4:30 PM is 68.8% of the
way from midnight to the next midnight. If the decimal part is omitted, it
is assumed to be midnight. In this case, you usually format the value so
that only the date, not the time, appears.
If you happen to know the numbering system for dates, that is, you
somehow know that 38060 corresponds to 3/14/2004, you could enter
the number 38060 in a cell and then format it to look like a date.
However, you usually enter a date like 3/14/2004 in a cell. Actually, there
are several formats Excel recognizes as dates, including 3/14/2004,
March 14, 2004, 3-14-04, and a few others, but they are all stored as
38060.
The same is true for date-times, such as 3/14/2004 4:30 PM, or just
times, such as 4:30 PM. If you enter either of these in a format that Excel
recognizes as a date-time or just a time, Excel will recognize that these
are date-times or times, but it will store them as numbers, 68030.688 or
0.688.
Try it! The cells to the right include some date-times, dates (no times
specified), and times (no dates specified), formatted in several ways.
Format these as numbers with three decimals to see the serial values.
Then reformat them as date-times in any formats you prefer.
Date and Time functions Dates to format
3/14/04 1:30 PM
12/31/1901
3:50
12:00 PM
29-Feb-96
9/24/46 14:45
TODAY, NOW Functions (Date & Time Category)
Excel has two useful functions, TODAY and NOW, for automatically
entering the current date or the current date and time .
Enter the formula =TODAY() in any blank cell. (The blank parentheses are
necessary.) It returns the current date. If you open this spreadsheet
tomorrow, it will list tomorrow’s date, that is, it will update each day.
To use the NOW function:
Enter the formula =NOW() in any blank cell. (Again, the blank parentheses
are necessary.) It returns the current date and time. It is also dynamic, but
it won't change until worksheet recalculates.
Try it! Enter the TODAY and NOW functions in the gray cells. Then format
the result of NOW as time only—no date. (Scroll to the right for answers.)
After you have worked a few other exercises in this tutorial, come back to
this topic and see whether the time has changed. (You might have to force
a recalculation to see the change. You can do this by pressing the F9 key.)
Today's date
Current time
Today's date 9/19/2019
Current time 9:37 AM
The value
The value in
in cell
cell AF8
AF8 was
was
formatted to
formatted to show
show time
time only,
only,
not date
not dateand
and time.
time.
Date
YEAR, MONTH, DAY, WEEKDAY Functions (Date & Time Category) 9/11/2001
1/28/1986
If a cell contains a date, it is easy to strip off the year, month, and day 11/22/1963
with the YEAR, MONTH, and DAY functions. There is also a WEEKDAY
function that returns the weekday index, 1 (Sunday) to 7 (Saturday). Each 8/6/1945
of these functions has a single argument, a date or a reference to a cell 12/7/1941
containing a date.
4/14/1912
Try it! For each date to the right in column K, return the year, month, day,
and weekday in columns L-O. (See to the right for answers.)
You might want the month name, such as September, and the day name,
such as Tuesday, rather than numbers. You can do this with custom
formatting. To get to custom formatting, right-click on any cell, select
Format Cells, and select Custom to bring up the dialog box to the right.
For month names, you can enter the code mmm (for three-letter
abbreviations) or mmmm (for full month names). Similarly, you can enter
the codes ddd or dddd for days.
The DATE function takes three numerical arguments, a year, a month, and a
day, and it returns the corresponding date. The important part is that Excel
recognizes the result as a date, which you can then format in any date
format you like.
This function can be very useful for manipulating dates. For example, it can
be used to find your next birthday, given your birthdate, as illustrated in cell
L8. The formula in cell L8 is a long one, but it is simple logic. This person's
next birthday will certainly be on July 22. The only question is whether it
will be in the current year or the next year. The IF function checks for this.
Note that YEAR(TODAY()) returns the year corresponding to today's date.
Tip: Depending on the width of your Excel window, you might not be able
to see all of the long cell L8 formula in the formula bar. To see long formulas
like this one, you can make the formula bar "taller." Just drag the border
below the formula bar down.
Try it! Enter your birthdate in cell K17 and then calculate your current age
(as an integer) in cell L17. (Scroll to the right for the answer.)
The DATEVALUE function can be a real life-saver. It takes a date stored as text
and returns the corresponding serial value, which you can then format as a
date. Why is this important? Suppose you have a lot of data stored in some
type of legacy system in your business, and you are somehow able to dump it
into Excel. The chances are that all dates will be imported as text. That is, a
cell value will look something like 5/20/2001, but Excel won’t recognize it as a
date. Without the DATEVALUE function, you would have to retype all of the
dates! However, DATEVALUE saves you this mind-numbing work.
Try it! Create dates in column L corresponding to the text values in column K
that happen to look like dates. Then format the results with any date format
you prefer. (Scroll to the right for answers.)
Enter the formula =DATEVALUE(datetext), where datetext refers to a date
stored as text. Then format the result as a date.
Try it! Create dates in column L corresponding to the text values in column K
that happen to look like dates. Then format the results with any date format
you prefer. (Scroll to the right for answers.)
Birthdate Next birthday
7/22/1976 7/22/2019
Birthdate Age
The values
The values in
ingray
graycould
could
now be
now be formatted
formatted as
as
dates.
dates.
MIN, MAX Functions (Statistical Category)
The MIN function returns the smallest numeric value in a range. Similarly,
the MAX function returns the largest numeric value in a range.
Sales rep
To use MIN and MAX functions:
Jan sales
Enter the formula =MIN(range) or =MAX(range) where range is any range. Feb sales
These produce the obvious results: the maximum (or minimum) value in
the range.
Try it! Use the MIN and MAX functions to fill in the gray range to the right.
(Scroll to the right for answers.) Jan
Note that MIN and MAX work only on numeric data. If you have a list of Feb
names, you might expect MIN and MAX to return the first and last names
in alphabetical order, but unfortunately they don't. (There are two other
functions called MINA and MAXA, but they don't appear to be very useful.)
Allison Baker Jones Miller Smith Taylor
$3,700 $2,400 $2,300 $3,000 $3,800 $3,700
$2,600 $2,200 $2,400 $2,800 $3,600 $2,300
The median is the middle value in a set of n numbers, in the sense that half are
above it and half are below it. More precisely, when the values are sorted in
increasing order, it is the middle value if n is odd, and it is the average of the
two middle values if n is even. Fortunately, Excel takes care of the details with
the MEDIAN function. 33
3
To use the MEDIAN function: 0
Enter the formula =MEDIAN(range), where range is any numeric range. 1
4
Note that if range contains labels or blank cells, these are ignored when 14
calculating the median. This is also true for the other statistical functions.
5
Try it! Find the median of the data in column K. Does it equal the average? 41
Why or why not? (Scroll to the right for answers.) 3
5
9
1
0
22
10
QUARTILE Function (Statistical Category) 5
13
The values in a data set are often ranked in some way. For example, if you 7
take the SAT exam to get into college, you learn your ranking by a percentile.
If you are at the 85th percentile, you know that 85% of all people scored 6
lower than you, and only 15% scored higher. Excel has two useful functions 3
for finding this type of information: PERCENTILE and QUARTILE.
9
The QUARTILE function is the easiest to understand. Imagine that you have 5
1000 scores. You sort them from low to high and then divide them into four 14
sets of 250 scores each, where the first set contains the smallest scores, the
second set contains the next smallest scores, and so on. The first, second, 7
and third quartiles are the breakpoints between these sets. For example, 27
25% of the scores are below the first quartile, and 75% are above it. By 10
definition, the second quartile is the median.
7
To use the QUARTILE function: 3
11
Enter the formula =QUARTILE(range,k), where k is 1, 2, or 3. For example, if
you enter 3 for k, you get the third quartile. 15
35
Try it! Find all three quartiles, Q1, Q2, and Q3, for the data in column K.
9
0
5
6
11
13
4
17
3
PERCENTILE Function (Statistical Category) 19
The PERCENTILE function takes any percentage, expressed as a decimal 4
number from 0 to 1, and it returns the value such that the given percentage of 5
all values is below this value. For example, if the percentage is 10% (0.10) and 1
the PERCENTILE function returns 45, you know that 10% of all values in the
data set are below 45 and 90% are above it. 21
4
To use the PERCENTILE function: 16
Enter the formula =PERCENTILE(range,pct), where pct is any percentage 6
expressed as a decimal between 0 and 1, such as 0.10 for 10%. 18
18
Try it! Find the requested percentiles for the data in column K. For example,
P10 indicates the 10th percentile. Do you see the relationship between the 2
quartiles and certain percentiles? 3
17
7
9
6
4
2
Technical Note About QUARTILE and PERCENTILE Functions 7
The QUARTILE and PERCENTILE functions are typically used on data sets with a 3
large number of values. If they are used on a very small data set, you might be 0
surprised at the results. In fact, you might even disagree with them. For 14
example, if the data set has the five values 10, 20, 30, 40, and 50, Excel’s
PERCENTILE function indicates that the 10 th percentile is 14. This is certainly not 2
a very intuitive answer, and you might disagree with it, but why anyone would 4
want the 10th percentile of a five-value data set in the first place? 24
In any case, Microsoft introduced the functions QUARTILE.INC, QUARTILE.EXC, 12
PERCENTILE.INC, and PERCENTILE.EXC in Excel 2010. The INC versions are 1
identical to the original QUARTILE and PERCENTILE function (which still work
fine). The EXC versions were evidently added to work better on small data sets. 4
You can go to online help for further details. 36
3
0
2
4
12
7
2
1
16
5
31
15
29
12
5
4
5
22
14
7
7
19
38
15
45
1
4
14
3
16
4
Average
Median
Quartiles
Q1
Q2
Q3
Percentiles
P01
P05
P10
P25
P50
P75
P90
P95
P99
Average 10.27
Median 7
Quartiles
Q1 3.75
Q2 7
Q3 14.25
Percentiles
P01 0
P05 0.95
P10 1
P25 3.75
P50 7
P75 14.25
P90 22.2
P95 33.1
P99 41.04
STDEV and VAR Functions (Statistical Category)
% within 1 stdev
Mean 999.77
Variance 83102.38
St Dev 288.27
The PMT function is usually used to find the monthly payment for a car
loan or a home mortgage loan. The inputs are typically an annual interest
rate, a term (number of months financed), and the amount borrowed
(the principal). The PMT function finds the amount you have to pay each
month of the term. Part of this payment is principal and part is interest.
At the end of the term, you will have paid just enough to pay off the
entire loan.
Try it! Suppose you take out a $30,000 loan for a new car when the
annual interest rate is 3.75% and the term of the loan is 36 months.
Calculate your monthly payment in the gray cell. Then use a data table to
see how your monthly payment varies for terms of 24, 36, 48, or 60
months. (Scroll to the right for the answers. The Data Table topic in this
tutorial explains data tables.)
Principal $30,000 Data table for payment versus term
Annual interest 3.75% Term Payment
Term 36
Payment 24
36
48
60
Data table for payment versus term
Term Payment
$882.39
24
36
48
60
ent versus term
NPV (Net Present Value) Function (Financial Category)
Much of the theory of finance is about the time value of money. Basically,
a dollar earned in the future is less valuable than a dollar earned today
because the dollar earned today can earn interest. To account for this,
future cash inflows or outflows are discounted to get their present values
now. Given a future stream of cash inflows and/or outflows, the sum of all
their present values is called the net present value, or NPV. If this stream is
incurred at regular time intervals—at the end of each year from year 1 on
—you can use Excel’s handy NPV function to calculate the NPV of the
stream.
Try it! Assume a company pays $100,000 at the beginning of year 1 to get
into an investment. It then receives the cash inflows at the ends of years 1
through 5 shown to the right. What is the NPV of this investment (inflows
minus outflows) with a 12% discount rate? Does the NPV increase or
decrease as the discount rate increases? (Scroll to the right for the
answer.)
Typically, the first cash value will be an outflow and the rest will be
inflows. In this case, the initial outflow (investment) should be included in
the XNPV function, and the NPV will be discounted back to the date of this
initial payment. This payment should be entered as a negative number.
Enter the formula =XNPV(discount_rate,cash_flows,dates), where
discount_rate is the same as with NPV, cash_flows is a stream of cash
inflows or outflows, and dates is a stream of the dates when they are
incurred.
Typically, the first cash value will be an outflow and the rest will be
inflows. In this case, the initial outflow (investment) should be included in
the XNPV function, and the NPV will be discounted back to the date of this
initial payment. This payment should be entered as a negative number.
Try it! Find the net present value of the stream of cash inflows shown to
the right, where the first is really a payment at the beginning of 2013.
(Scroll to the right for the answer.)
Discount rate 12%
Initial payment $100,000
NPV
NPV
NPV $29,806
NPV $69,805
IRR (Internal Rate of Return) and XIRR Functions
Companies often have investment opportunities where they pay initially Cash flows (initial value is a
and then receive returns in the future. It is easy to show that the NPV of
such an investment decreases as the discount rate increases. In fact, for $100,000
large enough discount rates, the NPV will typically become negative,
meaning that the future returns are not enough to offset the initial IRR
payment. The discount rate at which NPV changes from positive to
negative is called the internal rate of return, or IRR. Specifically, the IRR is
the discount rate at which NPV equals 0.
Companies are interested in IRR for the following reason. Typically, they
have a "hurdle rate" that they use to discount potential investments. If
the NPV of an investment is positive, discounted at the hurdle rate, it is
worth pursuing. If it is negative, it is not attractive. Stated equivalently,
the investment is worth pursuing only if its IRR is greater than the
company’s hurdle rate.
Excel has an IRR function that calculates an investment’s IRR. As with the
NPV function, the investment should be structured so that there is an
initial cash payment at the beginning of year 1 and then regular cash
returns at the ends of years 1, 2, and so on.
Try it! Find the IRR for the investment to the right, using an initial guess of
15%. What does this IRR say about the attractiveness of the investment?
(Scroll to the right for the answer.)
Note: The NPV topic in this tutorial describes an XNPV function for cash
flows that don't occur at regularly spaced intervals. There is a
corresponding XIRR function. You can look it up in online help.
sh flows (initial value is a payment)
$35,000 $45,000 $40,000 $25,000 $10,000
IRR 19.81%
The company
The companywillwill find
findthis
this investment
investment
attractive only
attractive only ifif its
its hurdle
hurdlerate
rate isis
below 19.81%
below 19.81% (which
(whichititprobably
probably is). is).
INDIRECT Function (Lookup & Reference Category)
The INDIRECT function is useful when you have named ranges and want to
refer to these, via labels, in your formulas. For example, suppose you have
ranges named Sales1, Sales2, and Sales3. Each of these is a long column of
data. Then suppose you have labels Sales1, Sales2, and Sales3 in some other
cells, say, G1, G2, and G3. If you enter the formulas
=AVERAGE(INDIRECT(G1)), =AVERAGE(INDIRECT(G2)), and
=AVERAGE(INDIRECT(G3)) in cells H1, H2, and H3, this is the same as
entering the formulas =AVERAGE(Sales1), =AVERAGE(Sales2), and
=AVERAGE(Sales3). The name of the function implies that you are indirectly
referencing a range via a label with this range name.
Try it! Name the data ranges in columns L-O by their labels in row 4. Then
use the AVERAGE, STDEV, and CORREL functions, along with the INDIRECT
function, to enter copyable formulas in the gray ranges below. As you should
appreciate, this is particularly useful for the matrix of correlations. (See to
the right for the answers.)
Monthly sales
Month Product1 Product2 Product3 Product4
Jan-13 1043 1047 957 1031
Feb-13 993 832 883 796
Mar-13 968 1114 1206 1048
Apr-13 1461 1487 1495 1519
May-13 1137 1183 1035 1045
Jun-13 1103 999 931 1133
Jul-13 1140 1025 1124 982
Aug-13 772 927 797 922
Sep-13 1195 1297 1231 1230
Oct-13 1140 1358 1267 1253
Nov-13 1236 1120 1107 1275
Dec-13 696 573 513 687
Jan-14 749 581 481 711
Feb-14 984 1005 998 804
Mar-14 1114 933 1084 963
Apr-14 758 832 950 745
May-14 307 418 428 508
Jun-14 1055 807 865 1102
Jul-14 1108 1149 1240 1275
Aug-14 1286 1041 919 968
Correlations
Product1 Product2 Product3 Product4
Product1
Product2
Product3
Product4
Averages, standard deviations
Average Stdev
Product1 #REF! #REF!
Product2 #REF! #REF!
Product3 #REF! #REF!
Product4 #REF! #REF!
Correlations
Product1 Product2 Product3 Product4
Product1 #REF! #REF! #REF! #REF!
Product2 #REF! #REF! #REF! #REF!
Product3 #REF! #REF! #REF! #REF!
Product4 #REF! #REF! #REF! #REF!
Total sales
Smith
Jan-05 $6,700
Feb-05 $5,800
Mar-05 $5,000
Apr-05 $6,700
May-05 $9,400
Jun-05 $6,200
Jul-05 $8,700
Jones Wilson Donalds
$7,400 $5,800 $9,000 Answer: Open
Answer: Open the
the name
name manager
manager and
and look
look at
at
the definition
the definition of
of the
the Sales1
Sales1range
rangename.
name.
$8,900 $5,500 $7,900
$7,900 $5,900 $8,300
$5,800 $6,000 $9,700
$7,800 $6,700 $8,400
$5,800 $9,400 $8,500
$5,300 $6,900 $7,500
anager and
anager and look
look at
at
1range
rangename.
name.
Date
Quick Analysis 6-Mar
6-Mar
The Quick Analysis tool, introduced in Excel 2013, is a feature that 6-Mar
received considerable publicity. Starting with a data set such as the one
to the right, the new Quick Analysis tools provide you with instant 6-Mar
conditional formatting, pivot tables, charts, and other results with almost 6-Mar
no work. You can decide how useful this new feature really is. It 6-Mar
undoubtedly gives you very quick results, but it might not give you the
results you want. 7-Mar
7-Mar
To see how this works, select the entire data range to the right, including
the labels in row 3. You will see a Quick Analysis icon at the bottom right 7-Mar
of the data range. (Remember that if you are using a pre-2013 version of 8-Mar
Excel, this won't work.) When you click this icon (or press Ctrl+Q), you 8-Mar
see the Quick Analysis options below and to the right. Then you can
explore the possibilities. They are all straightforward. 8-Mar
9-Mar
As an example, if you choose Tables and then choose the first of several 9-Mar
automatic pivot tables, you get the pivot table on the next sheet, which
breaks down the sum of Total Cost by Region. This might or might not be 10-Mar
the pivot table you really want, but at least it gives you a pivot table that 10-Mar
you can then modify as you like. Similar statements can be made about 10-Mar
the automatic charts available from the Charts item. You can decide
whether this is any easier than building the pivot table or the chart you 10-Mar
really want from scratch. 11-Mar
Starting in Excel 2013, two of these Quick Analysis options are duplicated 11-Mar
by two "let us guess what you want" items in the Insert ribbon, shown to
the right. These are the Recommended PivotTables and Recommended Quick Analysis options
Charts items. They provide exactly the same options for pivot tables and
charts as from the Quick Analysis tools.
If you no longer want the range to be designated as a table, you can click
Convert to Range on the Table Tools Design ribbon. The dropdown
arrows will disappear. Only the cell formatting will remain, and you can
restore it to "plain" if you like. Try this on the table you just created.
43
44
45
46
47
48
49
50
51
Filtering in Tables 52
53
One of the main uses of tables is filtering, that is, hiding (but not 54
deleting) rows that don't match various conditions. Filtering is done
through the dropdown arrows next to the column headings. This tutorial 55
won't explain all of the options because there are so many, but with a
little bit of experimenting, you should be able to master them in no time.
Just remember that they build upon one another. For example, if you
filter on Gender so that only males are showing, and you then filter on
Children so that only people with at least two children are showing, you
will see only males with at least two children.
Filtering on a numeric vari
The screenshots to the right shows filter dialog box for a numeric
variable, Salary. It shows all distinct values of Salary, which you could
check or uncheck, but more importantly, the Number Filters group
contains many useful possibilities, such as Greater Than. Similarly, if you
filter on a text variable such as State or a Date variable such as Birthdate,
there are many Text Filters and Date Filters you can choose from.
Try it! If you haven't already done so, designate the data set to the right
as a table, and then experiment with the filters.
To clear a filter, click the column's dropdown arrow and select Clear
Filter. To clear all filters, click the Clear button in the Sort & Filter group
on the Home ribbon. You can also do it from the Data ribbon. (See to the
right.)
Sorting in Tables
You probably noticed that when you click a column dropdown arrow, there are
sorting options. This provides one more way to sort in Excel. It is not clear that
sorting in tables provides any advantages over sorting in regular (non-table)
data sets, but it is certainly possible and easy.
One important advantage of a table is that you can summarize filtered data
easily. To do so, check the Total Row box on the Table Tools Design ribbon.
This generates a "total" row below the table. By default, it shows the sum of
Summarizing with the Total Row Total Row button on Table
One important advantage of a table is that you can summarize filtered data
easily. To do so, check the Total Row box on the Table Tools Design ribbon.
This generates a "total" row below the table. By default, it shows the sum of
the values in the rightmost column, as shown to the right. But it gives you
many more options. If you select any cell in the total row, you will see a
dropdown list of summarizing options for that column (count, sum, average,
and others). And if you then filter the data, the summary measures will be
only for the filtered data. (This couldn't be done, at least not easily, before
Excel 2007.) Example of Total Row
Try it! Create a total row for the table of people, and show summary
measures that seem appropriate. Then filter in some way and watch how
the summary measures change.
Filtering on a numeric variable Clear all filters on Home ribbon Clear all filters button on Data ribbon
Total Row button on Table Tools Design ribbon
s Table options
on on Data ribbon
Introduction to Data Tables
Data tables, also called what-if tables, allow you to see very quickly how
one or more outputs change as one or two key inputs change. This is
often called sensitivity analysis, or simply what-if analysis, and it is a key
part of most business models.
Business models are all about what-if questions. What would happen to
profit if our unit cost increased by x%? What would happen to our sales if
our competitor's price decreased by y%? And so on. Data tables are
perfect for answering these types of questions in a systematic way, and
they are quite easy to create. Therefore, it is surprising that so few Excel
users are aware of data tables. This is a very valuable tool, so you should
definitely learn it!
There are two types of data tables: one-way data tables and two-way data
tables. A one-way data table has one input and any number of outputs. A
two-way data table has two inputs but only one output. Both of these are
discussed here.
You find the Data Table option (for one-way or two-way data tables)
under the What-If Analysis dropdown on the Data ribbon, as shown to the
right.
A one-way data table lets you see how one or more selected outputs
change as a single input varies over some range.
To illustrate, suppose you buy a new car for $20,000, make a $5,000
down payment, and finance the remaining amount over the next 36
months at a 6.5% annual interest rate. There are at least two outputs
that might be of interest: the monthly payment and the total interest
paid on the loan. These are affected by the four inputs in blue to the
right.
Let’s first look at a simple one-way data table, which illustrates how a
single output, monthly payment, varies as the annual interest rate varies.
This is shown in the example to the right.
Enter a link to the output in cell L39. Specifically, because the monthly
payment was calculated with the PMT function in cell L34, enter the
formula =L34 in cell L39. Then, starting in cell K40, enter any sequence of
interest rates. Next, select the entire table—the range K39:L44. Then
select Data Table from the What-If Analysis dropdown on the Data
ribbon. Finally, enter L31, the interest rate cell, as the column input cell in
the resulting Data Table dialog box shown to the right. There is no row
input cell, so leave it blank.
If one of the input values along the side of the data table equals the
original value of this input, this provides an internal check of your data
payment was calculated with the PMT function in cell L34, enter the
formula =L34 in cell L39. Then, starting in cell K40, enter any sequence of
interest rates. Next, select the entire table—the range K39:L44. Then
select Data Table from the What-If Analysis dropdown on the Data
ribbon. Finally, enter L31, the interest rate cell, as the column input cell in
the resulting Data Table dialog box shown to the right. There is no row
input cell, so leave it blank.
If one of the input values along the side of the data table equals the
original value of this input, this provides an internal check of your data
table. In this example, the original annual interest rate, 6.50%, is one of
the values in the data table, and the corresponding monthly payments, in
cells L34 and L42, are both equal to $459.74, as they should be.
You can tell that you have a data table by looking at any of the "answer"
cells, such as cell L40. It contains a formula =TABLE(,L31), surrounded by
curly brackets. The part inside the parentheses shows the row and
column input cells, the first of which is blank in this example. The curly
brackets indicate that this is an array formula. Essentially, this means that
it is entered in all of the answer cells of the data table at once, as a
group. You never need to enter this formula; you should create the table
as explained above. However, the formula documents what the answer
range contains.
Try it! Create a one-way data table to the right, where the monthly
payment is calculated for each price of car from $18,000 to $25,000 in
increments of $1000 (with the down payment fixed at $5000). (Scroll to
the right for the answer.)
An example appears to the right, where the single input is still the interest
rate, but there are two outputs: monthly payment and total interest paid.
This table is formed exactly as before, using the same column input cell,
except that the data table range now includes column M, and there are
links to both outputs in the gray cells.
Try it! Create a one-way data table to the right that shows the monthly
payments and the total interest paid for each value of the number of
payments from 12 to 48, in increments of 12. (Scroll to the right for the
the data table is structured exactly as before.
An example appears to the right, where the single input is still the interest
rate, but there are two outputs: monthly payment and total interest paid.
This table is formed exactly as before, using the same column input cell,
except that the data table range now includes column M, and there are
links to both outputs in the gray cells.
Try it! Create a one-way data table to the right that shows the monthly
payments and the total interest paid for each value of the number of
payments from 12 to 48, in increments of 12. (Scroll to the right for the
answer.)
Two-way tables allow you to vary two inputs, one along a row and one
along a column, and capture a single output in the body of the table. The
example to the right illustrates this, where the annual interest rate and
the amount of the down payment both vary, and the single output is the
monthly payment.
Enter the formula =L34 for the single output in the upper left corner, cell
K102, of the data table. (Again, this cell has been colored gray for
emphasis.) Enter any sequence of down payments to the right of this and
any sequence of interest rates below this. Next, select Data Table from
the What-If Analysis dropdown, and enter L29 as the row input cell and
L31 as the column input cell as shown to the right.
As with one-way tables, you can tell you have a data table by looking at
any of the "answer" cells, such as cell L103. Each contains the formula
=TABLE(L29,L31), surrounded by curly brackets. This formula indicates
that cell L29 is the row input cell and cell L31 is the column input cell. In
words, the values for down payment go across the top row of the table,
and the values for interest rate go down the left column of the table.
Remember that a two-way data table allows only one output. If you want
to analyze multiple outputs, you have to create multiple two-way data
tables, one for each output.
Try it! Create a two-way data table to the right that calculates the total
interest paid for each value of the number of payments from 12 to 60 in
increments of 12, and each down payment from $4000 to $6000 in
increments of $1000. Put the down payments along the top and the
numbers of payments along the side. (Scroll to the right for the answer.)
Some data tables are very long (many rows), and each value might require
the recalculation of a complex business model. Therefore, the recalculation
Recalculation and Data Tables
Some data tables are very long (many rows), and each value might require
the recalculation of a complex business model. Therefore, the recalculation
of the entire data table can take a while, several seconds or even minutes.
For this reason, Excel allows you to select the Automatic Except for Data
Tables calculation option from the Formulas ribbon, as shown to the right.
In this case, the data tables won't recalculate until you force them to by
pressing the F9 key.
Try it again! Check that the calculation setting is Automatic (the default
setting), and create any data table to the right. Next, change the calculation
setting from Automatic to Automatic Except for Data Tables and create the
data table again. You should see the same value throughout the table,
which is disconcerting. But you can press the F9 key to get the correct
answers. Then change the calculation setting back to Automatic.
Data Table item on Data ribbon
Payment model
Price of car $20,000
Down payment $5,000
Amount financed $15,000
Annual interest rate 6.50%
Number of payments 36
Data table
Interest rate Monthly payment
$459.74
6.00%
6.25%
6.50%
6.75%
7.00%
Data Table dialog box
Data table
Interest Monthly payment Total interest
$459.74 $1,550.46
6.00%
6.25%
6.50%
6.75%
7.00%
Data table for exercise
Number of payments Monthly payment Total interest
Do you remember your high school algebra class where you had to solve
a single equation for a single unknown value? You can do this in Excel
with the Goal Seek tool. The unknown is called a changing cell.
Essentially, you want to change the value in this cell to force a formula in
some other cell to equal a specified value.
A simple example of this appears below and to the right. Demand for a
company's product is determined by a linear demand curve: the higher
the price, the lower the demand. The company produces exactly enough
to meet demand, with the given fixed and variable costs of production.
The company wants to find the breakeven price, that is, the price that
makes profit equal to 0. This breakeven price can be found with Goal
Seek. Here are the steps. (Before you do this, you might see if you can
find the breakeven price by trial and error, by entering different values in
cell L32. If nothing else, this will help you understand the model better,
and it will give you a better appreciation of Goal Seek.)
1. Choose Goal Seek from the What-If Analysis dropdown on the Data
ribbon (see to the right)
2. Fill in the Goal Seek dialog box as shown to the right. Specifically, the
price in cell L32 should be changed so that the profit in cell L39 is driven
to 0.
If you try this, you will see the Goal Seek Status dialog box to the right,
and you will see that the the price should be set to $22.57. This price
makes demand equal to 3900, so the company sells 3900 units and
makes $2.57 on each of them, which is just enough to offset the $10,000
fixed cost. The calculations with this unit price are shown in column N.
Try it! Use Goal Seek to find the price that makes profit equal to $30,000.
Note: For numerical reasons, Goal Seek doesn't force profit to exactly the
value you specify; it sometimes only gets close. If this isn't close enough,
you can change an Excel setting to make it closer. Go to Excel Options
and choose the Formulas group. (See below and to the right.) Then
change the "Maximum Change" to a smaller value (more zeros to the
right of the decimal).
Goal Seek item on Data ribbon
Profit model
Fixed cost $10,000 $10,000
Variable cost $20.00 $20.00
Unit price $25.00 $22.57
Profit $9,375 $0
Solver is an add-in that ships with Excel but is developed by Frontline Systems,
not Microsoft. It is used for constrained optimization models. There is much
more about Solver models than can possibly be covered here, but basically,
you must first develop a spreadsheet model that starts with numerical inputs
and values of decision variables (called changing cells), and then uses
formulas that capture the business logic and eventually lead to an objective,
such as profit or total cost, that you want to maximize or minimize. Then you
fill out a Solver dialog box to indicate the objective, the changing cells,
constraints that must be satisfied, and appropriate options. When you click
the Solve button, the add-in uses powerful algorithms to find the optimal
solution.
A simple optimization model appears to the far right. The objective is to find
the minimum-cost way to send units of some product from manufacturing
plants to customer regions so that plant capacities are not exceeded and
regional demands are met. The blue ranges contain given inputs (the unit cost
of transportation from plant sites to regions, the demands in the regions, and
the capacities of the plants), the red cells are the changing cells, and the gray
cell is the objective to minimize. You can check the formulas in the yellow and
gray cells that capture the business logic. The formulas are very simple for this
model, but the logic can be much more complex in other models.
You then invoke Solver from the Data ribbon and fill out its main dialog box as
shown to the right for Excel 2010 or later versions. (Scroll down for equivalent
screenshots in pre-2010 versions of Solver. There you have to go to an
Options dialog box to complete the settings.) When you click the Solve
button, you will see the Solver Results dialog box shown to the right, and the
solution in the red changing cells to the right will be found, regardless of the
original values in the red cells. This solution minimizes total cost, while
satisfying capacity and demand constraints.
Note: If Solver is not on your Data ribbon, you will need to add it in. Click the
File menu and Options in Excel 2010 or later (or the Office button and then
Excel options in Excel 2007), then Add-ins, and then the Go button. Check the
Solver item to add it in. If Solver isn't in the list below, you will need to run the
Office installer to install it.
First, the user interface has been streamlined, as shown to the right. In particular, for
most optimization models, you no longer need to go to the Options dialog box. You
can now check the nonnegativity option and choose an appropriate Solver algorithm
from this initial screen.
Actually, there are other differences "under the hood" in the improved Solver. In
short, it works better. Frontline Systems has many Solver products, one of which was
known as Premium Solver (and had to be purchased separately). Now the improved
Solver introduced in Excel 2010 is essentially the old Premium Solver.
short, it works better. Frontline Systems has many Solver products, one of which was
known as Premium Solver (and had to be purchased separately). Now the improved
Solver introduced in Excel 2010 is essentially the old Premium Solver.
Solver button on Data ribbon Solver model
Units shipped
From
Total cost
To
Units shipped Region 1 Region 2 Region 3 Region 4 Total shipped Capacity
Plant 1 150 0 0 300 450 <= 450
Plant 2 100 200 0 0 300 <= 600
Plant 3 200 0 300 0 500 <= 500
Total received 450 200 300 300
>= >= >= >=
Demand 450 200 300 300
$176,050
Solver Options dialog box in pre-2010 versions
Get External Data on Data
Introduction to Importing External Data into Excel
Excel's strength lies in its ability to analyze data. However, the data you
want to analyze will not always reside in an Excel worksheet. The data
might be on a Web site, in a text file, in a database, or in some other
source. The question, then, is how you can import the required data into
Excel. Fortunately, Excel has some very powerful tools for importing data,
both "old" and "new." The older tools, discussed in this section of the
tutorial, have been part of Excel for years, and they still work fine. You can
find them in the Get External Data group on the Data ribbon, shown to
the right. (Depending on the size of the Excel window, the Get External
Data group might appear as a single Get External Data dropdown.)
The newer tools comprise Power Query, part of the Power BI suite that is
discussed in another section of this tutorial. These tools are in the Get &
Transform group to the right of the Get External Data group.
Many Excel users are comfortable using the older tools and will probably
continue to use them (assuming that Microsoft continues to support
them). However, if you are new to importing external data, we highly
recommend the newer Power Query tools.
Get External Data on Data ribbon
Importing Data from a Text File
Data sets are often stored in "plain vanilla" text files, usually with a .txt, .dat,
or .prn extension, simply because everyone can view text files. All you need is
a text editor, such as Notepad. Fortunately, Excel has a wizard for importing
data from a text file into Excel. It is easy to use, but you have to be careful that
everything lines up properly in the import.
Text files come in two varieties: fixed width and delimited. In a fixed width
data set, each variable starts in the same column. For example, First Name
might be in columns 1-15, Last Name might be in columns 16-30, and so on.
This is a carryover from the old days of IBM punched cards, but fixed width
text files are still fairly common. In contrast, in a delimited text file, pieces of
data are separated by a delimiter character, the most common being a space,
a tab, a common, and a semicolon. You can tell that a data set is delimited
when you open it in a text editor and see that the columns don't line up; they
are "ragged."
Once you understand this distinction, importing text data is easy. To do so,
click the From Text button in the Get External Data group on the Data ribbon
(see to the right), and then browse to find your text file. This launches a
three-step wizard, shown in the three dialog boxes to the right.
In the first dialog box, you can see from the data in the first few rows that the
data are not fixed width, so Delimited is the correct choice. You also have the
option to start the import at a row other than the first row. Text files often
have data you don't want to import in the first few rows.
In the second dialog box, you can choose the delimiter, in this case, a comma.
In the third dialog box, you can fine-tune the import, but it usually suffices to
click the Finish button. If any fine-tuning is necessary, you can do it in Excel.
There is a final dialog box, not shown here, where you can select the location
of the imported data. For this example, the imported data are listed below.
Always look carefully at the imported data to make sure everything lines up
correctly. If it doesn't, you have to fix the imported data or fix something in
the original text file. One "small" error, such as when some of the Salary
values end up in the Age column, can completely mess up the data to be
analyzed.
Note: Starting in Excel 2016, another option is to use Power Query, which is
discussed in another topic in this tutorial. (You select From File and then From
Text from the New Query dropdown.
Faculty Support StaSupply Budget
Credit HourResearch Pubs
Business
150 70 5
15 225
Education
60 20 3
5.4 70
Arts & Sciences
800 140 20
56 1300
HPER
30 15 1
2.1 40
No. 2
From Text button on Data ribbon
The other topics in this section of the tutorial explain how to import data
from the Web or from a text file. Although these operations are common,
they probably aren't as common as the importing method described
here: importing data from a database. This is a huge topic, and this
tutorial only scratches the surface.
There are many database packages available for storing data, including
Microsoft Access (part of the Office suite) and many server-based
systems such as Microsoft's SQL Server, Oracle's RDBMS, IBM's DB2, and
others. Fortunately, all of these store data in essentially the same way: as
related tables, where each table stores information about a particular
entity such as a product, a customer, or a vendor. Also, they all use
essentially the same query language, Structured Query Language, or SQL,
to retrieve specific subsets of the data. Because of this commonality
across database packages, technologies have been developed over the
past two decades that allow users, often programmers, to import
database data into applications, including Excel.
The simplest way to import database data into Excel, and the only one
described in detail here, is to use the From Access button in the Get Named queries (top icons
External Data group on the Data ribbon, shown above and to the right.
After you then browse for an Access database file, you have two options.
The first is to import one or more tables. (The option to select multiple
tables was introduced in Excel 2013.)
The second possibility is more flexible. You can import data from a
named query in an Access file. For example, the list to the right includes
several named queries from the famous Northwind database provided by
Microsoft. This means that you should first create queries of interest in
Access, and save them, before importing the data into Excel. Of course,
this assumes that you know how to create queries through Access's user
interface. This is not difficult, but it takes some practice.
Other import options appear under the From Other Sources dropdown
list shown to the right. The most common of these is From Microsoft
Query. Only the outline of the procedure is given here. Basically, it is a
three-step process.
1. You identify the data source and the type of database you have:
Access, SQL Server, Oracle, or whatever. In case of a server-based system,
you must identify the server and probably provide a valid username and Microsoft Query in the Fro
password.
2. You create a query for the data you want. You can do this through a
user interface that is very similar to the one in Access, or you can enter
an SQL statement directly.
Note: Starting in Excel 2016, another option is to use Power Query, which
is discussed in another topic in this tutorial. (You select From Database
and then From Microsoft Access Database from the New Query
dropdown.
From Access button on Data ribbon
Named queries (top icons) and tables (bottom icons) in Northwind database
Microsoft Query in the From Other Sources list on the Data ribbon
Web Queries
To say the least, there is an abundance of interesting data on the Web. Because
Web authors can design their sites in a variety of ways, there is no guarantee
that the Web data can be imported easily into Excel, but it is worth trying with a
Web query, a simple and powerful tool.
To understand how Web queries work, you need to understand a little about
Web pages. They are all written in HTML, a markup language that has "tags" to
identify different parts of a page. One such tag is the Table tag. It often indicates
a rectangular array of data, but it is also used for all sorts of things that aren't
really tables. In any case, a Web query can import anything that is surrounded
by table tags. You can then decide which "tables" are of interest to you.
Try it! First open your browser, locate a website that has data you want to
import, and copy its URL. For this example, you could use the URL for monthly
IBM stock prices from November 2013 back to 2000:
http://finance.yahoo.com/q/hp?
s=IBM&a=0&b=1&c=2000&d=10&e=1&f=2013&g=m
Then, starting in a blank workbook, click From Web in the Get External Data
dropdown on the Data ribbon, as shown above and to the right. This opens the
New Web Query dialog box to the right. Paste your URL into the Address box
and click Go. The Web page will open, hopefully with one or more yellow
arrows corresponding to the table tags on the page. Find the one(s) you want
and click them, which changes them to green check marks. Then click Import.
The Import Data dialog box to the right lets you choose where to start the
import. Just make sure there is plenty of blank space below and to the right of
the selected cell. Note that not all of the data are imported. This particular
website sends back only a certain number of data items per query.
Excel remembers the source of this data and keeps a link to it. The connection in
the current workbook was removed, but to see it in your own workbook, you
can click the Connections button on the Data ribbon. You will see the Workbook
Connections dialog box to the right. (The connection has the generic name
Connection, but it can be renamed as shown. ) From here, you can do several
things. First, in case the Web data change through time, you can click Refresh to
get the newest data. Second, you can click Properties, then the Definition tab,
and then the Edit Query button to return to the New Web Query dialog box.
Finally, if you don't want a live link to the website, you can click Remove, as was
done here.
Note: Unfortunately, the Web query method described above doesn't work on a
lot of promising websites. The good news, however, is that, starting with Excel
2016, you can import Web data with Power Query, described in another topic in
this tutorial. (You select From Other Sources and then From Web from the New
Query dropdown.) Our experience is that the Power Query method works on
many websites where the "old" method described above does not work.
From Web button on Data ribbon
Insert comment
Cell Comments
Try it! Add the following cell comment to the gray cell to the right: Sales
are in $1000s. Then change the comment to: Monthly sales in $1000s.
Then delete the cell comment.
For more on cell comments, visit the Comments group on the Review
ribbon. You might not ever use all of these buttons, but they could be
handy if someone gives you a spreadsheet with a lot of cell comments,
and you want to browse through them quickly.
To insert a text box, click the Text Box button on the Insert ribbon, as
shown to the right, and drag a text box in some area of the worksheet.
next line, etc.? Many people do this, but it is not a good habit, mostly
because of the difficulty of editing. It is much better to use text boxes, as
you see throughout this tutorial. Text boxes are much better for
explanations than cells because they have word wrap. They are
essentially mini-word processors that can be edited (and moved or
resized) easily. You should use them in virtually every spreadsheet you
create!
To insert a text box, click the Text Box button on the Insert ribbon, as
shown to the right, and drag a text box in some area of the worksheet.
Then start typing. It's as easy as that.
You might also want to change the appearance of the text box. To do so,
click it twice so that the border becomes a solid line. (It's a dashed line
after the first click). Then you will see a Drawing Tools Format tab and
associated ribbon where you can make all sorts of changes. For example,
in this tutorial all text boxes are rounded in two corners and have a blue
border. If you like the appearance, you can right-click the text box and
choose the Set as Default Text Box item. Then every other text box you
create in that workbook will automatically have the same appearance.
Try it! Create a text box to the right and enter some text. Then see if you
format it like the text boxes in this tutorial.
Note again that if you click a text box once, its border becomes a dashed
line. If you then click it again, it becomes a solid line. The options
available are slightly different in these two cases. For example, if you
want to delete a text box, you should make the border a solid line and
then press the Delete key. In contrast, if you press the Delete key when
the border is dashed, you will delete some text.
When you add text boxes (or other shapes such as circles, rectangles, and
arrows) to a worksheet, they essentially "float" above the worksheet cells. If
you then insert rows or columns under these shapes, or if you change row
heights or column widths under them, the shapes might move or expand. You
might want this behavior, or you might not. In either case, you can control the
behavior. To do so, right-click a shape, such as a text box, and select Size and
Properties. The dialog box to the right appears. (This is for Excel 2013, where
the user interface changed noticably.) You can then select the "Object
positioning" option you want under Properties. For example, if you want the
shape to stay fixed in the same size and position, select the "Don't move or
size with cells" option, as shown here.
By default, a shape such as an oval is opaque, with a blue fill and a darker blue
border. But if you select it, you get the Drawing Tools Format tab and
associated ribbon, where you can format the shape in an endless number of
ways.
Insert comment Edit or Delete comment Sales
15.3
14.7
9.6
12.1
14.2
Conditional formatting was available before Excel 2007, but it wasn't very
prominent, and many users didn't even know it was available. Now it is
very prominent, right in the middle of the Home ribbon, as shown to the
right. It is also much easier to use. As illustrated here, most uses of
conditional formatting are really easy, but a few are tricky.
The user interface for conditional formatting is shown in the screenshots
to the right. When you click the Conditional Formatting button on the
Home ribbon, you see five categories of built-in conditional formatting
rules: Highlight Cell Rules to Icon Sets. Each of these leads to a list of
possibilities. For example, the Highlight Cell Rules options and
Top/Bottom Rules options are shown to the right. These are all fairly self-
explanatory: you select a range, click one of these options, and specify
parameters and a format to apply a rule.
There are also three options at the bottom of the main Conditional
Formatting list: New Rule, Clear Rules, and Manage Rules. The New
Formatting Rule dialog box shown to the right lets you build a new rule,
and the possibilities are almost unlimited. The Clear Rules option (dialog
box not shown) lets you delete rules for the selected range or for the
entire workbook. Finally, the Manage Rules dialog box shown to the right New Formatting Rule dialo
lets you see and edit the rules, if any, for the current selection or any of
the worksheets in the current workbook.
Exam score
Applying Some Simple Conditional Formatting 62
Person
Other Built-in Conditional Formatting Possibilities 1
2
As you can see when you click the Conditional Formatting dropdown,
there are a lot of built-in choices that are very easy to apply. Try out some 3
of the following: 4
5
The Highlight Cell rules let you format numbers that satisfy inequalities, as
in the example above, and they also let you format text or dates that 6
satisfy natural conditions. 7
8
The Top/Bottom rules let you format the top (or bottom) x items (or x
percent of items), where you can choose x. For example, you can format 9
the maximum number in a list by specifying the top 1 item. 10
11
The Data Bars, Color Scales, and Icon Sets are amazing -- and they can be
overdone. The point of all of them is to differentiate levels of values, such 12
as salaries or sales values. 13
Try it! Use any interesting formats you like to format the dates, text, or 14
numbers to the right. Remember that you can always modify the formats 15
or clear them. 16
17
Try it! Use any interesting formats you like to format the dates, text, or
numbers to the right. Remember that you can always modify the formats
or clear them.
18
19
20
21
22
Scroll down for more below… 23
24
25
26
27
28
29
30
Month
Building Your Own Conditional Formatting Rules with Formulas Jan-13
Feb-13
You can get even more control by building your own rules. You do this by Mar-13
clicking Conditional Formatting and then New Rule. The resulting dialog
box has more options than can be explained here, but the following Apr-13
explains one typical and useful possibility. May-13
Jun-13
The data set to the right contains monthly sales data for six regions.
Actually, they have been entered as random numbers with the Jul-13
RANDBETWEEN function, so if you press the F9 key, they will all change Aug-13
in a random way. (This makes the example even more impressive!)
Suppose you want to color the maximum sales value in each column Sep-13
green. One way is to do it separately for each column, formatting the top Oct-13
1 item as explained above. However, this would take too much time, Nov-13
especially if there were many more columns. Here is a better way.
Dec-13
1. Select all the dollar values, dragging from the top left cell. This makes
the top left cell the active cell, the one in white.
3. In the "Format values where this formula is true:" box, enter the
formula
=(L107=MAX(L$107:L$118)). Make sure you get the dollar signs right.
Then select a green format of your choice.
Try it! Apply the above steps to the sales data. Apply a similar formula to
format the minimum value in each column red. Then press the F9 key a
few times and watch how the green and red cells bounce around.
Once you understand how this formula works, you can do some amazing
conditional formatting. Remember that you selected the entire sales
range, but L107 is the active cell because you started the dragging from
it. The formula as written applies to cell L107. Specifically, if its value is
the maximum value in column L, it is formatted green. But because the
entire sales range is selected, the formula is applied, in a
relative/absolute sense, to each cell in the range. The rows in the MAX
function are absolute because the maximum is always over these rows,
but the columns in the MAX function are relative because you want this
formula to apply to all cells in all columns. And L107 is totally relative
because you want this rule to be applied to every cell in the range.
it. The formula as written applies to cell L107. Specifically, if its value is
the maximum value in column L, it is formatted green. But because the
entire sales range is selected, the formula is applied, in a
relative/absolute sense, to each cell in the range. The rows in the MAX
function are absolute because the maximum is always over these rows,
but the columns in the MAX function are relative because you want this
formula to apply to all cells in all columns. And L107 is totally relative
because you want this rule to be applied to every cell in the range.
Conditional Formatting button on Home ribbon
Conditional Formatting options Higlight Cell Rules options Top/Bottom Rules options
At some point, you might be developing spreadsheets for others to use, and
you might want to force them to use certain values in certain cells because
other values wouldn't make sense or wouldn't satisfy business rules. You can
do this fairly easily with data validation. There are actually many possibilities,
but only the most common are illustrated here. All of the options are found
from the Data Validation item on the Data ribbon shown to the right. This
leads to the fairly self-explanatory Data Validation dialog box also shown to
the right. All of the examples below assume you have selected the cell you
want to validate, and they assume that you have opened this dialog box and
have chosen the Settings tab.
Choose Whole Number (if you want only integers) or Decimal in the Allow
dropdown list, choose Between from the resulting Data dropdown, and
enter values in the Min and Max boxes. You can also place cell references in
the Min and Max boxes. You can experiment with the other options in the
Data dropdown. They are all quite straightforward.
The Data Validation dialog box has two other tabs, Input Message and Error
Alert. The first allows you to create a message that the user sees when the
cell is selected. The second allows you to create a message that appears if
an incorrect value is entered in the cell.
Try it! Force the values in the gray cells in column K to have values indicated
by the labels to their right. Add your own input messages and error alerts.
Then try entering appropriate and inappropriate values in the gray cells.
Probably the easiest data validation is to allow the user to choose from a
dropdown list of values. To do this, first create the list in some column,
usually out of sight to the far right. Then from the Allow dropdown in the
Data Validation dialog box, select List, and in the Source box, provide a cell
reference to the list. That's all you need to do. When the user selects the
cell to be validated, a dropdown arrow automatically appears, with the
values in the list to choose from.
Try it! The example to the right lets a user enter an amount to be financed,
an annual interest rate, and a term (number of months to pay), and it
returns the monthly payment (using the PMT function that has already been
entered). Create a list in a column out to the right that contains the possible
terms: 12, 24, 36, 48, and 60, and then create a data validation for the term
usually out of sight to the far right. Then from the Allow dropdown in the
Data Validation dialog box, select List, and in the Source box, provide a cell
reference to the list. That's all you need to do. When the user selects the
cell to be validated, a dropdown arrow automatically appears, with the
values in the list to choose from.
Try it! The example to the right lets a user enter an amount to be financed,
an annual interest rate, and a term (number of months to pay), and it
returns the monthly payment (using the PMT function that has already been
entered). Create a list in a column out to the right that contains the possible
terms: 12, 24, 36, 48, and 60, and then create a data validation for the term
cell that lets the user choose from these values. Check that it works.
Validating a Date
Suppose you want to make sure the person enters a valid date in a cell. This
is a great place for data validation. By choosing the Date option from the
Allow dropdown list, you can force users to enter only values that are
recognized as dates. This is no small achievement!
In addition, you can put limits on the dates. For example, suppose you want
the person to enter the date she took out a loan. This must not only be a
date, but it can't be in the future. To allow only such dates, you can select
"less than or equal to" from the Data dropdown and then enter the
following formula in the End date box: =TODAY(). The effect is that the user
will not be allowed to enter a future date, regardless of today's date.
Try it! Create the date validation just described in the gray cell to the right.
Then enter incorrect and correct entries to see how it works. (Can you
change it so that only dates that are at least a week ago are allowed? Just
change the formula slightly.)
Data Validation button on Data ribbon
Date of loan
for these values)
Protect options on Review
Protecting a Worksheet or Workbook
If you create an Excel file for others to use, you probably don't want
them to mess up the formulas you entered so carefully. In fact, you might
not even want them to see the formulas. Maybe they are company
secrets. Excel gives you plenty of options for protecting, or unprotecting,
your work. Only a few of them are explained here. You can then Protect Sheet dialog box
experiment with others.
The key idea is locking cells. Right-click any cell on this worksheet, select
Format Cells, and click the Protection tab. You will see that the Locked
option is checked. By default, all cells are locked until you unlock them.
However, this locking has no effect until you protect the worksheet (or
the workbook). Therefore, protecting is a two-step process.
1. Unlock all cells you want users to have access to. These are typically
input cells where a user can enter data like unit cost, amount ordered,
and so on.
Sumifs
or 70 10 113