You are on page 1of 214

This isn't E.

xcel,
it's Magic!
NOTE: All the tips in this book will work in Excel 2000,2002.2003, and
2007. Most will also work with Excei 1 997.AII the screen shots are from
Excel 2007, and the detailed descriptions of how to access many of them are
via Excel 2007's new Ribbon. There are also descriptions for accessing the
same tips using versions earlier than Excel 2007, and these all begin with the
italicized text,"[Exce1 2003: . . . ]"
Tips 27, 28, 68, 69, and 90 have no equivalent in versions other than Excel
2007.
This isn,t Excel
,
it,s Magic!
Tips and Tricks for getting
the most out of Microsoft® Excel

Bob Umlas
Microsoft® Excel MVP

SECOND EDITION

.4'��­
••••
�.. .,,
IIL PUBLISHING
Copyright© 2007, by International Institute for Learning, Inc.

All rights reserved. No portion of this book may be reproduced, stored in a re­
trieval system, or transmitted in any form or by any means-electronic, mechanical,
photocopying, recording, scanning, including the right of reproduction in whole or in
part in any form, except for brief quotations in critical reviews or articles, without
the prior written permission of the publisher. For information, contact the publisher.

The information in this book is distributed without warranty. Although every pre­
caution has been taken in the preparation of this book, neither the author nor the
publisher shall have any liability with respect to any loss or damage caused in any
manner by the information contained in this book.

Ill Publishing, New York titles may be purchased in bulk at a discount for educa­
tional, business, fund-raising, or sales promotional use. For information, please email
michelle.blackley@iil.com or call 212-515-5144.

Microsoft® Excel is a registered trademark of the Microsoft Corporation.

Published by Ill Publishing, New York a division of International Institute for Learn­
ing, Inc., 110 East 59'h Street, 31" Fl., New York, NY 10022
www.iil.com

ISBN 978-0-9792153-2-2
Library of Congress Control Number: 2007936376
Second edition

Designed by Tony Meisel


Publisher Judy Umlas

Printed in Canada
I'd like to thank my wife, Judy, for her continued support while I pursue my
Excel "studies," including trips to Redmond for the MVP Summits, as well as
spending time answering people s questions on the newsgroups .
'

I also want to thank Will Tom pkins my fellow Excel MVPs, my co-work­
,

ers, and the many other contributors to the online newsgroups-David


Hager, John Walkenbach (who has put many of my excel "oddities" discover­
ies on his website), Bill Manville,Jim Rech,Jan Karel Pieterse,Tom Chester,
Reed Jacobson, Eric Wells, Bob Greenblatt,Tim Aurthur, Monika Weber, Bill
Jelen {"Mr. Excel"), Jim Janssen, and Joe Sorrenti for their contributions to my
knowledge.
I want to acknowledge my best friend. Jerry Goldin, Ph.D., for his ongoing
support of everything I do and of my entire family. I want to thank my sister,
Marilyn Umlas Wachtel, for being there when I have most needed her.
My wonderful children, Stefanie and Jared Um las, have put up with me as
I remained at the computer, writing this book, instead of watching Alias or
The Simpsons with them. They have been terrific!
I would especially like to thank E. LaVerne Johnson, President and CEO
of International Institute for Learning (IlL), for believing that I am one of the
top three Excel gurus in the world, no matter what I tell her. I also thank
her for supporting my love of teaching by offering the Mastering Microsoft®
Excel course through IlL all these years.

Bob Umlas, Microsoft® Excel MVP


International Institute for Learning, Inc. (Ill)

I
ntemational Institute for Learning, Inc. (Ill), headquartered in New York City and
with eleven operating companies in major cities around the world, is a global
leader in Project, Program and Portfolio Management, Microsoft® Project, Six Sigma,
and Business Analysis corporate solutions.
Using its Many Methods of Learning TM, Ill combines the theory and practice
that professionals need in order to manage today's business complexities with
maximum flexibility. Ill offers traditional classroom training as well as on-demand
learning, "virtual" instructor-led courses, and hands-on leadership simulation classes.
Ill recently released Project Management elibrary, a state-of-the art, animated and
engaging program that is rich in education and exercises.

TRADITIONAL CLASSROOM LEARNING


Each year Ill schedules hundreds of live, instructor-led courses and workshops in
major cities around the world.This offers a convenient and effective way for profes­
sionals to participate in classes that expose them to diverse industry perspectives
and trainers' real workplace experiences.

VIRTUAL ELEARNING
Utilizing the latest online technologies, Ill brings professionals a broad curriculum
of live, instructor-led courses, including Mastering Microsoft® Excel, via the Internet.
This environment allows students to interact live with the instructor and fellow
classmates, while avoiding the costs and inconvenience of travel.

ON-DEMAND LEARNING
Ill offers a wide variety of courses that provide extraordinary content along with
the convenience of learning at a student's own pace-whether that's at home or
work, day or night. In addition to traditional video, texts and workbooks, Ill offers
content-rich, multimedia training programs.

COMPUTER -AIDED SIMULATION LEARNING


A growing number of Ill's courses use computer-aided simulation.This allows par­
ticipants to learn b y making official decisions in a realistic and safe "virtual" business
setting.

ONSITE LEARNING AND CORPORATE SOLUTIONS


Ill works closely with clients to develop learning solutions that are tailored to meet
their precise business objectives and cultural needs.

For more information, please contact:


Lori Milhaven, Executive Vice President
International Institute for Learning, Inc.
Phone:1-212-51S-5121 or1-800-325-1533
e-mail: Lori.Milhaven@iil.com
www.iil.com
Also published by Ill Publishing, New York

The Zen Approach"' to Project Management


by George Pitagorsky, PMP

The Power of Acknowledgment


by Judith W. Umlas

Project Portfolio Management Tools and Techniques


by Parviz F. Rad, PhD and Ginger Levin, PhD

Forthcoming:

Project Management Poetry, Puzzles and Prose

Positive Leadership in Project Management:


Practical Leadership for the Practitioner
by Frank P. Saladis, PMP
Praise for THIS ISWT EXCEL, IT'S MAGIC!

"I was astonished reading this book. The tips are excellent and well
worth knowing-you won't want to miss even one of them! Although Eng­
lish is my second language, I got through it effortlessly. Bob Umlas is a magi­
cian-thanks for sharing this immense knowledge with us!''

- Monika Weber, Excel MVP


Project Manager, Corporate IT
AMCOR Rentsch Ltd.

"I carry This isn't Excel, It's Magic! in my car and read tips while stopped at
traffic lights. The book is already full of post-it flags fo r all the tips I didn't
know. I think I've flagged all but the title page."
- Melanie Beck, technical training specialist,
Grant County Public Utility District

"I thought I knew a lot about Excel; but I now realize how little I did know.
There are so many great head spinning, jaw dropping tips and tricks. It makes
unlocking the power of Excel an amazing experience. A must have for (Excel)
users everywhere. Mr. Umlas (is) a true magician."
-Aiesa Lambert, corporate accountant, CM Foods

"I love this book and highly recommend it to all Excel users. Whether you
are looking for some simple techniques to make you more productive in
Excel, or if you are ready fo r some sophisticated how-to's, you will learn
valuable information from This isn't Excel, it's Magic!"

- Bob Schuster, partner of ExceiMagic and


RWS Information Systems

is) a simple, but amazingly useful book.Very clever!


"(This isn't Excel, it's Magic/
Bob has produced a compact, but brilliantly useful book of shortcuts, for­
mula secrets and tricks. One thing I loved about this book is it tackles 'real
world' problems.This is not a book for Excel beginners. However, if you use
Excel professionally o r for fun then you absolutely should consider grabbing
a copy of this highly useful and informative book. It will save you many hours
of work and delight you at the same time."
- Darryl Collins, Excei!VBA developer
"Nobody willing to use Excel efficiently should be without a copy."
- Miguel Fischman, systems analyst programmer

"What a handy little book chock fill of hints, tips and techniques.
I have been studying Excel for longer than I care to admit yet I
consider my knowledge of the subject miniscule compared to the author's
breadth of skill."
- Chris Curtis, desktop p ublisher, bellaonline.com

"Bob Umlas is a Microsoft® MostValuable Professional (MYP) who put his


nearly 20 years of Excel experience into a book called: This isn't Excel, it's
Magic! Bob shares many excellent tips for the experienced Excel user that
will save time and energy when working with spreadsheets. A beginner may
be a little daunted by some tricks, but will appreciate them once they get to
know Excel. The book is well illustrated and narrated."
- Rick Ca.stellini, host of Castellini on Computers

"One of the biggest perks of attending the MYP conference in Redmond was
the opportunity to chat with folks from all over the world. I had the unique
opportunity to chat with Bob Umlas, an expert in Microsoft® Excel. If you
have questions about how to use Microsoft® Excel then Bob probably has
the answers."
- David Ciccone, founder, mobilitytoday.com

"The first time I read it was in the middle of the night during a blackout. I
had to use a flashlight under the covers.Thanks again for your help."
- Debi Morrison, B2B Support Coordinator,
"the Excel Queen"

"Despite the large selection of accounting software programs for businesses,


Microsoft® Excel is the tried-and-true spreadsheet option for most, espe­
cially for small businesses.A new book by Bob Umlas,a Microsoft® Excel
MYP and author of 300 articles on Excel, shares tips on how to get the most
out of the software."
-Accounting Smartpros.com

"You just have to buy this book!"


-Jack lmsdahl, co-host, On Computers
radio show with AlaskaJoe
FEATURES
1 . Using Advanced Filter to another sheet 14
2. Select all O's: or Select all specific keyword 16
3. Cut/Copy, Insert Paste by dragging borders! 21
4. Use Fill-handle to insert or delete rows 22
5. Shift/find finds backwards 23
6. Combining cells with Paste Special/Skip Blanks 25
7. Right-click drag the Fill Handle for several options 27
8. Defining names for large non-contiguous ranges 29
9.What is that :1, :2 ... I see in the work book title? 31
10. Double-clicking tools 33
1 1 .AutoSum Tool features 34
12. Change dates like 20050923 to one Excel can "understand" 36
1 3.AIIow only unique entries in a column 38
14. Right-mouse/drag the border of a range for several new options 40
15. Shift/click inner VCR controls 41
16. Using Pictographs 42
1 7.Wish there were a "No to All" when closing many files? 46
18.Quick return from FS(Goto) 47
19. Split Bars 48
20.Window/Arrange Tiled (except this one!) 51
21. Adjusting Row Heights for Merged cells 53
22. More Scrolling 54
23. Drag/Scrolling 56
24. Using the Justify command 57
25. Understanding the order ofWindow/Arrange 60
26. Creating names 62
27. Long Names 64
28. Long Formulas 65

FORMATTING
29. Formatting comments 66
30. Format #VALUE! or any errors away 70
3 1 . Using (h] format for hours>=24 72
32.Advanced number formatting 73
33. Formatting text 74
34. Using Fills 75
35. Indenting or distributing text 76

FORMULAS
36. Easily create custom list of a-z,A-Z 78
37. Inner Series 80
38. Using Apply Names 81

10 This isn't Excel, it's Mogicl


39. Selecting a random sample of data 83
40. How to change row height when a key field changes 86
4 1 . Define "global/local" name 90
42. XLM-Names (not XML) 92
43. Getting number of unique values 95
44. Named formulas are array-entered 96
45. Getting End of Month 97
46. How many Wednesdays between 1/1/05 and now? 98
47. Looking up 2 (or more) values 100
48. Named ranges which define themselves 101
49. Using REPT for visual effects 102
SO. Using the Space as a n operator 103
51. Extracting the last pan of a string 104
52. Using SUM PRODUCT 105
53. Using the TEXT function 107
54. Use wildcards in MATCH function 108
55. See all characters in font set 110
56. Double-Spacing data 1 11
57. Fill "=A 1 " right, have reference become =A2, =A3, 113
58. Fill "=C3" down, have reference become =D3, =E3, etc. 115
59. Using Define Names & scrolling 1 18
60. Show a picture by typing its name? 119
61. Protecting ranges from insertion of rows/columns 124
62. NumberingQuestions tip 125
63. Mailing Label tricks - 1 128
64. Mailing Label tricks - 2 132
65. Bulk formula change 135
66. Fun with relatively defined names 138
67. Using notes inside formulas via the N-function 140
68. New Table features 141
69. New Excel Functions 143

KEYBOARD SHORTCUTS
70. Ctri/Shift/-,1 ,2,3,4,5,6 for quick formatting 145
71. Borders from keyboard 146
72. Inserting Date & Ti me shortcuts 147
73. Click the AutoSum button from the keyboard 148
74. Bringing the selection into view 149
75. Ctrl/[ more powerful than its "equivalent" GoTo Precedents 150
76. Show Corners of Selection Easily 151
77. Anchoringthe active cell 152
78. Finding after the Find dialog is closed 153
79. A few miscellaneous Shortcuts 154

This isn't Excel, it's Magid 11


MISCELLANEOUS
80. Sorting columns 155
81. Making exact copies of ranges with relative or mixed references 157
82. Filling Holes 161
83.Aiigning objects 163
84. Leaving cursor in the cell after pressing enter. 165
85. Shortcut 3D formula 166
86. Pulling cells together 167
87.An oddity with the Camera Tool 169
88.Quicker data entry 171
89. Miscellaneous - Changing cell reference 172
90. More miscellaneous Info 173

PRINTING
91. Copy Page Setups to other sheets 175
92. Copy Page Setups across workbooks 178
93. Print many worksheets at once 179
94. Print remote areas on same page 180
95. Reset all page breaks caution 183

VBA
96. Getting to your Visual Basic routine by FS (go to)
from the worksheet 184
97. Can't find the old Excel 2003 commands! Use this feature! 185
98. Aligning Userform objects 186
99. Put pictures in Userforms from the clipboard 188
100. Make your own tools for forms 189
101. Using invisible objects 193
102.1nitialize Listboxes, Comboboxes with Months
via GetCustomListContents 194
103. Using MicrosoftVisual Basic bookmarks 195
104.VBAArray 196
105. Ensuring users don't open your workbook with the shift key
down to prevent your macros from kicking in! 197
106. Bulk Removal of leading apostrophe 200
107. Multi-select offset 201
108.VBA Boolean test 203
109.VBA Shortcut to fill ranges 204
1 1 0. Some VBA Shortcuts 206
1 1 1.A few VBA Keyboard Shortcuts 208

Index
209

12 This isn't Excel, it's Magic/


I actually learned Microsoft Excel on the Macintosh in 1 986 or so, using
version 0.99! When the real version (1.001) shipped, I read the manual (yes,
Excel came with manuals then) from cover to cover. Six times. Especially in
order to learn Data Tables. I just didn't get it. (Okay, so I'm a geek. Actually, I
once heard that you're a geek if you double-click the TV remote)!
Around 1 993 I received the nickname "Excel Trickster" from one Will
Tompkins, a real Excel Guru. I got that because during a seminar he was
hosting in Washington, I believe, for what he called the Excel SWAT team, he
was showing his then famous Tompkins methodology - a macro structure
using Excel4 style macros (beforeVBA existed in Excel) which was quite
sophisticated. It may have been Excel 3, I really don't remember!
In any case, he showed a line of code which used a range name, a label,
and he wanted to show us the code at that label. So he used Edit/Goto, and
we saw literally many hundreds of defined names which he had to labori­
ously scroll through to get to the one he was looking for. After he had done
this about 4-5 times, I raised my hand and said, "You know, you can get to
that label directly.Just press Ctrl/[." He tried it and was flabbergasted! So he
tried it again. Then he remarked chat I just saved him about 2 hours every
day scrolling through his defined names!
When I also told him you could return to the location you were just at
by using Ctrl/], he called me the Excel Trickster, and that nickname has stuck
with me ever since. So thank you,Will.
I've been the contributing editor to Excellence and The Expert maga­
zines, monthly 1 6-page publications for about 8 years (they no longer
publish), and I've led a few sessions at Microsoft's Tech-Ed on tips & tricks
and on array formulas. I've also been an Excel MVP for Microsoft since chat
program's inception -this is an acknowledgement for people who contrib­
ute answers on the online newsgroups, and I currently lead an online Master
Class in Excel which is twelve 3-hour sessions (details can be found at http://
www.iil.com and clicking on "Live Elearning").
So, over the years, I've gathered many tricks and I decided to put them
together in this book.And in no particular order! I hope you enjoy them!

This isn't Excel, it's Magic! • 13


1. Using Advanced Filter to another sheet
Advanced filter can only filter to the active sheet.
The active sheet can pull information from another sheet, but it cannot
" "

"push" information to another sheet.You'd get this message:

l8J
---

Microsoft Excel

� You can only copy filtered data to the active sheet.

But by using the Advanced Filter on the Data tab: [Excel 2003:
Data iFilteriAdvanced Filter]

r Data l
rrp
Home Insert Page Layout Formulas Revit

lillJ 7
(llil Connections � Cl.:ar

·rnaI

Refresh
All•
�Properties

�-:J Ed1t lmks


X� Sort Filter �
�Advanced�
'{<> Reapply

Connections Sort & Filter

you can pull information to the active sheet:

A I B c D E

��
1 -

1\dvance<! Filter
2
3 Action
4 0 Eilter the list, in-pla.ce
5 0 CQPY to another location
6 b_ist range: I=Range2 t�I
7
8
Criteria range:
1�1
9
Copy to: ISheet l !$A$ll
10 � Unique tecords only
11
12
OK ]I Cancel ]
13
14 This isn't Excel, it's Magic/
Range2 is a range defined on another sheet.The sheet we're filtering to is
currently empty.
After clicking OK (notice the "Unique records only" is checked, above):

A I
!_]Jared
B

2 1Fred
3 Stefanie

Judy
4 Bob
5
6 Alice
-
7 Jared
8 Kate
q

This isn't Excel, it's Magid 15


2. Select all O's or Select
all specific keyword
Suppose you had a worksheet which looked something like the following,
and you wanted to select all the cells containing the word "amounts":

A B
u2
Description____

m35-c summary input


_

--

3 m35-c gl �coun�- -­
4 I
[
m35-c gl description
5 m35-c amounts
6 m35-d description I
7 m35-d summary input [
8 m35-d g_l acount# !_
9 m35_.:<!_gl des�ption I
_
10 m35-d amounts I

11
- m80 gl acount# I
12 lm80 gl description _ I

I
<:...
::..:.
.:.:._: .:..._ _

13
-- m80 ye balance
14 m80 amounts paid after
15 m8�g� count� ---•
_ --- -
16 m81gl description !
17 m81 ye balance
i81 m81 amounts paid after
19 m 82 g�count#-··---•-
' _
20 m82 gl description I •

21 m82 ye balance
- -
22 m82 amounts paid after
23 m83 gl �count#
-·---:
24 m83 gl description I
·-

You can't do it with FS/(Goto) Special and use features there, but you can
use Excel 2007's Find All, with a twist...

16 This isn't Excel, it's Magic/


If you use Home tab, Find and Select from the Editing section, then Find (or,
simply press Ctri/F): [Excel 2003:Edit!Find)

-V �
..
I: ..

..
[il· Sort & Fihd &
a· F il ter y Select ..
, ..

=I �
Find...

= e�e I ,Beplace.. .

� Go To ...
-
Go To Special...

Form ulas

- Comments

Conditional Formatting
Constants

Data Validation

� Select Objects

�I Selection Pane...

type in "amounts" (without the quotes), then click the Find All button you'll ,

see:
. '

Fmd and Replac


e
Fin!! ] R•l!l��<e l
Fi!)dwhat: Iamounts!

Options »

F[nd All
I I Eind Next I Close

Book S heet

hydr adienton;;Ja�zermap2 .xl$ clior.t org•nl•.,. to ewp


client organizer to ewp
$9$10 m3S- d •mounts
hydradlentorganirermap2.xis $8$14 mBO amounts paid after
hydradiefltorganirermap2.xis client organizer to ewp
eli� organizer to ewp
$6$18 m81 amounts paid after
hydradiemorQanirermap2.xls $6$22 m82 amounts paid after
hydradlentorganizermap2.xis dient organizer to ewp $8$26 mB3 amounts paid after
hydradJentorganirermap2.xis ctiert organizer to ewp $8$30 m81 amounts paid after
diest organizer to ewp
cliett organiw to ewp
hydradientorganizermap2.xis $6$34 m8S amounts paid after
hydr•diemorQ•niu!rm•p2.xls $6$38 mB6 •mounts paid •fter
hydradiemorganirermap2.xls client organizer to ewp $9$42 m87 amounts paid after
hydradiefltorganirermap2.xis client organizer to ewp $9$46 m88 amounts paid after
hydr•diemorQaniwmap2.xis client organizer to ewp m89 •mounts paid after
cli ent organizer to ewp
$9$50
hydradientorganizermap2.xk $9$51
.... .... �...........v
A:.-.,... ....--.
... ....., ...... .f.O.t-C'O

� ����� ��� ����.,..'
j'iicell(s) found

This isn't Excel, it's Magic! 17


Here's the twist: instead of selecting the items in the found list, you can
use ctri!A (or shift click the last item in order to select from the already­
selected item through the item you're now selecting, or even ctrllclick to
select specific items), and all items selected in the list will also be selected
in the worksheet:
" c D F G H J
O..:.C.iptiel'l
mlS.cw....•'Y . ft�,ut
MlS..c:tl �C.YM.
nOS.c ,, 6Kaf,tio-n
lft3:S-cIMOUntl
"" ,_,
nOS·-4111 c1Htf1p*
nOS-41 �Uttt.nUI)' ln�n
��� �--�--------------------------3,·
m3S• glIC'IOU..

n1JS4 glltW
l ip•ion
m)S,4 UIIOV1'111
n.O sl Ue ll ntl
n180 Jl dHUiplion
n1180 �· h•J•not
m80 lm ountt ptld'""
ni81 tl �e.unt.f
nt81 tl dtsO"fpllon
nl81 ye b t
.s a.n
e.
n.S t emountfpeldel\er
nt82 gl �eount *
n8
l 2 gl dowlptlo*'
nl82 yo h.tlinet
ru82 •mounts paid tftet
m8lgl•eountk
m83 gl dewlrtlon
m83 ye b 6 1 anc
t
nl8) trnountt poht after
n.&• gl•eount.f
_,, -· ..............

Now, when you close the dialog box, the cells will still be selected!

Now, suppose your worksheet looks something like the following, and you
want to change all the yellow cells to be bold (and still yellow):
A
1 Form Name
2 FORMS471
3 FORM5471
4 FORMS471
s FORMS471
6 FORMS471
7 FORMS471
8 FORM547l
9 FORMS471
10 FORMS471
11 FORMS471
12 FORM5471
13 FORMS471
14 FORMS471
15 FORM5471

16 FORMS471
1
17 FORM 5471
18 FORM5471
19 FORM5471
20 FORMS471
21 FORMS471

18 This isn't Excel, it's Magic/


Selecting by text now won't do, but there's another feature of Excel's Find
command: Find by Format. Note the Format button at the top, (you may
need to click the Options button):

Fin!;! R.egjace

Find what:
I�:-I ----- �� �
� � I No Format Set I '[ f;�.rm.a_t,., )
-:

Witbin: Sheet 0 �1ati::h £ase


Search:
;==
By Rows :::;;
0 Match entire cell contents .

�ook in: Formulas

When you click this, you'll see:

�im�.rm!!! · ·

-:��
fjiU«,;��:JI Alignment II FOnl I Border l ! Fill IProtection l
Category:

