Professional Documents
Culture Documents
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.
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
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
,
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.
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.
Forthcoming:
"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!''
"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!"
"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
"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"
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
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
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
l8J
---
Microsoft Excel
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
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
A B
u2
Description____
--
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...
-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:
. '
Options »
F[nd All
I I Eind Next I Close
Book S heet
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
Fin!;! R.egjace
Find what:
I�:-I ----- �� �
� � I No Format Set I '[ f;�.rm.a_t,., )
-:
�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
-···
Find J Re12.lace j
FiQd what<
Ef b
c =--- P_r_e_v_ie_w_"' d
---=:::l L:::f.:gioi�C::.::J •
.
Look i(i: ]Formulas
a Options<:<
A B c 0 E F G H
lForm Name
-
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
«
16 FORM5471
17 IFORM5471
18 FORM5471
19 FORM5471
21 FORM5471
.-- ------, -
Popular
I][J Advanced options for working with Excel.
Formulas
r1
Customize
It]
Allow 1dlting directly in cells
Resource s
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.
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.
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
-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!
Fing ReQiace
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
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
. ,..
A c 0 F G
1 ....
....;.
.- -.;... �--:
B E H
a
:-
:b- -
2
1,!d : ------
L..
c Paste Special �I:RJ
3
___
:
4
' '
• ' Paste
'
�
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
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('\
A E
.
tI F
45
±I - ---- -
36 1/1/2003
40 50 2/1/2003
3
I Fill
-
4 ·-
.
Cop� Cells
.
. -
-..
5 �eries
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...
A B c D
1 36 45 1/1/2003
2 40 so 2/1/2003
-
3
4 �opy Cells
5 Fill �eries
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.
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
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
Selection.Name = "MyData"
Then Alt!Q will bring you back to Excel. Now the name MyData will accu
rately refer to the desired cells.
� 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
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
!:=:
:=
Al • fi< Cool!
@ Book6:1
A I B c D u v
!
1 cool! I •
99998
3
�
9.:
99
:: �
9:..: :
100000 Cool!
4
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.
I � �� � �t, b�
Clip
Art
s.hapes sma�rt
•
...
�0.1�:�rifi. ��._!,!,•
•
.
Ba
'
.s
� 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!
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
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
•
' '
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
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
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.
tl-�0050923
� 0050930
��0051107
ri
�
[ ll f!!ext > J! [ finish
Cancel
II < B<;d<. I
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
A B I
1 20050923 9/23/2005'
2 20050930 9/30/2005· .
3 20051107 11/7/2005'
4
c;
�� ..J (d �� .
8ool:6 • Mlcrosort Excel
""'
•
"
� R
t\
1 V
t\ Add-Ins
Hom� tnstn Formul.ls Data
.:.:..:.:.;
· � ; ,;,;;;,;.�
V
1
tv1 OtvtlOPtt
�
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
•
81
. \. I
I• Cln contain only unique values
A 8 c D F G H
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
·''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.!.�; ·
·· ·
.-
·-- -·
---..
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
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
-
Shift Right and Copy
14
15 I Shift Down 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.
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.
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
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 �
•.•
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
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
,
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:
�-
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.
Microsoft: EKcel
,
I I
yes
Yes To All No Cancel
HH···· ......... .
.............
.
.
. ................
�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! ):
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
..>.<
� + �
�
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?
-
•
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!
�
�
Arrange Windows
Arrange
0[!���1
0 HQrizontal
0 Vertical
O �ascade
0 Windows of active workbook
�
[_ o_K _;] [ Cancel ]
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:
3
4
� 4
5 5
6 6
7
8
9
0
1
11
12
R u dy Num lock �
� 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:
�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!
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?
I: •
...
A
�· 'Ef
""'"'
@:
� Qp
@ J.eft
• Hl:sheets ..
�eries...
Justify
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
rl:sheets •
�tiltS...
Iustify
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
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
@ Freeze Panes.,.
::1
u
1_
.:!
Zoom .
Wir
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:
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:
So, it turns out, that Excel's order always was the LIFO (Last in, first out)
sequence you activated the windows. Go figure!
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
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
0 !,eft column
0 !!ottom row
0 !iight column
'-
'[__K -"j [
o_ Cancel
A c D E F G
1 Cars Data ...
��
------ ------
New Name
Name: IThislsAVerylongNameAndNormallyWontDispla·l
Scope: jworl<book
CQmment :
!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
'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
( ,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'
/Bob Umlas:
This is a typical comment
l
'
Bob Umlas:
Bob
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
When the comment is selected by the border, click the new Change Shape
tool.
� 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!.�
-
� - -
�
� ..
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
.·
� !jyperhnlc..
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!).
------
Setect Pictur
e. ..
sample:
0 �ol•
t• fill elfe<t l!llh sh a pe
(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 •
® !j ew Ru l e ... -·
® �Itar RuiH •
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
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!
«!�) 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,:,('
fxlore Colors...
OK II Cancel
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 •
Here,
�
-
•
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.
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_
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):
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
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 ,
� D �. .!lJ.C.�IOp,lio�.·.��'
� Hom
� ,)1
-�
Pa�t· "
ILPopula•
Formulas r � Change the most popular options in Ex
c el.
. .. = �
5 E Ruourcu Crute lnts for use in sorts and fill s�quen<es: IEdit Cust,gm Lisu...J
6 F
Custom ll�t s
Cus
tom list �ntries:
[ &dd I
�--. [
Sun, Mon, Tue, Wed, Thu, Fri, �
NEW LIST A :6·
E
F
G
H
I
J
I(
l
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.
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!
82
.r tx 1 =B5+86
A B .
c D
1
2 I nl •
s First 4
6 Second 7
7
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
Manager .•.
I Defined Names
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
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.
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]
T
o( Clear
:{� Reapply
� I
,
Filter
LV
I Adva n c.,� c
�
-
Advanced Filter
Action
!.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!
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!
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
�
-
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
��
rt • I: •
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 .
�o Insert •
� Delete •
Sort & Find &
i!) Format • (2· Filter • Select •
:
Cell S"12e
:c '
:
Row Height...
.Qefault Width...
Visibility
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
�
.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
;
/.
D E F G H I J K
lL.--1 ��
-- -- -
Nd/JlC Manager
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."
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 !
-·
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!
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()
There are many more, and if you're interested, you can download them from
http://support.m icrosoft.com/kb/q1 281 85/
�ew Name
[ZJ[?SJ
�ame: lk
2cope: �
IWor==
kbook==
====�I ----------�
l;'
CQmment: :========!...- .__ ----------.,
Refers to:
lL=_
lin
..
ks_,
O..: I,_------ =
--;=
== :;-;:
= = �
(�:;J
::::!
:=
II_ ] [ Cancel J
A1
If� lill1 1
Mi} Connections .,A Oear
u A
� Reap1
al Refresh
All•
H Sort filter
�Advar
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
Open
�,.: lo :1-2000
v E
�-
...
.. - ty pe Dote-lid
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
�
••• 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
·�-
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
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).
.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!
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
.
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 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
. . . ,
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 •
D E F I
A 8
l c I l I G
1 1/1/2005
2 3/5/2005
.!
. •
3 .. ;FALSE}
II • r
.
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,
. . .
�ame: IDatabase I
2cope: I� ========�--�
Worlcbook
VJI�--�
cQlllent
l!l : �==========
"
-
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.
•
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
Go be creative!
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.
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.
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
�
. A B c Ill E F G H .I
__!.. 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
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,...)
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
--
�
Home tnsert Page Layout Formulas Data Review View De
velo
per
----------- --
�
General
'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.
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."
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
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.
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.
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
- -
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
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•
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
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!
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.
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
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 ·
�
Fi!!dwt>ot: �[=
s ============="'
f:g]
R�lace wi
L-----------------------�[o;=
p�==
M=>>�I
t h: •8 1 v,
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
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
'
I c 0 E F G H I I J
I
- the
Here's
f -
Info
-
-
r3c3
r3c4 I I
r3c5 I I I
r3c6 • •
r3c7
J)J:cel Optioi'\S
Popular
� Change options related to formula calculation.
11, F'o1mu1as �
Proofing Calculation options
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
- ••
OK II Help
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
01(
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�
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
,,
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:
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:
albn g
Conditional format
�m Styles
C:�ll
· �Jorma::A
t ·S<t
lt& F':n
.f:!
-
C
ell Size
•
•
![ P.o �el9n;...
�
ute:F �
J i K l Ro
w He;
g�t
C�V:t'rJ .:.::_i�-
�..
n
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
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
,.
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!
-
�
· ·
Mi_�;ro�oft �xc�t
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.
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]
( 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)
Now we have:
A7
txl
A B . 0 E
1 NumberTip
1 Here's some 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
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
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
.£!
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
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
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
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
... .. - . .. • • • - . .. ...
.. .. . -· .... . .. ...
c D
1 Company
2 Bob's Company =C2
3 Judy's Company =A2
7 Curtis's Company A6
=
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
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
- --
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
':.:
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
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
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]
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 ,
-
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)
__;;-_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
( 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 .
B1 I
fx ="=COUNTA( INDIRECT("""&MIO(Al,2,255)&"""))"
i A B
-
1 �heet2!$1:$1048576 (
=COUNTA IN01RECT "Sheet2!$1:$1048576" ( II •
-
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):
�
=
------------�--��------�--�-+-
COUNTA(INOIRECT("Sheet2!$1:$1048576"))
=COUNTA(INOIRECT("Sheet3!$1:$1048576"))
� �--��
� �-
=COUNTA(INOIRECT("Sheet4!$1:$1048576")) Move Here
.!;opy Here
=COUNTA(INOIRECT("Sheets!$1:$1048576"))
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•
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 . ..
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
��
,
.,.
� · ·
�·
� -
..,..�
....
N;._
'!:.
ew _,.N
� am
e��
-'"""' - �
--
...
..--- , -
�: z
I
�ope:
lwort<book �I
C�: ,..
-
-�-
;•,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�
·�
-
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
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:
J I K l M N
I
15 data2 data2 data2 data2 data2 data2 data
19 data2
-
data2 data2 data2 data2 data2 data
-
20 data2 data2 data2 data2 data2 data2 data
-
24 data2 data2 data2 data2 data2 data2 data
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:
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!
[ 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).
, -'"',] •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.
8 c 0 £ f G I ( J ,K_
.l t
l l M
l
5 4
� ...,.
·liN;�·
1
•:ot.ak
"n.,.II.Oort
•
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,
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
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:
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
,
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/[.
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!
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.
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 ...>.
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 �
•
Y= filter
1� f:e•ppty
��
Coi.Jmn ar
d..
Sortby ·
,- - ,
,__
_ __
-- .. to z
0 ,••• ..sitiv.
.,
Orie:nUaion
t
OK II Cancel
OK cnce
a l
'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
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
.--.:..:.
A�� 8 c D
1 labc ! def
2 ghi jkl
3
4
s
6
7 abc def
8 ghi jld
9
_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
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]."
Home
�eries...
!usttfy
A
!�.....IH
-
· .
,
0 Contents
0 Formats
[ OK I[ Cancel I
I =C7
[ I �f
Al fx
1
A
0
B
0
I c
2 0 0
•
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
•
l
.
.
def
def
2 ghi
3
4
jkl
I
abc
ghi jkl I
•
7 abc def
8 ghi jkl
9
��:
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 ____
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
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
••
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
� ..:1 U
} Ht1ghl: �S.endt - !ljGroup•
•
16 Ci
•
(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
wdl
-
Align §ottom
g Distribute Vertically
.S.nap to Shape
View Gridlines
c
t1• ··1.-.t:
'
!
Jtt�
'i:
!
�:
i
t ! Ol,
i
J
·�o
0 Option Button 2
0Option Button 3
0Option Button 4
0 Option Button 5
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 B
l1
A
1 want I •
3 these cells
4
5
6
7 to
8
10 all be
11
12
.
13 together.
-
• •
- .--- 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
. ...
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.
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
Al fx ltooooooo
A I B c D E
1 [l.OOE�9�
2
� J(,
n
LJ�
Ollibrl
• 11 • rA A·1 p�- ...u � ·l Scientific
�====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
,.. X .J fx =sum(.A535:A525)
8 I .. C· I 0 l
k! =SUM(A525:A535)
8
I ol,
----!-
1 i-
- Excel would change it for you!
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
���© � �
� -- � �--------------------�
A\ � •1
• P Starch •
What's new
4items
'
.
(You may experience a delaywhile
-
---
.:::.: - .;:.-·::e..-:-_
.":''"
..-
�:..:: ::..-:-
·-·
Microsoft Office Excel2007 has a
·-·-
o;;·;-:..o::�:.::-:;-:n··;;;-�::!
· - - -· -·---- -·
.. --
. -. ·- new design that makes your work
A I B I
c
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]
Bteaks.
.
. . , ,•.., . .. .
,. ' • ' r . .
. .
Orientation
Scalonv
0 Ad� to: lt=
� oo =�:l..:.;% normal size
O�to: It �;lpage(s)wodeby �.:.
1'_ ---.=.J
:!tal
.
OK
-·
11 [ Cancel I
�
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!
Jnsert...
Qelete
Bename
Move or Copy...
� �ewCode
Iab Color �
Hide
!:,!nhide...
=;(!)
lelect All S heets-·'"""
===
mC o : wamp =>
o=w =
=
[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!
Jnsert...
Delete
Rename
Move or Copy...
cy YlewCode
� frotect Sheet...
t!ide
D
Re<en
t Do<umenb
t!<W
1 oddityJ<ls -t:l
�p
!! FlowChart.XI!
erlnt •
l! 4-PivoU.xls -!):l
Classm'atfs.xlf �
� Stn.sl • l065·EOSO.xls
l·FlLTER.XLS
-1):;1
-i):;J
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):
....
_
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..,
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
"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
�{
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).
I I I I E
I A B
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!
B
-
El C3L j:
I ~ l] I"= ~ &!]
;.
I
t
0
•
c I
.....
D -
E I Reset All Page Breaks
-
Not nice!
Edit!Goto (FS) and enter the name of the proced ure! This is also true if you
type the name in the Name box.
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�� - �==��
" ·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 - -
u.�erform3
�
• •
• •
• •
• •
Notice the 2nd one has white handles. This one is the one used for aligning:
.IIJT !ops
Arrange Buttons �
J:e:i
•
!ifoup
•
Ifi b!ngroup
•
�
•
Order
I
•
'I
�s�rform3 �
• •
•
•
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!
Alph�betlc CateQorlzed
. . . . . . . . . . . . . . . . . . . . . . .
• • • • • • • • 0 • • • • • • • • • • • • • •
. . . . . . . ... . . . . . . .... . . .
. . . . . . .... .. . . . . . . . . .
. . .
• • • • • • • • • • 0 • • • • • • • • • 0 '
•
• • • • ' • • • • • 0 • • • • • • • • • • • •
. ' . . . . . . . . . . . . . . ...... .
• • • • • 0 • • 0 • • • • • • • • • • • • • •
&None)
0 fmMcJUSeP'oint ll
(None)
•
2·
. . .. .. . .. . .. . . , , . .. . , . .. , . ., . . . . . ,
_. .
. '
,_,
. . .
"'
. .· . . .· . . . .
"
--
Toolbol< {8)
Controls I . . . . . . .
• • 0 •
• • • • • • • 0 • • •
� A
• • • • • • • 0 • • •
abl � IHll
• • •
. . . . . . .. . . . . . . - . . . .
. . . . . - . ... . . . . . - . .
• • • • •
• • -
• • • • - • 0
• • •
.
• • • • • 0 •
. . . . . . . . . . . . . . . .
• • • 0 0 • • • • • 0 • •
..!..l..:J;��
• • • • •
. . . . . . . • •
rnl L...,,...--
.- ___;L.L��.......,
• 0 • • • • 0 • •
• • • • • • •
• •
• • • • • 0 0 • •
0 • • • • • 0 • • • 0
&dditlonal Controls...
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
--
Customize Control �
!New Group
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.
New Page
Delete Page
Rename ...
Move .•.
Controls
NewPage
Delete Page
Rename ...
�ave...
UserForm3
which yields:
�
Rename �
Caption: IM.v Cool Control�
Control !ip Text:
OK
I Cancel
I I I I
And now you can see you can store a whole library of controls:
IOption ButtonsI
UsefForm3
'1Mnn11IP.< v
I •
just drag them from the control toolbox onto your userform!
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:
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:
Now, when the mouse is over the form the label disappears, and when it's
over the button it shows up!
IL e+: Jl
If you want to show days of the week, you'd use Application .GetCustomlist
Contents(2)!
. r-=====�===
•
0 &H800()()()0j ;r.xuilQM..,;,
I· �
F� A. �e'mtr-(;o."'"'
Done Cit:!I A Soc.:..r1u1r.$
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!
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
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
....
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]:
Restrict Editing
0
Protect Structure and Windows
I Restrict Permission M
I N
Jj Unrestricted Access
,Bestricted Access
Manage Credentials
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
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:
I � IJ a c B,eferences... , Cc
�ltronal Controls...
0 �
,.. &:1 <i=:-
. ,
General Proteclion I
Lock project
I
Password to view project properties--------,
OK H
.
'
elp
-
I
'
So now, if the user opens the workbook with the shift key down, it's a fairly
useless workbook!
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]:
!��
--= �=-
;., Clear 1:=-.:I 1�1 Data Validation •
��Reapply � �o Consolidate
Text to Remove
.":V Advanced Columns Duplicates � What-If Analy i s s •
When you get the Text to Columns wizard, just click Finish!
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
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
Sub BoolcanTestQ
Dim MyBool As Boolean
If Range("A12").Voluc > 12 Then
MyBool = True
Else
MyBool = False
End If
End Sub
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!
A l B c D
___::l_�:.N:.:;a;.;.;m;.;.;e;..._.Aceount # Date Amount
2
Sub FiiiRangeQ
Range("A1").Value ="Name"
Range("B1").Value = "Account #"
Range("C1").Value = "Date"
Range("D1").Value ="Amount"
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
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
�:.. ---
....... ........: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!
...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:
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!
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
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 •
Add Watch...
I Qefinition
Last Position
I
!:!ide