-' [
l
G eneral "
Sample
Number
Currency
Accounting pecifte number form at.
G eneral form at cells h ave no s
oate
Time
Percent�ge
Fractton
Scient(fic
Text
Special
Custom

I Clear
l
I OK
-···

Choos e Format From Cell . ..


I [ 'II I Cancel
I

This isn't Excel, it's Magic! • 19


I n this dialog, you can enter all the properties of the formatting you're go­
ing to want to find, but there's also an easier way: click the bottom button,
"Choose Format From Cell. . . " When you do this, you'll see a special cursor
which looks like the regular cell-selection cursor but with an eye-dropper
next to it!
When you click on the cell containing the format you want to find, you'll
then see a preview of the formatting in the dialog box, and you can combine
this with text to find as well!

Find and Replace

Find J Re12.lace j

FiQd what<
Ef b
c =--- P_r_e_v_ie_w_"' d
---=:::l L:::f.:gioi�C::.::J •

jsheet r rvlatch �ase


Within:
3
r !VlatGh entire cell·contents
J.sy Rows
Searcli:
2J '

.
Look i(i: ]Formulas
a Options<:<

F[nd All E.ind Next J Close

Here's the result:

A B c 0 E F G H
lForm Name
-

find and Replace


2 FORM5471
FORM5471 ��
FORM5471 Fil!!

j[ Format .. ·J
FORM5471
FORM5471 Fi�d what: '-----'-"v.ll Preview�

FORM5471
FORM5471 vI 0 �tch £ase
:====='=:;
v _l 0 Match entire cell C!lntents

vi [Opljons I
«

Fr>d AU I !1 e;nd Next Close

16 FORM5471
17 IFORM5471
18 FORM5471
19 FORM5471

21 FORM5471

20 This isn't Excel, it's Magic!


3. Cut/Copy, Insert Paste
by dragging borders!
In order for this tip to work, you need to have the setting checked for
Enable fill handle and cell drag-and-drop turned on (which is the default
setting anyway). Office button, Excel Options, Advanced section, as shown
here: [Excel 2003:Toolsl0ptions1Edit!AIIow cell drog and drop]
------- ------- -----
Ex
cel Oplio n s

.-- ------, -
Popular
I][J Advanced options for working with Excel.
Formulas

Proofing Editino options

0 Afttf prenino Enter. move selection


' e� _j OJrectlcm: IDown vj
0 Autom1tle�lly i nsert• .stedmal point
Advanc

r1
Customize

Add · lns .,0 E.nob lt fill handle a n d cell grag.and-drop

Trust Center /.0 0 alert before overwriting cells

It]
Allow 1dlting directly in cells
Resource s

Enabfe autom atic percent entry


Extend data tange fo1mats and formu!as
0

0 Enable &utoComplete for cell values


0 60om on roll wtth IntelliMo use
0 Alert the user when a potentially time consuming operation ocrun
When this nymbtr of cells (in thounnds) is affeded: 133554 :I

To cut and paste a range, select it and drag the border (the cursor will
change to a cursor with a 4-headed arrow).
To cut and insert paste a range, drag a range by its border and the shift key
held down.You will see an indication of where the range will be inserted:

1
A
36
B
45
c
1/1/2003
L
2 40 50 2/1/2003

3 44 55 3/1/2003
48 60


4 4/1/2003t
'
5 52 5/1/2003
6 56 6/1/2003

The grey line indicates where A1 :C2 will be cut and insert-pasted.The intel­
lisense shows that the new location will be at AS:C6.
If you hold the ctrl key down with either of the two action s above, the cut
becomes a copy.

This isn't Excel, it's Magic! 21


4. Use Fill-handle to insert or delete rows
Did you know th at holding the shift down while using the fill handle will shift
cells? Well, now you do! Let's take a look.

1 . Hold shift key while dragging Fill Ha ndle.You will see a new shape to the
fill handle, a split vertical 2-headed arrow.

2. If drag down you will insert rows


3. If drag up you will delete rows
4. If drag right you will insert columns
5. If drag left you will delete columns

22 This isn't Excel, it's Magic/


5. Shift/find finds backwards
This is great for finding the last department in a list, for example:

A B I c --L---=:.
0_J. . __
I _:e::...jl...
....J F .--...: _i_:
1 Department
2 Acctg
3 Acctg v��..,
.. = � __,_
_ _ __•niOI'

4 Acctg

-2!�!1,!!-,�P.,�
£!51..

5 Acctg Fins[ 1ReQiace1
6 Acctg
FiQdwhat: .-l-
A c-t�
gj ----�-
.= 11 Previe·:., .. I [
7 Acctg
8 Acctg
9 Acctg !sheet C::}} 0 ch !;,ase

MatcH tire_cell cQ.ntents


i :
Witb.n
'10 Acctg _
�:

"-i
� ;,
� ,
S,earch: :=
�Rows
r.;:==== W _ 0
,11 Acctg
!,ook in: (Formulas �
..

-12 Acctg .
-

:0:13> Acctg
-

·14 Acctg
l F(nd All ]1 _ ��Next j
lS' Acctg
-

16 Acctg

How can you tell where the last Acctg department is? Use Find & Select from
the Home Tab (or ctri/F), and before clicking Find Next, hold the shift key, and
you're there in one click!

This isn't Excel, it's Magid 23


A B c E

Fing ReQiace

Fi!ld what: IAc_. c_tgj�------------


�...

271
272
F[nd All J ( __Eind N�xt J

Department
. . .1:-- 1""\-.-. ........... _ ._... 1- -- ---- ·-
I
r

You can use a wildcard to search for anything backwards, so starting from
cell A1 , you can find the last row or column!


£!!t
�.!!!J.d Rep�£!!,�,.,��
..

F"''! L ReQ!occ}
,- iQ<:I
F v.t.at:
From cell AI. finding an� backwards and

selecting "By Rows'' will select the lost row
(Excel's ctrVend is often too far downl)

-
Then. reselecting cell AI and changing the
wt!!On: Shett dropdown to "by columns" will find the lost

�rch:
. used column!

�ooi<irl;
��_J
I Ffld AI I I fi>d - Closej

24 This isn't Excel, it's Mogicl


6. Combining cells with
Paste Special/Skip Blanks
You've seen the Skip Blanks feature in the Paste Special dialog, but do you
know how to use it? It refers to the range being copied-blank cells in the
source won't erase cells in the receiving range.
Exam ple:

A1 :A7 has a,c,e,g and B1 :B7 has b,d,f,h:


Copy B1 :B7, select A2, Right/Click, Paste Special

1 a
A 1_ __2l
:b
__ _J' c
I D I
. '

2 � '

3 c � Cut
-

4 Lt!l f:;opy
5 e �� faste
6 I Paste �pecial... I
7 g Insert Copied C_tlls...
8 Delete...
9
Clear Contents
. ,..

with Skip blanks:

A c 0 F G
1 ....
....;.
.- -.;... �--:
B E H
a
:-
:b- -

2
1,!d : ------

L..
c Paste Special �I:RJ
3
___
:
4
' '
• ' Paste
'

5 e :t 0!!1 0 AI u.ing Sou"ce tl!eme


6 0 AIe11cept borders

' OE«.-.Jas
0:talues
7 g
0Colo.mn !f!idhs
---<


8
....... ..................
0Fetmats 0 Fotrr..Jias and r.Jmber formots
0 Vaii!E's and nl.lllber formats
9
0 !:_omments

10
0 ValldatiOQ

11 Operation

12 0NQne 0Mu�iply
13 0P4d 0Divide
14 0 S.Ubtract
15 0 Transpos!l_
16
17 ][
-

[ OK Cancel
18

This isn't Excel, it's Magic! 25


Here's the resu It:

i 1'!j..
t_:!\;::..-..
. k...____(j .c��

'
2 b '
-· --

'
3 c d
'
4 d '
--
·
'
--

5 e f t,
'
__ __

6 f --
: --

'
7 g h
--- .........J ___

8 h

9_
1('\

26 This isn't Excel, it's Mogicl


7. Right-click drag the Fill Handle
for several options
If you use the fill handle and drag with the right-mouse button down, you
will be presented with a dialog containing several options when you let go:

A E
.
tI F
45
±I - ---- -

36 1/1/2003
40 50 2/1/2003
3

I Fill
-

4 ·-
.
Cop� Cells
.
. -
-..

5 �eries

6 Fill formatting Only

7 Fiii1Nith.Qut Formatting

s I Fill Days
9 Fill �eekdays
10 Fill Months
n-

12 I
Fill Years

I

13 I .blnear rrend

1 I !;iro.,.Jth Treno

I S�ries...

This isn't Excel, it's Magid 27


What the original selection contains will determine what options are
available in the dialog:

A B c D
1 36 45 1/1/2003
2 40 so 2/1/2003
-
3
4 �opy Cells

5 Fill �eries

6 Fill formatting Only


7 Fill WithQut Formatting
8 F111 0,; ·s
9
Fill W.:ekday:
10
F1ll Months
11
F111 Years
12
13 1inear Trend

14 Growth Trend
15
--
S�ries...

Notice that in the first example, dates were selected, so the middle sec­
tion of the dialog (filling dates) is available, but the second example has the
middle section disabled because dates weren't selected. The Fill Weekdays
option with dates selected can be quite useful:

1
A
36
B
45
c
1/6/2005
I
2 40 50 1/7/2005
1/10/2005
4 1/11/2005
5 1/12/2005
6 1/13/2005
7 1/14/ 2005
8 1/17/ 2005
9 1/18/2005

Cell C1 's fill handle was dragged down to cell C9 with the right mouse used,
and Fill Weekdays was chosen. Notice 1/8,1/9, 1/1S,and 1/16 are missing,
because they're weekends.

28 This isn't Excel, it's Magic/


8. Defining names for large
non-contiguous ranges
If you need to name a multi-area range, you're limited to about 255 charac­
ters in the definition. This can cause problems as seen here.
In this worksheet we want to give a name to all the cells containing values
so that it's easy to clear them or add them up, or refer to them in some way.

A 8 c D E F G H
1 Data: 2
2
3 Data: 21 Data: 27
• •

4 •
5 Data: 25
6 Data: 12
7 Data: 14
8 Data: 89
9 Data: 63 Data: 8 1
10 Data: 50 Data: 70
11 Data: 33
12 Data: 88
13
14
15 Data: 30 Data: 105
,....- • >�] This tab has a

Also notice the tab's name is quite long.


Okay, we want to name the cells, so we select them first (it's easiest using
F5, Special, and making this selection):
------
Go To Special �
Select
0 �orrrnents 0 Row differences
0cqnstants 0 Colum differences
OEonnulas 0 erecedents
01'1\Lml>ers 0 Dependents
o--·· ·1
fig�, C•ecl nl

0Log_icals 'lle-�ls
0�rrors 0 lait cell
0 Blan!!,s 0 Visible cells onl:,:
0 Current region 0 Condi{ional formats
0Current �ray 0 Data yahdation
0 Ot!jects AU
Same

II OK J I Cancel J

This isn't Excel, it's Magic! 29


That is, we're selecting constants which are num bers (not text). Then we use
Define Name from the Formulas tab. [Excel 2003:/nsertiNameiDe(tne].
But you'll find that if the resulting name was too long. then Excel won't even
bring up the dialog! You can name these cells most easily, though, by using
VBA! Press Alt/F1 1 . getting you to the VBE (Visual Basic Environment), then
Ctri/G (the immediate pan e) then type this exactly, and press enter:
,

Selection.Name = "MyData"
Then Alt!Q will bring you back to Excel. Now the name MyData will accu­
rately refer to the desired cells.

30 This isn't Excel, it's Mogicl


9. What is that : 1, :2 ...
I see in the workbook title?
The New Window button from the Window section of the View tab creates
another "view" of the same workbook: [Excel 2003:WindowlNew Window]

View Developer Add-Ins

� New WindowI S
q 89
El

Zoom
[] �
Zoom to
9 Arrange All """"
-··-··
.JJ
.d! EQ
Switch
Selection � Freeze Panes •
100% Save
L1 3!1 Workspace Windows •

Zoom Window

You can use it to:


•View separate sheets of the same workbook at the same time:

Al f,. =Sheetl!Al

BooloS:l ® 800�'6:2
A B C_l 0 -1-
- .::.
E_.!_II'-+--=
A-.J-�B_L__:::._
C _!_
__;_
D _::
1 Cool!
2
1-=---p;:
::::.:.-.
Cool!

3 3
4 4
5 5
6

:
6

9
:1
9
1
0 1
0
ul
• >t1 Sheetl/
=""""::::-:-
" """'"--,;
Sheet2""' She
etJ
,--
0
---� i Jl 1
" •
'-=�
"'-'-
;;
· ;;;
·�
..,.
; ,.e,

LJ�sn�
e�
e
-
u=�
;
� �
s
h
!!§
ee
�t
�2�
Lj
=stl
�!!
!j
�!J
!:=:
:=

This isn't Excel, it's Magic! 31


• View the same sheet but remote areas simultaneously:

Al • fi< Cool!
@ Book6:1
A I B c D u v
!
1 cool! I •
99998

3

9.:
99
:: �
9:..: :
100000 Cool!
4

• View formulas and values simultaneously:

Al ... ( .,
/x =Sheetl!Al
@ Book6:1 - 1::1 X Book6:2
'
I B
1 c 1 lrr1 =Sheetl!Al I
t;E
A D ..... A
1 !cool! I
2

-
=
2
- =

3 3
-
4 '-- 4

----1
5 5
6 6
-
7 7
____,
8 8
9 ... 9
I � 4 � �mSheet2/ ShelT
rH..,.J 1tdl
.- I� �. � ��;3 Sheeq.Lsheet3
To rejoin the windows, close the window by the "x" in the upper right, not
by Office button/Close, [Excel 2003:FileiC/ose] because the separate windows
would save and reopen that way.You can use New Window many times and
get as many windows as you wish of the workbook.

Think of it as if you were looking out your physical window and seeing
parked cars. Now move to another window and look at the same cars. You
have a slightly different perspective of the same object.That's kind of what's
going on here.

32 This isn't Excel, it's Magic/


10. Double-clicking tools
Double-click the format painter keeps it "alive" to click on several cells
without having to click it again.
You can no longer double-click Shape tools - But if you right-click a tool,
you'll see an option to "Lock Drawing Mode", then you can draw several of
the same shape without revisiting the tool [Excel 2003:Doublec/ick the shape
from the drawing tao/bar] (From the Shape button on the Insert tab):

Formulas ... Data


,

Insert \ Page layout Review

I � �� � �t, b�
Clip
Art
s.hapes sma�rt

...
�0.1�:�rifi. ��._!,!,•

.
Ba
'

.s

""- '\, '\. L_ L. i... ( 4 � �''- G �


l Rectangles_
OODOQQQQQ
_________
Basic Sha.!:..pes=----

� 0 6 � 0Q O G Q 0 0 ®
® 6C> O D IF CS � OO I3 Bl
D @@ tru Q © <V � ·�· « (;J \
( ) {} ( ) { }

Press the esc key to stop that feature or click the tool again!

This isn't Excel, it's Magid 33


1 1. AutoSum Tool features
Suppose you have a block of cells like in this illustration, containing numbers
which you want to enter the totals both on the right and below; that is, in
E1 :E7 and A8:E8.You'd probably do it something like this:

A 8 c D G
•--w------. -
1 65 30
2 84 85 87
3 14 69 78 97
4 88 42 71 6
5 5 32 71 62
6 57 47 65 2
7 50 5 63 92
8

Click in E1 and click the Sum tool (on the Editing section of the Home tab)
[Excel 2003:Sum too/bar button on Standard Too/bar]

[�� u �
Sort & Find &
Q. y Filter y Select y

Editing

1 . and press enter, or double-click the Sum tool.


2. Click the fill handle in E1 and drag to E7, or double click the fill handle
in E1.
3. Select cell AS, click the sum tool, enter the formula, select the fill handle,
drag to E8.

Hold on to your hats. It can be done in one click:


Make this selection as shown in the illustration:

i A B c D E
1 65 54 30 46
2 84 85 87 74
3 14 69 78 97
4 88 42 71 6
5 5 32 71 62
6 57 47 65 2
7 so 5 63 92
8

' '

34 This isn't Excel, it's Magic/


Select an extra blank column and row.
Click AutoSum Tool once and you're done!
I know . . . you have to try it!

Next, if you have a multi-cell selection, as in this illustration:

A B
1 60 60
2 54 66
3 58 28
4 57 16
5 9 14
6 91
7 34 29
8 70 16
9 62
10 70 7

11 66 68
12 95 77

13 76 13
14 46 81
15 32 70

16 18
I

A single click of the sum tool will put the correct totals in!

A B J
1 60 60
2 54 66
3 58 28
4 57 16
5 9 14
6 238 91
7 34 29
8 70 16
9 62 320
10 70 7
11 66 68
12 95 77
13 76 13
14 46 81
15
.

32 70
16 551 18

17 I 41
33

This isn't Excel, it's Magic! 35


12. Change dates like 20050923
to one Excel can "understand"
Suppose you are looking at a worksheet which contains dates which can't be
formatted as "real" dates because of their structure:

h
l l A
1 20050923
2 20050930
3 20051107
4

Select the date(s), and use Data tab, Text-To-Columns, [Excel 2003:Data!Text
to Columns]

l Review
���
Data View Developer Add-Ins

V.. Clear ffi-:.I 1�1 Data Valida�ion "'

'"{v Reapply � Ef:c Consolidate


Text to Remove . s"'
.�Advanced ,Sol� !!ms , Dup licates � Wh at-If Analysi

Iter Data Toots

which brings up the Text-to-Columns wizard:

C!J.fll(ert Text .to ColiJmns Wizard. - Step1 .of 3. 0Jii'J


The Text Wizard has determined that yoor data is Delimited.
If this is correct, choose Next, or choose the data type that best deS<ribes your data.
Original data type
Choose the file type that best describes your data:

0[
§
iiiT,i��1 -Characters such as commas or tabs separate each field.
0 Fixed \:)!idth - Fields are aligned in columns with spaces between each field.

Preview of selected data:

tl-�0050923
� 0050930

��0051107
ri­

[ ll f!!ext > J! [ finish
Cancel
II < B<;d<. I

36 This isn't Excel, it's Magic!


Even though the dates are fixed width, in this case you can simply click
"Next" twice.
In step 3 of wizard Select Date,YMD:

.Convert Text to Columns Wizard · Step 3 of 3 ��


Tt-is screen lets y(ltJ select each cobnn and set the Data Format.
Cobnndata fOI'mat
O�al
'Genetil converts runenc vakles to runbers, date v.....,. to
Orext dates, and al remaining vakles to text.
1Advanced... 1
O£stnob01'1: MYO t�I
DVM
Data erev'L.!YD-"'M"'-----1

Cancel I[ < !l_ack Next >

If you click Finish now, the result will replace the dates.You can select an­
other destination cell:

3 - - @�
Column dMa format
0 l:ieneral
Orext
0Qate: � v

0 Oo not �t cobm

Here's the result:

A B I
1 20050923 9/23/2005'
2 20050930 9/30/2005· .

3 20051107 11/7/2005'
4
c;

This isn't Excel, it's Magic! 37


13. Allow only unique entries in a column
Use Data Validation from the Data tab: [Excel 2003:DatajValidation]

�� ..J (d �� .
8ool:6 • Mlcrosort Excel
""'

"

� R
t\
1 V
t\ Add-Ins
Hom� tnstn Formul.ls Data
.:.:..:.:.;
· � ; ,;,;;;,;.�
V
1
tv1 OtvtlOPtt

-:J• sll � Coontchons Ot�� )tl !'!i_� �Data Vall�atoon


�I 1m ')[ \


A

,. 'ttpp., � : tr [to Consoli�•••
Gtl e<ttrnal Rtfrtlh
Oitll "' All· � clltlrnts �I Son fllttt
'!.1Ac!Yan<td Columns Duprocotts � Wl\at-h Anat/111
TtJ<tlo Rtmovt

Connections Sort & F


lttt
t Oata Tools

81
. \. I
I• Cln contain only unique values
A 8 c D F G H

with a custom formula like


=CO UNTIF(8:8,8 1 )= 1 :

81 /x Can cont
a in values

E F G
1
2 -------
3 Data Validation --- --��
4
setltn!l> InPut Me
ssaQe Error Al
ert

V.tlid.!Jtion ateria

lL:==-
Cust
=""' "1 ���·!llrt
-'
--

--

1-<.B...-u( :B,BJ)=JI

17

Remember the COUNTIF function-its syntax is =COUNTIF(Range,criter


ia).With all the cells in column 8 selected, this formula returns TRUE only if
the COUNTIF for all of column 8 (the range) contains only 1 value of"Can
contain only unique values." If you were to select 82 at this point and reex·
amine the data validation formula, you'd see =COUNTIF(8:8,82)=1.
Let's enter 1 in cell 87 and see what happens:

38 This isn't Excel, it's Magic/


0 This value has a!re.ady been entered I

·''R
:"
·
�t;;···j
... [ Cancel I [ tiel� I
The message appears because the data validation for cell B7 is
=COUNTIF(B:B,B7), which returns 2.The message comes from the error
alert tab of the Data Validation dialog:

J�)�
.-
-
---.-� ·-- -
P.�!.�X�!i��t.!.�; ·
·· ·

.-
·-- -·
---..

Settings Input flilessage i Error


... . '
:··················Alert
.. ....

;
,.............................

0 Show error alert after invalid data is entered


When user enters invalid data, show this error alert:

St:!le : T tle:

!
i
stop
Sl
Error. message:
This value has already been ""
-

0
entered!

v·'
-

[ Clear All
I I OK
I[ Cancel
I

This isn't Excel, it's Magid 39


14. Right-mouse/drag the border
of a range for several new options
If you right-mouse drag & drop the border of a range to a new location, then
when you let go of the right-click you're presented with a dialog containing
many options:

I J .E
-
1 1
A B 0 , 0

45

II
1 36 1/1/2003
2 40 50 2/1/2003
3

!-
4

lI
5
6
7.
.� _J_;
veHere

p
y Here

8
9
I
I
E" ��opy H.�rt�.. .Yall.l � S.:QJ.lly

Copy Here as tormats Only


]
10
·:. link Here
11
Create !::!Yp erlink Here
12 · I I_ �hift Down and Copy
13·

-
Shift Right and Copy
14
15 I Shift Down and Move

16 Shift Right and Move

17 C�ncel

If you drag a range this way and before letting go you drag it right back to
the original location. you will still be presented with the above dialog, and
this way you can copy/paste special values in place with the m ouse.

40 This isn't Excel, it's Magic/


15. Shift/click inner VCR controls
I n the tab VCR-type scrolling controls,

I i
-

23 I
24
- I l
25 I ! I

_

26 l l
� Sheetl..(shee.�fj?Sheets.,.tb:/
���1
Ready Num Loci< e:J-f

If you hold the shift key down while clicking one of the inner two controls,
you will scroll a "page" of tabs (all the tabs that are viewable) at a time
instead of one sheet at a time.

This isn't Excel, it's Magid 41


16. Using Pictographs
Anything in the clipboard can be pasted onto a chart

3.5

2.5

1.5

0.5

1 2 3

Clicking on the coins, copy (ctrl/c), click on a series, Home/paste (or ctrl/v):

3.5 .------
3 +-- -
--,------- - -- --- -
2.5 .J-
- -- ---- - -- ---.!..,L
- - -
-I-
2 - -- ----.,.---- -JI.t.
� � -
1.5 +-- -- ---�A-- - --.L.(!l...:.-
..-- 1. Seriesl
1 t-�-=------Lm,v----�..4---

1 2 3

42 This isn't Excel, it's Magic!


Right-dick on the series, use Format Data Series:

s.s -
..-- ---------------
3 t-
- -----
------ -- --·--.-- - -
2.S t-
----
----
- ···-
2 t-
- -- -- - .- - --� � .
--
---�·r·
1.5 +-
- -- -- --.-!!}-- ---G:
1 t--.--
- ---�-1':(!fr.===ililbt:=:.___,
0.5 +-- Q�ld�

0 -1--
- __, �rl
R to M! t ch Styl �

ill Chang� S�rie1 Chart T� e


I 2 •..

r------l !1l} Stt•a Oata_.


Oati Lall:�H
-
4<t a
,
Ad d Trtn dli n t

f o rmillt Oat-a 5-tri es


•. •

•.•

Click these options: [Excel 2003:Patterns tablfi/1 Effects]


� -
J
� ��1:
Fill
seriK Op

� nt
·
0 S,elld M
I
FJ
ector
0 C10 ftl

0 G-od.,.tNI
Onrd�

Border SWAct
0 e,t11Jrur texb$e ffl
Sh.'ldoW
0 Ay:IOflliiiC
J.O fiOfti\Jt 0 lrlw:•tifnt:'];Jii'IC!
0 't.•-v cdf.Msbypoir.t
Tcxlyrt:
IM
tt ! cm�
c

I !Je...
I I Q¢o
W"
d
I I Clip Att... I
0 ...1<11
0 Sl><t
0 SUCk<it!dScU �., D ts
ISI! lv.":
'()le

I
I
Ir�ttCY:
l.:l '
l. !0% ��
,.

! a..

I

This isn't Excel, it's Magid 43


There are 3 format options:
1 . Stretch (default)
2. Stack
3. Stack and scale to
If we select Stack, we see:

3.5

2.5
2
1.5
,

1
'

0.5

0
1 2 3

If we select Stack and scale we can enter a number into the Unit/Picture
,

box. Again, this is something you can experiment with.

You also may have noticed these optio ns in this dialog:


•Gradient fill
•Picture or texture fill
•And others
Here's the gradi ent option selected and the Preset colors dropdown:

Fill
0 ttofl
0 :;oldtil
0 �-fil
0 ew:ture ot teXVe II
0 Apma11<

D x•rcolnbr...,.
0 flwuta""9"""'

l'$<:

(!<<<ton:

At'lfJit!
Gridentstops �;;:, ,.--.,
(stot:� 1

�or:

44 This isn't Excel, it's Mogicl


The new chart:

�-
3.5

2.5

1.5

0.5

1 2 3

On the picture tab there was a button to select a picture-you can use any
picture you have on your computer! You can experiment with the other tabs
as well.

This isn't Excel, it's Magic! 45


1 7. Wish there were a "No to Air'
when closing many files?
There is!
Hold the Shift key when clicking the No button and you won't be prompted
to save changes on any workbook!

Microsoft: EKcel

& Do you want to save the changes you made to 'Book3'?

,
I I
yes
Yes To All No Cancel
HH···· ......... .

.............
.
.
. ................

46 This isn't Excel, it's Magic/


18. Quick return from FS(Goto) . . .
The "return" address of the last range you visited via another FS/Goto is
stored in the Goto dialog, so to return quickly, use the FS key and press
Enter. Actually, the last 4 addresses you've gone to are kept.

This isn't Excel, it's Magid 4 7


.19. Split Bars
Did you know there are split bars in Excel? They're here:

�Book2 - 1:1 X

I La c

A 1
1
-� l I
3

4

5
6
7
8
9
10
11
,.

You can click and drag them into the workbook or you can double click
either one to split the window in half.
Here's what it looks like when both split bars were double clicked:

@sook2 - c X

A � B c 0 E F G ' I"=
Ci:i 1 -'Iii
21
3 .
4
s
6
7 1

' • I ..::

I
8 -


9
10

J
11
12

.
13
1� I
.
"'

i
, .�· • •••I Sheeul sheet!r(rw. '
.•.

Here's what it looks like when the intersection of the 2 split bars are
dragged up and to the left (before letting go of the mouse button! ):

48 This isn't Excel, it's Mogicl


\!1 Book2 - 0 X

1 1::=! B I c 0 I E I I G I
F 1':
iii
2
3
4
s
-

1 .::
8 -
9

�•
10
11
12
13
\--
14
..>.<
� + �

14 4 � "' Sheet!� Sheetl!,cl ua.-1 ij Ll. 1-r•�

Of course, you can also do this from the Split button in the Window group
of the View tab:

� New Window 13 jJ El
i3 Arrange All '::: ldt EQ
Save Switch
(f) Freeze Panes L:] �
Workspace \h.lindows T

Window
If the cursor is anywhere other than column A or row 1 , the splitting will
occur to the left or above where the cursor is. lf you double-click the inter­
section of both split bars if they're both present, they will both disappear.

All of the above you may have known. But did you know that the VBE also
has split bars?

I(Generof) iJ (< Declarations ) -

-

This isn't Excel, it's Magic! 49


Here's an excerpt from a very long routine and where the split bar was used
to help align the If statement with the Else statement since there was a lot
of nesting of statements:

3 jeattA1b
n: Ht·.Find(Ht•f & "." lookot::xiPoJ·t).Row
, 'On A1
If n : 0 Then 'no ".xxxx"
�: _J
n : Ht·.Find(Ht·f. lookot::xiWhole, Aftet·::Hr.Offset(Hr.Cells.count - 1).1
I f n : 0 Then

GoTo 1
'··················end loop----------------·····
Else 'yes .xxx
With Sheets("Copysh<Zetl")
.Activate
.Unpt·otect
.Rows.Delete
Sheets("Al").Rong<Z("H4:H313").AdvoncedFiltel' Action: :xl Fi ltet·Cop�_J
Set Choices : .Rong<Z("A2". "A" &.Ronge("AlOOO").End(xiUp).Row)
Sheeh("Alb").Activote

You can see that the split bar makes the align m ent (since this author indents
code to align the statements!) easier to see!

50 This isn't Excel, it's Mogicl


• 20. Window/Arrange Tiled
(except this one!)
Here's the result of using View/Window/Arrange All/Tiled with 3 open work­
books: [Excel 2003:Window!Arrange/Tiled]


Arrange Windows

Arrange

0[!���1
0 HQrizontal
0 Vertical
O �ascade
0 Windows of active workbook

[_ o_K _;] [ Cancel ]

\!)Boolol - 1:1 X Book3

Ll A I 8 c D 1 E c D E

1I
I

2

3
4
5

:�I
9

�I A B c D E

2
u 1

17
18
li • � H Sheetl

But suppose you didn't want to include Book3 in the arrangement? Do you

]
have to close it or hide it? No, you can minimize it (click the leftmost tool in
the upper-right corner of the workbook: and it won't be
r:� X
included in the arrangement:

This isn't Excel, it's Magic! 51


@sook2 - "' X Book4
A 8 J c D E
1
I•
2

3
4
� 4
5 5
6 6
7
8
9
0
1
11
12

R u dy Num lock �

Notice Book3 is at the bottom left, not included!

52 This isn't Excel, it's Magic/


• 2 1. Adjusting Row Heights
for Merged cells
Excel has a bug when you merge cells and try to adjust the row height by
double-clicking the row separator. To see this, merge cells A1 :C1, and also
mark it as Word wrap. Now enter lots of text, then double-click the row
border between rows 1 and 2. Nothing happens. The solution is to make
some remote area as wide as A1 :C1 is, say cell AA1 , and in there, give it the
formula =A1,and also mark this is wrap-text (merge cells isn't necessary
because it's only one cell!). Now, when you double-click the border, the
cell AA1 is being used as the one to make the adjustment, and it looks like
you've got it working!

This isn't Excel, it's Magid 53


• 22. More Scrolling
You probably know that scrolling is ''localized". If your entire worksheet goes
from A1 :C1 0, the scrollbar looks like this:

� Book5 - c X·

A D �-
I 8 ..:.

1
.

1
2
3 -- - 1
4
5
6
7
Is
r9 I
l1o jz.,:. ! ,
r11 ]
__

_-
__

! _!,
1 12 I I
__

_i,
l_·- lll!
ru I
1 14 I l_,
rlS l JI
__

1
16 I
. --·
�--

� --i---''
17
Sh-
--
eetl
------ .......

But if your last cell was XX200000, it'd look like this:

54 This isn't Excel, it's Mogicl


� Books
I
JJ
A B.
I•

�I
4
5
6
7

8
9
10

rli
11

Notice the difference in the sizes of both the vertical and horizontal scroll ­
bars between the two diagrams. It gives you a hint as to the size of the
worksheet (a cute tip in itself, if you didn't know it).
If you simply scroll, you're somewhat restricted to the range where there is
data. This makes sense. However, if you do want to scroll faster, and outside
the range of the data, simply hold the shift key down as you scroll.You'll get
to row 1048576 or column XFD pretty quickly!

This isn't Excel, it's Magid 55


23. Drag/Scrolling
Did you know that if, in a large worksheet, you drag the cursor-that is, you
click in cell A20, for example, hold the mouse button down and then drag
the cursor beyond the bottom of the worksheet, into the area of the tabs
or over the scrollbars-the worksheet scrolls. But did you know that the
farther away the cursor is from the window the faster is scrolls?

I Ay_toShapes • "'-

__...._

If you resize the Excel application window (here you see part of my desktop)
and drag totally outside the window, Excel's worksheet will scroll very fast.

Did you also know that Excel slows down the scrolling (when dragging the
mouse) as you approach the end of the used range and pauses momentarily
when it reaches the end?

56 This isn't Excel, it's Magic/


• 24. Using the Justify command
What is this command, anyway? It's a way of reflowing text.You can get it
from the Editing section of the Home tab: [Excel 2003: Edit/Fi/1/justift):

I: •
...
A
�· 'Ef
""'"'

@:
� Qp
@ J.eft
• Hl:sheets ..
�eries...
Justify

O r from the Vertical section of the Alignment tab:

Number A6gnment Gnt Border FUI 11 ProtectionI


Text &gnment Orientation

tfOrizontal:
G
eneral v nj�· •



&
- t
k
_ ai
_ :
----
-- � L
-- o � ��
��
__
T

Bolt om -•
e
Text
X
t

Ll·

lo
Suppose you have text like this...
A l B E F G H J K L M
i time! forall &ood men to oomt to the aid oftheir party. Now Isthe tim� tot allgoodmen to come tothe aid ofthei rparty.
C 0
-

1 1.(
-N
- o""
w-
IS,..;
th
2

... and you want to fit it all from columns A:E, not A:K. Make the selection as
this:
.. B c 0 II F G H J K L I
Now is tht ume for all good rt1en to come to the aleortheir pany. Now is the time forall good men to col'ne tothe aid oftheir party.
o e M
1
2
3
4

This isn't Excel, it's Magic! 57


purposely selecting a few extra rows, then issuing the Justify command:

rl:sheets •

�tiltS...
Iustify

and the resu It is:

1 Now is th time for all good men to come to the aid


i
2 of their p rty. Now is the time for all good men to
3 come to tllle aid of their party.

4 I

just what you wanted. If you selected A1 :C2 first, you would see an excel
warnmg message:

A B c D E F G
1 Now is the time for all good men to come to the aicof their party. Now is the
2

3 ----
4 Microsoft Office Excel �

5
6 Textwl extendbelowselectedrange.
7
8 i oitJ I Cancel J
9

which means all the text won't fit insideA1:C2.1f that's o k with you, then
you'd see:

D Ais th
1 Now
B
time for all good
c

2 men to ccme to the aid of


3 their part. . Now is the time
4 for all gocd men to come to
5 the aid of. heir party.
-
6 I
58 This isn't Excel, it's Magic/
You can also use Justify to flow the text into a longer string, rather than
shorter strings. If you select A1 :DS from the above and use the Justify
command, then you'd see the text refl owed to:

L� = A II .
B --
I
� · c�
· �
� -- -- �� D
-·�
·
·--
� -
1 Now isth time for all good men to
2 come t o t e a1 d of their party. Now is th�
3 time for a I good men to come to the aid

-
4 of theirp; rty.
• ---r-•-- ·----- 1---
s I
And if you selected A1 :M 3, it would reflow back to the original:
A e c o e LF G L H J K ] L M ]
-:�, l'r.:
Now
,.,.::,"'
ls" thi'
tlmr. forall good tnPn toCOIYU! to the tid ofthf"lr party. NQ\v li the tim�Of'
f all good men to come to the aid l?f their par 1y.
.
2J
'

Just to be complete, if instead of A1 :M3 being just selected you tried A1 :M2,
(leaving out row 3):

A:=il: :Ji: 1 ¢ h ·G
' b
· • H::
I;:
:::; il: h LJI 1;, IK
li:JF
- .
� No
w Is
B
the timefor all god
o
c
1'1'1en to I
2 to• nli! t'othet aid ofthttlr < 111 I
l
• No w I s th8

<
time for a ll good men to (omo lo t h e a id
4 of theirpirty. I

I
I
Then the justify would leave rows 3 and 4 out of the result:

A � 8 I c f 0 I E • F ' G . H
-l"'ii_N_
o_
w_
_ th-li time for all good men to come the aid of their party. Now is the
is-: to

-
2'
3 time for all good men to come to the aid
-
4 of their party.
----.I
5

probably not what you want!

This isn't Excel, it's Magid 59


• 25. Understanding the order
of Window/Arrange
Suppose you have S workbooks open and you use View tab/Arrange All from
the Window group [Excel 2003: Window/Arrange):

View Developer Add-Ins

� New Window i·-3 _

Zoom 100% Zoom to


Selection
� Ar ange Alii
l r

@ Freeze Panes.,.
::1
u
1_
.:!
Zoom .
Wir

� Boola - Cl X Boo�S Book4


A B A B A B
1 1
2 2 2
3 �

etl_LsheeR
• >II She ..c
�<

Book! Book3

6 A B B (
L.!
7 1
8

The top/left window will always be the active window. But what is the order
of the rest of them1 Probably seemed sort of random, didn't it1 Well, this
author recently learned the "secret" of how to determine the sequence.
If I wanted to see it in this order:

Book1 Book2 Book4

Book3 BookS

all I need do is click the workbooks in the reverse order, from bottom right
(bookS) and up (book4, then book3, then book2, then book1 ). Yes, just click!
The result after clicking Arrange All:

60 This isn't Excel, it's Magic/


� Bookl - 1:1 X 800�2 Book4
1 A 8 A Ls A I B
1 1 1

2 2 2
,1
3
>�1 Sheen/Sheet2
• I< • • >I Sheetl Sheet2
4
---st
6 A__ --�� 8
-- -- --��A�----=8--�� �
7 1
8 2
9.

So, it turns out, that Excel's order always was the LIFO (Last in, first out)
sequence you activated the windows. Go figure!

This isn't Excel, it's Magic! 61


• 26. Creating names
Suppose you have a worksheet which looks like this:

A J B c 0 E F G I
+1cars Data...
2 Toyota 204 613 846 680 780
3 Oldsmobile 734 n 202 411 436
4 Honda 961 847 749 461 589
5 Ford 876 340 857 171 262
6 lincoln 797 480 616 254 919
53 728
±JBMW
7 Mercury

Chevrolet
63
933
676
922
420
801
568
720
410
405
172
981
326
�Aif• Romoo 139 120 837 77 232
Mustang 241 17 722 889 989
Volkswagen 516 534 908 917 498

and you wanted to name each of the ranges in columns C:G.That is, you
want C2:G2 to be named "Toyota", C3:G3 to be named "Oldsmobile", etc.
You can't simply select A2:G12 and use the Create names feature because
Toyota would be B2:G2, not C2:G2, etc. How about using an intermediate
step? Select A2:A12, use the fill handle to drag to B12:

j
!
A B
1 cars Oat<
2 Toyota Toyota
3 Oldsmobile Oldsmobi
4 Honda Honda

-
5 Ford Ford
6 lincoln lincoln
_!_Mercury Mercury
8 BMW BMW
9 Chevrolet Chevrole
10 Alfa Romeo Alta Rom
...!.!_ Mustang Mustang

•.,......,
12 Volkswagen Volkswae

62 This isn't Excel, it's Magic/


then selecting B2:G12 and using Create from Selection command in the
Defined Names group of the Formulas tab (or Ctri/Shift/F3): [Excel 2003:
lnsert!Name!Create]

A B E
--

)X-; f9 Recently
- Used /? Usei n Formula
.
• � Text • f9 Math & Trig · ·

Insert
� I[Er Date & Time • fiE! More Functions •
Name
Function Financia l • Managerj!lli' Create from Selection

B2

A H
Data ...
Toyota 204 613 846 680 780
le Oldsmobi 734 72 202 411 436
Honda 961 847 749 461 589
Ford 876 340 857 171 262
Lincoln 797 480 616 254 919

Mercury 53 676
.
801 410 728
BMW 63 922 568 405 981
Chevrolet 933 420 720
.
172 326
AIfa Rome 139 120 837 n 232
Mustang 241 17 722
.
889 989
kswagen Volkswago 516 534 908 917 498

Create names from values in the:


Dfoilrow !
.,......."''''''"'
.

0 !,eft column
0 !!ottom row
0 !iight column

'-
'[__K -"j [
o_ Cancel

Then simply clear B2:B12!

Olds m obile .. .,. "<t fx


\B
734

A c D E F G
1 Cars Data ...

2 Toyota 204 613 846 680 780

3 Oldsmobile 734 72 202 411

4 Honda 961 847 749 461 589

5 Ford 876 340 857 171 2.62


6 Lincoln 797 480 616 254 919

This isn't Excel, it's Magic! 63


• 2 7. Long Names
If you create a very long name for a range:

��
------ ------

New Name

Name: IThislsAVerylongNameAndNormallyWontDispla·l
Scope: jworl<book
CQmment :

B,efers to: I=Sheet2!$A$1 [�J


[I OK
I [ Cancel J "'

then it doesn't display the entire thing in the name box:


>-hislsAVerylongNa... •
f,c 1000000000
I A B I c I D
I E

!toooooooool•

1

2
3

4 J
New to 2007 is the ability to widen the name box by simply dragging the
little circle indicator as shown (double-clicking restores it to its default
position):

ThislsAVerylongNameAndNormallyWontDisplayWell •
fx !10000000
A 1 B c l 0 __L
_ =._
E - I---''---
F -l- l'- G H

64 This isn't Excel, it's Magic/


• 28. Long Formulas
If you create a very long formula, p revious versions of Excel often made it
hard to see both the formula and the cell. Here's a screenshot from Excel
2003. Notice cell F1 is selected, but you can't see the cell:
rI • f. �'J �·, .,..,..
,,,.,'lbl<"'·;�,'11..•'/.'.blot',·J ;J{, '...,_.1"'� 1: �·· : .,)(
�� 4'!'".·��.:.fi'.CIH
· � ok - .-�"'1-:1�(,
'N11'(1'1',''·••r,"fl.:.y';.,.,..','J /
f.'...,_.,.,.·;Sff!•-e:.tr,"0::.:."":.:..-·:.-..,.;·!"«," "OK�;.J.wJMr·,"ft�,N 'l 'th

.1, ';..,.._.,._. ''.!¥(,.,.,.',
:v,
e
•. 'A.If..'\�• 'ktt...'Oct:W'" .:.,·. .?-......,_..( "''dl---4f":J ..,..., ;:
·...t'k# .""�•·.·;.ur.'May',·...,.·.$ :,);,�(.·�.q,.nc·."Sttt�··
.. A;
.."': ' -r-•..,...tit'--�-:-.uy.-�-.�w.a¥;'()c«..ft'.":�+t­

'Oct�. , �
• _... ."O.(ot'llbt.f'.'Jtl'loN'f'•..,·�)'-. "N ....
"'«.tw..t>tl"" '#loli'J'"f -er .1¥) ';w
II!"C t : ,J-.
11'
', ,f,·�·;J,'!·;����roT«(';'Ort:�.�
( ,,_
,' •
• t
C'..,"0.:..-&.,..,'J»t.m(',
.,' O(�a.t',�t«'-."Crt.. �·.·�.-
,.�)l}"'.�fii','A:J('
' , '.:V·1VJ'·r�',""'-W'
-
'
*'-
t( 'N•", Jt.l'( 'AI.;�II',"Sf'CI....
� ¢(:�·. '
. ; ','
''�-��.·�·-·,.
•,f,'J..ht','Mr'.'�·.·s.�t-....'
' , "Mfl'
)., ..,-; '1.\K
..t .-
.-
;¢ti ' 1-{
H'J

Here's the same thing in Excel 2007:


./
• " '�" ""
•t k'f"':
�l e
� ·:"'M.Wd'i':"A;1ll tt·:' M
,q ;'"" �o.JM."';;
� .._�,�
�- ; ' S.;�.: embt,...;O :· � "':

( ,1! T
• ..

i.l
� ', :. � n.,.
e �
' owr
c 0 t , 1 ,H ,M,.• H .

l:�l.I*Y

But you might wonder where's the rest of the formula? You can drag the

11 •
""- f•1•l"
formula bar down, or double click it to see both:
J<fh\Jo!y-;"f'cttwry";"M-ar<.t�":'"lt;lrtli.-..,..,.-:�June:·-:�to'l'i"':·;.\.W,at";·St�tN'I�r;.,O<.tob<:r'";·r\o-o'<'�'";
•Oc<(•flibtt':'"u-r..u,.y'"t'' cbtu;�r,..:· MMO!'':•Aprfl-.:· ,_...:'
..,.-· J.-rA:•:..r!lt)·":'.\u:-g.\i$t�.:'SeptMbet':'O;·to1xH-";" :;Q\�Mb!.·•·:
,_��•:•t\p!ll':' M¥(:'J�r..t�:"'h...,.,-;''..'4"')1\ISI'";'"$otpt�-r.t:,t1' ;'()(tOIX-t"!"' N O"' "-Mbt
t.
W di; •J
' •SNri•:• Mtr( J�r�'�·tr:itf':'�U��"�'$tp1\".'l'l�l":'0<10�,..�·NOO!�ftt�I":
'0\.'<1!M'!t�r·;"t�AuMY"'t'fCbfl1oi'J": .. 1":
' � "(.,t:n.JJr(':'
'tl«A!tn�f'':""� .t. � Aot'W'

...J. J_,.i;,j ·J I .I\_! L .I M I "



;

• .....L..._,c,._j o -� r 1 <> r...J , .L.<IJ


'''""
;;;I
As you can see, when the formula bar is expanded the worksheet moves
down to accommodate it. You can use Ctri/Shift/U to open the formula bar
to fit the active cell. And press it again to restore it to one line.

This isn't Excel, it's Magid 65


29. Formatting comments
When most people create a comment (Review Tab, New Comment, or
Shift/F2), {Excel 2003: lnsertiComment), they accept the shape and color and
just enter the information they want. So most comments look something
like this:

/Bob Umlas:
This is a typical comment

But how about a comment like this?

l
'

Bob Umlas:

Or even this: (It's me!)

Bob

Here's how you can do it.


When you first create a comment, the cursor is right after whatever you
typed.You need to select the comment itself, not the text inside. So, select
the border of the comment:

66 This isn't Excel, it's Magic/


Comment3 ....

B c D E F
A I
·
-
-
12r--
13
14

is a typical comment

5I
1
-'
161
17J
___...

You need the "Change Shape" tool. This can be placed on the Quick Access
Toolbar: [Excel 2003:View 1Too/borsl DrowingiDrow Menu !Chonge Autoshape)
. ..

'�!l,9P.
.!i
i!.
� ..
.S�
-rr,
-..
Customize the Quick Ac.ces�'\T.
'' 9,'3 16�r.
Popular
. .

Formulas
l;hoost commands from:(!)
Proofing
J
All Commands
[
Save

Changt Layout
Advanctd

�Cu\torn1u 3
''
""-'
Add-Ins

-
� l
j
Chart Background
Trust Ctnttr

Ruoura\
Chart Data lablt >


I
Chart Eltmtnts p
=..>
Chart Floor •

Chart Gridlints •

,.=:,..
[ I
Chart Layouts

r
Add >>
Chart Namt

"

...,
Chart Ptoptrtles .:!J - me

Chart Quick Sill« •

When the comment is selected by the border, click the new Change Shape
tool.

This isn't Excel, it's Magid 67


@liD IY �·w�� r8 '
ISiti>�
J) ;; BO<

J Home tnsert PaJJe oBasi<SMpes


- -
o v <> o0 D. � o ooo
...

� h T!lhomo a
u .l fJBliOQ@@@A<V """ � <r

P�sle
"-"
""'\ ( ) {}0 ( ) { }
c:$
• fs u ·
l I -

81
0<1< A
rr
oW>
Olpboard r; Font
¢ ¢ 'if .O. (:;) i.t + e f" � ca c1J
Com
ment3 ·(• � � \\.9 O't> •1.> ¢ D » [l;; g ·:0 �
A 8 I c - o-v�
12 flowth
ort
13 DO<>OO[jGJ(;'k>OCJ\J
14 o o O t?®Ee & � 6 \7 G D
15 QEJOlO
16 Cal lOUIS

Q 009-DAJ,-o
. I -, -1
<PJ.J "
__jtf-j�)
"". C . - O
'· ti
O �
17

18 ..L.� A, r
"
I
r
o ...
1 ·a

lg Starsand 8a
_nners

J!.�
-
� - -

20 00 � -A- ® ® ® $ 1121 !tll fRl !l:SJ


.triP�� ..


� ..

From that, you can select basic shapes, block arrows, flowchart, stars and
banners, or callouts, each of which has yet another set of shapes to choose
from. Shown here is the Cloud callout:

cauouts
o o og...o ...a rGl @ -
.J...... .. . .
...: r:,....J. c.....;. JO '0
..J /:,.... / .,
i [1� ri,..,
' L::J

Once you have the new shape, (cloud, here), right-click the border once
again and choose Format comment, as shown, if you wish to format this
comment even further:

g.
1
m;�
� ··�···:· :>- t·t·t·�·!·!�·t··
!
� :�
i:
;::
·
:•
··
N:· >··
·:·
,.J J, Cu!
i'''= �op•

� faste
iii'�
'�
�..J 5) Edi tTe�
-=- 1
I
- ------

Grouping >

I Order •

l A�sign Ma<ro...

I Set AutoShape Defaults


I �� �Format Comm.ent·.-. . I.
1
-··

I

� !jyperhnlc..

68 This isn't Excel, it's Mogicl


That will bring up yet another dialog, from which you can choose Fill Effects:
------ - - -
------ ··-

Format Comment �
II I II Web
Font Colors and l in
es
I I Si2e

Ft1l

�olor: tv"I
Iransparency: NoFtll Io "'o �I
ne
l Automatic
0
C�:
• •· •· •· •· •· •· ·• •·
�shed: • •••• • • • !o.7s pt �I
luooou•co
Connector: • o• • ••

MOWS
••oo• ••o
aegin style: • • [1(- • • • •
[
Mor e Color s
Begin s[ze:
I . .•

I I
Eil E ffects . . .

Fill � I[ Cancel
I
..

From this dialog box you can select the Picture tab and import any picture (I
chose me!).
------

rill flfor.ls rEl

Setect Pictur
e. ..

sample:

0 Lock Q.icturt .spec.t ratio

0 �ol•
t• fill elfe<t l!llh sh a pe

as you saw before.

This isn't Excel, it's Magic! 69


30. Format #VALUE.! or any errors away
Probably the easiest way to not display errors like #VALUE! or #DIV/0! in
an already existing worksheet is to use Conditional Formatting. Here's how:
1 . Select all the cells you want to hide these error values in.
2. Use Conditional Formatting from the Home tab and select New Rule ,

(there are other ways to get to the new rule, but this is the most direct)
[Excel 2003: FormotjConditionol Formatting):

r � �- �
-
e

"
,;

for
matting " as Table .; t
Cond1t1onal Format C�ll
!!
' �� l!lghllght F

Syl e s •

F
Cells Rules >

1m Iop/Bottom Rules • -

Qata Bars
�� •

� Colo r S«otes •

I ngr:;l (con Sets •

® !j ew Ru l e ... -·

® �Itar RuiH •

li!l Mana g t Buies...

3. Select the Rule Type "Format only cells that contain," then pick the Errors
rule from the dropdown:

Mt ·
·---
��l. !''.'!.'!_l!l!�.e.�,!l}�- r@�
�lect A Rule Type :
1> Fonnat al eels based on their values
1> Fonnatonly celo thatcontain
1> Format only top or bottom ranked vakles
1> Format only values that are above or below average
1> Forrnat only unique or duplicate values
1> Use a formula to det2rmine whi
ch cells to forrnat

!:;dtt the Rule Description:

fQrmat only cells with:


�iii..H.rc
oo> i i_ '"'
· ·'
!.. " '",'=
..;...,.,g:. "� i�l
,-...,-...

Prevlew:
I No Format Set
I [ fo
r mat. ..
I
IL OK
' II I .
Cancel I
70 This isn't Excel, it's Magic/
4. Click the Format button, the font tab, and assign a white font!

' Fgrt style; Size:

«!�) R..P., 8
8<dy) nw. 9
"

i
'.It'
"-
"
v•e

Sold
Sold ltak
"
-
13
I!
I�
14
v

�:
IEff ects �--
• Automat•c
-

051<\elt'<OUti> Them4!Colors
' r

LJ .'(A,:,('

For Cond•lJOMI Fo:rnotlilo you con sel FoUII

fxlore Colors...

OK II Cancel

This isn't Excel, it's Magid 71


3 1. Using [h} format for hours>=24
When you add times, anything over 23:59:59 will start over at O. lf you use
a format of [h]:mm:ss then you will get the "true" number of hours:

17 C6

A
(
.

B
�x:I =SUM(Bl:85}
' Q
'

--· c�
3:15
I
21I

1
4:15

3•
5:15

jl 6 15
:
7:15


.

2: 151 26:151 •

The formulas in 86 and C6 are identical. However, 86 is formatted as


h:mm:ss which will not permit the "h" to be above 23, and the format for
cell C6 is (h]:mm:ss.

72 This isn't Excel, it's Magic/


32. Advanced number formatting
You can specify formatting by value ranges.This format:
(Red] [<SO]"TOO LOW";[Biue][>1 20]"TOO HIGH";$#,##0.00 says: if the
value in the cell is <80, make it red and show the text "TOO LOW." If the
value in the cell is >120, make it blue and display the text "TOO HIGH."
Otherwise, format it as currency.
Aside from [red], (blue], [cyan], [magenta], [white], (black], [blue], and
[green], you can use [color1] thru (color56].
The rule is to place the color inside square brackets, followed by another set
of square brackets for the condition, then the format if it meets that condi­
tion. You're limited to 2 conditions plus an "all other."

This isn't Excel, it's Magid 73


33. Formatting text
You can have parts of text constants in one cell be different sizes, fonts,
color, by selecting the text and using the tools from the formatting features
in the Home tab [Excel 2003: Formatting too/bar].
'

Text cal refarn:tted Of d'a'actErS in a rell (oot fam.ias)

Here,


-

@ Home Insert Page Layout Formu las Data Revi

Calibri • 11

Al
B c
can be formatted by ch

II I I
2
3
4 �ardCo
l
ors

5
6

\;)
= •• • ••
,More Colors...

the word "Text" is selected, and the red font color is being applied. Only the
word "Text" will be red. You can also access the font by right-clicking once
the word is selected.

74 This isn't Excel, it's Magic/


34. Using Fills
A number format which includes * will fill the cell with the nex.t character.
A format of General*. will fill the cell with periods. Enter 1 2 and you'll see
1 2 . . . . . .. . . . . . .. as wide as the column is:

Al ... , fx u

A B
1 u......

0 ••••••••• 00 • • •0 • • • • • • • •0.

Use a format of $**#,##0 to get asterisk-fill for currency. The first * is the
code indicating to use the next character to fill the cell. That next character
is *, so now 1 2 looks like this:

Al ... ( fx 12
A E

1
$*************** 12.00

2_

This isn't Excel, it's Magic! 75


• 35. Indenting or distributing text
Suppose you have a worksheet which looks like this:

A B
1 Main section
2 Sub Sections
3 Isub Secti o ns

4 ; Sub Sections
5 Sub Secti o ns
6 I Sub Sections
7 Sub Sections
8 Main section
9 Sub Sections
10 Sub Sections
11 Sub Sections
12 Sub Sections
13 Sub Sections
14 Main section
15 S ub Sections
16 Sub Sections
17 Sub Sections
18 Sub Sections
19 Sub Sections

and you want to indent each Sub section a few cells. In this example, you
could replace the word Sub with" Sub", but in reality, each of these cells
would contain other text.What many people would do is laboriously click
in each cell and type a few leading spaces! But what about this:
Two clicks of the indent button on the alignment section of the Home tab:
[Excel 2003: Format!Cel lsjA/ignmentllndent up-arrow twice)

Alignment

works just fine. It's a command also found in the format cells dialog (ctrl/1,
alignment tab or the bottom right arrow of the above illustration):

76 This isn't Excel, it's Magic/


"'J,

py_-;-
-,.,.·-
��gmt_a�.����l�;
- ,
Number Alignment Font Border
j[ Fill

Text alignment

I (Indent) vi Indent:
Horizontal:

Left

V rtical
:
IBottom
e g
vi
Distributing text is found in the same Format cells dialog. Here, cells A1
and A2 contain the text "This is a wide cell," but cell A2 was formatted as
distributed:

is is a wide cell
is is a wide cell

F�;mat
-
.-.
·� � -
•r

--"
'''r•• " .,_
• _
_,
4 'U Ce l ls . . _lfm
�,
� '!'
� �� ...d
5
Number Alignment Font Border Fill Protection
6
7 Text a�gnment Orientation

8 ttorizontal: • • •


9 (Indent) lndent:
T

10 lo �1 e

11 X
Text - •
t

12 •

13 •

14

This isn't Excel, it's Magid 77


36. Easily create custom list of a-z, A-Z
Instead of typing this all out and then importing to custom lists, you can
enter:
=CHAR(ROW()+64) in row 1 and fill down to row 26 for A-Z.

I Al
fxI =CHAR(ROW(}+64)
A B c I D
_!_.,
2 B
�:; ;lA_�!
31c
4 .o
- ,
5 IE
� �� ------- ------ : 1'---
=CHAR(65) is the letter "A", thru =CHAR(90) is the letter "Z"

Copy the list and paste special Values (or you won't be able to import them
into the Custom Lists).

Then select the range and use Office Button, Excel Op t ions Edit Custom ,

Lists button: [Excel 2003:Toolsl0ptions!Custom Lists]

� D �. .!lJ.C.�IOp,lio�.·.��'
� Hom
� ,)1
-�
Pa�t· "
ILPopula•
Formulas r � Change the most popular options in Ex
c el.
. .. = �

Pfoofino Top options for wo king


r with Ex
c
el

,Mani Toolbar on nltdion"J:


£!1pboir<J tv
Savt � Show
S Enabl• LiY< Prev;ew"
Al
ACS.Jn<cd
8 Show Q�eloptrtab in the Ribbon<D
--� -=-

A
1 A Cu1tomirt 8 Alway\ u'e Out!Jpe
_3_ 8 Add-Ins t;olor sd1eme: ��'=
Blu
'=
•:::!
i:J
:L __
____
____
_____ -:1
Sho w feature deu rfptions i n S a
eenTi ps v
3
-
c
..1_0 Tnnt Center S<{l."tnTip 't y( t:

5 E Ruourcu Crute lnts for use in sorts and fill s�quen<es: IEdit Cust,gm Lisu...J
6 F

and click Import:

78 This isn't Excel, it's Mogicl


-
� -
·-·-
Custom lists,.lj. - -
,_,
. ,.�
·
-.
u.·,.,
,,_"
·
-- �-IM"i)rv;)
-
l!£!:J�
-

Custom ll�t s

Cus
tom list �ntries:

[ &dd I
�--. [
Sun, Mon, Tue, Wed, Thu, Fri, �
NEW LIST A :6·

SUnday, Monday, Tuesday, Wee


B

Jan, Feb, Mar, Apr, .lul, J


c
0
I
Qefete

E
F
G
H
I
J
I(
l

Pre�s Enter to separate nst entrie


s· -
.--
- - - ----
-,,. ==
===::.
tmpoct bst from cells: �
$A:!.
l $:.:
L.:! !!:
:$
A
� =
$2
=
6--- ----�J

::.:
�::l
'<
- [::J��C:�;

OK I[ Carocel

Now, you can enter any letter (upper or lower case), and use the fill handle.
I f you entered upper case, it will fill with upper case letters. Lower case will
fill with lower case letters.

This isn't Excel, it's Magid 79


37. Inner Series
Some fu nctions take a parameter which changes, like =IPMT(rate,per,nper,
pv,fv,type)
The "per" argument usually differs from one row to the next, making it
difficult to fill down. Most people enter the series 1 ;2;3;. . . down a colu mn
for the sole purpose of being able to reference it in the formula!
Instead, use ROW(A 1 ) as the "per" argument:

86 • f,. :IPMT($B$1/12,ROW(A1),$B$2"'l2,-$B$3}
A Ji..__ B Lc o I E F
1 Rate 5.25%
2 ' Nper 0:00
3 PV $400,000
4
5 I
6
I S1,75o.ooI -�-- ---
1-
• ---!
7 $1, 4 .
8

9
7.98
$1,745
$1,743.95
99 i�
10
11
12
7 1. 2
$1,74
$1,739.88 j
92
$1,737.8 · --

13 $1,735.76

When the formula in cell 86 is filled down, the part containing ROW(A1)
becomes ROW (A2), etc. This is, of course, 1 in 86, 2 in 87, etc, giving the in­
ner senes.
You can also use COLUMN(A1 ), of course, if the series needs to be filled
rg
i ht!

80 This isn't Excel, it's Mogicl


38. Using Apply Names
Immediately after naming ranges, you can easily apply these names to exist­
ing references. For example, if you have =BS+B6 in a cell

82
.r tx 1 =B5+86
A B .
c D
1
2 I nl •

s First 4

6 Second 7
7

and then name BS "First" and B6 "Second."


2 11
3 Create Names from Selection @�
- ---·
---
-

4
s F irst 4
Create names from values in the:
0t!i1:;:..;;:e· ..........
,owJ
7
....

Second .

0 �eft column
6
7
Oaottomrow
8 0 fii<;lht column
9
10 OK JI cancel
11

then after naming them you can use Apply Names from the Define Name
dropdown in the Formulas tab, [Excel 2003: lnsertiName!Apply) and these will
already be selected in the dialog:

Data

Formulas Revi�w View Developer A

� lookup & R�f�rence • �� Define Name '4


til Math & Trig • A:B Define Name...
-=
Name
• � Mor� Functions • �pply Names
I
--

Manager .•.

I Defined Names

After you apply the names you will see =First+Second:

This isn't Excel, it's Magic! 81


..,...
"'(" -...
��P.! X. !'-1.�
!:��-§;; ��

0 !gnore Relative/Absclute
0 Yse row and column names [Qptions J >>

[ OK ] [ Cancel

B2 ...
C:t (..
-• ; . =First+Second

J;>. .c
Iii'� -.0<
1 ' -
2 11
3
4
5 First 4 -
6 d 7
7

82 This isn't Excel, it's Magic/


39. Selecting a random sample of data
If you have a database with many records and you want to take a random
sample of that data, here are a few techniques you can use.

One way to get a random sample is to use a computed criteria and


advanced filter.

Suppose you want to take a random 10% of the data. Enter the formula as
shown in C2 (keep C1 blank). By entering the formula =RAND()<0.1, every
time this worksheet calculates, the =RAND() will return another random
number. So RAND()<0.1 will return TRUE, about 10% of the time.

(Rand() returns a random value between 0 and 1, not including 1 ).

C2 •
f,. =RAND()<O.l
A 8 c
1 Database of 100 items
2 TRUE I
lteml
I •

3 ltem2
4 ltem3
5 ltem4
6 Items
7 ltem6
8 lte m7
9 ItemS
10 ltem9

Using the Advanced button from the Data tab: [Excel 2003: DateiFilteriAd­
vanced Filter]

Formulas Data Review

T
o( Clear
:{� Reapply
� I
,
Filter
LV
I Adva n c.,� c

Sort & Filter

This isn't Excel, it's Magic! 83


you can filter like this:


-

Advanced Filter

Action

0 filter the list, in-place


0 CQPy to another location

!.ist range:

I$C$1 : $C$2
� :::: ==: :.: :: ==�
�riteria range:

-"11� .) '

L
I
________ _:·�::.:.J-:1
0 Unique records only

[ OK I[ Cancel I
and that will create a random selection:

roc A

-
1 Database of 100 items
10 ltem9
-

13 ltem12

16 ltem15
27 ltem26

-
62 ltem61
1-
-
74 ltem73

n ltem76
- 1-
86 ltem85
-��

This will be different each time.You may notice that there are only 9 items
shown, not 10, and that's because the values RAND returns are random! It's
best to use this on larger databases!

84 This isn't Excel, it's Magic/


A second way to select a random 10% of your data is to still use the RAND
function, but not use filltering. Look at this:

A B
1 Database of 100 items r- -- .,
2 ltem1 I !
0 .472988

3 ltem2 0.754415

4 ltem3 0.161792

5 ltem4 0.236491

6 ItemS 0.255978

7 ltem6 0.786952

8 ltem7 0.810523

9 ItemS 0.227744

10 ltem9 0.2444

11 ltem10 0.170091

12 ltemll 0.506724

13 ltem12 0.073749

14 ltem13 0.186336

15 ltem14 0.498387

Cells B2 thru B101 contain =RAND().AII you need do is select A2:B101 and
sort by column B! Take just the first 1 0 items, and you have your random
1 0% of the database!

This isn't Excel, it's Magic! 85


40. How to change row height
when a key field changes
Suppose you had a worksheet something like this (but more complicated!)

A I B
- �- .Joeeartment!
2 IAccounting
3 Accounting
4 Accounting

5 Accounting
6 Accounting
7 Accounting
8 Accounting
9 Accounting
10 Personnel
11 Personnel
12 Personnel
13 Personnel
14 Personnel

15 IS
16 IS
17 IS
18 IS

If A1 :A3000 contains departments (sorted) and you want a visual break


between departments you can change row heights on the first row of each
new one. How can you select the changed department?
In the above example, in cell B2, e.g., enter a formula such as
=IF(A1 =A2,1,NAO).
Or you could enter =IF(A1 =A2,TRUE,"X").

86 This isn't Excel, it's Magic!


The choices I'm usi ng are any two of Number,Text, Logical, Error because
of this:


-

Go To Special

Select
O co ents
mm 0 Row differences
o c�nstants 0 CokJmn differences

0·Eorm�lasl 0 Erecedents
�N!lmbers 0 Dependents
�Te�t D ecc orI
�logicals :.l .evel>
0 La�t cell
0 Blan!ss 0 Visible cells onl:(
0 Current tegion 0 Cond�onal formats
0 Current �rray 0 Data yalidation
0 O!ljects AI
Same

OK
!, 1) I Cancel
l
Assumi ng we choose the first formula, then the NA()'s will show on every
new department:

B2
.. (
I A
1 Department
Accounting #N/A
Accounting 1

Accounting 1
5 Accounting 1
6 Accounting 1
7 Accounting 1
8 Accounting 1
9 Accounting 1
10 Personnel #N/A
11 Personnel 1
12 Personnel 1
13 Personnel 1
14 Personnel 1
15 IS #N/A
16 IS 1
17 IS 1
18 IS 1

This isn't Excel, it's Magic! 87


Select column B. Home tab, Find & Select, Goto Special (or simply press FS):
[Excel 2003: EditiGo ToiSpecial]

��
rt • I: •

�te "" liD ·


Sort & Find &
nat •
a· Filter • Select·
s at& find...

3
" 3C Replace...

M q Go To...

Go To �pedal...
l
Formylas

Comments

Conditional Formatting
Constants

Data Validation

� Select Objects
ln. � ...t- ....:-- n...--

select Formulas + Errors (you actually have to deselect Numbers, Text, and
Logicals, leaving just Errors, or just deselect Numbers because you know the
result is only numbers and errors):

Go To Special [8]
Select
O�omments 0 R� diferences
0 CQ:nstants 0 Colu(!11 differences
@Eor!Was O�ecedents
0
N11.mbers 0 Dependents
0
Te;![t
0 .
0 ct or'
'..·
.
!
<;
.... ._....._..,

u
� .
ll.���!�i .

0 '-rrors 0La� cell


0 Blan!ss 0 Visible cells onll(
0 Current region 0 Conditional formats
0 Current �rr�y 0 D�ta y_alidation
0 O!lJects All
Same
0� J[ Cancel

88 This isn't Excel, it's Magic/


Now only the #N/A cells are selected, so you can use Format Row Height
from the cells group of the Home tab [Excel 2003: Format/Row/Height]:

�o Insert •
� Delete •
Sort & Find &
i!) Format • (2· Filter • Select •

:
Cell S"12e

:c '
:
Row Height...

AutoFit Row Height 0


++
n Column Width...

AutoFit Column Width

.Qefault Width...

Visibility

And change the row height to 30 to give this effect:

B (
A I
1
_Department

2 Accounting c:J
3 Accounting 1
4 Accounting 1
5 Accounting 1
6
_Accounting 1
7 Accounting 1
8 Accounting 1
9 Accounting 1

10 Personnel #N/A
11 Personnel 1
12 Personnel 1
13 Personnel 1
14 Personnel 1

15 IS #N/A
16 IS 1
1 7 I<; 1

And finally you can clear column B.

This isn't Excel, it's Magic! 89


4 1. Define "global/local'' name
If you define a name to be the cell above, like from D2 you define "above"
to be =D1, Excel puts the sheet name in front of it. Using Define Name
from the Formulas Tab[fxce/ 2003: Insert/Name/Define]:


.ayout Formulas Data Review View Developer Ac
cal lookup & Reference ...U Define Name
6 Math & Tr�g • JP Use in Formula •
! & T1me � Create from Selection
Name
' More Functions •
Manager
Library Defined Names


D E F G H I
-

New Name
L.
l ! ��
__

�ame: IA bove
�cope: �
I ======; --__J
� vI
Workbo ok

CQmment:

&efers to:
l=dll [�J
��--==, =
�= ===�
jr
[=c==
aoc�
-
el�j
;
/.

you get "above" to be =SheetS !D1:

D E F G H I J K

lL.--1 ��
-- -- -

Nd/JlC Manager

[ Mew··· Ed Delete I filtw ]

So any time I use =Above to reference the cell above the active cell, it will
always pick the cell from SheetS! That is, if on Sheet5, cell A1 I have "Bob,"
then if I enter =Above from Sheet1 cell A2, 1'd see "Bob."

90 This isn't Excel, it's Magic/


Interesting side note: if the active cell is in row 1 and you use Edit/G o To and
type Above, the active cell will be in row 1 048576!

To get "above" to be the cell above on any sheet, do one of the following:
1 . Leave leading "!".That is, define "above" to be =!D1:

A B c I D E
1
2 I._ !
3
__

--

4 rill�
Edit Name

5 �me: I
lAbove
6 ...

7
C2mment:
8
"
-

9
10
11
12 Befer> to: 1�101
13
t�I
14
II OK
l I Cancel l/
2. Define "above" to be =INDIRECT("r[-1 ]c",FALSE)

I !

New Name �t'2]


!!lame:
[Above I
�ope:
lworl<book vi
C�:
-

&efers to: [&indirect("r[-1)<",false� 1�1


I OK l I Cantel l

The difference between the 2 choices is that the latter will calculate auto­
matically, and the former won't (without forcing a calculation with the F9
key).

As a side note, you probably shouldn't use this technique if you're also using
VBA because there's a bug that when VBA recalculates, all cells with that
name refer to the active worksheet!

This isn't Excel, it's Magic! 91


42. XLM-Names (not XML)
Old style Excel 4 macros ("XLM"=eXceL Macros) are still around and useful.
They must be used as a defined name, not as a worksheet function. If you
try to use these as worksheet functions Excel will give you an error. (Please
note that prior to version 2003, copying a cell which uses this name to an­
other sheet will crash Excel!)

For example, the LINKS function will return a list of the links in the work­
book (and in a way that you can see the entire path!)
=LINKS()

This will return all the file names in the current directory.
=FILES()

This will return the names in the workbook


=NAMES()

There are many more, and if you're interested, you can download them from
http://support.m icrosoft.com/kb/q1 281 85/

Exampl e: Define lk as =LINKS(). Then use =INDEX(Ik,1) to get first link, or


=INDEX(Ik,row()) in row 1 & fill down to get all the links:

�ew Name
[ZJ[?SJ
�ame: lk
2cope: �
IWor==
kbook==
====�I ----------�
l;'
CQmment: :========!...- .__ ----------.,

Refers to:
lL=_
lin
..
ks_,
O..: I,_------ =
--;=
== :;-;:
= = �
(�:;J
::::!
:=
II_ ] [ Cancel J
A1

92 This isn't Excel, it's Magic!


As you can see, cell A1 contains the formula as indicated, and it returns
the entire link path to the first link document. The workbook is linked to 3
workbooks, named del1.xls, del2.xls, and del3.xls. But the Edit Links dialog
(from the Connections section of the Data tab [Excel 2003: EditjUnks])

Home Insert Page layout formulas Data

If� lill1 1
Mi} Connections .,A Oear
u A
� Reap1
al Refresh
All•
H Sort filter
�Advar

Connections Sort � filter

doesn't show the whole path:

Edit Links
-


I Typ e [ �evalues ]
WN I s he et
Sour ce Updote Stotus
.
dell -y j $
[Chaoge s-ee.. I
' A Unl niJwn
del2.xls Wo�ksheet A Unknown .
del3.xls Wor·ksheet A Unknown

Location: C:\Oo<uments ond SettlnQs\Sob Umlas\t-ly Oocumenls...\3·2000


Item:
Updote: 0 &utomotl<
[�tMtuP Prompt... I

Similarly, here's the file/open dialog:


- ------

Open

�,.: lo :1-2000
v E

�-
...
.. - ty pe Dote-lid

��vt:�!] •z�<�� t'icro$0lt<:ifK.c Extd 3/1?/2000 IMZm


I!Joz-�•".""
•••

Mcrosott cttlc:cElCCeJ... 3/1212000 10:57m


(j o..stop <9 1<8

i!) O>-OQORl.>i< 38 1<8 Mcro$01t�fiai £xcel 3{12{2000 tO:><m


e�. !)�-thTI\O.JdJ IS 1<8 Mcn>$011: ctfi<eExul.••
••.

3/12/2000 10:221'1'1
i!)OKLOSEA\IG.xb 35 1<8 Mcrosoft ctfite Encl.•. 3{12/2000 10:31 1'1'1
!l ""' 3/12/2000 10:571'1'1
Ccnpltcr i;!)os-5'{EO.x� Z'ISIC8

�..,Network '!!J ONN:>lR£CTZ.>I< 3/l<f2000


I�CIOlo/t Off�e Exte\. ..
221:8 9:35""
1!.)07-IN:>IAE CT.>CI<
Mcro«ltt ctfiee Excel...
21 K8 t-1crosolt cttke Excel
i!!)oe.F1Nlt11"H.><IJ
••• 3/12/2000 10:571'1'1
i2 1<B llicrosolt Cfficc Exccl
Pious


••• 3/12/2000 10:31FN
"!)09-15
1K
1 m . xls 261<8 MCIO$oft Offkc Exte1.,, 3/12/2000 10:57 FN
3/12/2000 10:26 FN
30K8 3/l2f2000
10<-IAXOATt.x� 161:8 Mcrosoft otfke Ex<el..•
11·1fX1SOAT.>k Mcrosoft O.eflte Excel... I0:II I'N
• 12·A'.rne.xls IHB IIJcrosoft ().<fica Excel ... 3/12/2000 10:57 I'M
'e!.)13-SORTP'I'!0.>4s 531<8 14cro,olt Olliao Extcl... 3112/2000 10:57 I'M
·�-

This isn't Excel, it's Magic! 93


By defining a name like FL, for example, to be =FILESQ, you can get this
directly into your worksheet:

Al • ( I =INDEX(FL,ROW()}
fx
..., A _
I _:...:. ...._ -,\1. ____B_.: =----
_ c I
1 �
1 !
-
01-ARRAYl
.xls
2 02-SUMIF.xls
3 03-0KSORT.xls
4 04-MatchTwo.xls
J
5 05-CLOSEAVE.xls
6 06-SPEED.xls
7 ,07-INDIRECT.xls
8 07-INDIRECT2.xls
9 08-FINONTH.xls
10 09-ISINCELL.xls
11 10-MAXOATE.xls
12 11-TEXTSORT.xls
13 12-Prlme.xls
14 13-SORTPTNO.xls

Another nice feature of this is that you can fi Iter on the files. For exampie,
if you wanted to return only those files which have an "0" in them, you can
use =FILES("*O*") where the asterisks are wildcards:

"'I:INOEX(fi,ROW())
A1
A
!_103-0KSORT.xls
� ( f
!
B l c
--
0 E F G H 1
Ndlllc Manager
_
2 04-MatchTwo.xls
3 05-0.0SEAVG.xls fjew... II �..... II �e

__, Refers To Scope


4 11-TEXTSORT.xls
5 1
__,
3-SORTPTNO.xls fl � ... } =FllES
(" ' O '") WoM.ook
6 14-WilCOX.xls
7

94 This isn't Excel, it's Magic/


43. Getting number of unique values
For this example, assume Rg is defined as A1 :A10 and contains
4;5;5;4;5;5;4;5;5;5
Array-enter (ctrl+shift+enter) =SUM(1/COUNTIF(Rg,Rg))

How it works:
First, a brief discussion of the COUNTIF formula.The syntax is =COUNTIF
{Range,Criteria). lt counts the number of items in the range which meet the
criteria. So, in our example, =COUNTIF(Rg,4) would return 3, because there
are 3 4's in the range. Similarly, =COUNTIF{Rg,5) would return 7 because
there are 7 5's.

It turns out that if you use the range itself a.s the criteria, then each item in
the range is used, one at a time, as the criteria.

So, COUNTIF(Rg,Rg) counts the number if 4's, then counts the # of 5 s, then '

counts the # of 5's, etc. This returns ={3;7;7;3;7;7;3;7;7;7}. However, you will
only see the first value, 3, in the cell. If you clicked in the formula bar and
pressed the F9 key (calculate), you'd see all the values. (If you did this, don't
forget to either press esc to cancel the calculation or click the X near the
formula bar).

So now, 1/COUNTIF(Rg,Rg) returns ={1/3,1/7,1/7,1/3,1/7,1/7,1/3,1/7,1/7,1/7}.


There are 3 "1/3", and 7 "1/7", each totaling 1 .
So the SUM returns the correct result:There are 2 u nique values.

This needs co be ctrl/shiftlentered or it will calculate as if that first 3 were


the only value, and the answer would be 1/3, or . 3 33333333.

This isn't Excel, it's Magid 95


44. Named formulas are array-entered
If the formula in the preceding tip were entered without ctrl+shift, the cell
would contain 33333 as mentioned.
. ,

If a name (say "unique") is defined to be =SUM(1/COUNTIF(Rg.Rg)) and you


enter =unique, without pressing ctrl+shift, the cell would contain 2!

.tL.���!l"iS&£�
[ New Filter •
•• .

lI �dit...
)[ tlelete
) I I
Name Value Refers To Scope Convnen
t
Cl unique { . .}
. -S....-(1/CO�Tlf(Rg,Rg)). Workbook

�.!;
Refers to:
'1'!) t.>-11
jX)f./1 l•sur�(I/COUNTIF(Ro,Ro))j !�I
I Close l •

So it seems all named formulas are treated the same as if you entered it as
a n array-formula.

However, here's an oddity. If you enter =A1 :A2 in cell A3, you'd see #VALUE!.
If you array-enter it, you see whatever is in cell A1 . 1f, while the cursor is in
cell A3, you define a name to be =A1 :A2, then entering that name in A3 still
produces #VALUE! If you array-enter that name (like {=test}-the braces
supplied by Excel) then it returns A1 's value. So these techniques seem to
contradict one another!

Just be aware that your named formulas may be different from what you
expect only because it's likely interpreted as array-entered!

96 This isn't Excel, it's Magic/


45. Getting End of Month
You don't need the Analysis Toolpak (an add-in which ships with Excel). If
the date is in cell A1 , then to get the date of the last day of that month, use
=DATE(YEAR(A1 ),MONTH (A1 )+1 ,0).

The DATE function takes 3 parameters: year, month, and day. The Year is the
same year as cell A1's year, so we simply use YEAR(A1 ) MONTH(A1 )+1 is
.

one month past the month in cell A1.


The first day of next month is =DATE(YEAR(A1),MONTH{A1)+1,1 ), so the
day before that is the last day of this month. Therefore, instead of using 1 as
the day parameter, Excel has no problem with using 0.
The Month parameter for the DATE function doesn't need to be 1-12, and
the Day parameter doesn't need to be 1-31!
Of course, you can also use =DATE(YEAR{A1 ),MONTH(A1 )+1 ,1 )-1 if you
don't like using 0 for the day parameter!

This isn't Excel, it's Magid 97


46. How many Wednesdays
between 11 1105 and now?
{This is obviously not limited to Wednesdays!)

Use the INDIRECT function to turn the date into a range! (Hang in there!)

IfA1 has 1/1/05 and A2 has =TODAYQ (and let's assume for this example
that today is 3/5/05)
=ROW(INDIRECT(A1&":"&A2)) is the same as
=ROW(I NDIRECT("38353:3841 6")) which is the same as {38353;38354 . . .
38415;38416}.

These numbers are "serial" numbers, Excel's way of numbering days since
1/1/1 900.

The INDIRECT function changes text to a range, where possible.

The WEEKDAY function takes a date and returns the day of the week,
where 1 =Sunday. 2=Monday, etc. So, =WEEKDAY(ROW(IN DIRECT(A 1 &":"&
A2))) would return {7;1 ;2;3 } because 1/1/05 is a Saturday and Saturday is
. . . ,

7,so it starts with 7.

Put another way, =WEEKDAY(38353), where 38353 is the serial number for
1/1/05, is 7.
Comparing this sequence of numbers-{7;1 ;2;3}-to a 4 changes these
numbers to a series ofTrue/False values:

A3 •( fxj{:WEEKDAY(ROW(INDIRECT(Al&":"&A2)))=4}
A J B

l
I c I D E� F G
....!.... 1/1/2005
2 3/5/2005
3 FALSE •

expanding the formula bar shows:

98 This isn't Excel, it's Mogicl


C
U BEMEM. .. ... ( t. 'X ./ ,
..
={FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;
FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;
FALSE; FALSE;FALSE; FALSE;TRUE;FALSE;FALSE;
FALSE;FALSE; FALSE;FALSE;TRUE; FALSE;FALSE;
FALSE; FALSE;FALSE; FALSE;TRUE;FALSE;FALSE;
FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;
FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;
FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;
FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;

FALSE

D E F I
A 8
l c I l I G

1 1/1/2005
2 3/5/2005
.!
. •
3 .. ;FALSE}
II • r
.

. . . the TRUE values correspond to Wednesdays.


The N function changes False to 0,True to 1 .

Array-entering =SU M(N (WEEKDAY(ROW(IN DIRECT(A1 &":"&A2)))=4))


gives 9, meaning there are 9 Wednesdays between 1/1/05 and 3/5/05.

This isn't Excel, it's Magid 99


47. Looking up 2 (or more) values
Suppose you have a table of values looking something like this:

I A B C l
_!_�
�------�M��
a ���
e r��
l i�
�-----1
2 IFi rst Last Amount
3 1 Bob Smith 23
4 Fred Williams 78
S IBob Devon 45
6 Bob Williams 34
7 John Smith 89
8 Bob Clinton 67
9 Bob Jones 12
10 Bob McCarthy 56

and elsewhere in your workbook you have a first and last name for which
you'd like to find the amount value.That is, you have Bob Williams in F2:
G2 and you need to pick up the value from cell C6.You can't use any of the
LOOKUP functions, and you can't directly use the MATCH function either.
What to do? Here, an array formula comes to the rescue:

H2 •
fx (:INOEX(C:C,MATCH{F2&G2,$A$1:$A$21&$B$1:$B$2 1,0))}
A B c 0 E F G H
Master List Find
+f� lrst
Bob
Last
Smith
Amount
23
Bob
Fred
Williams I
Williams
34•
78
1

4 Fred Williams 78 B
ob Clinton 67
s Bob Devon 45
6 Bob Williams 34
7 John Smith 89
8 Bob Clinton 67
9 Bob Jones u
10 Bob McCarthy 56
,

F2&G2 becomes the string "BobWilliams," and this is being matched against
A1:A21&B1:B21 which, when selected in the formula bar and the F9 key is
pressed, expands to:
NDEX(C:C. MATCH(F2& G2.("Maslerl.Jsl";1'irSI I.0$1";"8obSrrilh". "Fred'IViliams":"Bob0evon";"BobWilliams";"JohnSmilh";"8obCiu11on·
BobJone$·:"'Bot>McCanhy"; ":··: ":•••·-:·-;·;··:•·:•·:• },0))
i•
i •

.. .
'" '" '"
.. . . . . - . ·-·····

and you can see that the combination BobWilliams is the 6th item in the list,
. . .

so this formula reduces to =INDEX(C:C,6), which is C6,so the result 34 is


returned.

100 This isn't Excel, it's Magic/


48. Named ranges which define themselves
Currently you have Database defined as $A$1 :$E$25.

�ame: IDatabase I
2cope: I� ========�--�
Worlcbook
VJI�--�
cQlllent
l!l : �==========

"
-

B.efers to: �Sheeti!$A$1 :$E$2S I [�J


��=====;- 1 r==
l �=;
1 OK Cancel
L
You add a record to row 26, and then need to redefine the range to include
the new row.
Assuming there are no "holes" in the first column of the database, change
the definition to be =OFFSET($A$1,0,0,COUNTA($A:$A),5).
This means starting with cell A1 , 0 rows down and 0 columns over, in
COUNTA(A:A) rows by 5 columns. (COUNTA returns the number of
non-blank cells).
This automatically will include new rows added because the COUNTA re­
sult will change. lf it were now A1 : E25 then the COUNTA function returns
.

25.When you add a new record, the COUNTA returns 26, so the new
definition is =OFFSET (A1 ,0,0,26,5), or A1 :E26.

This isn't Excel, it's Magic! 101


49. Using REPT for visual effects
You can easily use a variation on =REPT("/\",500) for a nice effect. Shown
below, you can see the effect of the formula entered in cell A1 .


s· txl =REPT("/\",500)
Al
A 8 C 0 E F G H
=-t-..__
II\/\/\JV
:.
_.:_ tv
.____ \l vwVV\1\MiVVVV
2 -
--"--'
-----

3 l·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll·ll
4�0<X>OO<X�O<�>Oo<X>OO<KX>OC<X>Oo<�>OO<X>OO<>C
'i

Cell A2 contains =REPT("=",500).


Cell A3 contains =REPT("(-)",500).
Cell A4 contains =REPT("<>",500).

Go be creative!

102 This isn't Excel, it's Magic/


50. Using the Space as an operator
The space is as valid an operator as +,-,/, or *.
=West Gizmos will pick up the intersection of the 2 ranges, West and
Gizmos:
C
9
·� I =West Gizmos
fx

A L 8
! c J D E.
1 North West South East

2 1Thlngs 24 51 92 91
85
·--

3 Gizmos 37 39 98

4 Objects 53 74 58
-
8
-

5
I
-
6
7 I -
s I
9 I ssl• 1
1n I I I

Here. West is defined as C2:C4, and Gizmos as B3:E3. They intersect in C3,
which is the result you see in cell C9.The space operator is an intersection
operation.

This isn't Excel, it's Magic! 103


5 1. Extracting the last part of a string
Suppose you have this in a cell: C:\MSOFFICE\EXCEL\LIBRARY\MSQUERY\
MyFile.xls
and you'd like to pick out the last piece, MyFile.xls. Here's how to do it.

The technique basically changes the last slash to some unique character, then
finds where that character is, and returns from that position + 1 to the end.

First, there are a few things you need to know.There's a LEN function which
returns the number of characters in a string, or cell. So if A1 contains ABCA.
=LEN(A1 ) would return 4.
The SUBSTITUTE function substitutes one value for another in a cell. So
=SUBSTITUTE(A1 ,"C","Q") would return ABQA in the above example.
Also, =SU BSTITUTE(A1 ,"A","Q") would return QBCQ, because it changes
both A's. We're going to take advantage of another option in the SUBSTI­
TUTE function, where we can change a particular occurrence.
=SUBSTITUTE(A1,"A","Q",1 ) would give QBCA, and
=SUBSTITUTE(A1,"A","Q",2) would give ABCQ. The 1 and 2 tells which
one to change.

Okay, preliminaries are done. Let's go back to where A1 contains C:\MSOF­


FICE\EXCEL\LIBRARY\MSQUERY\MyFile.xls.
1 . =LEN(A1} is 44.
2. =SUBSTITUTE(A1 , "\'"', "") is C:MSOFFICEEXCELLIBRARYMSQUERYMy­
File.xls-the same string without the backslashes.
3.That length (LEN(SUBSTITUTE(A1, "\"","") is 39.
4. =LEN(A1 )-LEN(SUBSTITUTE(A1,"\","")) is S, telling us there are S backs­
lashes. If we use that as the 4th parameter in the SUBSTITUTE function, we
will only change the 5th slash.
S. =SUBSTITUTE(A1,"\",CHAR(222),the value from step 4) changes the last
backslash to a CHAR(222). (CHAR(222) is kind of arbitrary strange charac­
ter_ . . hang in there!)
6. =FIND(CHAR(222), the value from step S) finds what position that char­
acter is in-that is, where the last slash is!
7. =MID(A1 ,the value from step 6+1 ,255) gives just MyFile.xls.
Putting it a II together:
=MID(A 1 ,SEARCH (CHAR(222),SUBSTITUTE(A 1 ,"\",CHAR(222),LEN(A1 ) ­

LEN(SUBSTITUTE(A1 ,"\",""))))+1 ,255) will return MyFile.xls.

1<2 J•
-...........,. ..________...,.,.
, ...
1> =MID(A1.SEARCH(CHAR(222).SUBSTITUTE(A1,'\".CHAR(222).
,, .n _

lEN(Al)·l.EN(SU9SllME(A1,'\',"))J)•I .Z$)

2
1 C:\MSOFFICEIEXCEL\LIBRARY\MSOUERY\M
.li)
le.xls
M
yFile.xls

104 • Tllis isn't Excel, it's Magic!


52. Using SUMPRODUCT
Instead of trying to make SUM I F or COUNTIF work on multiple conditions
(you can't), use SUM PRODUCT. Or you can use the new functions SUMIFS
or COUNTIFS, discussed in tip 69.

Look at the following worksheet:


. A B c Ill E F G H .I

.2... ' Fred l I



I
3 2 l i
3
.
4 Fred
4'
m1 I I
5 Fred �< II UcT((I' ? · "11 111
;& Fred 5
7 ...2004ifred
' .., .. ..... ,
6 I I
. . �
-"D.-1)") )
- .
20031 Bob
.

__!.. UCT((1''·�11
9 ; treo 8

,10 9 1l1lJ. I I
04) --(B2:Bll="Bob") C2:Cll}
.
11 Fred 10;. :SUMPRODUCT(
' {A
--·2A l1=
: 20
-- .
--

-·- ·-
, ,

Cell D4, which contains the formula shown in DS, returns 1 1 .This is the sum
of the amounts in column C which correspond to the year being 2004 and
the name being Bob. That occurs only in rows 3 and 1 0. The formula works
like this: The part of the formula which is A2:A11 =2004 evaluates to (what
you'd see if you selected that part of the formula and pressed F9):
{FALSE;TRUE;FALSE;FALSE;TRUE;TRU E;FALSE;FALSE;TRUE;FALSE}
where the TRUE's correspond to the 2004's. B2:B11 ="Bob" evaluates to:
{FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;TRUE;FALSE}.
Now these are being multiplied together. Only TRUE *TRUE is 1 , any other
combination is 0. (You can try it in a cell-enter =FALSE*TRUE, for ex­
ample). So this produces {0,1 ,O,O,O,O,O,O, 1 ,0}, where the 1 's correspond to
a pair ofTRUE's. Now this in turn is multiplied by the range in C2:C 1 1 , or
{1 ;2;3;4;5;6; 7;8;9;1 0}.This multiplication yields {0;2;0;0;0;0;0;0;9;0}, and this is
added up to produce the 1 1 .

Cell D7 (formula shown in DS) only returns the {0;1 ;0;0;0;0;0;0;1 ;0} part of
the multiplication, and this is added up to produce the 2-which represents
a COUNT of the number of records for which the year is 2004 and the
name is Bob.

You may have seen another variation of the formula in cell D4. Cell
D1 0 contains the formula shown in D 1 1 . What is the"-" before
each set of parentheses? If you enter =-TRUE in a cell, you'll see -1,
=-FALSE yields 0. So --TRUE yields 1 , and --FALSE still yields 0. The

This isn't Excel, it's Magic! • 105


-- coerces the set ofTRUE/FALSEs shown above to 1's & O's
(not - 1 's & O's). so the formu la really reduces to =SUMPROD­
UCT({0;1 ;0;0;1 ;1 ;0;0;1 ;0} ,{0;1 ;0;0;0;0;1 ;0;1 ;0},{1 ;2;3;4;5;6;7;8;9;1 0})
which again becomes SUMPRODU CT({0;2;0;0;0;0;0;0;9;0}), or 1 1 .

A side note: you can also use the new function in Excel 2007, SUMIFS.The
formula in cell 04 would be =SUMIFS(C2:C1 1 ,A2:A1 1 ,2004,B2:B1 1 ,"Bob").
The syntax for this function is =SUMIFS(sum_range,criteria_range,criteria,...)

1 06 This isn't Excel, it's Magic!


53. Using the TEXT function
Date won't fit in the column/

fx =TODAY()
I
c I o E F G �...J.:H.:...._�_:..__c__
------- -

m
formdl Cells

General �
.....­
Wednesday, 11/1/2006
Cunency
Ac<olrtln'l
o.to
Time m/d/
Y'/Y'I
Penent•90
Fra<tlon
Scient1k
Text
--

Cell D2 contains =TODAY() and is formatted as shown: dddd, m/d/yyyy.


Well, it won't fit. If you're restricted from changing the column width, what
can you do/ The solution is the TEXT function. Cell D1 contains this formula:
=TEXT(TODAY(),"dddd, m/d/yyyy")
Since this returns text, it will flow into the next column if there's not enough
room to display in its own column!
By the way, you can bring up the Format Cells dialog with either Ctrl/1, or
by the little arrow at the bottom right of the Number section of the Home
tab. This arrow will bring up the same dialog (in the Home tab), in the Font,
Alignment, or Number section, but with a different tab or the Format Cells
dialog showing initially.


Home tnsert Page Layout Formulas Data Review View De
velo
per
----------- --

X Cahbri • 11 • [A· A·1 1= & e;JI�·j � •


General

fB I u ·JI�±� ·JI� A ·I I� • :trJ[iF t�l �· s • % •


11�•8 +�81
:J ·

'd r)l

Wherever you see this little arrow, it means you will be presented with a
dialog, very similar to what you saw in previous versions of Excel.

This isn't Excel, it's Magid 107


54. Use wildcards in MATCH function
Look at this worksheet:
I C2 •
'• f
�j(:B2/INDEX{B: B,MATCH{"'Totai",OFFSET{A2,0,0,1000,l) ,O)+ROW{)·1)}
= A � c j p E f G H i
....;__.oept Amt " ofTot
al
�Deptl ani 30%1
3 Depn 86
9 30%
4 Depll 384 13"

II
5 Depn 794 27%
6 Depn Total 2919 100%
7 Dept2 340 10%
a oept2 762 23%
9 Dept2 426 13%
10 Dept2 367 11%
1l Dept2 207 6%
122 4%
564 17%1 I
459, 14%1
3247 100%
16 Dept3 671 4%

The formula in C2 is filled down as far as necessary (past C16) and yet it
returns the percent each number in column B is to the total value for that
department. It's based on the fact that the total is indicated in column A by
text ending in the word "Total."

Part of the formula uses an asterisk inside the MATCH function:


=MATCH("*Total will look for anything ending in the word Total (case
insensitive). So, cell C2 is dividing B2 by that number in column B which cor­
responds to the next Total, or in this example, it's B2 divided by B6.

Let's examine the formula more closely. =B2/INDEX(B:B,MATCH("*Total".


OFFSET(A2,0,0,1000,1 ),0)+ROW()-1 ) in this case winds up being =B2/
INDEX(B:B,6), which is B2/B6.The part we're interested in here is how the
6 is derived. And more specifically, how this same formula in C3 through C6
returns 6 and how in cells C7:C1 5 it returns 15.

Okay, back to cell C3. =MATCH ("*Totai",OFFSET(A2,0,0,1 000,1 ).0) is the


same as =MATCH("*Totai",A2:A1001,0) because the OFFSET function as
used here says to start with A2. go 0 rows down and 0 columns over, and
use a shape of 1 000 rows x 1 column, or A2:A 1001. This part returns 5
because the MATCH function never returns 0-it's a value from 1 and up,
or #N/A if not found. An adjustment needs to be made. We need 6, so we
can just add 1 ! But that seems like cheating. And in C4, the MATCH would
return 4 and adding 1 wouldn't be right; we'd need to add 2! In other words,

1 08 This isn't Excel, it's Magic!


we need to add one less than the row the formula is contained in: in C2 add
1; in C3 add 2, in C4 add 3. So in cell Cn, add n-1. Now look at the formula.
We're adding ROW()-1.

I've added a column in this next illustration which is simply the part of the
formula from the MATCH on:

07 /.< =MATCH('"'Total",OFFSET(A7,0,0,1000,l},O}+ROW(}-1
A 8 C 0 J E F G
1 'Dept Amt % ofTotal
2 0eptl 872 30% 6
3 0eptl 869 30% 6

4 0eptl 384 6
--- --

13%
5 0eptl 794 27% 6
6 0eptl Total 100% 6
' · -

2919
7 0ept2 340 10% I 151• 1
426 r- 13%
-.!l�
Oept2 I 762' 23%I 151 i
9 oept2 l
.

15
I

10 Oept2 I 367[ 11% 15 I


'

11 0ept2 6%1 1
r
�1.
2071 '

12 0ept2 1221� 4% I i
5641 I 15 r
-- · -

13
.

0ept2 17%'
-
14 Oept2 459 14% 15 I
15 0ept2 Total 3247 100% 151
I

r
What makes this formula interesting is that it can be filled down as far as
necessary without knowing what row the total is in.

This isn't Excel, it's Magic! 109


55. See all characters in font set
1 . Enter =CHAR(ROW()) in row 1
a. =ROW() returns the row you're in. =ROW() entered in cell G23 returns
23.
b. =CHAR(97) returns the 97th character in the character set for that font,
usually a lower-case "a" (picture fonts like Wingdings or Webdings return
something else).
2. Fill down co row 255.
3. Easy co see th ings like •, ¢. £:

A
147 "

"
148
149 •

150 -

151 -
-
152 ...
-
153 TM
154 s
-
155 )
156 �
157 0
158 z
159 y
160
161 .I
162 ¢
163 £
4. When you see that is in row 1 49, you can then know that holdingAit
"•"

while typing 0149 on the numeric keypad will create chis character, as soon
as you let go of the AIt key! And this holds true for all of Office, not just
Excel! You can copy/paste special values for the character(s) you want. and
you can then copy the re sulting character from the formula bar.

110 This isn't Excel, it's Magicl


56. Double-Spacing data
Here's a technique to double-space your data which is faster than any macro
could do it (unless the macro utilizes this technique also!) Imagine being able
to double-space thousands of rows in a spl it second. The secret? Sort them!

1. Number the rows. ln this example the data is in A1 :09.We used column E
for the row numbering:

I A B c D E F 1
1
1 Data
- -

Data Data Data 1


2 Data Data Data Data 2

3 Data Data Data Data 3


4 Data Data Data Data 4

5
2 in E2. Select El:E2,
t er 1 in E1,
Data
#the rows- en
s Data Data Data
6 Data Da ta Data Data 6 double-click the fill handle
7 Data Data , Data Data 7
'Data

Data .Data •
'Data 81
91
'

Data Data :Data :oata

2. Copy and paste these nu mbers so there are 2 sets


·-.·..-s'-
A B c
1
2
Data
Data Da
ata
'

Data
'

Data
D
ll
21
DData Data
_j

'
D ta IData Data
3
4 iData Data ata

tData
Data Data

Data

a
.
3

4
5
6 DataaData Da a Data

Data
Dat

Data
a
5
6

8 a Data Data
7 D ta Data Data Dat 7
Dat

9
10
Data Data Data
Da
ta
Data
8
9
1
1l 2
12 3

..!.� 4
14 5
15 6-
16
-

7
17 8
18 9•

This isn't Excel, it's Magic! 111


3. Sort the data by this column.This sorts the blank rows into their correct
place.

A B c D E
1 Data Data Data Data 1
2 1
3 Data Data Data Data 2
4 2

-
5 Data Data Data Data 3
6 3
7 Data Data Data Data 4
8 4
9 Data Data Data Data 5
10 5

-
11 Data Data Data Data 6
12 6
•13 Data Data Data Data 7
14 7
15 Data Data Data Data 8

•16 8

-17 Data Data Data Data 9


18 9

4. Clear the column, and you're done! You can use this technique to triple-
space by pasting another set of row numbers before the sort!

112 This isn't Excel, it's Magic/


57. Fill "=A 1" right,
have reference become =A2 , =A3, • • •

Yo u've probably wanted to be able to fill a formula horizontally and have the
resulting formula reference a vertical range. That is, you may have entered
=A1 , and wanted to fill that to the right but have the result become =A2,
=A3, etc. Of course, Excel gives you =B1, =C1, etc.

This is not a substitute for either the Transpose function or copy/Paste


Special and che cking the Transpose checkbox. We want a dynamic and simple
formula reference as a result.

Here's a te chnique that shows you how to do this.

1.Enter the first formula without"=". Here, B2 was entered in cell B12. The
B2 is used because that's where the data starts.

'"I!
1
�--+-
- � B..-
···""- -+
-
-
J I
2 )Here's I
3 lth-e - r-
: inf�rmation1
-
4
s_ 'to
6 see

7_ :...._
left ____
_ ,
8 to
9 right
10
11
i

�l 82

This isn't Excel, it's Magic! 113


2. Fill right with the fill handle (You'll have B3, B4, BS,. . . )

c 0 E
I'1 I A [ .B

i I
2 Here's
3 the
4 information
--

5 ·to
6 see
7 left
8 to
-

9 right
10
11

-
12 ls2 B3 B4 B5 I ·

3. Replace "B" with "=B":

Fi!!dwt>ot: �[=
s ============="'
f:g]
R�lace wi

L-----------------------�[o;=
p�==
M=>>�I
t h: •8 1 v,

(Replace !II ) ( B.epla<e f[nd All I ( Eind Next I [ Close J

4. Here's the result:

A I B c I 0 I E I
1
2 Here's
3 the
4 informati on
5 to
6 see
7 left
8 to
9 right
10
11
12 IHere's the lnformatlc to

114 This isn't Excel, it's Magic!


58. Fill "=C3" down,
have reference become =03, =E3, etc.
This is similar to the preceding tip but the orientation is the reverse.
However, this is a lot trickier. If we enter C3 (without the equal sign) and
fill down, we'd get C4, CS, etc, the same as if the equal sign were present.
We really want the C to become D. E. etc. Here's how:

1. Enter first formula without"=" but in R1 C1 notation so instead of =C3,


use r3c3, which means row 3, column 3.

c I o I E G
I
L
F H I J

-
-:- .
Here's fhe 1 info to - �ee left to right

-
1
I 1-
-

Ir3c3 l T
'

2. Fill down, giving r3c4, r3c5, etc.

I c 0 E F G H I I J
I

- the
Here's
f -
Info
-
-

to see left to right

r3c3
r3c4 I I
r3c5 I I I
r3c6 • •
r3c7

This isn't Excel, it's Magic! 115


3. Switch to R 1 C1 notation via Office button/Excel Options, Formulas: [Excel
2003:ToolsiOptionsiGeneraiiR 1 C1]

J)J:cel Optioi'\S

Popular
� Change options related to formula calculation.
11, F'o1mu1as �
Proofing Calculation options

Save Workbook Calculation())


0 Automatic
Advanced
0 Automatic except for data tables
Customize 0 Manual
0 Recalculate w-or�bool:b�•·. ,oving
-

Add-Ins
Working with f
Trust Center -
Resources 0 Bfa reference style
0
0 ,Eormula AutoComplete0
0 Use table names in formulas
0 Use Get£ivotData functions for PivotTable references

4.This step is necessary, because you can't replace r with =r in the above
because Excel will give you an error message:

c D E F G H I J K

Here's "


J I An!l ReQiace
.........

.........
.
Fi�what: Jr ·vJ]
ov�� 1- R�e with: J•r v]
..... ......
1-
1- I()p!ions » I

. -

Mi-c

rocsoft Excel
- ••

The fornda you typed contains an error,

•For lnformotion about fixing common formula probl.,.,, click Help.


•To get a$slstance in enter'ng a fuoction, dickOK, then dickFunction on the Insert meoo.
•If you are not ti)'Wlg to enter a formula, avoid using an equal sign (=)or minus sign (-) or precede it with
,

quotation motk (').

OK II Help

116 This isn't Excel, it's Magic!


5. Replace "r" with "=r" (after switching to R 1 C1 notation as indicated
above).

I 3 4 5 6 7 8 9 10 1

Here's

Here's
ntJ
• R��e�
l======================�
FQIV!Nt: r v

�e�: �

-
'
�==
==
--
==
--
--
==
--
--
==
--
==
--
==
--
--
==
--
--
==
--
--


v

ll
--
--

[�»
Close

� Excel has completed Its search and has made 5 replacements.

01(

6. Switch back to A1 notation-uncheck the R1 C1 notation box.

This isn't Excel, it's Magic/ 117


59. Using Define Names & scrolling
While the Formulas Tab, Define Name dialog is showing [Excel 2003:
lnsertiNameiDefine] you can't scroll unless the cursor is in the refers-to box.
Just thought you'd like to know!

118 This isn't Excel, it's Magic!


60. Show a picture by typing its name?
First, let me demo what we're about to accomplish:
I type the word "dog" in cell A 1 and see:

A I 8 c 0
_!__Idog I

2
3
4
5
6
7
8
9
10 cat
11 dog
12 baby
• - I
I type cat and see:

l I
lcat
A I 8 c 0
1 I

2
3
4
5
6 �
7
8 �
9
10 cat
11 dog
12 baby
1�

This isn't Excel, it's Magic/ 119


I type baby and see:

I A 1 B c D

_:�
l J,.::.
Ib::.:;
ab._y_J
+f
3
4
5
6
7
8
9
10 cat
11 dog
12 baby
1 '1

The really neat part is that this is done without macros of any sort, just
formulas! Imagine having a parts inventory and being able to type in the part
number and get a picture!

Here's how it's done. The pictures need to already exist in the worksheet
and be equally spaced (and out of sight)-here's a 50% view of the work­
sheet from cell U1:

I Picture 6
·C I
/:c =$U$1:$W$10
A B c D E
1 baby
2
3
4
5
6
7
8
9
10 cat
11 dog
12 baby
13
_10
-1
,,

120 This isn't Excel, it's Magic/


The dog starts in U 1 , the cat starts in U 1 1 , and the baby picture in U21.
That is, all the pictures here are 1 0 rows apart.
Next, you need a camera-tool type object whose reference is a defined
name, like =pic. See how to get the camera tool into the Quick Access
Toolbar in the tip about printing remote areas on the same page earlier in
this book.

Then, select a 1 0 row x 3 column set of cells near column U-like U 1 :W1 0,
then click the camera tool. Then click again near where you want the picture
to show up. In our example, that was around cell B2.You should see some­
thing like this:

Picture 6 ... fx =$U$1:$W$10


A B c D E

1 baby
2
3
4
5
6
7
8
9
10 cat
11 dog
12 baby
13
,.
"

Notice the formula bar has a reference to the range originally selected when
clicking the camera tool. By the way: this works much better with grid lines
turned off, otherwise the grid lines are part of the picture.You also need to
format the picture to have no border:

This isn't Excel, it's Magic/ 121


Select the picture, use Format picture from the Format button in the cells
section of the Home tab: [Excel 2003: FormatiPicture]

albn g
Conditional format
�m Styles
C:�ll
· �Jorma::A
t ·S<t
lt& F':n

.f:!
-

atTab� St)'I<S a· f: l!u - se r.

C
ell Size


![ P.o �el9n;...

ute:F �
J i K l Ro
w He;
g�t

C�V:t'rJ .:.::_i�-
�..
n

Auto.=!! Cot..Jmn WC'th

Defa.;.z:t lidth...

Visibility
I H1de &. !Jnhidt >

I Organize Sheets

l
-
Benamt Sheet
or CopySheet...
II I
�ove

1 !ab Color •

I
I
I �I J
I
)a
18
Prot ection
-.-. . .-;

frolect Sheet...
,

J I @] �o<k Cell

I I ��� F.ormat P.icture.,,-•


This shows:

1'M'JF.o
" " "'
"�
""u
v
= .
� ·

.o.
� ·
··
··
··
>Y
...,.
__.....
���!!.���.t?ID
and lines I
Colors I Pltture •. ffPropertiesn
Size Protection Web

Fill

�clot: II I "';'
< I >
·-
:2 lo%
J.ransp.vency: �I
IJle
�yle:
["·N'fL\9k'lld
Weight:

Con_nector: J
,.

122 This isn't Excel, it's Magic!


Now define Pic as =OFFSET(Sheet1 !$U$1,which-1,0,30,1 5).The U1 is the
top left cell for all the pictures;"which" we will define in a moment, the 0
means 0 columns away from column U, and the 30, 15 is the shape of the
picture: 30 rows x 1 5 columns.
"pix" is the list of legitimate picture names-in this example,A6:A8.
"which" is defined as =MATCH (Sheet1 !$A$1 ,pix,0)*30-29.An example will
help. To see the dog, we type dog in A1 .The MATCH statement matches A1
against pix and that part of the formula returns 1 since dog is the first item
in the range A6:A8. So, 1 *30-29 is 1 : (30-29). So, "which" is 1 , which-1 is 0,
and that makes Pic be OFFSET(U1 ,0,0,30,1 5), or the original range U 1 :AI30.

So where are we using pic? Remember seeing $U$1 :$AI$30 once we clicked
the camera tool? Select that in the formula bar and type =pic:

I A I B I c D
1 [dog I

10 cat

]
11 dog
12 baby

One more example and we're done. If we type baby in A1 , then the MATCH
statement matches "baby" against pix and that part returns 3 since baby
is the third item in the range A6:A8. So 3*30-29 is 61: (90-29). So, "which"
is 61, and wh ich-1 is 60.That makes Pic be OFFSET(U 1 ,60,0,30,1 5), or the
range U61 :AI90. That exactly covers the picture of the baby, so the picture
switches!

This is involved, but the impact is great.

This isn't Excel, it's Magic/ 123


6 1. Protecting ranges from
insertion of rows/columns
You can put an array formula to the left or on top of ranges to be protected
from inadvertent insertions. Suppose you have a table of values in N33:R70
which isn't always in view, so you (or someone else) might accidentally insert
a row at A44 and destroy the integrity of the table (if it were being used in a
lookup formula, the blank row in it would likely create errors).
In M33:M70, a parallel 1 -column range, array-enter =0 (that's hold ctrl+shift,
when entering =0):

M33 T ( ' fxj{=O}


[Mj
LF L N 0 I
(2krote_cted_r_<u��e_ Pr�tect�.d ran[e Pre-
32

I 0 Protected range , Protected range Pre


33
34
35 0 Protected range_ Protecte_d ran�e Pre
36 1 0 Protected range · Protected range Pre
37 .0 Protected range Protected range Pre ..
38 1 0 Protected range ,Protected ran$e Pre

You'll see {=0}, indicating the range is array-entered.


If you try to insert rows you get the "you cannot change part of an array"
message:

-

· ·

Mi_�;ro�oft �xc�t

_n You cannot change part of an array.

r· Oii·-'1
'
ttt
!t!
d "
"stt
e
""

Notice that the protected range is out of sight and we're trying to insert a
row at row 37 which would put a blank into that remote range.

124 This isn't Excel, it's Magic!


• 62. Numbering Questions tip
Take a look at the following:

A2 ... fie =MAX($A$1:A1)+1


A B c I 0 I E I F
1 Number Tip
_?__I'-H---�1! ere's some text
3
4 2 Here's some more text
5
6 3 Perhaps this could be a question which takes
7 more than one line to pose
8
9 4 And another question
10
11 5 And yet another
12
. ..

You can see that the formula looks at all numbers from A1 (as an abso-
lute reference) to the cell above (as a relative reference), and adds one to
the largest number on that range. I n this case, cell A4 has a formula which
examines A1 :A3 and takes the largest number (1) and adds 1 to it. So far no
big deal.This formula is not being filled down, but is copy/pasted to the first
line of each "paragraph." The nice feature with this formula, instead of simply
entering the numbers wanted, is that if you decide to delete a question or
add a new one, all the other numbers are re-numbered!
Let's see what happens when rows 6:8 are deleted, using the Delete Cells
command from the Cells section of the Home tab: [Excel 2003: EditjDe/ete]

d"" Insert • I: "'" g d


� Delete j:l � •
� Qelete Cells...
� Delete Sheet ,Bows
1
'JJ' Delete Sheet �olumm
J
lim Delete �heet

This isn't Excel, it's Magid 125


The result is:

( I =MAX($A$l:A5)+1
fx

l
A6 •

A
1
rBr= · C( 0 I E I F.
1 Number Tlp
2 1 Here's some text
3
4 2 Here's some more text
5 �------
6 3 And another question
7
8 4 Andyet another
9

Notice that cell A6 has the same formula as it did before, but what were
questions 4 and S are now 3 and 4! Suppose I wanted to insert a new ques­
tion before question 4 (let's also assume there are 100 questions!)
First select rows 7:9 and use the Insert Cells from the Cells section of the
Home tab: [Excel 2003: lnsertiCe/ls)

Ia"" Insert � ... I


I: ..
I a"" Insert (£liS

;.a Insert Sheet Rows


.> .J
� Insert St1eet ,\;;olumns

[31 In1ert Sheet

Now we have:

A7
txl
A B . 0 E
1 NumberTip
1 Here's some text

2 Here's some more text

1-1�-6 ���----�3�A�n�d�a�n�o���er�u�e�s�ti�o�n--�
7
8

9. � -------�

10
11 4 And yet another
12
13

126 This isn't Excel, it s Magic/


'
I type in the new statement and copy/paste any of the formulas in column A
to cell AS:

AS •
( fx I:MAX($A$1:A7)+ 1
i A j 8 c
I D
F. F
1 Number Tip
2 1 Here's some text
3
4 2 Here s some more text
'

5
6 3 And another question
87 ,_ ....,4 •The new statement
_

9
10
11 siAnd yet another
12 l

This isn't Excel, it's Magic! 12 7


• 63. Mailing Label tricks - 1
Suppose you have a list of names and addresses arranged like this and you
want to rearrange it like the textbox indicates:

A B c
1 Address City... Company
2 Bob's Address
---<
Bob's City, State, Zip Bob's Company
3 Judy's Address Judy's City, State, Zip Judy's Company
4 Jane's Address Jane's City, State, Zip Jane's Company
5 Herman's Address Herman's City, State, Zip Herman's Company
_L Laird's Address From this, we want
Laird's Company
7 Curtis's Address Curtis's Company
Bob's Company
8 Jared's Address Bob's Address Jared's Company
9 Stefanie's Addre' Bob's City, State Zip lp stefanie's Company
10 Peter's Address Peter's Company
11 Alice's Address Judy's Company Alice's Company
12 Joan's Address Judy's Address Joan's Company
13 Reid's Address
Judy's Oty, State Zip Reid's Company
14 LaVerne's Addre·
�P
LaVerne's Company
etc
15 Eli's Address en ::. \.on:y,-;:,"\.<ffe/L"lp Eli's Company
16 Oon's Address Oon's City, State, Zip Don's Company
17

If you tried to enter formu las like these in D2:D4 (showing formulas):

A B c I 0
!
1 Address lcity...

Company
2J Bob's Address Bob's City,State, Zip Bob's Company =C2

3 Judy's Address Judy's City, state, Zip Judy's Company =A2


4 Jane's Address Jane's City, state, Zip Jane's Company =B2
.2_tHerman's Address Herman's City, state, Zip Herman's Company
6 Laird's Address Laird's Company
From this, we want
..2._t Curtis's Address Curtis's Company
Bob's Company

.£!
8 Jared's Address Bob's Address
Stefanle's Addre; Bob's City, State Zip
Peter's Address
Jared's Company
lp Stefanie's Company
Peter's Company
11 Alice's Address Judy's Company Alice's Company
12 Joan's Address Judy'sAddress Joan's Company
Judy's Oty, State Zip

J
13 Reid's Address Reid's Company
14 LaVerne's Addre! p LaVerne's Company
l etc
1
5 Ell's Address c.n::. "''lY1 .;)ld(�, U'f.J Eli's Company
16 Oon's Address Don's City, State, Zip Don's Company

128 This isn't Excel, it s Magic/


'
which results in:

c D

-+i
A B
1 Address City... Company
Bob's Address Bob's City, State, Zip Bob's Company Bob's Company
3 Judy's Address Judy's City, State, Zip Judy's Company Bob's Address
4 Jane's Address Jane's City, State, Zip Jane's Company Bob's City, State, Zip

5 Herman's Address Herman's City, State, Zip Herman's Comp


_any
6 Laird's Address laird's City, State, Zip laird's Company
7 Curtis's Address CUrtis's City, State, Zip CUrtis's Company
� l;uoti'c: 6tirli'OC< l:arorl'< ritv <:t�to 7in l::�rorl'c; rnmn::.nv

which seems like a good start, filling this down (starting with selecting D2:
DS, including a blank cell) produces a disaster:

06 ·� t.J=C6
A l B c 0 I
1 Address City... Company

Bob's Address Bob's City, State, Zip Bob's Company Bob's Company

Judy's Address Judy's City, State, Zip Judy's Company Bob's Address

Jane's Address Jane's City, State, Zip Jane's Company Bob's City, State, Zip

Herman's Address Herman's City, State, Zip Herman's Company


6 laird's Address Laird's City, State, Zip Laird's Compan'!' !Laird's Company I •

7
-
Curtis's Address Curtis's City, State, Zip Curtis's Company La i rd'sAddress

8 Jared's Address Jared's City, State, Zip Jared's Company Laird's City, State, Zip
9 Stefanle's Address Stefanle's City, State, Zip Stefanle's company
Peter's City, State, Zip Peter's Comp!ny Peter's Company

11 Allee's Address Allee's City, State, Zip Alice's Company Peter's Address
Joan's City, State, Zi p Joan's co�pany Peter's City, State, Zip
... .. - . .. • • • - . .. ...
.. .. . -· .... . .. ...

-what happened to the intermediate companies like in row 3, 4, and 5?


Oudy's company...)-notice the formula bar for the active cell has =C6 in it,
not =C3. Here are the formulas for the next few rows:

c D
1 Company
2 Bob's Company =C2
3 Judy's Company =A2

4 Jane's Company =82


5 Herman's Company
6 Laird's Company =C6

7 Curtis's Company A6
=

8 Jared's Company =86


9 Stefanie's Company
10 Peter's Company =C10

11 Allee's Company =A10

12 Joan's Company =B10


. .. - . .. .

This isn't Excel, it's Magic/ 129


You begin to get the picture. The solution? Watch:
Enter these values (not formulas!):
02
·C firI xc2
iAddress A City
I
Company ...
B c D

Bob's Address Bob's City, State, Zip Bob's Company xa l


Judy's Address Judy's City, State, Zip Judy's Company xa2
4 Jane's Address Jane's City, State, Zip Jane's Company xb2
I
5 Herman's Address Herman's City, State, Zip Herman's Company
6 Laird's Address Laird's City, State, Zip Laird's Compa ny
7 Curtis's Address Curtis's City, State, Zip Curtis s Company '

8 Jared's Address Jared's City, State, Zip Jared's Company


9 Stefanie's Address Stefanie's City, State, Zip Stefanie's Company
10 Peter's Address Peter's City, State, Zip Peter s Compa ny
'

•• � u...-•... ,.. ..-............ A lr.,....l,. ,..1••• ,.


. •,.•.,. "'tl- ",,_,_ ....--·-··
..

Now, when you select 02:05 and double-click the fill handle, you get this:

A B c D
Address City ... Company
Bob's Address Bob's City, State, Zip Bob's Company xc
2
Judy's Address Judy's City, State, Zip Judy's Company xa2
Jane's Address Jane's City, State, Zip Jane's Company xb2
Herman's Address Herman's City, State, Zip Herman's Company
Laird s Address
' Laird's City, State, Zip Laird's Company xc3
Curtis's Address Curtis's City, State, Zip Curtis's Company xa3
Jared's Address Jared's City, state, Zip Jared's Company xb3
Stefanle's Address Stefanle's City, State, Zip Stefanie's C�mpany
Peter's City, State, Zip Peter's Company Xc4
Allee's City, State, Zip Alice's Company xa 4
Joan's City, State, Zip Joan's Company xb4
Reid's City, State, Zip Reid's Company

Now you can change x to =:

A B c
1 Address City ... Company
2 Bob's Address Bob's City, State, Zip Bob's Company xc2
3 J udy's Address Judy's City, State, Zip Judy's Company xa2
4 Jane's Address Jane's City, State, Zip Jane's Company xb2
- --

find dod Replace


5 H er
6 Laird ��
7 CurtI Fins! rReQiace I
fi!ld wh&:
8 Ja re
9 Stet
X v

R�iace woth: - v
10 Pete
11 Aile

12 Joan
I
[ Options »

13 Reid
14 1 "v..
[ Repi�ce e,ll I [ B.epiace
I I F!(ld All
I [I Next I I Close I
Find

130 This isn't Excel, it's Magic/


This gives (formulas are showing)
0

':.:
d
::. re:.,...,.
: d:,:
:.:s
::=
s --- City,:c
. ··. - - -+ Co
:.:n
l, '-
:.: p;my ---- :�
Bob's Ci
'-::c
ate, Z
i
p
-! ,---
-::-
- --=
,---- . ,..
= ,.,...
..., .

- - -
,

-
lob's Add
ress S
t Bob's Company C2
udy's Address Judy's C ity, Sta
te, Z
ip Judy's Company =A2
���
ane's . �

� .
� � .�������--
����
" �L -- - 1=B2 " ' . ' ' '

, Replace
terman Find and
[1Jl[J
R
ej!lace
=C3

� ======== ==
==== == �
.aird's
Find
:urtis's =A3
FiQd what: �=
·= ========= === =i=
;ijv
L-
· ------------�;===��v
ared's =B3
:tefani A.§.Piace with:
'eter's =C4

.lice's
[ Op�on
s I »
=A4
oan's =B4
F[nd I I Eind Nex t

� !;
;;����!!��� � ��� ������� �
teid's iOI I B.ep loce I
f��ei.�.i:i.� AI a-

� - � --
� ��. �
. a�
Ve� rn =C5

��
:li's ��
Address
� - � �
Eli's City,
� � ��
1
State, � - �Eli's
Zip � � � � �
ny-
Compa -- =A5
>on's Address Don's City, State, Zip Don's Company =B5

And without formulas showing, we have:

c D
1
A B
Address City... Company
Bob's Address Bob's City, State, Zip Bob's company Bob's Company
'
3 Ju dy s Address Judy's City, State, Zip Judy's Company Bob's Address
Jane's City, State, Zip Jane's Company Bob's City, state, Zip
Herman's Address Herman's City, State, Zip Herman's Company
6 Zip Judy s Compa·ny
'

-,-r
--
Laird's Address Laird's City, State, Laird's Company
7 Curtis's Address i
Curtis's C ty, State, Zip Curtis's Company Judy's Address

8 Jared's Address �red's City, sta_t�,Zip. red's Co


J". �pany Judy's City, State, Zip
9 Stefanie's Address Stefanie's City, State, Zip Stefanie's Company
Peter'� <:ity, State, Zip Peter's COmpany Jane's Company
' _
Alice's City, State, Zip Alice's Company Jane s Address
Joan's City, State, Zip Joan's company Jane's City, State, Zip

Sneaky, eh?
But this was touted as mailing labels.The format is okay, but how can you
make these fit on address label paper? Well, you can tweak the row height of
the blank cells. First, you need to make column D be the print area, from the
top label to the last line of the bottom label. Check how it would look now,
using Print Preview. Make sure there are no labels which are split across
pages.You can also adjust the top & bottom margins. If it needs adjustment,
select column D, use FS(Goto), Special, select Blanks, and click OK. Now
only the blanks are selected. Now use Home Tab, Cells Group, Format com­
mand, Row Height and make your adjustment, taller or smaller and print
preview again. [Excel 2003: FormatiRowiHeight]

This isn't Excel, it's Magic/ 131


• 64. Mailing Label tricks - 2
OK, what about this set of addresses?
A B c D
1 Jones, Jim
2 addrt
3 Cltyl Statel, 2ipl
How can you
,

4
possibly sortthese
S Smith, Bill
by name?
6IAddr2
7 Addr2 part 2 i
8 Clty2, State2 Zlp2
9 e mailaddr
10
11 Johnson, Alice
12 addr3
13 Clty3, State3 Zlp3 I__
14 emalll I
151emall2 I I I
16 POBox 33333 Il I
17 I I
18 Zedwlch, Paul
19 addr4 I
I lI
20 Clty4, State4 Zlp4 I T
21 I I
22 Bergman, Sylvia I
23 addr5
24 Clty5, States Z.lp5

It's already "arranged:' but what if you need to sort them by name? Not only
does this seem impossible, but the num ber of lines in each address is not the
same, making it more difficult! Or so it would seem!
First, we need to insert a row at the top:

A B c
1
'

2 Jones, Jim
3 addr1

1 possiblysort
4 Cityl, Statel, Zipl
How can you
s
these
6 Smith, Bill by name?
7 Addr2
8 Addr2 part 2
9 Clty2, State2 Zip_2 f r
10 emalladdr I I
•• I ,
-

132 This isn't Excel, it's Magic!


This is so we can enter a very simple formula in B2:

B2 "'I=IF(Al="",A2,Bl}
i A l B I c
1
2 Jones, Jim !Jones, Jim I •

3 addrl
4 Cityl, Statel, Zipl
s
6 Smith, Bill
7 Addr2
8 Addr2part 2
9 Clty2, State2 Zip2
10 emailaddr
11

The formula takes advantage of the blank between address-sets, hence the
need to insert a row. It says that if the row above is empty, use the name
(from A2), otherwise use the row above. Watch what happens when we fill
this down (important-include one extra blank row at the bottom to keep
the separation between addresses when we sort)

B2 . " "'I =IF(Al="",A2,Bl}


A I B c
__!__
� Jones, Jim Jones, Jim
3 addrl Jones, Jim
4 Cltyl, statel, Zipl Jones, Jim
S Jones, Jim
..2_Smith, Bill Smith, Bill
7 Addr2
_ Smith, Bill
8 Addr2 part 2 Smith, Bill
9 Clty2, State2Zip2 Smith, Bill
1q_ emalladdr Smith, Bill
11 Smith, Bill
12 Johnson, Alice .Johnson, Alice
13 addr3 Johnson, Alice
1� Clty3, state3 Zip3 Johnson, Alice
1S emalll Johnson, Alice

This isn't Excel, it's Magic/ 133


Why, now we have a field to sort on!

__;;-_A 8 :::J c 0 E F G H J K

2� Jone
�s , Jim
--
----
--Jones, JIm --
---,
l addrl Jones, Jim
tyl. StateI, Zlpl Joo�s. Jim
------- --
Jones, Jim
Smith, Bill
Sorl �
J rK
Smltl\. Bill
r'lpar12 Smith, Bill c.o.... s..t On a-
...

,
__
_11'-'·tv2. St•te2.Zlpl Smith. Btll ..,,by .,.
-�
.:; :l.!

·.,., :;;;:;
r�v, �::,;;
· :...,.�
.�������
vl "1•::.::;;
.,,---
, � � v

11
oladdr Smith, Bill

12 ohnson,
Smith, Bill
Alice Johnson, Ahc

14
13 itddr3 Johnson, AUc
ty3,
· State3, 2Jp3 Johnson, Aile
15 emaill Johnson, Aile
email2
17 POBox
16 John$0n. Aile
33333 Johnson, Aile
'.... .. . ''

'"' I I cance�

resulting in:

A B
1
2 Johnson, Alice Johnson, Alice
3 addr3 Johnson, Alice
4 Clty3, State3, Zlp3 Johnson, Allee
S email1 Johnson, Alice
6 email2 Johnson, Alice
7 POBox 33333 Johnson, Alice
8 Johnson, Allee

9 Jones, Jim Jones, Jim


10 addr1 Jones, Jim
11 dtyl, Statel, Zipl Jones, Jim
12 Jones, Jim
13 Smith, Bill Smith, Bill
14 Addr2 Smith, Bill
1S Addr2 part2 Smith, Bill
16 Clty2, State2, Zlp2 Smith, Bill
17 email addr Smith, Bill
18 Smith, Bill
19 Zedwlck, Paul Zedwlck, Paul
20 addr4 Zedwick, Paul

All there is left to do is clear column B!

134 This isn't Excel, it's Magic/


• 65. Bulk formula change
Suppose you have a worksheet with references to many sheets like this:

( I
fx '=Shee\2!$1:$1043576
I
• '
A1

..£ I
!I-'! I

_ !._[=Sheet21$1:?J.048576
2 =Shee\3 1$1:$�048576 '
3 ,Sheet4 1 $1: �
$ 048576
4 =She e
tS!$1: 1
$ 048576

5 =Shee
\6!$1:$1048576

6 =Shee
tl!$1:$1043576
7 =Shee
\8!$1:$1043576
8 =Shee
\9 ! $1 : $1043576
� =She et!0!$1:$1043576
10 =Sheettl!$1:$1043576
�1 =Shee\12!$1:$1043576
12 =Shee
t BI$1:$10435 76

13 =Shee
- --
4 !$1:$1
\1 04357
6

14 =Shee
\15!$1:$1
04357
6 .

And you want to put in column B these formulas corresponding to what's


in column A: =COUNTA(INDIRECT("Sheet2!1 :1 048576")) in B1 through
=COUNTA(INDIRECT("Sheet16!1 :1 048576")) in B16.
It could be done with a VBA routine, but here's a way to do it with formulas:
Look at the formulas in B here (The cells are all selected from the result of
a Fill/Down):

B1 I
fx ="=COUNTA( INDIRECT("""&MIO(Al,2,255)&"""))"

i A B
-
1 �heet2!$1:$1048576 (
=COUNTA IN01RECT "Sheet2!$1:$1048576" ( II •

2 �heet3!$1:$1048576 =COUNTA(INOIRECT("Sheet3 !$1:$1048576"))


3 �heet4!$1:$1048576 =COUNTA(INDIRECT("Sheet4!$1:$1048576"))
4 �heets!$1:$1048576 =COUNTA(INDIRECT("Sheets!$1:$1048576"))
5 �heet6!$1:$1048576 =COUNTA(INDIRECT("Sheet6!$1:$1048576"))
6 �heet7!$1:$1048576 =COUNTA()NOIRECT("Sheet7!$1:$1048576"tJ
7 �heetS!$1:$1048576 =COUNTA(INOIRECT("Sheet8!$1:$1048576"))
8 �heet9!$1:$1048576 =COUNTA(INOIRECT("Sheet9!?1:$1048576"))
9 �heetl0!$1:$1048576 =COUNTA(INDIRECT("Sheetl0!$1:$1048576"))

-
10 �heetl1!$1:$1048576 =COUNTA(INDIRECT("Sheetll!$1:$1048576"})
11 �heetl2!$1:$1048576 =COUNTA(INDIRECT("Sheetl2!$1:$1048576"))
. ... -t"t-......�ot
.. "\ tf"o1 .c'1 t\_.tH:"7C _ ,...1"'\1 I "I'TA I I"I r"\ 1 n ,.�lli t"I.. .... ,....a.- 1 ... I cA-1 , t'-1 n .. nc-,cII'\

The formula in B1 is
="=COUNTA(INDI RECT("""&MI D(A 1 ,2,255)&"""))"
This is understood by Excel to simply be a bunch of text made to look like
a formula, but it does not act like one. Since it looks like the right one, let's
copy/paste special values (by the trick of dragging the border away & back to
the same spot which gives a dropdown to choose values):

This isn't Excel, it's Magic/ 135


I ="=COUNTA( INDIRECT("""&MIO(Al,2,255)&"""))"
B c I 0 I E


=
------------�--��------�--�-+-
COUNTA(INOIRECT("Sheet2!$1:$1048576"))
=COUNTA(INOIRECT("Sheet3!$1:$1048576"))
� �--��
� �-­
=COUNTA(INOIRECT("Sheet4!$1:$1048576")) Move Here

.!;opy Here
=COUNTA(INOIRECT("Sheets!$1:$1048576"))

Copy Here as �alues Only


=COUNTA(INOIRECT("Sheet6!$1:$1048576"))
=COUNTA(INOIRECT("Sheet7!$1:$1048576"))
Copy Here as formats Only
=COUNTA(INOIRECT("SheetS!$1:$1048576"))
1
ink Here
=COUNTA(INOIRECT("Sheet9!$1:$1048576"))
=COUNTA(INOIRECT("Sheetl0!$1:$1048576")) Create!jype�ink Here

=COUNTA(INOIRECT("Sheetll!$1:$1048576")) �tuft Ot> n ancJ Cop_

So now it looks like the formula we want, even in the formula bar:

Bl •
fx =COUNTA(INOIRECT("Sheet2!$1:$10485.
A B
1 =Sheetl!$1:$1048576 =COUNTA(INDIRECT("Sheetl!$1:$10485 71
2 =Sheet3!$1:$1048576 =COUNTA{INDIRECT("Sheet3!$1:$1048571
3 =Sheet4!$1:$1048576 =COUNTA(INDIRECT("Sheet4!$1:$1048571
4 =SheetS!$1:$1048576 =COUNTA{INDIRECT("SheetS!$1:$1048571
5 =Sheet6!$1:$1048576 =COUNTA(INDIRECT{"Sheet6!$1:$1048571
6 =Sheet7!$1:$1048576 =COUNTA(INDIRECT("Sheet7!$1:$104857•

But it's not. We once again need to Replace"=" with"=":

rg
-
L -
• ¥
!ID-
btl
Sort & Find &
ot • (2 · Filter · Select •

=�
find ...


�ac Replace
=
...

q �o To...

Go To Special...

Formylas

Comments

Conditional Formatting

Constants

Data Validation

� Select Qbjects

� Selection fane . ..

136 This isn't Excel, it's Magic/


And the final result is:

81 �( fx =COUNTA(INDIRECT("Sheetl!$1:$1048576"))
A 8 c D
45 I
1 =Sheet2!$1:$1048576
2 =Sheet3!$1:$1048576 0
3 =Sheet41$1:$1048576 1
4 =SheetS!$1:$1048576 1
5 =Sheet6!$1:$1048576 1
6 =Sheet7!$1:$1048576 1
7 =SheetS!$1:$1048576 1
8 =Sheet<J!$1:$1048576 1
9 =Sheet10!$1:$1048576 1
10 =Sheetll!$1:$1048576 1
11 =Sheet12!$1:$1048576 1
1? :<;h<><>t1 ':II �1·�11\411<;7/i 1

This isn't Excel, it's Magic/ 13 7


• 66. Fun with relatively defined names
If, while on cell A 1, you define a name, z, to be =!A1 :Z1 00 like shown:

��
,
.,.
� · ·
�·
� -
..,..�
....
N;._
'!:.
ew _,.N
� am
e��
-'"""' - �
--
...
..--- , -

�: z
I
�ope:
lwort<book �I
C�: ,..
-

aefers to: ltAI:ZIOO -


[���
[ OK
�I Canc el
I
then you can use this name to scroll the active cell to the top left of the
worksheet!
For example, suppose you have a worksheet which looks like this:

-�-
;•,l
- ;.i IS>�
t
, �0 .1 c .L 0 I ( l '
1 0 " J � l .... I N
� t�<t�:!
-
d �..
•• d)tla
,... ,.
d•:• dat::� d.ltil
) d .J:;:! C�1.J ......
1d.)UI
dUI d)!ll (1..;11:1 "'"'

-
J ..... Cl•l.l dau cu• I»til
chta dJlA
di!.�
• 'CftiUI cf)1<1 dlol<l dt.lo <I•tit
.S -(u:.a

-�d�t�
·�

4.1�.1 .,,,. CI.U:t d.l !.- dill�


d&tl
doll..
on.- .,... (t,n;t
data
dJtf �.,.

-
1 4.1"..., 6J14 ..... d..lt• d.!• .,.,.
• 4.1t.1 C..1• d•t• 4.1t<1! d.t!lt d..at• d.1Uo
' .,.,. .,.,. .,.,, d�t.li ...,. ..... <1>1>
.:0 CI;U """ d•t.t .....
. "'" �1..l clA!•
u I;!J� Cb!.l ...,. d.){,\ tht,\ ...,. 6>1.>
u �; ., c!Jll d>t• cUI> .,... �t.l .....
u <!.tt.. cs..:.a
c t..a
.,.,. ...
,
. d.i�• "''"' ....
M
- b C'.Jt.1 ..... d
.)
I ,\ d.at• �:.. d>U

�t:;tl
l.S �tl .... dm 4-W.li 4.la ...... .... �'!� tJ�l d>l>l �t� 4.1�2 c!JtU
16 �Jt"' ...,. d1U .... .,.,. ""'' d.ttf c:..-:�2 ��:
.. IC.lt.f)
d.1ta2
d.Jt..2 d..�.l
" ct:.:.1 cla:.-2 d>u> dJit.l1 chtll
d.-�J dJu:
..
11 �:..: 1!��1: cb.al d.-t.l)

" dt!.-t ..w d
..
tt
1 d.t
t.tl

;o
&Ul <l&U2
d4.. C..St-11
:z �:.a d;):.C d.at.l.l d.J•:.u
n 4-f�.-2 t\1:...1 d.ii\#1 d.at� CU
'::OIJ 4Jt�-J
21 d.tt..1 .:.Jt-�2 d>t>l d.-:#l. "'
"' """'t

-2l d.lW ......, .....


.
- .
dl�d d.l:42 t.:.�.,1
e� .t
..a
:o.s d�!.\1 dnll d.1l.t7 4.1-�.u d.U.U'

and you'd like to see more of the data starting in cell 115. Certainly you can
scroll both horizontally and vertically, but you can also take advantage of this
newly defined name, z. Click on cell l15, then use FS and Goto z.The result
will be this:

138 This isn't Excel, it's Magic!


115
·� fx I data2

J I K l M N
I
15 data2 data2 data2 data2 data2 data2 data

16 data2 data2 data2 data2 data2 data2 data


-

17 data2 data2 data2 data2 data2 data2 data

18 data2 data2 data2 data2 data2 data2 data

19 data2
-
data2 data2 data2 data2 data2 data

-
20 data2 data2 data2 data2 data2 data2 data

21 data2 data2 data2 data2 data2 data2 data

22 data2 data2 data2 data2 data2 data2 data

23 data2 data2 data2 data2 data2 data2 data

-
24 data2 data2 data2 data2 data2 data2 data

25 data2 data2 data2 data2 data2 data2 data

26 data2 data2 data2 data2 data2 data2 data

27 data2 data2 data2 data2 data2 data2 data

28 data2 data2 data2 data2 data2 data2 data


'q rl�t<>7 rl�t�') rl�t::t? ri::lt::t' ri ::l
t::l., rl�t�7 rl�t<>

Notice that the cell has been scrolled to the top left. That's because, from
cell 115, the definition of z is =!I1 S:AH 1 1 4 as in this illustration:

tjew... I[ t<ll. I[ Qelt<e fi l t e r ..

Refe.-s TO
··

Veluo ComMent

/
- a relative reference to the active cell resized by 100 rows and 26 col­
umns. In order for Excel to show as much as it can of this range, it scrolls
the worksheet!
Z is defined with a leading exclamation mark so that the sheet name is not
appended to the name, and you can use z to be a 1 00x26 shape in any sheet!

This isn't Excel, it's Magic/ 139


• 6 7. Using notes inside formulas
via the N-function
The N function, shown here:
��"'
-
= •
l!J�,I!fl_,t�nc,ti�!l=� ��
�arch for a functcon:

[ I
Or sele<t a !;.ategory: IL_
An
_____
____
��
��
Select a functioo.:

MIRR
MMIULT

N(value)
Converts non-number value to ·a number,.- dates to.serrai numbers,· TRUE to
I, anything else to 0 (zero).

converts non-number to a number, dates to serial numbers,True to 1 ,


anything else to 0. Well, you can take advantage of this knowledge inside a
formula. For example:

, -'"',] •VLOOK UP ( B22,x yztable, 3,FALSE)+ N(" T his will search the table for the z·factor")
- c l o l e F ! G ' H : : J 1 �
Io.otamJ
This formula now explains that the VLOOKUP is searching xyztable's third
column for the occurrence of cell B22's value for the z-factor (whatever
that is). The point being that the part of the formula, N ("This will search the
table for the z-factor") will be zero. not effecting the result. So you can use
the N-function inside formulas like this to document or comment on a part
of the formula by effectively adding 0.

140 This isn't Excel, it's Magic!


• 68. New Table features
If you have entered a table (new to 2007), it is automatically assigned a name,
like Table1, etc. You can reference parts of the table in formulas. Here is a list
of some of the new features. If you enter the beginning of a formula for a
table and include the opening bracket, like =table1 � Excel provides an
intellisense tool tip:

8 c 0 £ f G I ( J ,K_
.l t
l l M

l
5 4

� ...,.
·liN;�·
1
•:ot.ak
"n.,.II.Oort

The small text says:


"Returns the entire contents of the table, or specified table columns includ­
ing column headers, data and total rows"
It provides a reference to the entire table, so you can sum it, for example,
without knowing the cell addresses. =SUM(Table1 [#All]) might include a
total row, if present, so the above illustration would give 20 in this example.
Using =SUM(Table1 [#Data]) would yield 10.

This isn't Excel, it's Magic! 141


To get the headers, you could ctrl/shift/enter =table1 [#Headers] if there
were more than one column in the table, or simply enter the formula (with­
out ctrl+shift) if there was only one column:

IAI
Illata

ITotals
, .tllisRow

01 fxlt=Table1(#Headers]}

B I c ' 0 E I F
1 data2 a loata data2 !
2 1 4
3 2 3
4 3 2
5 4 1,
Here are the last 2:

Data
#All
#Data
#Headers
[Returns the total rows for the table or specified table columnsI

03 •
,.
c 0 E F
2 1 5
3 2 1 I 3!
4 3 2
5 4 3,

142 This isn't Excel, it's Magic/


• 69. New Excel functions
Excel 2007 comes with 5 new built-in functions (excluding the new CUBE
functions):
SUMIFS,AVERAGEIFS, COUNTI FS,AVERAGEIF, and IFERROR. Let's take a
brief look at them in action:

E3 �
fx =SUMIFS(Amount,Region,''South",Oate,"<4/06")
I
A 8 c 0 I E I F G H
1 Region Amount Date
2 East 558 29·May·05
3 North 43 14-Apr-07 I 111&51
East

4 826 28-0ct-04
5 West 765 3·Apr·09 508.4090909
6 South 271 14-Feb-10
7 West 415 17-Jun-05 481.2837838
East 402 16-Mar-07
633 15-Nov-05 22

16 9-Aug-05
11 East 198 20-Jan-06 Not Found
12 West 741 26-0ct-10
13 East 559 5-0eo-08 Not Found
14 East 263 30-Apr-08
15 North 809 27·NOV·08
16 South 884 23-Aug-07
17 West 894 10-0ec-08
18 North 942 13·Mar·ll

Here, we see the SUMIFS function. Its syntax is SUMIFS (Sum_range,criteria_


range1,criteria1, ... ) which basically states which range to sum based on
,

pairs of criteria ranges and their criteria. This example uses Amount (column
B) as the range to sum, and there are 2 pairs of criteria: the region (column
A) must be "South," and the Date (Column C) must be prior to April, 2006.
The next function we take a brief look at is the AVERAGEIFS, which is basi­
cally the same as the SUMIFS, but the Average is taken instead of the Sum:

ES fx =AVERAGEIFS(Amount,Region,"South",Oate,"<4/06")
A 8 c 0 E F G H
1 Region Amount Date
East 558 29-May-05
North 43 14-Apr-07 111&5
826 28-0ct-04
765 3-Apr-09 Isos.4o909o9!
271 14-Feb-10

The AVE RAGEIF function is like the AVERAG EIFS function, except there's
only one pair of criteria:

This isn't Excel, it's Magic/ 143


E7 •
"' =AVERAGElF(Region,"East",Amount}
A I B c I D I E I F j
1 Region Amount Date
2 East 558 29-May-05
3 North 43 14-Apr-07 ll185
4 East 826 28-0ct-04
s West 765 3-Apr-09 508-4090909
6 South 271 14-Feb-10
Jlwest 415 17-Jun-05
1481-2837838!
R F�<l 40, 11\-M�r-07

The COUNTIFS fun ction is like the SUMIFS and AVERAGEIFS functions,
except the range to sum (or average) is not included. It's still pairs of criteria,
but they're merely counted:
E9 •
"' =COUNTIFS(Region,"South",Date,"<A/06"}
A B c D E F
Region Amount Date
East 558 29-May-05
North 43 14-Apr-07 11185
4 East 826 28-0ct-04
5 West 765 3-Apr-09 508.4090909
6 South 271 14-Feb-10
7 West 415 17-Jun-05 481.2837838
8 East 402 16-Mar-07
9 South 633 15-Nov-05 I 221
10 South 16

9-Aue-05
You can calculate that 1 1 185 I 22 is 508.4090909, verifying that the SUM I
COUNT is the AVERAGE!
The last new function is the IFERROR function, which basically shortens
something like this:
I=tf(ISERROR(Vl0UP{
0K "Herman",A2:CS0,2,FAISE)),"Not Found",VlOOKUP("Herman",A2:CS0,2,FAISE))

o l E 1 F 1 G H J K t 1 M
INotFound !
to this:
I =IFERROR(VLOOKUP("Herman",A2:C50,2,FALSE},"Not Found"}

D E F G H I
INot Found !
The syntax isjiFERROR(Val.;e,value_if_worJ which means that if it is NOT an error,
it returns the value of the calculation, as in the first longer example above.
In Engli sh it's "If the VLOOKUP returns an error, show "Not Found." Other­
,

wise, do the VLOOKUP."


But this requires you to code the sameVLOOKUP formula twice in the
same function. The IFERROR avoids that!
144 This isn't Excel, it's Magic/
70. Ctri/Shiftl-, 1,2,3,4,5,6
for quick formatting
These simple keyboard shortcuts can help with number formatting (here,
the value 1.5 was entered in the cell):

Ctrl+sh ift+: Resulting Format: Example:


-
General 1.5
1 2 decimals 1.50
2 Time format 1 2:00 PM
3 Date format 1 -Jan-00
4 C u rrency $1.50
5 Percent 150%
6 Sc ientific 1 .50E+OO

This isn't Excel, it's Magic! • 145


7 1. Borders from keyboard
Ctri/Sh ift/7 creates outline border
Ctri/Shiftl- removes border

146 This isn't Excel, it's Magic!


72. 1nserting Date & Time shortcuts
Ctri/Semicolon (Ctrl/;) will insert the date in m/d/yyyy format;
Ctri/Colon (Ctrl/:) will insert the time in h:mm AM/PM format.

This isn't Excel, it's Magic! 14 7


73. Click the AutoSum button
from the keyboard
Altl= is the same as clicking the AutoSum tool.
Altl= twice (quickly) will also enter the result.

148 This isn't Excel, it's Magic!


74. Bringing the selection into view
It's possible you've selected some area of cells and then scrolled away so
you can't see it any more. Ctri/Backspace brings that selection into view, and
shift/Backspace brings selection into view as well but reduces the selection
to the active cell. So, if this is the before picture:
I A I B I c
1
2
3 I I
4
5
6 •

then shift/backspace will simply have cell B3 selected.

This isn't Excel, it's Magic! 149


75. Ctrll[ more powerful than
,,
its "equivalent Go To Precedents
If a cell has =SUM (B2:E4), then with that cell selected, use FS (Goto) I
OSpecial and select Precedents. The result is that cells B2:E4 will be selected.
Ctrll[ does the same thing.
However, if a cell has a link to a cell in a closed workbook (the entire path
would be shown in the cell), then using FS (Goto)ISpeciai/Precedents would
give an error message:
-
Microsoft Excel �
No cells were found.
_G �."..........".............1
'
i OK i

whereas ctrll[ would open the file, switch to the appropriate sheet, and
select the cell!

The FS (Goto) I Special dialog also has an "All levels" option button when
you select Precedents (or Dependents). This means that if, in the first exam­
ple above, cell C3 had a formula which referenced H12, the all-levels option
would also select cell H 1 2 (in addition to B2:E4).
-
G.o To Special C8J
Select
0 !:;_ome
m nts 0 Ro�differences
0 C2f'St4ntS 0 Column differences
0 Eotmulas 0 erecedents
0 Dependents
O D!redonly
0iAif!eveiSl.
·-·-···-··..--

0 La�t cell
Oal�n� 0 Visible cells onl�::
0 Current (B!jion 0 Conditional formats
0 Current �rray 0 Data �alidation
Oo�Vects All
Same
.---
- - �
OK J [ Cancel ]
The equivalent keyboard shortcut is ctrl/shift/[.

150 This isn't Excel, it's Magic/


76. Show Corners of Selection Easily
Ctrllperiod successively selects corners of the selection, even if the entire
selection is large, as in A1 :DD799.

This isn't Excel, it's Magic! 151


77. Anchoring the active cell
Holding the shift key down while you click a cell, or double-click a border, or
even in the GoTo dialog (FS) will keep that cell as the active cell.
If cell C4 is active, as shown, and you use the GoTo (FS) dialog and enter e9
as the cell to go to:

I c D F I G H E I
� -
q�T!J ��.
!iO to: .
I I
• ....


I_ vi .
.
.
!l.eference:

1•91 I.
.
I SPecial. • .
l It ..
OK
. JI Ca ncel
. l

then if you hold the Shift key down when you click the OK button, this will
be your result:

1
A 8 I c

2
3
4
-

I
5
----1
6
7

11
10
I

In other words, the original active cell will still be the active cell.

If you shift click cell A2, now, the selection will be A2:C4, with C4 being the
active cell.
Since Ctrl/down arrow (or right/left/up arrow) takes you to the end of a
block, shift/ctrl/arrow will also take you to the end of the block, but the
active cell won't change!

152 This isn't Excel, it's Magic!


• 78. Finding after the Find dialog
is closed
Shift/F4 repeats the Find command after a find was done; Shift/Ctri/F4
repeats find backwards! That is, if you did a normal Find command to find
something:

fi.t��t !'. !'��.._�P}�_e�
_,
.� �

IOpl;io,">S »II

then if you close the find co mmand and use Shift/F4, it will still find the same
text, and Sh ift/Ctri/F4 will find the same text backwards.

This isn't Excel, it's Magic! 153


• 79. A few miscellaneous Shortcuts
• Ctrl/' (single apostrophe)-this copies the cell above exactly. So, f i cell A1
has =SUM($B2:C7), then pressing Ctrl/' from cell A2 will put =SUM($B2:C7)
in cell A2.
• Ctrll" (quote)-this copies the value from the cell above. So f i cell A 1 has
=SUM(E1 :E1 0) and its value is 350, then pressing Ctrl/" from cell A2 will put
the plain number 350 in cell A2.
• Ctrl/; will put in today's date.
• Ctrl/: will put in the time.
• If you press Ctrl/; followed by a space then Ctrl/:, you ll have the date and
'

the time.
• Sh ift/F2 will insert a Comment.
• F9 will calculate the open workbooks; Shift/F9 will calculate the active
workbook.
• Ct ri/T or Ctri/L will insert a Table.
• Alt/T/0 will get you to 2003's equivalent ofTools/Options.
• Alt/T/1 will get you to 2003's equivalent ofTools/Add-ins.
• Alt!V/U is Full Screen
• Alt/F/<1-n> is File/Open <last used file ...>.

154 This isn't Excel, it's Magic!


80. Sorting columns
This is useful for rearranging columns and is often easier that cut/insert
paste to move the columns around.

You may have to use a "dummy" row to enter the sort sequence.
In this worksheet, a dummy row was inserted (row 1 ) to enter the sort
sequence. We want Name, then Address. then City, State, and Zip:

A I B c 0 E

1 21 1 4 3 5
Address Name State Zip

2 City
3 123 Main Name1 Fl Orlando 12345
4 124 Main Name2 NV Albany 12346
5 125 Main Name3 WA Red mond 12347
6 126 Main Name4 TX Houston 12348
7 127 Main NameS CA San Diego 12349
8 128 Main Name6 Fl Tallahassee 12350
Use Home tab, Editing section, Sort & Filter, and Custom Sort [Excel 2003:
Data/Sort]:

�: u �

Sort & Find &


0.. •
Filt er • Select •

�� �ort Smallest to largest


X� S2rt largest to Smallest
inJ Custom Sort...

Y= filter

1� f:e•ppty

Click the "Options" button, click Sort Left-to-Right,

I.)!1Add ][X !!dote J I-b �Y II 0 MydatahastJoaclors


lev el LOYd level ,) •
IQptions...I

��
Coi.Jmn ar
d..

Sortby ·
,- - ,
,__
_ __
-- .. to z

0 ,••• ..sitiv.
.,

Orie:nUaion
t

0 Sort \Of> t4 bottom


®1'
• t��u��-�.!!2�J
.
.... _.......,_,•..•.,_,1
..

OK II Cancel

OK cnce
a l

This isn't Excel, it's Magic/ 155


click OK,
--
Sort 0

'Row

IQptions.·•I
SOr t On Order
SOrt by
l� t

then pick the row containing the desired column sequence (Row 1 in this
case), and finally click OK:

A I B c 0 E

-
1
IName 1•1 2 3 4 5
2 Address City State Zip
3 Name1 123 Main Orlando Fl 12345
Name2 124 Main Albany NV 12346
Name3 125 Main Redmond WA 12347
Name4 126 Main Houston TX 12348
7 NameS 127 Main San Diego CA 12349
8 Name6 128 Main Tallahasse FL 12350

156 This isn't Excel, it's Magic/


81. Making exact copies of ranges
with relative or mixed references
This technique is useful if you have many cells to copy-otherwise, it's pretty
simple to copy the formula directly from the formula bar. Usually, if you copy
a range which has relative or mixed references to a new range, the referenc­
es will adjust. That is, if A1 contains =C7 and you copy A1:82 to C2:D3, then
C2 will contain =ES. Here's how you can have C2 still contain =C7.
We'll use the above references as an example.

To copy A1:82 to C2:D3 and not change any references in the resulting
range:
Here are the formulas we're starting with, using relative, mixed, and absolute
references:

A B
1 =C7 =D$7
2 =$C8 =$0$8

:� I

And here's the worksheet displayed normally:

.--.:..:.
A�� 8 c D
1 labc ! def
2 ghi jkl
3
4
s
6
7 abc def
8 ghi jld
9

This isn't Excel, it's Magic/ 15 7


1 . Use a 2nd worksheet in group edit mode. To do that. Ctrl/click a second
(unused) sheet tab:

c6;;\ [) Q � • J £3 .2iJ J> . Book1 [Group] Micrc ; -

-� HomejInsertIPage layou-1formulas I DataIReview Vi!w�vel


,

� % 1

Cahbri • 11

_j '-cl I B I u ·I K .£1
IEB · I �· A · � �����·I •
Paste Numbu Sl)

J
Clipboard r. r. r.

I
Font Alignment

I A1

•fldef .fx =C7

c I I
A B ! D
--.
E F
1
-
jabc •
-

2 ghi jkl
3
4
5

-
6
7 abc def
-
8 ghl ]kl
9
10
•• • �
�11Sheetl/Sheet 37tl7
27Sheet lil41
Ready Num lock �
l�!m [Q]J!!!JLlOOj
(Notice both sheets 1 and 2 are selected, and there's another indication
you're in group mode-at the very top of the screen you can see "[Group]."

158 This isn't Excel, it's Magic/


2. Select A1 :B2, use Across Worksheets in the Editing section of the Home
tab (this is dimmed when you're not in group edit mode) [Excel 2003: Edirl
Fill/Across Worksheets]:

Home

Sort & Find &


• Folter Select ·
Edotm
tiJ Down
= 11! BighE
= IQI llP
� ),eft
I �cross Worksheets...

�eries...

!usttfy

3.You're presented with this dialog

Fill Across Workshe. . .


Fill
0:...... :

A
!�.....IH
-
· .
,

0 Contents
0 Formats

[ OK I[ Cancel I

4. Now, Sheet2 contains the exact same references in A1 :B2 as Sheet1


contains.
S. Activate the 2nd worksheet (not in group edit)-you do this by shift/click­
ing on Sheet2's tab. Since we didn't copy C7:D8 as well, you only see O's in
Sheet2, but that's fine.
6. In Sheet2, Cut A1 :B2 and paste to C2:

I =C7
[ I �f
Al fx

1
A
0
B
0
I c

2 0 0

This isn't Excel, it's Magic/ 159


You can see in the formula bar that cell C2 still contains the reference to C7.
This is because the references don't change in a cut/paste, only in copy/paste.
7. Back to group edit (with Sheet2 active, ctrl/click Sheet1 ) select C2:D 3, use ,

Across Worksheets from the Editing section of the Home tab, [Excel 2003:
EditiFilljAcross Worksheets]

[QI Down

� .Bight
tm Up

� .!,eft
l!cross Workshee!s.,.=-o: l
·l �eries...
lu�tlfy

filling the 2nd sheet back to first. Shift/click Sheet1 and you'll see:

C2
� t� = C7

rr!l A B jl;� c· .li "o-1 E I 0 I G.


I H I I
_abc
-

l
.
.

def
def
2 ghi
3

4
jkl
I
abc
ghi jkl I

7 abc def
8 ghi jkl
9

10 the formulas are...

��:
1
3j:==
C2 •( t.J =C7
B
.

- � G 0
A - -

14 1 =C7 =0$7
15 2 =$C8
;..
=$0$8
I

1:�8
=0$7
16 3 =$0$8
17 4

18 5
19 6 I I
20 7

r [
abc J�. ::::.:.
ef ...
8 _Jijkl
_

I j gh
.::_
I ____

Another way (maybe easier) would be to replace the"=" in the formulas


with something like "x=" (turning formulas to text), then copy/paste to the
new location, then replace "x=" with "=" in both ranges!

160 This isn't Excel, it's Magic!


82. Filling Holes
Suppose you have a worksheet something like this:
A1 ·( f.<
J State

A 8 c
1 �ate JRegion Amount
2 PA North 300
3 04
1

4 19
5

s 749
6 SOuth 700
7 348
8 508
9 935
10 582
11 WA North 377
12 936
13 south 831
14 2
43
15 344
16 NY North 97
17 120
18 South 577
19 955

And you'd like to sort it by state! Yikes.You KNOW it would be quite


messed up because of the holes (empty cells). ln this example it wouldn't
take too long to fill PA down from A2:A 10, then WA from A1 1 to A1 S, etc.
and then it'd be easy to sort, but if this extended to row 6000, forget it!
Well, there's a pretty easy way:
1. Select cells, use FS key, click Special, select Blanks:

I 83

A
·{ 8
J.<l
c
1 State Region Am
oun
t
2 PA North 300
3 I 104
4 159
s 49
7
6 South 700

7 348
8 508
9 935
10 582
11 WA North 377
12 936
13 south 831
14 243
5
1 344
16 N Y North 97
17 120
18 south 577
19 955
••

This isn't Excel, it's Magic/ 161


2. Type "=," press the up-arrow, then press Ctri/Enter:

83 .c� I=sz
.r.

1- s_] c
�Stat:
1 Region Amount
2 PA North 300
3 PA l!::!orth 104
4 PA North 1S9
s PA North 749
6 PA SOUth 700
7 PA south 348
8 PA South 508
9 PA South 93S
10 PA South 582

11 WA North 3n
12 WA North 936
13 WA South 831

1 WA
4 South 2
43
15 WA south 344

16 NY North 97
17 NY North 120
18 NY South 577
19 NY South 95S
'"

3. What? It can't be that easy! What happened? Look at cell B3: It says =B2,
or the cell above. Ctrl-enter says "fill the selected cells with the formula," so
every blank cell references the cell above. So A1 2 says =A 1 1 , etc.
Now the sort is trivial. And if you want to clear the formulas after the sort,
simply select 1 cell, use the FS key, click Special, select Formulas & OK, then
press the delete key to produce the sorted result.

==:
' = A I =
• a c .J-
'---

1 State Reglon Amount
2 NY h
Nort 97
3 I 120

4
_,
Sout h sn
5 955

6 PA North 300
7 104
8 1S9
9 749
10 South 700
11 348
12 508
13 93S
14 5
82

5 WA
1 North 3 17
16 936
17 south 831
18 243
19 344
on

162 This isn't Excel, it's Magic/


83. Aligning objects
When a drawing object is selected, you will see the Drawing Tools context
sensitive menu show up. If you've inserted buttons or option buttons, check­
boxes and the like, then this isn't a "drawing object" so the context sensitive
menu is not present, but you can still get the desired commands in the Page
Layout tab, the Arrange group. In the Arrange group, is the Align button:
RnltW Yi<W ...... �
4Srif\0tofront � AMon ·I
�9�t.J0Ut f:otnlulas D•t• Orrtfop�r
.
=•
,L..J1 Wtdth: AUt
o• mc - Gridlin.t:J 1iudin9s
.....
., .

� ..:1 U
} Ht1ghl: �S.endt - !ljGroup•

16 Ci

Automlti< • � Vl.w .J View


OntWtiOn &actoround Print
aJ Sal"
Sao """' lfu"-1
• o'•tt
IS
a.ru· T•Utl """
' Pnnt tKtion Pane
agt Sttup
P '" SUi t to fll " t!:
'S h f.tt Op Atrangt

(by the way, if one object is selected, you can select all objects by ctrl/sh ift/
spacebar-if an object is not selected when you press ctrl/shift/spacebar,
you will first select the current region, and if you do it again, you will select
all cells): [Excel 2003:View1Too/bars1Drawing ToolbarlDraw menu ArrowlAiign or
Distribute]

Drawing Tools

1-Ins Format

t\
A · 't;h Bring to Front
-


� - � Send to Back • I� Align !,eft
_r -
<:\ � Selection Pane .$.
• •
Align £enter
r,
tyles
�I Align Right

'iii Align!op

J K L M oJ\} Align Middle

wdl
-
Align §ottom

D!}c Distribute Horizontally

g Distribute Vertically

1:t Sna.2 to Grid

.S.nap to Shape

View Gridlines

This isn't Excel, it's Magic/ 163


For example, if you use Distribute Vertically on the left worksheet with the
objects selected... you'II see them as on the right:

c
t1• ··1.-.t:
'
!
Jtt�
'i:
!
�:
i
t ! Ol,
i
J

0 ® Option Button I @Option Button I


!

·�o

0 Option Button 2

0Option Button 3

0Option Button 4

0 Option Button 5

164 This isn't Excel, it's Magic/


·
84. Leaving cursor in the cell
after pressing enter.
If the cursor normally moves out of the cell when you enter a value and you
temporarily want to keep it in the same cell, simply press ctrl/enter instead
of enter!
This assumes you have only 1 cell selected, else all the cells will be filled!

This isn't Excel, it's Magic! 165


85. Shortcut 3-D Formula
If you wanted to add up all the sheets' ceiiA1,you could enter this formula:
=SUM (Sheet1 :Sheet6!A1 ) But there's a shortcut where you can use a wild­
.

card to do it and Excel will change what you type into the correct reference.
One caveat: this shortcut excludes the sheet you're entering it on in the
reference. Here's an Example. Enter =SUM('*'!A1 ) and when you press enter
it will change:

CUBEMEM. . .
. ( ... :X ./ fx =sum('*'!al)

� Book3
c 0
IF:ll A I B
I I
1 =sum('*'!al}

2
-

Al ...
fx �UM(Sheet2:Sheet6!Al}

� Book3
-r
o
1
A
0
B c I 0 E

• !
2
But there's another advantage to the shortcut. If you enter it in Sheet3, for
example, you'd see =SUM(Sheet1 :Sheet2!A1 ,Sheet4:Sheet6!A1 ) in the for­
mula bar after entering =SUM ('*'!A1 ) .

Another variety of this tip is to use parts of sheet names. For example, if
your sheet tabs are named Sheet1, Bob1, Sheet2, MyBobDatabase, Bonbon,
Sheet3, Bonfire, and on sheet2 you enter the formula =SUM( *bo* !A1 ), ' '

Excel will expand it to include all the sheets containing "bo" somewhere in
the name:
C5 • � .fx =SUM('Bobl'!Al,MyBobDatabase:Bonbon!Al,Bonfire!Al)

� Book3
A
I B I c I D
1 E I F I G I H
T I
1
2
3
4
5
I ol
6

I� 4� �11-_Sheetl/Bobll Sheet2Ll�yBobDatabase /BonbonL"Sheet3LBonfireL�./1

166 This isn't Excel, it's Magic!


86. Pulling cells together
If you have data separated by many rows that you want to put in a contigu­
ous range of cells (see below), this will show you how you can do it easily.

I B

l1
A
1 want I •

3 these cells
4
5
6
7 to
8

10 all be
11

12
.
13 together.
-

• •

1. Selectthe column containing the data


2. Use FS (go to)/Special, selecting formulas or constants

- .--- A
- I. s
_, c D E F

_! jwant
_

I Go To Special
@X
----------


2
Seled
these cells
0RO!! differences
3
4 Oconvnents
®'Constants' 0 Column differences
5
0 e_recedents
� �

6
0Eormulas
0 Qependents
7
0Nvmbers
D"ec
to
t or y
8 0Te;!lt
0Logicals A l-eve.­
9 0�rrors Ola�cell
10 all be Oelan� 0 Visible cells onl�
11 0 Current tegion 0 Conditional fonnats
12 0 Current �rray 0 Data j!artdation
1� together. OoQ.lects All
14 Same
15
16 OK ]j [ Ca
ncel
. ...

This isn't Excel, it's Magid 16 7


3. Copy
'l A B
·

1 hwant I
2

3 these cells
4
5
6
7 to
8 ·-

9
10 all be
11
12
' 13 together. r
14 I
4. Click in new location and paste

A B · �
J . ._
.. -·-
...,� -· ---


� :w=
.... ... ... ... ... .. ... ... .
� I want I want
-

2
-
these .cell
... ... ... ... ... ... ... ... ..

3 these cells: ·
to
"""'-� -.,:.._.... -

-
------ - · -

'\- ;
all.;. be
- ,..

5
·-

to2ether:
·-
-
6
-------- '

7 ��-------:
8
9 - -----
--

10 lall be :
-
i-----
... ... ... .. ... ... ... ... ...

11
12 - -
131_lto"ether.
--- - - - ..

�;>
j�--
.. _
: _ _ _ _ __

14
---
.- I

The results will always be constants, not formulas, even if they were origi­
nally formulas.

168 This isn't Excel, it's Magic!


• 87.An oddity with the Camera Tool
In the following illustration, the grid lines were turned off, range A1 :C12 was
selected, the camera tool (See Print remote areas on same page, earlier in
the book). was clicked, and the picture was "developed" in range E1.

P icture 1 .. ( tx I =$A$1:$C$u
0 E F G
A
-B c • •

info
"
,_-·
1 info info info info info
-+i info info info info info info
3 info Info Info info info info
-4 info info info info info info
5 info info info info info info
-6 info Info Info info
>.
info info
7 info Info Info 111f 0 info Info
8 Info Info Info info info info
9 info Info Info info info info
10 info Info Info info info info
11 info Info Info info info info
12 Info Info Info info info info
·�

If you were to format this picture and give it no line and no fill, it would look
like this:

'-'
E F G
Info
"'

Info info
info info i nfo
info info info
info info info
Info Info Info
Info info info
0 0
info info info
info info info
info info info
Info Info Info
Info info info
info info info
0 0 0

This isn't Excel, it's Magic! 169


• 88. Quicker data entry
If you need to enter large numbers, like 1 billion, it's pretty easy to enter
the wrong number of zeroes. Instead of slowly typing the string of 9 zeroes
while mentally counting, you can simply type 1 e9.That would go in as:

Al fx ltooooooo
A I B c D E
1 [l.OOE�9�
2

because excel sees this as scientific notation (which it is):

......__,. J Home Jnwt Page Layout Formulas


-
Data
----'-
--
R vi w
e :....:
e �
...:
View Developer

� J(,
n
LJ�
Ollibrl
• 11 • rA A·1 p�- ...u � ·l Scientific

Pa�te � l B I Jl •][Ell •][ & • .6. •]IC: ��!� ·���


;;;: A • 0/o •J[�o8 +�8]
Clipbo a rd r.

�====r====r===;===
t..l loooooo��/
Font Number

Al

="' A I 8 J. c - D A- I F G H
1 I 1.00E+09l
but a simple reformatting of the cell will fix that.

Al f,c 110000000
A I �
B
__ -- ��c -- � �o -- ��E--

_!_[looooooo!
2

This isn't Excel, it's Magic/ 171


• 89. Miscellaneous,­
Changing cell reference
If you have a reference such as =SUM (A500:A525) and need to change it to
=SUM(A525:A535), you would most likely edit the formula and change the
500 to 525 and the 525 to 535. And of course, that would work. Did you
know you can just change the 500 to 535 an d get the same result? That is,
you would see this before pressing enter:

,.. X .J fx =sum(.A535:A525)
8 I .. C· I 0 l

but as soon as you entered the formula, you'd see:

k! =SUM(A525:A535)
8
I ol,
----!-
1 i-
- Excel would change it for you!

1 72 This isn't Excel, it's Magicl


• 90. More miscellaneous info
You can double-click a tab name to hide the ribbon:

Double click it again and it's back.


Lastly, you should press F1 for help on all the new features of Excel 2007
There are so many!

�Excel Help - 1:1 X

A\ � �
.. @@('l:) � l l(i)J --�--------------------
�1
• P Starth •

Excel
He l� Md HOV·tO c
=-=
I -w
llro se
---
£xce
- -
--
l tlelp
�;;j;'(sjj�;;j Getting help

tnsll!llin9 Accessi>ility

FR ccnversaon and �tility l'lorl:boolt ��

Worl<shee tand Excel toble ba51CS Formula and name basics

'il Excel Help - o X

���© � �
� -- � �--------------------�
A\ � •1
• P Starch •

What's new

4items

@ 1'/hafs new In MicrosoftOffice E<cel 2007

@ Use d1e Ribbon

@ E<eel speclflcadons and l1rrilll

@ Demo: Up to speed with Excd 2007

This isn't Excel, it's Magic/ 173


And don't forget to watch the demo!

�Excel Help - 1:1 X

;.:, -+ IX) I"� � !.(,)--


AA�--------------------
� til �•
• P S•arch •

Demo: Up to speed with Excel 2007

--- - " Play Demo {9


. . . . . . ::
.. .
-
-
...

'
.
(You may experience a delaywhile

- -- lhe demo is loading.}



-"'t=:;""=
=:= t :-=�. -·-

-
---
.:::.: - .;:.-·::e..-:-_
.":''"
..-
�:..:: ::..-:-
·-·
Microsoft Office Excel2007 has a
·-·-

o;;·;-:..o::�:.::-:;-:n··;;;-�::!
· - - -· -·---- -·
.. --­
. -. ·- new design that makes your work

1 74 This isn't Excel, it's Magic/


9 1. Copy Page Setups to other sheets
If Sheet1 has the setup you want and Sheet2 is to receive the same settings:
Here's what the print preview looks like for sheet1 :

I Next Jl-"1 J Zoom ][.e<intc..JILsetup...], [•largin sJ [PageB<eakPreviewJ [ Close J[ Help

11812005 ny· Cen.t:er Heade:r:

A I B I
c

� This contains page setup for


2 iliQe'Seti.,i . d' iiiW " T ___ ._,.....

And sheet2:

1/112003 63 72

2/112'003 70 "'
3/1/2'003 17 sa
4/112003 •• ..

.�/112003 81 104
S/1/200 3 98 112
7/112003 105 120
8/-t/200 3 112 128

So, you can see that Sheet2 is portrait and has no left/center header, while
sheet1 has landscape, has an italicized center head er, a date for the left
header, and the data is shown with gridlines and row & column headings.
We'd like sheet2's settings to be the same as sheet1 's settings. Here's how
to do it:
1. Put both sheets in group edit (with Sheet1 active, ctrl/click Sheet2-you
can also shift/click, but if you're using sheets which aren't next to each other,
ctrl/click will only put the 2nd sheet in group mode, whereas shift/click will
put all the sheets in-between in group mode).
2. Use dialog arrow in the Page Setup section of the Page Layout Tab to bring
up the Page Setup dialog: [Excel 2003: Fi/e[Page Setup]

Pa);e·La�ovt F ormUlaS• . Dat


a· R eV i eW' Vftw

[JJ �< !D .e.J


...
F-1
.
� "
.

tYi��:Qin( Orl��ati:Of{'· �·�� .� Ba.<.MJ round


.-
"

Bteaks.
.
. . , ,•.., . .. .

,. ' • ' r . .
. .

This isn't Excel, it's Magic! • 175


... which dis plays:
�-
-
Page Setup �!fg]
ra�.J[;.- THeader/FooterTSheet-1
or>s

Orientation

Scalonv
0 Ad� to: lt=
� oo =�:l..:.;% normal size
O�to: It �;lpage(s)wodeby �.:.
1'_ ---.=.J
:!tal

Paper sile: Iletter,


8.5xll n.
��
Quolty: �-.M
Ied_ ,u
_ m_
Pt1nt
=<J
vI
Fi(.st pbQe number: [utoJ
_______________

[ £!rint... I [Print I [ Qptions


Previe<;! .••

.
OK

11 [ Cancel I

3. Click OK (you don't even have to look at the settings!)


4. Get out of group edit (shift click a sheet tab), or right-click a sheet tab and
select Ungroup Sheets
S.That's it. Really! Here's Sheet2 now:

l1Y center Header


8

You can do this with >1 sheet at a time, or even the entire workbook.To do
it for more than 1 sheet, simply put all the sheets in group mode and have
the sheet with the settings you want to copy be the active sheet. Then Page
setup/OK/get out of group mode!

1 76 This isn't Excel, it's Magic/


To do the entire workbook, right-click a sheet tab, select "Select All Sheets,"
and repeat the process.

Jnsert...

Qelete

Bename

Move or Copy...

� �ewCode

dJD Protect Sheet...

Iab Color �

Hide

!:,!nhide...
=;(!)
lelect All S heets-·'"""
===

mC o : wamp =>
o=w =
=

Don't forget to get out of group mode!

This isn't Excel, it's Magic! 177


92. Copy Page Setups across workbooks
You can temporarily copy in the sheet from the desired settings to the sec­
ond workbook and proceed as in previous tip.
But this method brings in names, styles, number formats, and links as well.
Here's another approach which avoids that problem.

UsingVBA, run this command:


Application.Dialogs(xiDialogWorkgroup). Show. This puts all open work­
books and worksheets in group edit mode.
With workbooks Book1 and Book2 open, that produces this dialog:
�-
---

G�oup [dit @liD


Select !!roup:
[�!'.9.k.!.ls.b.�.e.t.?.:_., _, . . .....
•. . . ' ... . .... . -····· ··· ·· . .. ...... . ' , .. .
. . .
. .

[Book!]Sheet3•
[Book2)StieetI
[Book2)SheetZ
Booi,Z Sheet3

._[�- K
0 ----'J1l [ Cancel I
Selecting the sheets which contain the page setups to be copied, you can
then simply issue the File/Page Setup command as before. Once again, make
sure that the sheet with the proper Page Setup is the active sheet, because
selecting any other sheet will take you out of group mode.

And, once again, don't forget to get out of group edit mode!

178 This isn't Excel, it's Magic/


,
'
93. Print many worksheets at once
To do this, just put them in group mode:
Right-click sheet tab & choose "Select All Sheets:"

Jnsert...

Delete

Rename

Move or Copy...

cy YlewCode

� frotect Sheet...

Iab Color >

t!ide

O r ctrl/click specific sheets to print.


Then Print!
Don't forget to take the sheets out of Group Mode, which you can do by
shift/clicking any sheet.

This isn't Excel, it's Magic! 179


94. Print remote areas on same page
To do this, use the camera tool.You can get it by putting it into the Quick
Access toolbar. C lick the Office button, then Excel Options: [Excel
2003:
ViewiToolbarsiCustomizeiCommands tabiTools from CategoriesiCamera (-213 the
way down) in Commands))

D
Re<en
t Do<umenb
t!<W
1 oddityJ<ls -t:l

..,. l For Oan.xls -(:::1


L../ Qp•n
� Atlanllc City l.xls -(:::1
i Webinar2.xl� -�
ltd 1�V<
i Movie Jeopardy3.xl� t=l
§ Qui:.xls -\'::1
� Save e,s •
z Cool fml.xl.s �
-(;:1

�p
!! FlowChart.XI!
erlnt •
l! 4-PivoU.xls -!):l
Classm'atfs.xlf �

� Prepare • 6-P!VCALCS.XLS -D=I "


Tabl•s and Pivot Tablfs.xls -!):!1

� Stn.sl • l065·EOSO.xls

l·FlLTER.XLS
-1):;1
-i):;J

:bJ PJ.lblish • 9·Cond Fmtg and Data Val.xls

3-Userl'orm.xls
-1):;1
-(;:1

LJ �los• Homtwork.xls

Org.xls
..j):a
-(;:1
Pivot1.xhx -!:=
P4voU.xh �

which brings up the following dialog.You will have to select the Customize
option, then select All Com mands from the "choose commands from" drop­
down, then scroll down until you see Camera (they're alphabetical):

�� CU1tornl::t tht Qu•cl; A<e:tss To01bar.

Q'loo'•(OI!Im<�n(h froM:1 Cunomiu .Quid:A«-eufoolb.or::!J"


[All Comnu.tl(lt IFQI��� (IQ(\IIIIffiU(0��11(.11
--
_.J
v

....
_

a II(W
Q S�wr

U'J Un<lo I•
('..t A!do •

•. Qpcn
Tr�.ul Cen111

( tfllfl
CIUI\Ot Ql,ut 1�1)( ..
.


L.J
I•
'"'•"9" Colo"
Clung-tO•t• $ouru..,

180 This isn't Excel, it's Magic!


Next, select the remote cells, and click camera tool.

A 8 c 0 E G H K L M N 0 p
1 Areal Areal Areal Areal Aflll
2 Ateat Areal Areal Areal Areal
3 Ateat Areal AJill Areal Areal
• Areal Areal Arell Aletl Areal
-
5 Anal Areal Ar1tal Areal Areal
6 Neal Areal Areal Antal Areal
7 Areal Areal Areal Jueal Areal
8 Arlil Areal Artll Areal Areal
' Art11 Arell Arul Areal Aftll
10 Areal Areal Neal Areal Areal
u Areal Aftll Atell Areal Attll a2 lAtea2 Atea2 Ant2
12 Areal Areal Areal ,...
ArHl ... Areal iArea2 Area2 Areal
ea2 !Areal Areal Area2
ea2 jArea2 Ana2 Area2
13
14
15 ea2 jArea2 Areal Areal

15 rea2 ;Area2 An�l2 Areal


17

"Develop" the picture near the original range by clicking where you want
the picture to go.

Picture 2
·( I
/.-c =$M$11:$Q$16
'I A B l c I D
I E
I F
1 Areal Areal Areal Areal Areal

2 Areal Areal Areal Areal Areal


_
3 Areal Areal Areal Areal Areal
4 Areal Areal Areal Areal Areal
5 Areal Areal Areal Areal Areal
6 Areal Areal Areal Areal Areal
7 Areal Areal Areal Areal Areal
8 Areal Areal Areal Areal Areal
9 Areal Areal Areal Areal Areal
10 Areal Areal Areal Areal Areal
11 Areal Areal Areal Areal Areal
12 Areal Areal Ar eal Areal Areal
13 Area2 Area2 Area2 Area2 Area2

14 Area2 Area2 Area2 Area2 Area2


Area2 Area2 Area2 Area2 Area2_.

�{
18
Area2 Area2 Area2 Area2 Area2
Area2 Area2 Area2
Area2 Area2 Area2 Area2 Area2
Area2 Area2

1Q

If you hold the AIt key, the picture will exactly line up with the closest cell
grid.
For best results, you want to turn off the gridlines and removing the border
after the picture is shown. (Note the address in the formula bar).

This isn't Excel, it's Magic/ 181


j -
Prlnt Area (
• I Areal
fx

I I I I E
I A B

1 Areal Areal Areal


c 0

Areal Areal
2 Areal Areal Areal Areal Areal
3 Areal Areal Areal Areal Areal
4 Areal Areal Areal Areal Areal
5 Areal Areal Areal Areal Areal
6 Areal Areal Areal Areal Areal
7 Areal Areal Areal Areal Areal
8 A real Areal Areal Areal Areal
9 Areal Areal Areal Areal Areal

-
10 Areal Areal Areal Areal Areal
A
11 real Areal Areal Areal Areal
-
12 Areal Areal Areal Areal Areal
_
13 Area2 Area2 Area2 Area2 Area2
14 Area2 Area2 Area2 Area2 Area2
15 Area2 Area2 Area2 Area2 Area2
16 Area2 Area2 Area2 Area2 Area2
!Z. Area2 Area2 Area2 Area2 Area2
18 Area2 Area2 Area2 Area2 !Area2
1Q

Now select the cells to print, including the cells "behind" the picture and set
the print area, then print! It will print on one page instead of one page for
each remote area!

182 This isn't Excel, it's Magic/


95. Reset all page breaks caution
If you have a Page Setup which includes a setting like Adjust to 80% normal
size, this also gets reset to 100% by the Reset All Page Breaks command
found in the Page setup section of the Page Layo ut tab: [Excel 2003: Select all
cellsllnsert!Reset All Page Breaks]
Page Layout Formulas Data Review View

B
-

El C3L j:

I ~ l] I"= ~ &!]
;.

I
t
0

ns Orientation Size Print Breaks Bac.kground Print


• •
Area• -
Titles f
Page Setup Insert Page Break

fx gemove Page Break

c I
.....
D -
E I Reset All Page Breaks
-

Not nice!

This isn't Excel, it's Magic/ 183


96. Getting to your Visual Basic routine
by FS (go to) from the worksheet
If you know the name of your Visual Basic subroutine you can get to it
quickly just as if it were a range name! This assumes, of course, that the VBA
project is not protected!

Edit!Goto (FS) and enter the name of the proced ure! This is also true if you
type the name in the Name box.

�[!;;\ l&l"l ... ' . �icrosofl YlsUoJI&sic Bookl - [Modu"1 (Code))



·

1-iOIII• Cllutt htf 1 foun., Oilotl "-n v..w 0.,.... Ud-1 i; - � X 14 filt Edit � Jnsttt �mat Q<Ouo
: !:l.dl)

! l!il iii . Q b • • .J��� ·;;


'i � •
:::J 1..
• ...,. ..


" ·==��
L�� - �==��
" ·6:��--�=-�----==�==� �· m� �
·

0 tion E x l icit
F A 8 �
H• -!_
C 0 E F G - •l-
Pt.R�ALXl.S{PCR SOf"fAL ;.
.f6 KASOI'IAL.Xl.S (Pt:;RSClr'IA� -
.\! V8Aho;cd(Book2)
1 Areal Ate
.:l
2 An�al Are

-
� e:JMierosdtfxttiOb:ie<b
3 Area1 Ate :;Go�to
' �u ,.- ------- --. @I SheetI (9leetl)

4 Areal Are
Pr,...Jeo � Sheet2 (S'Ie End Sub
S Areal Are
5tle W)
'

,
Oi' l
boo l;

,,__6,_,.
6 Atet'l Ate
7 Areal Are .It-t
a1 &1. V8AProj.ect(8tnFaces.wla.�
< )
8 Areal Are

,,.. -,
ao1L-.--
9 A1e11 Are
--- --
.,... ::::::. �

�== = =;-
��
��- ..,.
-,�-..-:::.._
10 Ateat Ate - -

11 Areal Are ___ __,


12 Ata:J2 Ar�·
13A<U2 "'·I-··· I
.
. ..
_ ...., ·- -

184 This isn't Excel, it's Magic/


97. Can't find the old Excel 2003
commands? Use this feature!
Press F1 (Help).Then click What's New. Then click "Reference: Locations of
Ex c el 2003 commands in Excel 2007." Then scroll to the very bottom and
click "Interactive: Excel 2003 to Excel 2007 command reference guide." Then
click Start the Guide (requires Adobe Flash Player 7.0 or later). Then click
Start. You'll see Excel 2003 commands. When you try one, you'll see how/
where it's done in Excel 2007.

This isn't Excel, it's Magic! 185


98. Aiigning Userform objects
Selecting more than one object will show one with white handles, others
with black handles.

u.�erform3

• •

• •

• •

• •

Notice the 2nd one has white handles. This one is the one used for aligning:

Iools Add-Ins Window Help


�ign �
l:f> !,efts t@
�ak.e Same Size �
.g, Centers k �:..
::: _:-

lml Size to Fit �I Rights

·§i Size to Grig


-

.IIJT !ops

Horizontal SpacinQ � -o(} Middles


l!erbcal SpaCing • Jll&
- �ttoms

!:;enter in Form � :fll: to §rid

Arrange Buttons �

J:e:i

!ifoup

Ifi b!ngroup


Order
I

'I

186 This isn't Excel, it's Magic/


This becomes:

�s�rform3 �

• •


This isn't Excel, it's Magic/ 187


99. Put pictures in Userforms
from the clipboard
Copy any picture into the clipboard.

Access the Userform, and click in the Picture property.

Even though the picture you want is in the clipboard, the Paste command in
the Edit menu is dim. But you can paste into the picture property with ctrl/v!

Pr opert ies - U s erform

luserform3 UserForm Userform3


" " "

Alph�betlc CateQorlzed

. . . . . . . . . . . . . . . . . . . . . . .
• • • • • • • • 0 • • • • • • • • • • • • • •

. . . . . . . ... . . . . . . .... . . .
. . . . . . .... .. . . . . . . . . .
. . .

• • • • • • • • • • 0 • • • • • • • • • 0 '

• • • • ' • • • • • 0 • • • • • • • • • • • •

. ' . . . . . . . . . . . . . . ...... .
• • • • • 0 • • 0 • • • • • • • • • • • • • •

&None)
0 fmMcJUSeP'oint ll
(None)

You can remove the picture via ctrl/x.

. . .. .. . .. . .. . . , , . .. . , . .. , . ., . . . . . ,
_. .

. '
,_,
. . .

"'

. .· . . .· . . . .
"

188 This isn't Excel, it's Magic/


100. Make your own tools for forms
You're always creating and OK and Cancel pair of buttons, right? Well, you
can save them! Select them both and drag directly onto the toolbox!

--
Toolbol< {8)
Controls I . . . . . . .
• • 0 •
• • • • • • • 0 • • •

� A
• • • • • • • 0 • • •

abl � IHll
• • •

. . . . . . .. . . . . . . - . . . .
. . . . . - . ... . . . . . - . .
• • • • •
• • -
• • • • - • 0
• • •

P" r< j=!LJ....J


• • • • • • • • • • •

.
• • • • • 0 •

. . . . . . . . . . . . . . . .
• • • 0 0 • • • • • 0 • •

..!..l..:J;��
• • • • •

. . . . . . . • •

rnl L...,,...--
.- ___;L.L��.......,
• 0 • • • • 0 • •

• • • • • • •
• •
• • • • • 0 0 • •

0 • • • • • 0 • • • 0

&dditlonal Controls...

Delete New Group . .. . . . . .


erForm4
•cI Customize New Group

I� A bl!!ril
p r. ,...
...J
CJ_j
� ��

d
,..

�00

You can then use this new tool to drag both OK & Cancel buttons onto any
new Userform.
If you right-mouse click this new tool, you get

Controls I
� A abl !ili1 IHll
P" r< r!LJ....J
..!.J ....
• I.J AI ��
��fi!.L-: ::-----L.L....:�<�<-'-;
zJ

rn
&dditional Controls...
e rro rm�
Delete New Group
erForm4
• Ic Customize New Group

This isn't Excel, it's Magic/ 189


and by selecting "Customize New Group," you will see these options:

--

Customize Control �

Tool Tip TeKt

!New Group

Previewl �dK Picture... I


I iiD I !.,oad Picture... I

which you can edit (Edit Picture) to become:

If"• ' • I [�
Colors
Controls ]
1101 C�
t u:e l
Ill•• �A abl � �
•••ll!l �l
e ar
•••ll rv r. ...J
r LJ _J
...!..J � ,.,
� .!lfcll
OK
rn Ctll

You can save any combinations for easy future development.And they're
available in all future sessions of Excel to drag out of the toolbox onto your
form. Only the design is kept, not any code behind the objects.

190 This isn't Excel, it's Magic/


You can also place these on your own Controls "page"-if you right-click
the Controls tab you 'II see thi s:

New Page

Delete Page

Rename ...

Move .•.

�mport Page ...

Export Page .•.

Selecting New Page and right-clicking this tab, you'll see:

Controls
NewPage

Delete Page

Rename ...

�ave...

!mport Page .••

!;_xport Page ..•

UserForm3

which yields:

Rename �
Caption: IM.v Cool Control�
Control !ip Text:

OK
I Cancel

This isn't Excel, it's Magic/ 191


or:

I I I I

Controls My Cool Controls j OK

And now you can see you can store a whole library of controls:

Controls My Cool Controls

IOption ButtonsI

UsefForm3
'1Mnn11IP.< v
I •

just drag them from the control toolbox onto your userform!

192 This isn't Excel, it's Magic/


10 1. Using invisible objects
Suppose you have this simple form:
'.J•P
·��--·
.
�!!.:_t: k

� ��

r Done II
Change Aspect Ratio I

Wouldn't it be cool to show text simply by hovering (no click necessary) the
mouse over an object/ We'll show how you can have "Here's the explana­
tion you wanted ... blah blah blah" when the cursor moves over the "Change
Aspect Ratio" button:


t1V
�.J�
�!
� �
�---��
r0o�;;11
Change Aspect Ratio I
Here's the explanation you
wanted blah blah blah
•.•

Here's the "magic" code to do that. First, the label has its "visible" property
set to False, so it doesn't show up when you first show the form. Here's the
code for the MouseMove event over the Change Aspect Ratio button:

Private Sub CommandButton2_MouseMove(ByVal Button As Integer, ByYal


Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Labei1.Visible =True
End Sub

The "meat" of this command is simply to make the label ("Label1") visible.
So whenever the mouse hovers over the button you see it. But you also
need to make the label invisible when the mouse is no longer hovering over
the button. There's no MouseNoLongerMove event! So, you need to place
another mouse move event over the form itself:

Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As


Integer, ByVal X As Single, ByVal Y As Single)
Me.Labei1.Visible = False
End Sub

Now, when the mouse is over the form the label disappears, and when it's
over the button it shows up!

This isn't Excel, it's Magic! 193


102. lnitialize Listboxes, Comboboxes with
Months via GetCustomListContents
Much more efficient than setting up some range containing the list of
months, you can put this code into the initialize event of the form:
Private Sub UserForm_lnitializeQ
Me.ListBox1 .List = Application.GetCustomlistContents(4)
End Sub
�------- ----
P�Curos.;..-_,�

,�,
Mlteh
:O:tl
·t
�)'
)./'<

>
AI.I)H.
� .ett bel
O««<t
·­
""'"'�

IL e+: Jl

Application.GetCustomlistContents(4) refers to the 4th item in the Cus­


tom Lists (accessed from Office Button/Excel Options/Popular/Edit Custom
Lists) [Excel 2003: ToolsiOptionsiCustom UstsJ
·
· -
9J!�Lons.
;;,;�-� r@�
Color Save J Error Checb-.g Sewrity ]
Generat Transition Chart
List tnboes:
-
,
"' f
I
Ad;;
Fet.tu..-
t•arct,
,;.pr I o�:e
I
l'•t
Ju;e
JUly
tu'1JSt
S�te-.bet
-

If you want to show days of the week, you'd use Application .GetCustomlist­
Contents(2)!

194 This isn't Excel, it's Magic!


103. Using Microsoft Visual
Basic bookmarks
Microsoft Visual Basic has an Edit Tool bar which has, among other things, the
ability to put bookmarks into your code, temporarily (they won't save).

. r-=====�===

"6 Par�er Info Ctti+SNft+l


Ctri+Space

0 &H800()()()0j ;r.xuilQM..,;,
I· �
F� A. �e'mtr-(;o."'"'
Done Cit:!I A Soc.:..r1u1r.$

It makes getting to a location in code very easy to access. It shows up as a


blue flag in the margin of the code:

Pr·ivatc Sub Co andButton2_MouseMove(ByVal Buti


A1�.11isible : Tr·uc

vatc Sub Uscr•Form_MouseMove(ByVal Button As:


Me.Labell.Visible : False
End Sub

You can mark code even across projects, and as you click the Next or Previ­
ous Bookmark button, it will immediately take you to that section of code.
You can even bookmark the immediate window(!), but you won't see the
indicator because the immediate window has no margin. But you'll see the
cursor blinking in the immediate window!

This isn't Excel, it's Magic/ 195


• 104. VBA Array
Suppose you needed to access a strange sequence of numbers, like
4,1 3,1 9,20,28,44,123. Perhaps these are rows you need to work on You can .

get to them in a loop with this technique:

Sub AccessRowsO
For· i = 0 To 6
j = ArTay(4. 13, 19. 20, 28. 44, 123)(i)
RowsG).Font.Bold = Tr·ue 'for• example
1\lext
End Sub

The statement Array(4, 1 3 , 19,20,28,44,123) has 7 elements in it, num­


bered 0 through 6 (unless Option Base 1 is supplied at the top of the
module). So the first element has a subscript of 0 and can be referenced
by Array(4, 1 3, 1 9,20,28,44, 1 23)(0), which would be a 4. The 123 is Ar-
ray(4, 1 3, 1 9,20,28,44, 1 23)(6). So, using i as a subscript, j takes on the succes­
sive values i n the array list.
Here's another way to do the same thing. And since loops are s o fast, you
might sim ply prefer this way:

Sub AccessRowsO
For· i = 4 To 123
Select Cose i
Cose 4, 13, 19, 20, 28. 44. 123
Rows(i).Font.Bold =True
End Select
Next
End Sub

196 This isn't Excel, it's Magic!


• 105. Ensuring users don't open your work­
book with the shift key down to
prevent your macros from kicking in!
Here's a simple technique to ensure they allow your macros to run. Save the
workbook with only one sheet showing, and that sheet may look like this:

....

You may not use this workbook


without enabling macros! Reopen
and don't hold the shift key!

Prevent them from unhiding any other sheets by protecting the workbook's
structure with a password.
Use Protect Workbook/Protect Structure and Windows from the Changes
section of the Review tab [Excel 2003:Tools/Protection/Protect Workbook]:

81 ti}iJ Protect and Share Workbook


m � � Allow Users to Edit Ranges
Protect Prote ct Sha re
Sheet Workbook • · Track Changes·
Workbook �P -

Restrict Editing
0
Protect Structure and Windows

I Restrict Permission M
I N

Jj Unrestricted Access

,Bestricted Access

Manage Credentials

Then supply a password:

Protect worl<book for


0 S,tructure
O�n
i dows

eassword (optional):
I···
OK J] [ Cancel ]
This isn't Excel, it's Magic/ 19 7
Your Workbook_Open event procedure or Auto_Open procedure has the
code to hide the message sheet and unhide the other sheets by unprotect­
ing the workbook and supplying the password:

lworkhook
Pl'ivote Sub Wor·kbook_OpenQ
ThisWor·kbook.Unpr·otect "abc"
For· i : 2 To Sheets.Count
Sheets{i).Visible: Tr·ue
1\lext l
Sheets{l).Visible: False
End Sub

Pr·ivate Sub Wor·kbook_Befol'eCiose{Concel As Boolean)


Sheets{l).Visible: Tr·ue
For· i: 2 To Sheets.Count
Sheets(i).Visible: False
Next
ThisWor·kbook.Pr·otect "abc" sh·uctut·e::Tr·ue '

End Sub

Notice also that before the workbook is closed, it also resets the sheets
back for the next time, hiding all sheets except the message sheet. It's turned
to visible first because you can't hide all the sheets in a workbook!

Lastly, you can protect access to the VBA code by using this in the VBE:

�ebug B,un Iools I Add-Ins Window Help

I � IJ a c B,eferences... , Cc
�ltronal Controls...
0 �
,.. &:1 <i=:-
. ,

IT [workb• Macros... I==


Qptions... 1-
Pri
I In(

I VBAProject Pro perties.. .


"<
Digital Signature...
..-.
� �� . �n11n
.

198 This isn't Excel, it's Magic/


And then:

.!�i !:,<;1J'J:2 P �Qi_e�--*


!��P.!.� i£!;.L:J> .;.�
.....- �.

General Proteclion I

Lock project

� Lock ptO)eCt for VIewing

I
Password to view project properties--------,

Password "'I '"'"


Confirm password ,...,.

OK H
.
'
elp
-
I
'

So now, if the user opens the workbook with the shift key down, it's a fairly
useless workbook!

This isn't Excel, it's Magic! 199


106. Bulk removal of leading apostrophe
When a cell's contents contains a leading apostrophe, it doesn't show up
in the cell, only in the formula bar. This has the effe ct of making the cell be
treated as pure text. That is, if you enter '=1 0/2, you would see =1 0/2, not 5.
Getting rid of the' by Find and Replace doesn't work because Excel treats
the apostrophe as if it weren't there and would say it wasn't found! So re­
moving it is a matter of editing the cell.

But what if you have many cells with the leading apostrophe? Each of the
cells in A1 :A10 contain a leading apostrophe:

fxI '=Sheet2!A1
c I D I E

The way to remove them is via text-to-columns! Use this feature on the
Data tab, the Data Tools section [Excel 2003: DatalText to Columns]:

Data Review View Developer Add-Ins

!��
--= �=-
;., Clear 1:=-.:I 1�1 Data Validation •

��Reapply � �o Consolidate
Text to Remove
.":V Advanced Columns Duplicates � What-If Analy i s s •

Iter Data Tools

When you get the Text to Columns wizard, just click Finish!

200 This isn't Excel, it's Magic!


• 107. Multi-select offset
Did you ever have an odd selection and wanted to have the same selection
(
2 columns over or 1 or a few rows down, etc) to repeat some action?
Here's an oddly shaped selection, all filled with 123:

814 1123
1
A ·�
123
B
/x
c

2 123
3 123
4 123
5 123
6 123
7 123
8 123
9 123
--
10 123
11 123
12 123
13 123
14 I 1231
- �

Now you want the same shape beginning in D 1 . The easiest way to do it is
using the VBE's immediate window to execute a simple one-liner command:

Immediate

selection.offset(O,3).select

This isn't Excel, it's Magic/ 201


The result:

A B c ·- o�tJ-=-t�]�F �•
l 123 I I
2 123
3 123 I
4 123 I
5 123
I
6 123 I
7 123
8 123 I

� 123 r
10 123 i
11 123

I
l
12 123
13 123
. i
-
� 123 I
15
l J I
·; ., I

202 This isn't Excel, it's Magic!


• 108. VBA Boolean test
Instead of using this to turn a Boolean variab le to True/False:

Sub BoolcanTestQ
Dim MyBool As Boolean
If Range("A12").Voluc > 12 Then
MyBool = True
Else
MyBool = False
End If
End Sub

You can use this t o d o the same thing:

Sub BooleanTestO
Dim MyBool As Boolean
MyBool : (Range("A12").Vo.lue > 12)
End Sub

The expression (Range(''A 12").Value > 12) will be evaluated and if it is great­
er than 1 2, My BooI will be set to True, else it will be set to False, the same as
in the first example! Quite a bit sh orter!

This isn't Excel, it's Magic! 203


• 109. VBA Shortcut to fill ranges
Suppose you need to fill cells A 1 :D1 (using VBA) so it looks like this:

A l B c D
___::l_�:.N:.:;a;.;.;m;.;.;e;..._.Aceount # Date Amount
2

Most folk'sVBA would look something like this:

Sub FiiiRangeQ
Range("A1").Value ="Name"
Range("B1").Value = "Account #"
Range("C1").Value = "Date"
Range("D1").Value ="Amount"
End Sub

...and that would work fine. But look at this version:

Sub Fi iiRan geQ


Range("Al:Dl").Value : Ar·r·ay("Name", "Account#", "Date", "Amoun t")
End Sub

Not only is this shorter, but if the code needed t o fill range A1 :Z1, there'd
be a lot less typing!

What if you wanted to fill A1 :A4 with the same information? You might now
be inclined to use this:

Sub FiiiRongeQ
Range{" At: Dl").Value : Ar·r·ay("Narne", "Account #", "Date", "Amount")
End Sub

204 This isn't Excel, it's Magic/


But that would surprisingly result in:

1_::: �B=.�..=2c��=o:
I
�Name-r A

1Name
jName
2
I

-11Name <--F
3

4 .
" I •

...not what you expect.You need to use this code to accomplish the vertical
arrangement of the data:

Sub FiiiRangoQ
Range(" A1:A4").Value : Appl ieation.Tr•ar�<po<e(Arr·oy("Norne", "Account #", "Dote", "Amount"))
End Sub

That is, you need to transpose the information. Since Transpose is a work­
sheet function, you need to use any of these combinations:

Appl ication.Tr·anspose
Appl ication. Wor·ksheetFunction.Tr·anspose
Wor• ksheet Fu11ction.Tr·anspose

The latter two will give the intellisense dropdown:

�:.. ---
....... ........:a,
Wo r· kshe�t Function
--·····--·-

""�!Acos :�
:----
--·
··�
·
·-·- · ·-
· ·
· -
-

.:.
· � Acosh �
""� And

..
®J Application
,,� Asc
'"� Asin
"'� Asinh

The reason I chose the first one (without the intellisense) is that it's the
shortest amount of typing!

This isn't Excel, it's Magic! 205


• 1 10. Some VBA Shortcuts
Suppose you have a variable defined as this:

Dim savStr·i ngFor·Holding TheDescr·iption As Stt'ing

...and you wanted to use It, obviously, later m your code, you can simply start
typing it, then press ctri/Spacebar, which will give you this:

Dim so.vSh•ingFoi·HoldingTheDescl·iption As St1·ing

sa vi
��
-�� Savesening
r!§t savStringForHoldingTheDescr1ptlon
"'� Second
·�� Seek
rf!JJ Selection
'"� SendKeys

... and you can use the down arrow to select it, then the tab key (or enter
key) to put in into your code:

sav

<·� SavePicture
,,� SaveSetting
rtf}
"� Second .�

"·� SeeK
rtf} Selection
.:� SencJKeys

If what you typed is unique enough so there's really n o choice (like if you
typed savs then pressed ctrl/spacebar), Excel will simply put the entire vari­
able right into the module.

As a matter of fact, it's not just for variables. How often do you type out Ap­
plication? Simply typing Appl and pressing ctrl/spacebar will put Application
right in the code!

206 This isn't Excel, it's Magic!


"App" isn't quite enough for uniqueness:

oppl
l!ii' ApplicatiOn
.,� Asc
.o� AscB
...�AscW
r5J Assistant
"-� Aln v

And, if you have nothing on the line and press ctrl/spacebar, you will still get
the beginning of the list:

:.-..�;Ails.. ..
---....- ·--·-··
·--..
..
- ..
.
.
- ..
..
- .
.
.
- ....-..
--·-···
.
· ·- ·
- ..
-- ..
·-···-· !�
..
---·-�·-M·----·-···-····-·-·- ..
..
- ... .. _
, ,
.
_ _____
.. _
___
, , , _
_ _ .,
_ ,1 _

� AcliVeCell -

� ActiveChart
ll1ii' AcbvePrinter
� ActiveSheet
� AcliveWlndow
� ActiveWorkbook

This isn't Excel, it's Magic! 20 7


1 1 1. A few VBA Keyboard Shortcuts
AltlQ will bring you from the VBE to Excel. However, Alt/F11 is a toggle
back and forth from/to VBE and Excel, so I prefer that one!

Ctri/G will bring up the Immediate Pane.


If the cursor is IN the immediate window, then Ctri/A and then backspace
will dear it.

If you right-dick on a variable, you will see a dropdown where you can re­
quest the definition:

.
savStr·I
.
. .- '' I I• • 'T'
I
." ption
d. CUt
q_ Copy
End Sub !h. P.aste
..!.
ti]. U;t Properties/Metb.o.ds

;J
.

Li�t Constants .

I�
'

Quick Info

� Parameter'lnfo

J, Complete �ord

lO�JQie •

t:1 Qbject Browser


....

Add Watch...

I Qefinition
Last Position
I
!:!ide

208 This isn't Excel, it's Magic!


3D formulas, 1 6 6 Fill down
Aligning 0 bjects, 163 Alternate references, 11.5.
Apostrophe Fill Handle
Bulk removal, 200 Insert/Delete rows, 22
Apply Names, lli Right-click drag, ].]_
Autosum Fill right
Enter from keyboard, 148 Alternate references, llJ.
Auto-Sum Filling Holes, 1 6 1
Features, � Filter
Advanced, H
Borders Find after Find dialog gone, 153
Shortcut, 146 Formatting
Bringing cells together, 1 6 7 #VALU E,70
Camera Tool Comments, li
Oddity, 169 Fill, Z5.
Characters I ndenting, l.A
All in Font, 110. Number, Advanced, I.1
Closing workbooks, � Text, H
Comment Time, Hours over ll [h), D.
Inside formula, 140 Formula
Comments, Formatting, 6A Bulk change, 1 3 5
Copy formulas Change cell reference, 172
With mixed references, 1 5 7 Extract part of string, 1JM.
Cursor Movement Inner Series, 80.
Remaining Stationary, 165 Long, !U.
Custom Lists, lB. MATCH, using wildcard, 1QB.
Cut, Copy Named, �
Via Borders, 21 Note inside, 140
Numbering Questions, 125
Data entry REPT.1 02
quicker, 1 7 1 Show picture, 11i
Date & Time SUMPRODUCT,1 05
Shortcut, 147 TEXT, 1QZ
Dates Functions
As range. 2B. New to 2007, 143
Change those like 20050923, 3..6.
End of month, 21. Hiding ribbon, 173
Double space, 1il
Indenting Text, 1.A
End of Month, 21.
Excel 2003 commands Justify, ll
How to find, 185

This isn't Excel, it's Magic! 209


List Range protection, 124
Custom, za REPT.1 02
Lookup Ribbon (Hiding), 1 7 3
More than 1 value, 1Q.Q Right-Mouse
Border. �
Mailing labels Row Height, 8..6.
Trick1 , 128
Trick2.132 Scrolling, �
MATCH Formula,lQB. Drag, 56.
Merged Cells Selection
Row Height, S1 All Specific Text, 1.6.
Multiple selection Anchoring active cell, 1 5 2
Selecting offset, 201 Bring into view, 149
Select successive corners, 1 5 1
Names Shift key
Creating, U While opening workbook, 197
Defining. Scrolling, 118 Shift-Click, 4i
Defining Large areas, 2..2. Shortcut
Global vs Local, .2.0. 3D formula, 1 6 6
Long. !d. Autosum, 148
Relative definition, 138 Borders. 146
Self-D efining. l0
1 Date & Time, 147
X
LM,92 Formatting, 145
Miscellaneous, 154
Page Breaks Select Precedents, 1 5 0
Reset Caution, 183 So rting,

Page Setup Columns, 1 5 5


Copy to other sheets, 175 Space character
Copy to other workbooks, 178 Intersection, 103
Paste Special Split screens (In VBA, too), 18.
Bring cells together, 167 SUM PRODUCT,105
Skip Blanks, .25.
PictoGraphs. il Table
Picture New features, 1 4 1
Show by formula, l.l.i TEXT, 1QI
Printing Tools
M any sheets at once, 179 Double-clicking, ll
Remote areas on same page, 180 Unique
Reset page breaks, Caution, 183 Entries, 3B.
Protection Values, .2..5.
Range , 1 24 Userform
Aligning objects, 186
Random sampling, 8.1 Initializing listboxes, etc., 194

210 This isn't Excel, it's Magic!


Invisible objects, 1 9 3 Get to routine 1 84 ,

Make your own tools, 189 Shortcuts, Part 1,2


06
Shortcuts, Part 2,208
Using pictures, 188 Using bookmarks, 195

Visual Basic Window


Arrays, 196 Arrange, Except this one, 51
Boolean test, 203 Arrange, Order, 60.
Filling ranges, 204 · ,2
Title, 1 · , 11.

This isn't Excel, it's Magic! 211


ISBN-1 0: 0-9792153-2-3
ISBN-13: 978-0-9792153-2-2
5 1 4

You might also like