this isn't excel it's magic! - bob umlas

214

Upload: mihai

Post on 22-Dec-2015

267 views

Category:

Documents


27 download

DESCRIPTION

Tips and Tricks for gettingthe most out of Microsoft® Excel

TRANSCRIPT

Page 1: This isn't Excel it's Magic! - Bob Umlas
Page 2: This isn't Excel it's Magic! - Bob Umlas

This isn't E.xcel, it's Magic!

Page 3: This isn't Excel it's Magic! - Bob Umlas

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.

Page 4: This isn't Excel it's Magic! - Bob Umlas

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

Page 5: This isn't Excel it's Magic! - Bob Umlas

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 [email protected] or call 212-515-5144.

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

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

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

Designed by Tony Meisel Publisher Judy Umlas

Printed in Canada

Page 6: This isn't Excel it's Magic! - Bob Umlas

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 Tompkins, my fellow Excel MVPs, my co-work­ers, and the many other contributors to the online newsgroups-David Hager, John Walkenbach (who has put many of my excel "oddities" discover­ies on his website), Bill Manville, Jim Rech,Jan Karel Pieterse,Tom Chester, Reed Jacobson, Eric Wells, Bob Greenblatt, Tim Aurthur, Mon ika Weber, Bill Jelen {"Mr. Excel"), Jim Janssen, and Joe Sorrenti for their contributions to my knowledge.

I want to acknowledge my best friend. Jerry Goldin, Ph.D., for his ongoing support of everything I do and of my entire family. I want to thank my sister, Marilyn Umlas Wachtel, for being there when I have most needed her.

My wonderful children, Stefanie and Jared Umlas, have put up with me as I remained at the computer, writing this book, instead of watching Alias or The Simpsons with them. They have been terrific!

I would especially like to thank E. LaVerne Johnson, President and CEO of International Institute for Learning (IlL), for believing that I am one of the top three Excel gurus in the world, no matter what I tell her. I also thank her for supporting my love of teaching by offering the Mastering Microsoft® Excel course through IlL all these years.

Bob Umlas, Microsoft® Excel MVP

Page 7: This isn't Excel it's Magic! - Bob Umlas

International Institute for Learning, Inc. (Ill) I ntemational Institute for Learning, Inc. (Ill), headquartered in New York City and

with eleven operating companies in major cities around the world, is a global leader in Project, Program and Portfolio Management, Microsoft® Project, Six Sigma, and Business Analysis corporate solutions.

Using its Many Methods of Learning TM, Ill combines the theory and practice that professionals need in order to manage today's business complexities with maximum flexibility. Ill offers traditional classroom training as well as on-demand learning, "virtual" instructor-led courses, and hands-on leadership simulation classes. Ill recently released Project Management elibrary, a state-of-the art, animated and engaging program that is rich in education and exercises.

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

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

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

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

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

For more information, please contact: Lori Milhaven, Executive Vice President International Institute for Learning, Inc. Phone:1-212-51S-5121 or1-800-325-1533 e-mail: [email protected] www.iil.com

Page 8: This isn't Excel it's Magic! - Bob Umlas

Also published by Ill Publishing, New York

The Zen Approach"' to Project Management by George Pitagorsky, PMP

The Power of Acknowledgment by Judith W. Umlas

Project Portfolio Management Tools and Techniques by Parviz F. Rad, PhD and Ginger Levin, PhD

Forthcoming:

Project Management Poetry, Puzzles and Prose

Positive Leadership in Project Management: Practical Leadership for the Practitioner

by Frank P. Saladis, PMP

Page 9: This isn't Excel it's Magic! - Bob Umlas

Praise for THIS ISWT EXCEL, IT'S MAGIC!

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

- Monika Weber, Excel MVP Project Manager, Corporate IT AMCOR Rentsch Ltd.

"I carry This isn't Excel, It's Magic! in my car and read tips while stopped at traffic lights. The book is already full of post-it flags for 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 for some sophisticated how-to's, you will learn valuable information from This isn't Excel, it's Magic!"

- Bob Schuster, partner of ExceiMagic and RWS Information Systems

"(This isn't Excel, it's Magic/ is) a simple, but amazingly useful book. Very clever! Bob has produced a compact, but brilliantly useful book of shortcuts, for­mula secrets and tricks. One thing I loved about this book is it tackles 'real world' problems. This is not a book for Excel beginners. However, if you use Excel professionally or for fun then you absolutely should consider grabbing a copy of this highly useful and informative book. It will save you many hours of work and delight you at the same time."

- Darryl Collins, Excei!VBA developer

Page 10: This isn't Excel it's Magic! - Bob Umlas

"Nobody willing to use Excel efficiently should be without a copy." - Miguel Fischman, systems analyst programmer

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

- Chris Curtis, desktop publisher, bellaonline.com

"Bob Umlas is a Microsoft® Most Valuable Professional (MYP) who put his nearly 20 years of Excel experience into a book called: This isn't Excel, it's Magic! Bob shares many excellent tips for the experienced Excel user that will save time and energy when working with spreadsheets. A beginner may be a little daunted by some tricks, but will appreciate them once they get to know Excel. The book is well illustrated and narrated."

- Rick Ca.stellini, host of Castellini on Computers

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

- David Ciccone, founder, mobilitytoday.com

"The first time I read it was in the middle of the night during a blackout. I had to use a flashlight under the covers. Thanks again for your help."

- Debi Morrison, B2B Support Coordinator, "the Excel Queen"

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

-Accounting Smartpros.com

"You just have to buy this book!" -Jack lmsdahl, co-host, On Computers

radio show with Alaska Joe

Page 11: This isn't Excel it's Magic! - Bob Umlas

FEATURES

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

FORMATTING

29. Formatting comments 30. Format #VALUE! or any errors away 31 . Using (h] format for hours>=24 32.Advanced number formatting 33. Formatting text 34. Using Fills 35. Indenting or distributing text

FORMULAS

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

10 This isn't Excel, it's Mogicl

66 70 72 73 74 75 76

78 80 81

Page 12: This isn't Excel it's Magic! - Bob Umlas

39. Selecting a random sample of data40. How to change row height when a key field changes 41 . Define "global/local" name 42. XLM-Names (not XML) 43. Getting number of unique values 44. Named formulas are array-entered 45. Getting End of Month 46. How many Wednesdays between 1/1/05 and now? 47. Looking up 2 (or more) values 48. Named ranges which define themselves 49. Using REPT for visual effectsSO. Using the Space as an operator 51. Extracting the last pan of a string 52. Using SUM PRODUCT 53. Using the TEXT function 54. Use wildcards in MATCH function 55. See all characters in font set 56. Double-Spacing data 57. Fill "=A1 " right, have reference become =A2, =A3, 58. Fill "=C3" down, have reference become =D3, =E3, etc. 59. Using Define Names & scrolling 60. Show a picture by typing its name? 61. Protecting ranges from insertion of rows/columns 62. Numbering Questions tip 63. Mailing Label tricks - 1 64. Mailing Label tricks - 2 65. Bulk formula change 66. Fun with relatively defined names 67. Using notes inside formulas via the N-function 68. New Table features 69. New Excel Functions

KEYBOARD SHORTCUTS

83 86 90 92 95 96 97 98

100 101 102 103 104 105 107 108 1 1 0 1 1 1 1 1 3 1 1 5 1 18 1 1 9 124 125 128 132 135 138 140 141 143

70. Ctri/Shift/-,1 ,2,3,4,5,6 for quick formatting 145 71. Borders from keyboard 146 72. Inserting Date & Time 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" Go To Precedents 150 76. Show Corners of Selection Easily 151 77. Anchoring the active cell 152 78. Finding after the Find dialog is closed 153 79. A few miscellaneous Shortcuts 154

This isn't Excel, it's Magid 11

Page 13: This isn't Excel it's Magic! - Bob Umlas

MISCELLANEOUS

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

PRINTING

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

VBA

96. Getting to your Visual Basic routine by FS (go to)

175 178 179 180 183

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 Microsoft Visual Basic bookmarks 195 104.VBAArray 196 105. Ensuring users don't open your workbook with the shift key

down to prevent your macros from kicking in! 197 106. Bulk Removal of leading apostrophe 200 107. Multi-select offset 201 108.VBA Boolean test 203 109.VBA Shortcut to fill ranges 204 1 1 0. Some VBA Shortcuts 206 1 1 1 .A few VBA Keyboard Shortcuts 208

Index 209

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

Page 14: This isn't Excel it's Magic! - Bob Umlas

I actually learned Microsoft Excel on the Macintosh in 1 986 or so, using version 0.99! When the real version (1.001) shipped, I read the manual (yes, Excel came with manuals then) from cover to cover. Six times. Especially in order to learn Data Tables. I just didn't get it. (Okay, so I'm a geek. Actually, I once heard that you're a geek if you double-click the TV remote)!

Around 1 993 I received the nickname "Excel Trickster" from one Will Tompkins, a real Excel Guru. I got that because during a seminar he was hosting in Washington, I believe, for what he called the Excel SWAT team, he was showing his then famous Tompkins methodology - a macro structure using Excel4 style macros (beforeVBA existed in Excel) which was quite sophisticated. It may have been Excel 3, I really don't remember!

In any case, he showed a line of code which used a range name, a label, and he wanted to show us the code at that label. So he used Edit/Goto, and we saw literally many hundreds of defined names which he had to labori­ously scroll through to get to the one he was looking for. After he had done this about 4-5 times, I raised my hand and said, "You know, you can get to that label directly. Just press Ctrl/[." He tried it and was flabbergasted! So he tried it again. Then he remarked chat I just saved him about 2 hours every day scrolling through his defined names!

When I also told him you could return to the location you were just at by using Ctrl/], he called me the Excel Trickster, and that nickname has stuck with me ever since. So thank you, Will.

I've been the contributing editor to Excellence and The Expert maga­zines, monthly 1 6-page publications for about 8 years (they no longer publish), and I've led a few sessions at Microsoft's Tech-Ed on tips & tricks and on array formulas. I've also been an Excel MVP for Microsoft since chat program's inception -this is an acknowledgement for people who contrib­ute answers on the online newsgroups, and I currently lead an online Master Class in Excel which is twelve 3-hour sessions (details can be found at http:// www.iil.com and clicking on "Live Elearning").

So, over the years, I've gathered many tricks and I decided to put them together in this book.And in no particular order! I hope you enjoy them!

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

Page 15: This isn't Excel it's Magic! - Bob Umlas

1. Using Advanced Filter to another sheet

Advanced filter can only filter to the active sheet. The active sheet can "pull" information from another sheet, but it cannot "push" information to another sheet.You'd get this message:

---

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

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

Data iFilteriAdvanced Filter]

Home Insert Page Layout

rrp (llil Connections

� �Properties Refresh

Formulas r lillJ 7

Data l Revit

� Cl.:ar

All• �-:J Ed1t lmks X� Sort

'{<> Reapply Filter � � �Advanced ·rna I

Connections Sort & Filter

you can pull information to the active sheet:

1 2

3

4

5 6

7

8 9

10

11

12

13

A I B c D -

1\dvance<! Filter �� Action

0 Eilter the list, in-pla.ce

0 CQPY to another location

b_ist range: I=Range2 Criteria range:

Copy to: I Sheetl !$A$ll � Unique tecords only

t�I 1�1

OK ] I Cancel ] 1 4 This isn't Excel, it's Magic/

E

Page 16: This isn't Excel it's Magic! - Bob Umlas

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 B !_]Jared 2 1 Fred

3 Stefanie

4 Bob 5 Judy 6 Alice 7 Jared

-

8 Kate

q

This isn't Excel, it's Magid 15

Page 17: This isn't Excel it's Magic! - Bob Umlas

2. Select all O's or Select

all specific keyword

Suppose you had a worksheet which looked something like the following, and you wanted to select all the cells containing the word "amounts":

u 2 3 4 5 6 7 8 9

10 11 -12 13 --14 15 16 17 i81 19 ' 20 21 --22 23 24

A B Description ____ _

m35-c summary input --m35-c gl �coun�--­m35-c gl description I m35-c amounts [ m35-d description I m35-d summary input [ m35-d g_l a count# ! _ m35_.:_<!_gl des�ption I m35-d amounts I

m80 gl a count# I lm80 gl description I

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

_ •

m80 ye balance I m80 amounts paid after m8�g�_count�------•-m81gl description ! m81 ye balance m81 amounts paid after m8_2 g�count# -··---•-m82 gl description I •

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

·-

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

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

Page 18: This isn't Excel it's Magic! - Bob Umlas

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

.. I: .. -V � [il· ..

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

= I � Find ...

e�e I = ,Be place ...

� Go To ... -

Go To Special ...

Formulas

- Comments

Conditional Formatting

Constants

Data Validation

� Select Objects

�I Selection Pane ...

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

. ' Fmd and Replace Fin!! ] R•l!l��<e l

Fi!)dwhat: I amounts!

Book

hydr adienton;;Ja�zermap2 .xl$ hydr adlentorganirermap2 .xis hydr adiefltorganirermap2 .xis hydradiemorQanirermap2.xls hydr adlentorganizermap2 .xis hydr adJentorganirermap2 .xis hydr adientorganizermap2 .xis hydr•diemorQ•niu!rm•p2.xls hydradiemorganirermap2.xls hydr adiefltorganirermap2 .xis hydr •diemorQaniwmap2 .xis hydr adientorganizermap2 .xk .... .. .. A:.-.,...� .......... .v ......... --. ... .., ........ •

j'ii cell(s) found

S heet

clior.t org•nl•.,. to ewp client organizer to ewp client organizer to ewp eli� organizer to ewp dient organizer to ewp ctiert organizer to ewp diest organizer to ewp cliett organiw to ewp client organizer to ewp client organizer to ewp client organizer to ewp client organizer to ewp

Options »

F[nd All I I Eind Next I Close

$9$10 $8$14 $6$18 $6$22 $8$26 $8$30 $6$34 $6$38 $9$42 $9$46 $9$50 $9$51 .f.O.t-C'O

m3S- d •mounts mBO amounts paid after m81 amounts paid after m82 amounts paid after mB3 amounts paid after m81 amounts paid after m8S amounts paid after mB6 •mounts paid •fter m87 amounts paid after m88 amounts paid after m89 •mounts paid after

� ����� ��� ����., .. '

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

Page 19: This isn't Excel it's Magic! - Bob Umlas

Here's the twist: instead of selecting the items in the found list, you can use ctri!A (or shift click the last item in order to select from the already­selected item through the item you're now selecting, or even ctrllclick to select specific items), and all items selected in the list will also be selected in the worksheet:

" O..:.C.iptiel'l mlS.c w ..... •'Y ft�,ut MlS..c: tl �C.YM. nOS.c ,, 6Kaf,tio-n lft3:S-c IMOUntl nOS·-4111 c1Htf1p* nOS-41 �Uttt.nUI)' ln�n m3S • gl IC'IOU .. n1JS4 gllltWip•ion m)S,4 UIIOV1'111 n.O sl Ue ll ntl n180 Jl dHUiplion n1180 �· h•J•not m80 lmountt ptld '"" ni81 tl �e.unt.f nt81 tl dtsO"fpl lon nl81 ye b .st a.ne. n.S t emountf peld el\er nt82 gl �eount * nl82 gl dowlptlo*' nl82 yo h.tlinet ru82 •mounts paid tftet m8lgl•eountk m83 gl dewlrtlon m83 ye b 6 1 anct nl8) trnountt poht after n.&• gl •eount.f _,, -· ............ ..

c D F G H J

"" ,_, ��� �--�--------------------------3, ·

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):

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

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

171FORM 5471

18 FORM5471

19 FORM5471

20 FORMS471

21 FORMS471

Page 20: This isn't Excel it's Magic! - Bob Umlas

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

Fin!;! R.egjace Find what: �:-II -----���� � I No Format Set I '[ f;�.rm.a_t,.,

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

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

.

�ook in: Formulas

When you click this, you'll see:

�im�.rm!!! · · -:�� fjiU«,;��:J I Alignment II Category:

G eneral " ' Number -Currency

FOnl I Border l! Fill I Protection l [Sample l

Accounting G eneral form at cells h ave no specifte number form at. oate Time Percent�ge Fractton Scient(fic Text Special Custom

I Choos e Format From Cell . . . I [

. I Clear l -··· 'II I I OK Cancel

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

Page 21: This isn't Excel it's Magic! - Bob Umlas

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

Find and Replace

Find J Re12.lace j

FiQd what<

Within: jsheet Searcli: J.sy Rows Look i(i: ]Formulas

Here's the result:

A

l Form Name 2 FORM5471

FORM5471 FORM5471 FORM5471 FORM5471 FORM5471 FORM5471

1 6 FORM5471 17 IFORM 5471 18 FORM5471 19 FORM5471

21 FORM5471

Ef cb=---P_r_e_v _i e_w _"'---=d:::l L:::f.:gioi�C::.::J •

3 r rvlatch �ase

2J r !VlatGh entire cell· contents '

. a Options<:<

F[nd All E.ind Next J Close

B c 0 E F G H

-

find and Replace �� Fil!!

Fi�d what: '---------'-"v.ll Preview� j [ Format .. ·J v I 0 �tch £ase :====='=v:;_l 0 Match entire cell C!lntents

vi [ Opljons « I Fr>d AU I !1 e;nd Next Close

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

Page 22: This isn't Excel it's Magic! - Bob Umlas

3. Cut/Copy, Insert Paste

by dragging borders!

In order for this tip to work, you need to have the setting checked for Enable fill handle and cell drag-and-drop turned on (which is the default setting anyway). Office button, Excel Options, Advanced section, as shown here: [Excel 2003:Toolsl0ptions1Edit!AIIow cell drog and drop]

--------- --------- -----E xcel Oplion s .--------, -

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

Proofing

' Advance� _j Customize

Add·lns

Trust Center

Resources

Editino options

0 Afttf pre nino Enter. move selection

OJrectlcm: I Down vj 0 Autom1tle�lly insert • .stedmal point

r1 .,0 E.noblt fill handle and cell grag.and-drop /. 0 alert before overwriting cells

0 Allow 1dlting directly in cells

It] Extend data tange fo1mats and formu!as

0 Enabfe autom atic percent entry 0 Enable &utoComplete for cell values

0 60om on roll wtth Intel liMo use

0 Alert the user when a potentially time consuming operation ocrun

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

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

3 44 55 3/1/2003 4 48 60 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 actions above, the cut becomes a copy.

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

Page 23: This isn't Excel it's Magic! - Bob Umlas

4. Use Fill-handle to insert or delete rows

Did you know that holding the shift down while using the fill handle will shift cells? Well, now you do! Let's take a look.

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

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

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

Page 24: This isn't Excel it's Magic! - Bob Umlas

5. Shift/find finds backwards

This is great for finding the last department in a list, for example:

• A 1 Department 2 Acctg

B I c --L---=:..0 _J.I___::e:...........Jjl....--...:F _i_:

3 Acctg v��.., .. =� __ ,_ ____ •niOI' 4 Acctg

5 Acctg

6 Acctg

7 Acctg

8 Acctg

9 Acctg

'10 Acctg

.. ,11 Acctg

-12 Acctg - .

:0:13> Acctg -

·14 Acctg

lS' Acctg -

16 Acctg

�-2!�!1,!!-,�P.,�£!51..� Fins[ 1 ReQiace 1 FiQdwhat: .-lA-cc-tg�j ----�.-=1 1 Previe·:., .. I [

Witb.in: !sheet C::}} 0 ch !;,ase

:=r.;:====�"-i�;,�:_�, 0 MatcH tire_cell cQ.ntents S,earch: �Rows W_ !,ook in: (Formulas �

l F(nd All ] 1 _ ��Next j

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

This isn't Excel, it's Magid 23

Page 25: This isn't Excel it's Magic! - Bob Umlas

A B

Fing ReQiace

c E

Fi!ld what: �....IAc_c_tgj�------------

271 272

... 1:-- 1""\-.-. ............... _._ ... 1-Department

F[nd All J ( __Eind N�xt J

- -----·- I r You can use a wildcard to search for anything backwards, so starting from cell A 1 , you can find the last row or column!

� £!!t�.!!!J.d Rep�£!! .. ,�,.,�� ,-F"''! L ReQ!occ }

FiQ<:I v.t.at: •

wt!!On: Shett �rch: �ooi<irl;

-.

��_J

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 dropdown to "by columns" will find the lost used column!

I Ffld AI I I fi>d - Closej

24 This isn't Excel, it's Mogicl

Page 26: This isn't Excel it's Magic! - Bob Umlas

6. Combining cells with

Paste Special/Skip Blanks

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

A 1 :A7 has a,c,e,g and B 1 :B7 has b,d,f,h: Copy B1 :B7, select A2, Right/Click, Paste Special

A 1 a

2 3 c �

- Lt!l 4

1 _ __2l __ _ J :b '

. ' � '

Cut

f:;opy

c I D I

5 e �� faste

6 I 7 g 8

9 . ,..

with Skip blanks:

A B .....-....;..;...-:-- -�--1 a :b :

2 1 : 3 L..c ___ ,! d :

' ' 4 • ' ' 5 e :t

6 ---< 7 g � 8 9

10 11 12 13 14 15 16 -

17 18

• '

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

Paste �pecial. . . I Insert Copied C_tlls ...

Delete ...

Clear Contents

c 0 E F G H

------

Paste Special �I:RJ Paste

0!!1 OE«.-.Jas 0 :talues 0Fetmats

0 !:_omments

0 ValldatiOQ

Operation 0NQne 0P4d 0 S.Ubtract

0 AI u.ing Sou"ce tl!eme 0 AI e11cept borders 0 Colo.mn !f!idhs 0 Fotrr..Jias and r.Jmber formots 0 Vaii!E's and nl.lllber formats

0Mu�iply

0Divide

0 Transpos!l_

[ OK ] [ Cancel

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

Page 27: This isn't Excel it's Magic! - Bob Umlas

Here's the resu It:

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

2 3 4 5 6 7 8

9_ 1('\

26 This isn't Excel, it's Mogicl

b c d e f

g h

d

f

h ---

' ' -·--

' ' '

-- ·--'

__ t, __ ' -- : --

' ......... J _ __ _

Page 28: This isn't Excel it's Magic! - Bob Umlas

7. Right-click drag the Fill Handle

for several options

If you use the fill handle and drag with the right-mouse button down, you will be presented with a dialog containing several options when you let go:

±I A

3 -4 5 6 7 s 9 10 n

-12 13

36

40

I

1

45 50

- ---- -

1/1/2003

2/1/2003

I

I I I I

·-Cop� Cells . . . --. . I Fill �eries

E . I t

Fill formatting Only

Fiii1Nith.Qut Formatting

Fill Days

Fill �eekdays

Fill Months

Fill Years

.blnear rrend

!;iro.,.Jth Treno

S�ries ...

F

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

Page 29: This isn't Excel it's Magic! - Bob Umlas

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

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

5 Fill �eries 6 Fill formatting Only 7 Fill WithQut Formatting 8

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

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

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

1 2

4 5 6 7 8 9

A B 36 40

c I 45 1/6/2005 50 1/7/2005

1/10/2005 1/11/2005 1/12/2005 1/13/2005 1/14/2005 1/17/2005 1/18/2005

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

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

Page 30: This isn't Excel it's Magic! - Bob Umlas

8. Defining names for large

non-contiguous ranges

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

A 8 c D E F G H 1 Data: 2 2 3 • • Data: 21 Data: 27 4 • 5 Data: 25 6 Data: 12 7 Data: 14 8 Data: 89 9 Data: 63 Data: 81 10 Data: 50 Data: 70 11 Data: 33 12 Data: 88 13 14 15 Data: 30 Data: 105

,....- • >�] This tab has a

Also notice the tab's name is quite long. Okay, we want to name the cells, so we select them first (it's easiest using F5, Special, and making this selection):

------Go To Special � Select 0 �orrrnents

0cqnstants OEonnulas

01'1\Lml>ers

o--···1 fig�, 0Log_icals 0�rrors

0 Blan!!,s 0 Current region 0 Current �ray 0 Ot!jects

II OK

0 Row differences

0 Colum differences 0 erecedents 0 Dependents

C•ecl nl 'lle-�ls

0 lait cell 0 Visible cells onl:,: 0 Condi{ional formats 0 Data yahdation

AU Same J I Cancel J

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

Page 31: This isn't Excel it's Magic! - Bob Umlas

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

30 This isn't Excel, it's Mogicl

Page 32: This isn't Excel it's Magic! - Bob Umlas

9. What is that : 1, :2 . . .

I see in the workbook title?

The New Window button from the Window section of the View tab creates another "view" of the same workbook: [Excel 2003:WindowlNew Window]

View Developer Add-Ins

q [] � �New Window I S .JJ El 89 EQ 9 Arrange All """" .d! -··-·· Zoom 100% Zoom to Save Switch

Selection � Freeze Panes • L1 3!1 Workspace Windows • Zoom Window

You can use it to: • View separate sheets of the same workbook at the same time:

Al • f,. =Sheetl!Al

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

Cool! A B

1 Cool! 2

1-=---p;:::::.:.-. 3 3

4 4

5 5

6 6 : :1 9 9 10 10 ul ="""""::::-:-"""'"--,;,-----� i Jl 1 " • • >t 1 Sheetl / Sheet2""' SheetJ 0 '-="�'-'-·;;;·;;;�,...,. e,�L Jsn�e�e�u-=�;�s�h!!§ee�t�2�Lj=stl�!!!j�!J!:=::=

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

Page 33: This isn't Excel it's Magic! - Bob Umlas

• View the same sheet but remote areas simultaneously:

Al • fi< Cool! @ Book6:1

A I B c D 1 !cool! I

2

3

4

5

6

7

8

9

• View formulas and values simultaneously:

Al ... (., /x =Sheetl!Al

@ Book6:1 - 1::1 X

A I B 1 c 1 D t;E ..... ' 1 !cool! I

2 -- =

=

3 -4 '--5 ----1 6

7 8

9 ... I� 4 � �m Sheet2 / ShelrT H ..,. J .-1tdl

99998

�9.::..:99:::9� u v

100000 Cool!

Book6:2

lrr A 1 =Sheetl!Al 2 3

4

5

6 -7 ____, 8

9

I

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.

3 2 This isn't Excel, it's Magic/

Page 34: This isn't Excel it's Magic! - Bob Umlas

10. Double-clicking tools

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

Insert \ Page layout ,

Review Formulas ... Data

I� �� � �t, b�

.s

l

Ba Clip s.hapes sma� ... rt �0.1�:�rifi. �� . ._!,!,• ' Art • •

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

OODOQQQQQ Basic Sha.!:..pes=----------

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

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

This isn't Excel, it's Magid 33

Page 35: This isn't Excel it's Magic! - Bob Umlas

1 1. AutoSum Tool features

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

A 8 c D G • --w------.-1 65 30

2 84 85 87

3 14 69 78 97

4 88 42 71 6

5 5 32 71 62

6 57 47 65 2

7 50 5 63 92

8

Click in E1 and click the Sum tool (on the Editing section of the Home tab)

[Excel 2003:Sum too/bar button on Standard Too/bar]

[��u � Sort & Find &

Q. y Filter y Select y

Editing

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

Hold on to your hats. It can be done in one click: Make this selection as shown in the illustration:

i 1

2

3 4

5

6

7

8

A

65 84 14

88

5

57 so

3 4 This isn't Excel, it's Magic/

B c D

54 30

85 87

69 78

42 71

32 71 47 65

5 63

'

E

46

74

97

6

62 2

92 •

'

Page 36: This isn't Excel it's Magic! - Bob Umlas

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

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

A B 1 60 60 2 54 66

3 58 28

4 57 16

5 9 14

6 91

7 34 29

8 70 16

9 62

10 70 7

11 66 68

12 95 77 13 76 13

14 46 81

15 32 70 16 18

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

A 1 60 2 54 3 58

4 57

5 9

6 238 7 34

8 70

9 62

10 70

11 66

12 95

13 76 14 46 15 32

16 551

17

B

I

J 60 66

28

16

14

91

29

16

320

7

68

77

13

81 .

70

18 3341

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

Page 37: This isn't Excel it's Magic! - Bob Umlas

12. Change dates like 20050923

to one Excel can "understand"

Suppose you are looking at a worksheet which contains dates which can't be formatted as "real" dates because of their structure:

lhl 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]

Data l Review View Developer Add-Ins

V.. Clear '"{v Reapply

. �Advanced Iter

ffi-:. I ��� 1�1 Data Valida�ion "' � Ef:c Consolidate Text to Remove .

,Sol�!!ms, Duplicates �What-If Analysis"' Data Toots

which brings up the Text-to-Columns wizard:

C!J.fll(ert Text .to ColiJmns Wizard. - Step 1 .of 3. 0Jii'J The Text Wizard has determined that yoor data is Delimited. If this is correct, choose Next, or choose the data type that best deS<ribes your data.

Original data type

Choose the file type that best describes your data: 0[§iiiT,i��1 -Characters such as commas or tabs separate each field.

0 Fixed \:)!idth - Fields are aligned in columns with spaces between each field.

Preview of selected data:

tl-�0050923 � 0050930 ��0051107 ri­� [ Cancel I I < B<;d<. ll f!!ext > J! [ finish I

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

Page 38: This isn't Excel it's Magic! - Bob Umlas

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

. Convert Text to Columns Wizard · Step 3 of 3 �� Tt-is screen lets y(ltJ select each cobnn and set the Data Format. Cobnn data fOI'mat O�al Orext

O£stnob01'1: MYO DVM Data erev' L.!YD-"'M"'-------1

'Genet il converts runenc vakles to runbers, date v.....,. to dates, and al remaining vakles to text. 1 Advanced... 1

Cancel I [ < !l_ack Next >

t�I

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

Here's the result:

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;

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

Page 39: This isn't Excel it's Magic! - Bob Umlas

13. Allow only unique entries in a column

Use Data Validation from the Data tab: [Excel 2003:DatajValidation] """' �� ..J (d �� . � Hom� tnstn

• sll �Coontchons �I -:J �

Gtl e<ttrnal Rtfrtlh �I Oitll "' All· � clltlrnts

Connections

Formul.ls

1m A ')[ Son fllttt

Data

\ Ot��

8ool:6 • Mlcrosort Excel Rt\1t\V V1tv1 OtvtlOPtt ·.:.:..:.:.;;�,;,;;;,;.� Add-Ins

• ,. 'tt pp.,

)tl !'!i_� �Data Vall�atoon • � t:r [to Consoli�•••

'!.1 Ac!Yan<td TtJ<tlo Rtmovt

Columns Duprocotts � Wl\at-h Anat/111 • Sort & Ftlttt Oata Tools

81 . \. I• I Cln contain only unique values

A 8

with a custom formula like =CO UNTIF(8:8,8 1 )= 1 :

c D F G

81 /x Can conta i n value s

1 2 3 4

1 7

E F G

Data Validation ---------- --��

setltn!l> InPut MessaQe Error Alert V.tlid.!Jtion ateria

l L:C=ust=""'=-----"-'1 ���·!llrt

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

H

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

3 8 This isn't Excel, it's Magic/

Page 40: This isn't Excel it's Magic! - Bob Umlas

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

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

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

· -.---·---.. J�)�

[

:·················· .......... �

Settings Input flilessage i Error Alert ' , ............................. ;

0 Show error alert after invalid data is entered

When user enters invalid data, show this error alert:

St:!le: Title: !stop Sl Error. message: This value has already been ""

0 entered!

Clear All I I OK

-

v·' -

I [ Cancel I

This isn't Excel, it's Magid 39

Page 41: This isn't Excel it's Magic! - Bob Umlas

14. Right-mouse/drag the border

of a range for several new options

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

I J A B 0 , 0 E 1 - . 1 I 36 45 1/1/20031 2 40 50 2/1/2003 !-• 3 I 4

5

6 l . � _J_;veHere

7 I py Here . I 8 ��opy H.�rt� .. . Yall.l � S.:QJ.lly ] E" 9 I Copy Here as tormats Only 10 ·:. link Here 11 Create !::!Yperlink Here I I_ 12 ·

�hift Down and Copy 13·

14 Shift Right and Copy -

15 I Shift Down and Move

16 Shift Right and Move

17 C�ncel

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

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

Page 42: This isn't Excel it's Magic! - Bob Umlas

15. Shift/click inner VCR controls

I n the tab VCR-type scrolling controls,

23 24 -25

-I i I l I !

I _I

26� l l � ���1 Sheetl ..(shee.�fj?Sheets.,.tb:/

Ready Num Loci< e:J-f If you hold the shift key down while clicking one of the inner two controls, you will scroll a "page" of tabs (all the tabs that are viewable) at a time instead of one sheet at a time.

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

Page 43: This isn't Excel it's Magic! - Bob Umlas

16. Using Pictographs

Anything in the clipboard can be pasted onto a chart

3.5 3

2.5 2

1.5 1

0.5 0

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---2 -I--------.,.-----JI.t.��-1.5 +-------�A-----.L.(!l...:...---

1 t-�-=------Lm,v----� ..4---

1

4 2 This isn't Excel, it's Magic!

2 3

1. Seriesl

Page 44: This isn't Excel it's Magic! - Bob Umlas

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

····---�·r·

s.s ..------------------3 t-------------------.----

2.S t----------2 t-------.-----��.--

1.5 +--------.-!!}-----G: 1 t--.------�-1': (!fr.===ililbt:=:.___,

0.5 +-- Q�ld� 0 -1---__, R�rl to M! t ch Styl�

I 2 ill Chang� S�rie1 Chart T� e .•. r------------l !1l} Stt•a Oata_.

-, 4<t a Oati Lall: � H

Ad d Trtn dli n t •. •

f o rmillt Oat-a 5-tri es •.•

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

� -J���1·:

seriK Op�� n t FJI

Onrd� ector Border SWAct Sh.'ldoW J.O fiOfti\Jt

I I

Fill 0 C10 ftl 0 S,elld M 0 G-od.,.tNI 0 e,t11Jrur texb$e ffl 0 Ay:IOflliiiC 0 lrlw:• t if nt:'];Jii'IC! 0 't.•-v cdf.Ms by poir.t

Tcxlyrt: � IMctt ! cm�

I !Je ... I I Q¢oW"d I I Clip Att. .. I 0 ... 1<11 0 Sl><t 0 SUCk <it!d ScU �.,

Ir�ttCY: l.:l ,.

D ISI!ts '()lelv.":

'l . !0% !

�� a..� I

This isn't Excel, it's Magid 43

Page 45: This isn't Excel it's Magic! - Bob Umlas

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

3.5

3

2.5

2 1.5

,

1 '

0.5

0 1 2 3

If we select Stack and scale, we can enter a number into the Unit/Picture box. Again, this is something you can experiment with.

You also may have noticed these options in this dialog: • Gradient fill • Picture or texture fill • And others Here's the gradient option selected and the Preset colors dropdown:

44 This isn't Excel, it's Mogicl

Fill 0 ttofl 0 :;old til 0 �-fil 0 ew:ture ot teXVe II 0 Apma11< 0 flwuta ""9"""' D x•rcolnbr...,.

l'$<: (!<<<ton: At'lfJit! Grident stops �;;:, ,.--., (stot:� 1

�or:

Page 46: This isn't Excel it's Magic! - Bob Umlas

The new chart:

�-3.5

3 2.5

2 1.5

1 0.5

0 1 2 3

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

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

Page 47: This isn't Excel it's Magic! - Bob Umlas

1 7. Wish there were a "No to Air'

when closing many files?

There is! Hold the Shift key when clicking the No button and you won't be prompted to save changes on any workbook!

Microsoft: EKcel

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

I HH····yes......... ., ............ ....................

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

Yes To All No I Cancel

Page 48: This isn't Excel it's Magic! - Bob Umlas

18. Quick return from FS(Goto) . . .

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

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

Page 49: This isn't Excel it's Magic! - Bob Umlas

.19. Split Bars

Did you know there are split bars in Excel? They're here:

�Book2 - 1:1 X

I La • A 1 c

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

A � B c Ci:i 1 2 1 3 4 s 6 7 1 • 8

' 9

10

11

12

13

1�

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

0

'

- c X E F G ' I"=

-'Iii .

I ..:: I -

� J

. I

i "' � . .•.

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

48 This isn't Excel, it's Mogicl

Page 50: This isn't Excel it's Magic! - Bob Umlas

\!1 Book2 - 0 X

1 1::=! B I c 0 I E I F I G I 1':

iii

2

3

4

s -�

1 .:: 8 -9 10 � 11 •

12 \--13

14 � + �� ..>.< 14 4 � " ' Sheet!� Sheetl!,cl u a.-1 ij Ll. 1-r•�

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

� New Window 13 jJ

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

Window

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

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

I(Generof) iJ (<Declarations) -

-•

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

Page 51: This isn't Excel it's Magic! - Bob Umlas

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

�:

3 jeattA1b n : Ht·.Find(Ht•f & ".", lookot::xiPoJ·t).Row 'On A1 If n : 0 Then 'no ".xxxx"

_J n : Ht·.Find(Ht·f. lookot::xiWhole, Aftet·::Hr.Offset(Hr.Cells.count - 1).1

I f n : 0 Then

Go To 1 '··················end loop----------------·····

Else 'yes .xxx With Sheets("Copysh<Zetl")

.Activate

.Unpt·otect

.Rows. Delete Sheets(" A l").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 alignment (since this author indents code to align the statements!) easier to see!

50 This isn't Excel, it's Mogicl

Page 52: This isn't Excel it's Magic! - Bob Umlas

• 20. Window/Arrange Tiled

(except this one!)

Here's the result of using View/Window/Arrange All/Tiled with 3 open work­books: [Excel 2003:Window!Arrange/Tiled]

\!)Boolol Ll

1 I � 2

3

4

5

: �I 9

�I u �

17 18

A I I

li • � H Sheetl

8 c

Arrange Windows � Arrange

0[!���1 0 HQrizontal 0 Vertical O �ascade

0 Windows of active workbook �[ _o_K _;] [ Cancel ] - 1:1 X Book3

D 1 E

A

1

2

B

c D E

c D E

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 included in the arrangement:

r:� X

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

Page 53: This isn't Excel it's Magic! - Bob Umlas

@sook2 A 8 J

I •

4

5

6

7

8

R udy Num lock �

- "' X

c Book4 1

2 3

4

5

6

9

10

11

12

Notice Book3 is at the bottom left, not included!

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

D E

Page 54: This isn't Excel it's Magic! - Bob Umlas

• 2 1. Adjusting Row Heights

for Merged cells

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

This isn't Excel, it's Magid 53

Page 55: This isn't Excel it's Magic! - Bob Umlas

• 22. More Scrolling

You probably know that scrolling is ''localized". If your entire worksheet goes from A 1 :C1 0, the scrollbar looks like this:

� Book5 A 1 2 3 4 5 6 7

I s r 9 l1o r11 1 12 ru 114 rlS � 16 17

I

] I l

Sh eetl ---------...............

8

- c X·

1 D �-. ..:.

---1

I .,:.jz __ ! __ , ! _!, __ I I I _i, __ -Jl_, __ l·-lll!

. --·�--1 I I --i---''

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

54 This isn't Excel, it's Mogicl

Page 56: This isn't Excel it's Magic! - Bob Umlas

� Books

A I B . JJ I � I •

4 5 6 7 � 8

9

10

11 rli

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

This isn't Excel, it's Magid 55

Page 57: This isn't Excel it's Magic! - Bob Umlas

23. Drag/Scrolling

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

I Ay_toShapes • "'-

__ .... _

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

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

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

Page 58: This isn't Excel it's Magic! - Bob Umlas

• 24. Using the Justify command

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

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

@: � Qp @ J.eft

• Hl:sheets .. �eries ... Justify

Or from the Vertical section of the Alignment tab:

Number A6gnment Gnt Text &gnment

Border FUI 11 Protection I

tfOrizontal: General v nj�·

��&-tk_ai_:--------� �Lo __ ���� Bolt om

Suppose you have text like this ...

Orientation

T e X t

Text -•

Ll· • •

lo

A l B C 0 E F G H J K L M -1�1(.-No-w""IS-th,..;i time! for all &ood men to oomt to the aid of their party. Now Is the tim� tot all good men to come to the aid of their party.

2

... and you want to fit it all from columns A:E, not A:K. Make the selection as this:

.. B c o 0 e II F G H J K L I M 1 Now is tht ume for all good rt1en to come to the ale or their pany. Now is the time for all good men to col'ne to the aid of their party. 2 3 4

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

Page 59: This isn't Excel it's Magic! - Bob Umlas

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

�tiltS ... Iustify

rl:sheets •

and the resu It is:

1 Now is th time for all good men to come to the aid 2 of their p irty. Now is the time for all good men to 3 come to tllle aid of their party. 4 I •

just what you wanted. If you selected A 1 :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 aic of their party. Now is the 2

3

4

5

6

7

8

9

----Microsoft Office Excel � � Textwlextendbelowselectedrange.

i oit J I Cancel J

which means all the text won't fit insideA1:C2.1fthat's ok with you, then you'd see:

D A B c

1 Now is th time for all good 2 men to cc me to the aid of 3 their part . . Now is the time 4 for all goc d men to come to 5 the aid of heir party. - . 6 I

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

Page 60: This isn't Excel it's Magic! - Bob Umlas

You can also use Justify to flow the text into a longer string, rather than shorter strings. If you select A 1 :DS from the above and use the Justify command, then you'd see the text reflowed to:

L � A B I c D --�·�·�-�- --��-·�··--�-= II .

1 Now isth 2 come tot 3 time for a 4

tim e for all good men to e a1 d of their party. Now is th�

d men to come to the aid I goo of their p; rty. - • ---r-------•·-------1---

s I And if you selected A 1 :M 3, it would reflow back to the original:

A e c o e LF G L H J K ] L M ] -:,� 'lr.:Now,.,.::,ls"'t"'hi tlmr. for all good tnPn to COIYU! to the tid ofthf"lr party. NQ\v li the tim� fOf' all good men to come to the aid l?f their par1y.

2J . '

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

li:JFA:=il: B :Ji: c 1 � - . 2 l 4 <

Now Is the time for all good 1'1'1en to

to• nli! t'o thet a i d of thttlr < 111 • No w I s th8

time for a ll good men to (omo lo t h e a id

of their pirty.

¢ h ·G' ·b • H:::::;I;::il h LJI 1;, I K I I 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_i_s-:th-li time for all good men to come to the aid of their party. Now is the 2 ' -3 time for all good men to come to the aid -4 I of their party. ----. 5

probably not what you want!

This isn't Excel, it's Magid 59

Page 61: This isn't Excel it's Magic! - Bob Umlas

• 25. Understanding the order

of Window/Arrange

Suppose you have S workbooks open and you use View tab/Arrange All from the Window group [Excel 2003: Window/Arrange):

View

Zoom

� Boola -A B

1 2 3

6 7

8

Developer

100% Zoom to Selection

Zoom

Cl X Boo�S

A 1 2

Book!

A 1

Add-Ins

� New Window i·-3 _

� Arrange Alii ::1 1 _ l @ Freeze Panes.,. u .:! . Wir

Book4 B A

2

B

� �< • • >I I Sheetl _LsheeR..c

Book3

B L.! B (

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

Book1 Book2 Book4

Book3 BookS

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

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

Page 62: This isn't Excel it's Magic! - Bob Umlas

� Bookl 1 A

1

2

3 4 ---st 6 7 8 9 .

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

1 2 , 1

1

2

1

2

>�1 Sheen / Sheet2 • I< • • > I Sheetl Sheet2

A __ --�8�---- --��A�----=8----�� �

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

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

Page 63: This isn't Excel it's Magic! - Bob Umlas

• 26. Creating names

Suppose you have a worksheet which looks like this:

A J B c 0 E F G I +1cars Data ...

2 Toyota 204 613 846 680 780

3 Oldsmobile 734 n 202 411 436

4 Honda 961 847 749 461 589

5 Ford 876 340 857 171 262

6 lincoln 797 480 616 254 919

7 Mercury 53 676 801 410 728 ±JBMW 63 922 568 405 981

Chevrolet 933 420 720 172 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:A 12, use the fill handle to drag to B12:

A 1

!

cars 2 Toyota 3 Oldsmobile 4 Honda 5 Ford

-

6 lincoln _!_Mercury

8 BMW 9 Chevrolet

10 Alfa Romeo

B j Toyota Oldsmobi Honda Ford lincoln Mercury BMW Chevrole Alta Rom

...!.!_ Mustang Mustang 12 Volkswagen Volkswae

Oat<

•.,......,

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

Page 64: This isn't Excel it's Magic! - Bob Umlas

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

A B E

)X-; - --. f9 Recently Used • � Text • f9 Math & Trig ·

Insert Function � Financial• I[Er Date & Time • fiE! More Functions •

B2

A

le

kswagen

Data ...

Toyota 204 613 846

Oldsmobi 734 72 202

Honda 961 847 749

Ford 876 340 857

Lincoln 797 480 616

Mercury 53 676 801 . BMW 63 922 568 Chevrolet 933 420 720 . AI fa Rome 139 120 837

Mustang 241 17 722 . Volkswago 516 534 908

Create names from values in the: Dfoilrow! . ., ....... "''''''"'

0 !,eft column

0 !!ottom row 0 !iight column

/? Use in Formula ·

Name Managerj!lli' Create from Selection

H

680 780

411 436

461 589

171 262

254 919

410 728

405 981

172 326

n 232

889 989

917 498

'['-_o_K_-"j [ Cancel

Then simply clear B2:B12!

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

1 Cars

2 Toyota

3 Oldsmobile 4 Honda

5 Ford

6 Lincoln

\B fx 734

c

Data . . .

204

734

961

876

797

D

613

72 847

340

480

E

846

202 749

857

616

F 680

411

461

171

254

G 780

589

2.62

919

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

Page 65: This isn't Excel it's Magic! - Bob Umlas

• 2 7. Long Names

If you create a very long name for a range:

------ ------

New Name �� Name: I ThislsAVerylongNameAndNormallyWontDispla·l Scope: jworl<book CQmment:

B,efers to: I =Sheet2!$A$1 [�J [I OK I [ Cancel J "'

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

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

1 !toooooooool 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 !1000000000 A 1 B

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

c l 0 __L_ =._E - I---'F'-----ll'- G H 7

Page 66: This isn't Excel it's Magic! - Bob Umlas

• 28. Long Formulas

If you create a very long formula, previous versions of Excel often made it hard to see both the formula and the cell. Here's a screenshot from Excel 2003. Notice cell F1 is selected, but you can't see the cell:

r I • f. � 'J ��·, .,..,.., ,,., 'lbl<"' ·;�, '11..•'/. '.blot',· J;J {, '...,_.1"'1: ��··: .,)(��4'!'". ·��.:.fi'. · CIH�ok- . -�"'1-:1 �(, .1, e 'N 11'(1'1',' '·••r, "fl.:.y' ;.,.,.. ', 'J/ f. ' ...,_.,.,.·;Sff!•-e:.tr, "0::.:.""::..-. ·:.-..,.;·!"«", "OK�;.J.wJMr·,"f t�, 'Nl'th ';. .,.._.._., ''.!¥(, .,.,. ',

• :v, •. 'A.If..'\� • 'ktt....:.,·. 'Oct:W'". ?-......,_..( "''d l---4f" :J ..,..., · ... ;: t'k#. ""�•·. ·;.ur. 'May',·...,..$·:,);,�(. ·�.q,.nc·. "Sttt�·· 'Oct� . • ,�_... . "O.(ot'llbt.f'. 'J tl'loN'f' • .., ·�)'-. "N ........ "': 'A;-r-• ..,...tit'--�-: -.uy. -�-. �w.a¥;'()c«..ft'. ":�+t­"'«.tw..t>tl"" '#loli'J' "f -er .1¥) '; w II!"C t : , 'J-.,,'11'( , •• ,_, f, ·�·;J, '!·;����roT«(' ;'Ort:�. �tC' .. , "0.:..-&.,.., 'J»t.m(', ''�-��

-.·�·-·,.•,f,'J..ht','Mr'.'�·.·s.�t-....,'.'O(�a.t',�t«'-."Crt .. �·.·�.-,.�)l}"'.�fii','A:J(' *'-' t( 'N•", 'Jt.l'(, 'AI.;� II', "Sf'CI ..... �;¢(:�·. ').,"Mfl'..t..,-; '1.\K .-.-;¢ti' , ' .:V·1VJ' ·r � ', ""'-W'' ',' 1-{H'J

Here's the same thing in Excel 2007:

./• • t" ' �" ""k'f"':� l e�·:"'M.Wd'i' :" A;1ll tt· :' M,q .. ; '""�o.JM."';;� .._�,�� - ; ' S.;�.: embt,...;'Oeowr�:· �"': 0 t , i.l� 1 ,H ( ,1! T', :. �n . .,.,M,. • H l:�l.I*Y

c

But you might wonder where's the rest of the formula? You can drag the formula bar down, or double click it to see both:

11 •""-

• .....L..._,c,._j

f•1•l" 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'' cbt u;�r, .. :· MMO!'' :• Apr fl-.:·,_.....,.-·:' J.-rA: • : .. r!lt)·": '.\u:-g.\i$t�.:'SeptMbet':' O;·to1xH-";" :;Q\�Mb!.· • ·:

'0\.'<1! M'!t�r· ;"t�AuMY"'t'f Cbfl1oi'J": .. ,_�� •:• t\p!ll':' M¥(:' J�r..t � :"'h...,.,-;''..'4"')1\ISI'" ;'"$otpt�-r.t:,t1' ;' ()( tOIX-t"!"' N O"' "-Mbt 1": 'tl«A! tn�f'':"" � .t. � Aot'W' ' � "( .,t:n.JJr(':' t.Wdi'; •J•SNr i •:• Mtr( ;• J�r�' �· tr:itf':' �U��" � '$tp1\".'l'l�l" :'0<10�,..�· NOO!�ftt �I":

o ...J. -� r 1 <> J_,.i;,j r...J ·J, I .I\_! L .I M I " .L.<IJ '''"";;; I As you can see, when the formula bar is expanded the worksheet moves down to accommodate it. You can use Ctri/Shift/U to open the formula bar to fit the active cell. And press it again to restore it to one line.

This isn't Excel, it's Magid 65

Page 67: This isn't Excel it's Magic! - Bob Umlas

29. Formatting comments

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

/ Bob Umlas: This is a typical comment

-

I

But how about a comment like this?

' l Bob Umlas:

Or even this: (It's me!)

Bob

Here's how you can do it. When you first create a comment, the cursor is right after whatever you typed. You need to select the comment itself, not the text inside. So, select the border of the comment:

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

Page 68: This isn't Excel it's Magic! - Bob Umlas

Comment3 ....

A -r--12 13 14 -· 15 I -' 161 ___... 17J

I ·- B c D E F

is a typical comment

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

. . . '�!l,9P..!ii!.�.S .. � Popular

Formulas

Proofing

Save

Advanctd

� Cu\torn1u 3 Add-Ins

Trust Ctnttr

Ruoura\

-rr,-.. Customize the Quick Ac.ces�'\T.9,3 16�r.

. ' ' ' .

l;hoost commands from:(!) J All Commands

Changt Layout

' '""-' -Chart Background �

Chart Data lablt >

Chart Eltmtnts p =..> Chart Floor •

Chart Gridlints •

Chart Layouts ,.=:,.. Chart Namt r �

Chart Ptoptrtles ..., .:!J

Chart Quick Sill« •

[

l j � I [ Add >> I

" me -

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

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

Page 69: This isn't Excel it's Magic! - Bob Umlas

@liD IY �·w �� J Home tnsert

� h T!lhomo

r8 'IS PaJJe • a

iti>�J) ;; BO< Basi<SMpes - -

oov<>o0 D. � o ooo fJBliOQ@@@A<V """ � <r

...

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

Olpboard r; Comment3

A 12 13 14 15 16

17

18

lg 20 J!.� ��

8

- "-" Fon t

·(• I c -

8 10<1< ArroW> ¢¢'if.O.(:;)i.t+ef"�cac1J � � \\.9 O't> •1.> ¢ D » [l;; g ·:0 � o-v�

flowthort DO<>OO[jGJ(;'k>OCJ\J o o Ot?®Ee & � 6 \7 G D QEJOlO

Ca l lOUIS

Q 009-DAJ,-o <PJ.J"__jtf-j�) "I

. I -, -1 ro 'O tiO ·a ..L.�A,r"". C . - ... 1· � Stars and 8a_nners

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

..

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

cauouts

o o og...o ...a rGl @ -..... ,.... ,.... . .... JO '0 ., ri,.., .J ... J /: ... : r: .. .J c .. .; /i [1� '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.1m;���:�i:;::·:·•·N·:>· ··:···�···:·:>- t·t·t·�·!·!�·t·· ,.J J, Cu! i=i ''' �op•

� faste �..J

!

iii''�� 5) EditTe� --=-------1 I I

l I I -·· I 68 This isn't Excel, it's Mogicl

Grouping >

Order •

A�sign Ma<ro ...

Set AutoShape Defaults

�� �Format Comm.ent·.-... ·

� 1 !jyperhnlc .. I .

Page 70: This isn't Excel it's Magic! - Bob Umlas

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

··- ------ ---------

Format Comment � II I II Web

Font I Colors and l ines I Si2e

Ft1l

�olor: tv" I Iransparency: NoFtll I o "'o �I

lne 0 Automatic

C�: • · · · · · · · · • • • • • • • • �shed: • • • • • • • • !o.7s pt �I Connector: • o • • • • l u ooou•co

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

Eil E ffects . . .

Fill � I [ C a ncel I . .

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

as you saw before.

--------

rill flfor.ls rEl

Setect Picture . . .

0 Lock Q.icturt .spec.t ratio

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

s a mple:

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

Page 71: This isn't Excel it's Magic! - Bob Umlas

30. Format #VALUE.! or any errors away

Probably the easiest way to not display errors like #VALUE! or #DIV/0! in an already existing worksheet is to use Conditional Formatting. Here's how: 1 . Select all the cells you want to hide these error values in. 2. Use Conditional Formatting from the Home tab, and select New Rule (there are other ways to get to the new rule, but this is the most direct) [Excel 2003: FormotjConditionol Formatting):

Cond1t1onal Format C�ll r � �- � formatting " as Table .; Styl e s • ' �� l!lghllght Cells Rules >

1m Iop/Bottom Rules •

��� Qata Bars •

� Color S«otes •

I ng;l r: (con Sets •

® !j e w R u l e ... -·

® �I tar RuiH •

li!l Manag t Bui es ...

-e

� " ,;

!! � F F

-

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> Fonnat only celo that contain

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 which cells to forrnat

!:;dtt the Rule Description:

fQrmat only cells with:

�iiiirc·'"'·'"'"'="� i�l o>o i ... H _ !....;...,.,g:.,,-.. .,-...

Prevlew: I 70 This isn't Excel, it's Magic/

No Format Set

IL O K '

I II

[ format . . . I I Can cel I .

Page 72: This isn't Excel it's Magic! - Bob Umlas

4. Click the Format button, the font tab, and assign a white font!

' Fgrt style; Size:

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

v•e Sold 13 Sold ltak I ! '.It' � I�

""- " 14 v -

�: I --� Effects - • Automat•c

0 51<\elt'<OUti> Them4! Colors ' r

L J .'(A, :,('

For Cond•lJOMI Fo:rnotlilo you con sel FoUII fxlore Colors ...

OK I I Cancel

This isn't Excel, it's Magid 71

Page 73: This isn't Excel it's Magic! - Bob Umlas

31. Using [h} format for hours>=24

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

17 C6 .( �x: I =SUM(Bl:85}

' A B c� Q ' --· 1 I 3:15 • 2 1 4:15 3 I 5:15 • j l 6:15

� 7:15 2:151 26:151

.

The formulas in 86 and C6 are identical. However, 86 is formatted as h:mm:ss which will not permit the "h" to be above 23, and the format for cell C6 is (h]:mm:ss.

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

Page 74: This isn't Excel it's Magic! - Bob Umlas

32. Advanced number formatting

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

This isn't Excel, it's Magid 73

Page 75: This isn't Excel it's Magic! - Bob Umlas

33. Formatting text

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

'

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

Here,

� @

2

3

4

5

6

Home Insert Page Layout

Calibri • 11

Al

B c

can be formatted by ch

-•

Formu las Data Revi

II II �ardColors

� = • • • • • \;) ,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.

7 4 This isn't Excel, it's Magic/

Page 76: This isn't Excel it's Magic! - Bob Umlas

34. Using Fills

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

Al ... , fx u A B

1 u ...... 0 ••••••••• 0 0 ••• 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 A

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

2_

12 E

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

Page 77: This isn't Excel it's Magic! - Bob Umlas

• 35. Indenting or distributing text

Suppose you have a worksheet which looks like this:

A 1 Main section 2 Sub Sections 3 I sub Sections 4 ; Sub Sections

5 Sub Sections

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 Sub Sections

16 Sub Sections 17 Sub Sections 18 Sub Sections 19 Sub Sections

B

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):

7 6 This isn't Excel, it's Magic/

Page 78: This isn't Excel it's Magic! - Bob Umlas

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

Text alignment

Horizontal: I Left (Indent) vi Indent: Vertical: g I Bottom 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:

4

5

6

7 8 9 10 11 12 13 14

is is a wide cell

is is a wide cell -.-.·��-•r•--"'''r•••" .,_ __ , F�;mat Cells . . _lfm , 'U�'!'���...d �

Number Alignment

Text a�gnment

ttorizontal:

(Indent)

Font Border Fill

lndent:

lo �1

Protection

Orientation

• • •

• •

• T e X t

Text -• •

• •

This isn't Excel, it's Magid 77

Page 79: This isn't Excel it's Magic! - Bob Umlas

36. Easily create custom list of a-z, A-Z

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

I Al A

_!_.,�:;;lA_�! 2 B 3 1c 4 .o

-, 5 IE � ��

B fx I =CHAR(ROW(}+64)

c I D

-------:--------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 Options, Edit Custom Lists button: [Excel 2003:Toolsl0ptions!Custom Lists]

� D � Hom .� .!lJ.C.�IOp,lio�.·.��' � ,)1

-� Pa�t· " £!1pboir<J tv

Al

A --�-=-� 1 A _3_ 8 3 c -..1_0 5 E 6 F

ILPopula• Formulas

Pfoofino

Savt ACS.Jn<cd

Cu1tomirt

Add-Ins

Tnnt Center

Ruourcu

and click Import:

78 This isn't Excel, it's Mogicl

r � . .. = � � Change the most popular options in Exc el.

Top options for working with Excel

� Show ,Mani Toolbar on nltdion"J: S Enabl• LiY< Prev;ew"

8 Show Q�eloptr tab in the Ribbon <D 8 Alway\ u'e Out!Jpe

t;olor sd1eme: �� Bl'=u'=•:::!i:J:L _______________ -:1 S<{l."tnTip 't y(t: Sho w feature deu rfptions i n S aeenTips v

Crute lnts for use in sorts and fill s�quen<es: I Edit Cust,gm Lisu ... J

Page 80: This isn't Excel it's Magic! - Bob Umlas

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

Custom ll�t s

Custom

NEW LIST Sun, Mon, Tue, Wed, Thu, Fri, � SUnday, Monday, Tuesday, Wee Jan, Feb, Mar, Apr, .lul, J

list �ntries:

A B c 0 E F G H I J I( l

:6· [ &dd I --. � [ Qefete I

Pre�s Enter to separate nst entries·.-----------,,. ====

=::. tmpoct bst from cells: L.:!l $�A:!.$ !:.::$!:A�$2=6=-------���::.:-::l'<J [::J��C:�;

OK I [ Carocel

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

This isn't Excel, it's Magid 79

Page 81: This isn't Excel it's Magic! - Bob Umlas

37. Inner Series

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

86 •

A 1 Rate 2 ' Nper 3 PV 4 5

6

7 8 � 9

10 11 12 13

f,. :IPMT($B$1/12,ROW(A1),$B$2"'l2,-$B$3} Ji..__B L c o I E F

I I

5.25%

0:00

$400,000

S1,75o.oo I •

$1,

7

47

.

99 i $1,745.98 $1,

743.95

$1,741.

9

2 � $1,739.88 j $1,737.82 $1,735.76

-�-- ------! 1-· --

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(A 1 ), of course, if the series needs to be filled right!

80 This isn't Excel, it's Mogicl

Page 82: This isn't Excel it's Magic! - Bob Umlas

38. Using Apply Names

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

82 . r tx 1 =B5+86 A B c D .

1

2 I nl •

3

4

s First 4

6 Second 7 7

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

2 3 4 s 6 7 8 9 10 11

F irst Second

11

4 7

- ---·----

Create Names from Selection @� Create names from values in the:

01:;:;;· .... ,owJ t!i .. :e .......... . 0 �eft column Oaottomrow 0 fii<;lht column

OK J I cancel

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:

Formulas Data � lookup & R�f�rence • til Math & Trig •

• � Mor� Functions •

Revi�w View Developer

I

� �� Define Name '4 A:B Define Name ... Name -=--

Manager I �pply Names .•.

Defined Names

A

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

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

Page 83: This isn't Excel it's Magic! - Bob Umlas

1 2 3 4 5 6

7

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

0 !gnore Relative/ Absclute

0 Yse row and column names

v

[ Qptions >> J [ OK ] [ Cancel

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

J;>. Iii'� .c -.0< ' -

11

First 4 -d 7

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

Page 84: This isn't Excel it's Magic! - Bob Umlas

39. Selecting a random sample of data

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

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

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

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

C2 • f,. =RAND()<O.l A 8 c

1 Database of 100 items

2 lteml I TRUE I •

3 ltem2 4 ltem3 5 ltem4

6 Items 7 ltem6

8 ltem7

9 ItemS 10 ltem9

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

vanced Filter]

Formulas Data Review

T o( Clear :{� Reapply

Filter I

� .,,I LV Advanc � c

Sort & Filter

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

Page 85: This isn't Excel it's Magic! - Bob Umlas

you can filter like this:

-

Advanced Filter � Action

0 filter the list, in-place 0 CQPy to another location

!.ist range:

�riteria range: I $C$1 : $C$2 �:::::::.::::====� -"11� .)' LI ________ �_:·::.:.J-:1 0 Unique records only

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

roc A

1 Database of 100 items -10 ltem9

-

13 ltem12

16 ltem15

27 ltem26

62 ltem61 1--74 ltem73 -n ltem76 1--86 ltem85

-��

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

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

Page 86: This isn't Excel it's Magic! - Bob Umlas

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

A B 1 Database of 100 items r---., 2 ltem1 I 0.472988! 3 ltem2 0.754415

4 ltem3

5 ltem4

6 ItemS

7 ltem6

8 ltem7

9 ItemS

10 ltem9

11 ltem10

12 ltemll

13 ltem12

14 ltem13

15 ltem14

0.161792

0.236491

0.255978

0.786952

0.810523

0.227744

0.2444

0.170091

0.506724

0.073749

0.186336

0.498387

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

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

Page 87: This isn't Excel it's Magic! - Bob Umlas

40. How to change row height

when a key field changes

Suppose you had a worksheet something like this (but more complicated!)

A I B - �- .Joeeartment! 2 I Accounting 3 Accounting 4 Accounting 5 Accounting 6 Accounting 7 Accounting 8 Accounting 9 Accounting 10 Personnel 11 Personnel 12 Personnel 13 Personnel 14 Personnel 15 IS 16 IS 17 IS 18 IS

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

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

Page 88: This isn't Excel it's Magic! - Bob Umlas

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

Go To Special � Select Ocomments 0 Row differences

o c�nstants 0 CokJmn differences

0 ·Eorm�lasl 0 Erecedents

�N!lmbers 0 Dependents

�Te�t D ecc or I �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 A I Same

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

I 1

5 6

7

8 9

10

11

12

13

14

15

16

17

18

B2 .. (

A Department Accounting Accounting Accounting Accounting Accounting Accounting Accounting Accounting Personnel Personnel Personnel

Personnel Personnel

IS

IS

IS

IS

#N/A

#N/A

#N/A

1

1

1

1

1

1

1

1

1

1

1

1

1

1

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

Page 89: This isn't Excel it's Magic! - Bob Umlas

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

rt • I: • � � �te "" liD ·

Sort & Find & nat • a· Filter • Select·

s at& find ...

3 Replace ... " 3C

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 CQ:nstants

@Eor!Was 0 N11.mbers 0 Te;![t 0 ...... _ ..... _ .. ,

ll.���!�i 0 '-rrors

0 Blan!ss

0 Current region

0 Current �rr�y

0 O!lJects

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

0 R� diferences

0 Colu(!11 differences

O�ecedents

0 Dependents

0 ct or ' u ... ·.!<; � ' .

0La� cell

0 Visible cells onll(

0 Conditional formats

0 D�ta y_alidation

All

Same

0� J [ Cancel

Page 90: This isn't Excel it's Magic! - Bob Umlas

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

: :

�o Insert • � Delete • i!) Format •

Cell S"12e

(2·

:c Row Height. ..

Sort & Find & Filter • Select •

' AutoFit Row Height 0

++ Column Width ... n Auto Fit Column Width

.Qefault Width ...

Visibility

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

A B I 1_ Department

2 Accounting c:J 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

1 7 I<;

And finally you can clear column B.

#N/A

#N/A

1

1 1

1 1

1

1

1

1

1

1

1

1

(

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

Page 91: This isn't Excel it's Magic! - Bob Umlas

41. Define "global/local'' name

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

.ayout Formulas Data Review View Developer Ac

cal lookup & Reference � ...U Define Name

JP Use in Formula • Name

6 Math & Tr�g • ! & T1me ' More Functions • Manager �Create from Selection

Library

D

L.l __ !

Defined Names

E F G H I •

-

New Name �� �ame: I A bove �======;--__J �cope: CQmment:

I Wo rkbo ok � v I

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

/.

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

D E F G H I J K

L.l --1 - - ---

Nd/JlC Manager �� [ Mew··· Ed Delete I filtw ]

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

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

Page 92: This isn't Excel it's Magic! - Bob Umlas

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

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14

A B c I D E

._I __ ! --

Edit Name rill� �me: lAbove I

...

C2mment: " -

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

I ! -·

New Name �t'2] !!lame: [Above I �ope: lworl<book vi C�:

-

.

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

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

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

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

Page 93: This isn't Excel it's Magic! - Bob Umlas

42. XLM-Names (not XML)

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

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

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

This will return the names in the workbook =NAMES()

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

Example: Define lk as =LINKS(). Then use =INDEX(Ik,1) to get first link, or =INDEX(Ik,row()) in row 1 & fill down to get all the links:

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

Refers to: Ll =_lin....:ks_,O,_I --------;====:;-;:==::::!(:=��:;J II_ ] [ Cancel J

A1

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

Page 94: This isn't Excel it's Magic! - Bob Umlas

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

Home Insert Page layout

If� Mi} Connections u al Refresh

All• Connections

doesn't show the whole path:

H

formulas Data

lill1 1 .,A Oear

� Reap1 A

Sort filter �Advar

Sort � filter

-

Edit Links � Sour ce I Typ e Updote Stotus

dell . -y j $ WN I 'she et A Unl niJwn del2.xls Wo�ksheet A Unknown del3.xls Wor·ksheet A Unknown

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

Updote: 0 &utomotl<

[ �tMtuP Prompt . . . I Similarly, here's the file/open dialog:

[ �evalues ] [ Chaoge s-ee ... I

- ----------------------Open

�,.: lo :1-2000

�- ..... - ty pe Dote-lid ��vt:�!] •z�<�� t'icro$0lt <:ifK.c Extd ••• 3/1?/2000 IMZ m (jo..stop I!Joz-�•"."" <91<8 Mcrosott cttlc:c ElCCeJ ... 3/1212000 10:57 m i!)O>-OQORl.>i< 381<8 Mcro$01t �fiai £xcel ••. 3{12{2000 tO:>< m e�. !)�-thTI\O.JdJ IS 1<8 Mcn>$011: ctfi<e Exul .•• 3/12/2000 10:221'1'1

!l""' i!)OKLOSEA\IG.xb 351<8 Mcrosoft ctfite Encl .•. 3{12/2000 10:311'1'1 i;!)os-5'{EO.x� Z'ISIC8 I�CIOlo/t Off�e Exte\. .. 3/12/2000 10:571'1'1 Ccnpltcr �.., Network '!!JONN:>lR£CTZ.>I< 221:8 Mcro«ltt ctfiee Excel ... 3/l<f2000 9:35""

Pious 1!.)07-IN:>IAECT .>CI< 21 K8 t-1crosolt cttke Excel ••• 3/12/2000 10:571'1'1

i!!)oe.F1Nlt11"H.><IJ i21<B llicrosolt Cfficc Exccl ••• 3/12/2000 10:31 FN "!)09-1511Km . xls 261<8 MCIO$oft Offkc Exte1. ,, 3/12/2000 10:57 FN � 10<-IAXOATt.x� 161:8 Mcrosoft otfke Ex<el ..• 3/12/2000 10:26 FN

11·1fX1SOAT.>k 30K8 Mcrosoft O.eflte Excel ... 3/l2f2000 I 0: 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

v E

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

Page 95: This isn't Excel it's Magic! - Bob Umlas

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

Al • ( fx I =INDEX(FL,ROW()}

...,I __ A:...:.....__-,\1. _____.:B=---- c I 1-�01-ARRAYl.xls !

2102-SUMIF.xls 3 03-0KSORT.xls 4 J04-MatchTwo.xls 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 exam pie, if you wanted to return only those files which have an "0" in them, you can use =FILES("*O*") where the asterisks are wildcards:

A1

A � ( f B"' I :INOEX(fi,ROW())

l c 0

_!_103-0KSORT.xls ! 2 04-MatchTwo.xls

--

Ndlllc Manager E

3 05-0.0SEAVG.xls fjew... I I �..... I I �e 4 11-TEXTSORT.xls __,

F G H 1

Refers To Scope 5 13-SORTPTNO.x ls __, fl � ... } =Fl lES(" ' O ' ") WoM.ook 6 14-WilCOX.xls

7

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

Page 96: This isn't Excel it's Magic! - Bob Umlas

43. Getting number of unique values

For this example, assume Rg is defined as A 1 :A 10 and contains 4;5;5;4;5;5;4;5;5;5 Array-enter (ctrl+shift+enter) =SUM(1/COUNTIF(Rg,Rg))

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

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

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

So now, 1/COUNTIF(Rg,Rg) returns ={1/3,1/7,1/7,1/3,1/7,1/7,1/3,1/7,1/7,1/7}. There are 3 "1/3", and 7 "1/7", each totaling 1 . So the SUM returns the correct result: There are 2 unique values. This needs co be ctrl/shiftlentered or it will calculate as if that first 3 were the only value, and the answer would be 1/3, or .3 33333333.

This isn't Excel, it's Magid 9 5

Page 97: This isn't Excel it's Magic! - Bob Umlas

44. Named formulas are array-entered

If the formula in the preceding tip were entered without ctrl+shift, the cell would contain .33333, as mentioned. If a name (say "unique") is defined to be =SUM(1/COUNTIF(Rg.Rg)) and you enter =unique, without pressing ctrl+shift, the cell would contain 2!

.tL.���!l"iS&£� [ New • • . l I �dit ... ) [ tlelete ) I Filter • I

Name Value Refers To Scope Convnent Cl unique { ... } -S....-(1/CO�Tlf(Rg,Rg)). Workbook

�.!; '1'!) t.>-11 Refers to: 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 an array-formula.

However, here's an oddity. If you enter =A 1 :A2 in cell A3, you'd see #VALUE!. If you array-enter it, you see whatever is in cell A 1 . 1f, while the cursor is in cell A3, you define a name to be =A 1 :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 A 1 's value. So these techniques seem to contradict one another!

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

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

Page 98: This isn't Excel it's Magic! - Bob Umlas

45. Getting End of Month

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

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

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

Page 99: This isn't Excel it's Magic! - Bob Umlas

46. How many Wednesdays

between 11 1105 and now?

{This is obviously not limited to Wednesdays!)

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

If A 1 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/1900.

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

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

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

A3 • ( A J B

....!.... 1/1/2005 2 3/5/2005 3 FALSE 4

fx j{:WEEKDAY(ROW(INDIRECT(Al&":"&A2)))=4} I c I D E� F G l

expanding the formula bar shows:

98 This isn't Excel, it's Mogicl

Page 100: This isn't Excel it's Magic! - Bob Umlas

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

FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;

FALSE; FALSE;F ALSE; FALSE;TRUE;FALSE; FALSE;

FALSE; FALSE; FALSE; FALSE; TRUE; FALSE; FALSE;

FALSE; FALSE; FALSE; FALSE;TRUE;FALSE; FALSE;

FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;

FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;

FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;

FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;

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

1 1/1/2005

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

. . . the TRUE values correspond to Wednesdays. The N function changes False to 0, True to 1 .

Array-entering =SUM(N(WEEKDAY(ROW(INDIRECT(A 1 &":"&A2)))=4)) gives 9, meaning there are 9 Wednesdays between 1/1/05 and 3/5/05.

This isn't Excel, it's Magid 99

Page 101: This isn't Excel it's Magic! - Bob Umlas

47. Looking up 2 (or more) values

Suppose you have a table of values looking something like this:

I A B C l _!_��------�M�a���e�r�l�i��-----1 2 I First Last Amount 3 1 Bob Smith 23 4 Fred S IBob 6 Bob 7 John 8 Bob 9 Bob

10 Bob

Williams Devon Williams Smith Clinton Jones McCarthy

78

45

34

89 67

12

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$21,0))} A B c 0 E F G H

+f�lrst Bob

Master List Find Last Amount Bob Williams I 341 • Smith 23 Fred Williams 78

4 Fred Williams 78 Bob 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 "Bob Williams," 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: i •iNDEX(C: C .MATCH(F2& G2.("Maslerl.Jsl";1'irSI I.0$1";"8obSrrilh". "Fred'IViliams":"Bob0evon";"BobWilliams";"JohnSmilh";"8obCiu11on· •

.. BobJone$·: "'Bot>McCanhy"; '"": ··: '"": ••• ·-: ·-; ·; ··: • ·: • ·: • '"},0)) . . . . - . ·-····· . . ... .

and you can see that the combination BobWilliams is the 6th item in the list, so this formula reduces to =INDEX(C:C,6), which is C6,so the result 34 is returned.

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

Page 102: This isn't Excel it's Magic! - Bob Umlas

48. Named ranges which define themselves

Currently you have Database defined as $A$1 :$E$25.

�ame: I Database I �========�--� 2cope: I Worlcbook VJI �==========�--� c Qllll!lent:

" -

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

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

Page 103: This isn't Excel it's Magic! - Bob Umlas

49. Using REPT for visual effects

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

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

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

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

Go be creative!

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

Page 104: This isn't Excel it's Magic! - Bob Umlas

50. Using the Space as an operator

The space is as valid an operator as +,-,/, or *. =West Gizmos will pick up the intersection of the 2 ranges, West and Gizmos:

C9 ·� fx I =West Gizmos

A L 8 ! c J D E.

1 North West South East �

2 1Thlngs 24 51 92 91 · - -

3 Gizmos 37 85 39 98

4 Objects 53 74 58 8 - -

5 -6 I 7 I -s I

9 I ssl 1 • 1 n I I I

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

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

Page 105: This isn't Excel it's Magic! - Bob Umlas

5 1. Extracting the last part of a string

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

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

First, there are a few things you need to know. There's a LEN function which returns the number of characters in a string, or cell. So if A 1 contains ABCA. =LEN(A 1 ) would return 4. The SUBSTITUTE function substitutes one value for another in a cell. So =SUBSTITUTE(A 1 ,"C","Q") would return ABQA in the above example. Also, =SUBSTITUTE(A 1 ,"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(A 1,"A","Q",1 ) would give QBCA, and =SUBSTITUTE(A 1,"A","Q",2) would give ABCQ. The 1 and 2 tells which one to change.

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

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

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

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

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

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

Page 106: This isn't Excel it's Magic! - Bob Umlas

52. Using SUMPRODUCT

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

Look at the following worksheet:

� . A B c

.2... ' Fred 3 4 Fred

5 Fred

;& Fred

7 2004ifred - ... ' .. , ... ...... . , __!.. 20031 Bob

9 ; treo

,10

11 Fred

Ill E F G H .I

l I I • 2 l i .

3 m1 I I 4' �<II UcT((I' ? · " 11 111 5 6 � I I

UCT((1''·�11 . -"D.-1)"))

8 9 1l1lJ. I I

. 10; :SUMPRODUCT( -- {A2:Al1=2004) ,--( B2:B ll="Bob "), C2:Cll} . ' --· -- . -·- ·-

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;TRUE;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:C11 , 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 D1 1 . What is the"-" before each set of parentheses? If you enter =-TRUE in a cell, you'll see -1, =-FALSE yields 0. So --TRUE yields 1 , and --FALSE still yields 0. The

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

Page 107: This isn't Excel it's Magic! - Bob Umlas

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

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

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

Page 108: This isn't Excel it's Magic! - Bob Umlas

53. Using the TEXT function

Date won't fit in the column/

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

--------------------formdl Cells m

General .....­Cunency Ac<olrtln'l o.to Time Penent•90 Fra<tlon Scient1k Text --

� Wednesday, 11/1/2006

m/d/Y'/Y'I

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

Home tnsert Page Layout Formulas Data Review View Developer -----------�--

X � :J

' d r)l

Cahbri fB I

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

u ·JI�±� ·JI � · A ·I I� • :trJ[iF t�l � · s • % • 11�•8 +�81

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

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

Page 109: This isn't Excel it's Magic! - Bob Umlas

54. Use wildcards in MATCH function

Look at this worksheet:

I C2 • '• f� j(:B2/INDEX{B: B,MATCH{"'Totai",OFFSET{A2,0,0,1000,l) ,O)+ROW{)·1)} = A ....;__.oept �Deptl

3 Depn 4 Depll 5 Depn 6 Depn Total 7 Dept2 a oept2 9 Dept2

10 Dept2 1l Dept2

16 Dept3

� c j p E f G H i Amt " ofTotal ani 30%1

869 30% 384 13" 794 27%

2919 100% 340 10% 762 23% 426 13% 367 11% 207 6% 122 4% 564 17%1 459, 14%1

3247 100% 671 4%

I I

I

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

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

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

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

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

Page 110: This isn't Excel it's Magic! - Bob Umlas

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

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

07 A

1 'Dept

eptl

eptl

eptl

eptl

2 0 3 0 4 0 5 0 6 7 -.!l� 9 10 11 12 13 -14 15

0 0

eptl Total ept2

Oept2

oept2

Oept2

ept2

ept2

ept2

0 0 .

0 Oept2

0 ept2 Total

/.< =MA TCH('"'Total" ,OFFSET(A7,0,0,1000, l},O}+ROW(}-1

8 C 0 J E F G

Amt

I l I r

%ofTotal 872 30% 6 869 30% 6 --- --

'

384 794

2919

340

13% 27%

100% 10% I

762' 23% 426r- 13%

I I

'

I 367[ 11% 2071 6%1 1221 4% � 5641 17%

459 3247

14% 100%

' I I '

I

6 6 6

151 • 151

15 15

�1. 15 15 151

· -

1 i .

I 1 i r -- · -

I r

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

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

Page 111: This isn't Excel it's Magic! - Bob Umlas

55. See all characters in font set

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

A

147 "

148 "

149 •

150 -

151 -

152 --... 153 TM

154 s -155 ) 156 � 157 0 158 z 159 y 160 161 .

I 162 ¢ 163 £

4. When you see that "•" is in row 1 49, you can then know that holdingAit while typing 0149 on the numeric keypad will create chis character, as soon as you let go of the A It 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 resulting character from the formula bar.

1 1 0 This isn't Excel, it's M agicl

Page 112: This isn't Excel it's Magic! - Bob Umlas

56. Double-Spacing data

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

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

I A B c 11Data

-

Data Data 2 Data Data Data 3 Data Data Data 4 Data Data Data s Data Data Data 6 Data Da ta Data 7 Data Data , Data

Data .Data 'Data •

Data Data :Data

D E -

Data Data Data Data Data Data Data

'Data '

:oata

1

2 3 4 5 6

7 •

8 1 91

F

#the rows- ent er 1 in E1,

2 in E2. Select El:E2, double-click the fill handle

1

2. Copy and paste these numbers so there are 2 sets

A B c 1 Data Data

' Data

' 2 Data Data I Data 3 Data Data Data

4 iData Data 5 Data Data

Data Data

6 Data Data Data

7 Data Data Data 8 Data Data Data 9 Data Data Data

10 1l 12 ..!.� 14

15 -

16 17 18

D '

_jData Data

Data Data

Data Data Data Data

Data

·-.·..-s'-ll 21 3 4 . 5

6

7 8

9 1 2 3 4 5 6 -

7

8

9 •

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

Page 113: This isn't Excel it's Magic! - Bob Umlas

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

A B c D E

1 Data Data Data Data 1

2 1

3 Data Data Data Data 2

4 2

5 Data Data Data Data 3 -6 3

7 Data Data Data Data 4 8 4 9 Data Data Data Data 5

10 5

11 Data Data Data Data 6 -12 6

13 Data Data Data Data 7 • 14 7

15 Data Data Data Data 8

16 8 • 17 Data Data Data Data 9 -18 9

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

1 1 2 This isn't Excel, it's Magic/

Page 114: This isn't Excel it's Magic! - Bob Umlas

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

You'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 =A 1 , and wanted to fill that to the right but have the result become =A2, =A3, etc. Of course, Excel gives you =B1, =C1, etc.

This is not a substitute for either the Transpose function or copy/Paste Special and checking the Transpose checkbox. We want a dynamic and simple formula reference as a result.

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

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

'"I! 1 2

3

4

-

-s_ 6

7_ 8

9

10 i 11 ��l

�--+--·�··B""-.. --+-J I )Here's I lth-e - r-: inf�rmation 1 'to see left :...._ ___ , __

to right

82

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

Page 115: This isn't Excel it's Magic! - Bob Umlas

2. Fill right with the fill handle (You'll have B3, B4, BS, . . . ) I' I A [ B c 0 E .

1

2 Here's

3 the i I --

4 information 5 ·to

6 see

7 left

8 to -

9 right

10

11

12 - ls2 B3 B4 B5

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

Fi!!dwt>ot: �[s=============="'f:g] R�lace wit h: • 8 1 v, L-----------------------�[o;p=�=M=>=>�I

( Replace !II ) ( B.epla<e

4. Here's the result:

A I 1

B

2 Here's

3 the

f[nd All I ( Eind Next I [ Close J

c I 0 I E

4 information 5 to

6 see

7 left

8 to

9 right

10

11

12 I Here's 1 1 4 This isn't Excel, it's Magic!

the lnformatlc to

I ·�

I

Page 116: This isn't Excel it's Magic! - Bob Umlas

58. Fill "=C3" down, have reference become =03, =E3, etc.

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

1. Enter first formula without"=" but in R 1 C1 notation so instead of =C3, use r3c3, which means row 3, column 3.

c I o I E -

-:- . Here's fhe 1info to

1 I r3c3 l T I '

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

I c I 0 E

f --Here's the Info to - -

-r3c3 r3c4 r3c5 r3c6 r3c7

F G

- �ee

-1-

F G

see

I I •

I H I J

left

H

left

L to right

-

I I J

to right

I I I •

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

Page 117: This isn't Excel it's Magic! - Bob Umlas

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

J)J:cel Optioi'\S

Popular � Change options related to formula calculation.

11, F'o1mu1as � Proofing Calculation options

Save Workbook Calculation()) 0 Automatic

Advanced 0 Automatic except for data tables

Customize 0 Manual -

Add-Ins 0 Recalculate w-or�bool: b�•·. ,oving

Trust Center Working with f -Resources 0 Bf a 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 " � An!l J ReQiace I ........... Jr ·vJ] .......... Fi�what: 1- R�e with: J•r v] ov�� 1-..... ...... 1 - I ()p!ions » I � -. Microsoft Excel • -- c ••

The fornda you typed contains an error,

• For lnformotion about fixing common formula probl.,.,, click Help. • To get a$slstance in enter'ng a fuoction, dick OK, then dick Function on the Insert meoo. • If you are not ti)'Wlg to enter a formula, avoid using an equal sign (=)or minus sign (-), or precede it with quotation motk (').

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

OK II Help

Page 118: This isn't Excel it's Magic! - Bob Umlas

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

I 3

Here's

Here's

4 5 6 7 8 9 10

•ntJR��e�l======================� FQIV!Nt: r v �==================� �e�: �-�'------------------------------v�

[�» ll � Excel has completed Its search and has made 5 replacements.

01(

Close

6. Switch back to A 1 notation-uncheck the R 1 C1 notation box.

1

This isn't Excel, it's Magic/ 1 1 7

Page 119: This isn't Excel it's Magic! - Bob Umlas

59. Using Define Names & scrolling

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

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

Page 120: This isn't Excel it's Magic! - Bob Umlas

60. Show a picture by typing its name?

First, let me demo what we're about to accomplish: I type the word "dog" in cell A 1 and see:

A I 8 _!__I dog I •

2

3

4

5

6

7

8

9

10 cat

11 dog 12 baby

• - I

I type cat and see:

l I A I 8

1 lcat I •

2

3

4

5

6

7

8

9

10 cat

11 dog 12 baby 1�

c 0

c 0

� �

This isn't Excel, it's Magic/ 1 1 9

Page 121: This isn't Excel it's Magic! - Bob Umlas

I type baby and see:

I A 1 _:l�J,.::.Ib::.:;ab._y _J +f 3

4

5

6

7

8

9

10 cat

11 dog 12 baby

1 '1

B c D

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 A

1 baby

2

3

4

5

6

7

8

9

10 cat

11 dog 12 baby 13 _10-1 , ,

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

/:c I =$U$1:$W$10 B c D E

Page 122: This isn't Excel it's Magic! - Bob Umlas

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

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

Picture 6 ...

A

1 baby 2

3

4

5

6

7

8

9

10 cat

11 dog 12 baby 13 ,. "

fx =$U$1:$W$10

B c D E

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

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

Page 123: This isn't Excel it's Magic! - Bob Umlas

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

This shows:

Conditional format C:�ll

• .f:!�malbng atTab� St)'I<S Styles •

J i K l

I l I 1 I I

I � I J I I I J I I I

- ·S<tlt& F':n · �Jormat::A a· f: l!u - se r. Cell Size ![ P.o �el9n; ...

�ute:F � Row He;g�t

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

Auto.=!! Cot..Jmn W C'th

Defa.;.z:t lidth ... Visibility

I H1de &. !Jnhidt Organize Sheets

-Benamt Sheet �ove or Copy Sheet. .. !ab Color Protection

18)a

@] -.-, . . .-;

frolect Sheet ... �o<k Cell ��� F.ormat P.icture.,,-•

>

"1'M'JF.o""'"�"" uv=.�·•.o.� · · · · · · · >Y...,.__..... ���!!.���.t?ID Colors and lines I Size I Pltture •. Protection ff Properties n Web

Fill

�clot: II I "';' J.ransp.vency: < I ·>-:2 lo% �I

IJle ["· N'fL\9k'lld �yle:

Weight: Con_nector: ,. J

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

Page 124: This isn't Excel it's Magic! - Bob Umlas

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

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

I A I B I c D 1 [dog I

2 3 4 5 6 7 8 9

10 cat 11 dog

12]baby

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

This is involved, but the impact is great.

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

Page 125: This isn't Excel it's Magic! - Bob Umlas

6 1. Protecting ranges from

insertion of rows/columns

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

M33 LF L

32 33 34 35 36 37 38

T (' fx j{=O} [Mj N 0

(2krote_cted_ r_<u��e_ Pr�tect�.d ran[e

I 0 Protected range , Protected range 0 Protected range_ Protecte_d ran�e

1 0 Protected range ·Protected range 0 Protected range Protected range . ..

1 0 Protected range , Protected ran$e

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

I Pre -Pre Pre Pre Pre Pre

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

·-· Mi_�;ro�oft �xc�t � _n You cannot change part of an array.

r· Oii·-'1 'ttt!t!d"" stte""

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.

12 4 This isn't Excel, it's Magic!

Page 126: This isn't Excel it's Magic! - Bob Umlas

• 62. Numbering Questions tip

Take a look at the following:

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

A B c

1 Number Tip _?__I'----�1!Here's some text

3

I

4 2 Here's some more text 5

0 I E I

6 3 Perhaps this could be a question which takes 7 more than one line to pose 8 9 4 And another question 10

11 5 And yet another 12 . ..

F

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

d"" Insert • I: "'" g d � Delete j:l � • � Qelete Cells ...

� Delete Sheet ,Bows

'JJ' 1 Delete Sheet �olumm

lim J Delete �heet

This isn't Excel, it's Magid 125

Page 127: This isn't Excel it's Magic! - Bob Umlas

The result is:

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

A B C 1 rr= · ( 1 l Number Tlp 2 1 Here's some text 3 4 2 Here's some more text

0 I E I F .

5 �------------------------------6 3 And another question 7 8 4 And yet 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:

Ia"" Insert � ... I I: .. I a"" Insert (£liS ;.a Insert Sheet Rows .> .J � Insert St1eet ,\;;olumns

[31 In1ert Sheet

A7 txl A B .

1 NumberTip

1 Here's some text

2 Here's some more text

0 E

1-16 �-���----�3�A�n�d�a�n�o���er�u�e�s�ti�o�n------------� 7

8

9. �---------------------------�

10

11 4 And yet another

12

13

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

Page 128: This isn't Excel it's Magic! - Bob Umlas

I type in the new statement and copy/paste any of the formulas in column A to cell AS:

AS • ( 8 i A j 1 Number Tip

c

2 1 Here's some text

3

fx I :MAX( $A$1:A 7)+ 1

I D F. F

4 2 Here's some more text

5 6 3 And another questio 7 ,__...., 8 4 The new statement

9

10 •

11 siAnd yet another

12

n

l

This isn't Excel, it's Magic! 12 7

Page 129: This isn't Excel it's Magic! - Bob Umlas

• 63. Mailing Label tricks - 1

Suppose you have a list of names and addresses arranged like this and you want to rearrange it like the textbox indicates:

A B c 1 Address City ... Company 2 ---< Bob's Address Bob's City, State, Zip Bob's Company 3 Judy's Address Judy's City, State, Zip Judy's Company 4 Jane's Address Jane's City, State, Zip Jane's Company 5 Herman's Address Herman's City, State, Zip Herman's Company _L Laird's Address From this, we want Laird's Company 7 Curtis's Address Bob's Company Curtis'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 · etc �P LaVerne's Company 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 formulas like these in D2:D4 (showing formulas):

A B 1 !Address lcity ...

2 J Bob's Address Bob's City, State, Zip 3 Judy's Address Judy's City, state, Zip 4 Jane's Address Jane's City, state, Zip

.2_t Herman's Address Herman's City, state, Zip 6 Laird's Address From this, we want

..2._tCurtis's Address Bob's Company 8 Jared's Address Bob's Address .£! Stefanle's Addre; Bob's City, State Zip lp Peter's Address

11 Alice's Address Judy's Company 12 Joan's Address Judy's Address 13

14

15

Reid's Address Judy's Oty, State Zip LaVerne's Addre! Jp Ell's Address l etc

c.n::. "''lY1 .;)ld(�, U'f.J 16 Oon's Address Don's City, State, Zip

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

c I 0 Company Bob's Company =C2 Judy's Company =A2 Jane's Company =B2 Herman's Company Laird's Company Curtis's Company Jared's Company Stefanie's Company Peter's Company Alice's Company Joan's Company Reid's Company LaVerne's Company Eli's Company Don's Company

Page 130: This isn't Excel it's Magic! - Bob Umlas

which results in:

A B c D 1 Address City ... Company -+i Bob's Address Bob's City, State, Zip Bob's Company Bob's Company

3 Judy's Address Judy's City, State, Zip Judy's Company Bob's Address

4 Jane's Address Jane's City, State, Zip Jane's Company Bob's City, State, Zip

5 Herman's Address Herman's City, State, Zip Herman's Comp_any

6 Laird's Address laird's City, State, Zip laird's Company 7 Curtis's Address CUrtis's City, State, Zip CUrtis's Company � l;uoti'c: 6tirli'OC< l:arorl'< ritv <:t�to 7in l::�rorl'c; rnmn::.nv

which seems like a good start, filling this down (starting with selecting D2:

DS, including a blank cell) produces a disaster:

06 ·� A

1 Address Bob's Address Judy's Address Jane's Address Herman's Address

6 laird's Address 7 Curtis's Address -8 Jared's Address 9 Stefanle's Address

11 Allee's Address

... .. - . .. • • •

l t.J =C6 B

City ... Bob's City, State, Zip Judy's City, State, Zip Jane's City, State, Zip Herman's City, State, Zip Laird's City, State, Zip Curtis's City, State, Zip Jared's City, State, Zip Stefanle's City, State, Zip Peter's City, State, Zip Allee's City, State, Zip Joan's City, State, Zip - . .. ... .. .. . -·

c Company Bob's Company Judy's Company Jane's Company Herman's Company Laird's Compan'!' Curtis's Company

Jared's Company S tefanle 's company Peter's Comp!ny Alice's Company Joan's co�pany .... . .. ...

0 I Bob's Company

Bob's Address

Bob's City, State, Zip

!Laird's Company I •

La i rd's Address Laird's City, State, Zip

Peter's Company Peter's Address

Peter's City, State, Zip

-what happened to the intermediate companies like in row 3, 4, and 5? Oudy's company ... )-notice the formula bar for the active cell has =C6 in it, not =C3. Here are the formulas for the next few rows:

c 1 Company 2 Bob's Company

3 Judy's Company 4 Jane's Company 5 Herman's Company 6 Laird's Company 7 Curtis's Company 8 Jared's Company 9 Stefanie's Company 10 Peter's Company

11 Allee's Company 12 Joan's Company . .. - . .. .

D

=C2 =A2 =82

=C6 =A6 =86

=C10 =A10 =B10

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

Page 131: This isn't Excel it's Magic! - Bob Umlas

You begin to get the picture. The solution? Watch: Enter these values (not formulas!):

02 ·C fir I xc2

i A I B c D Address City ... Company Bob's Address Bob's City, State, Zip Bob's Company lxa Judy's Address Judy's City, State, Zip Judy's Company xa2

4 Jane's Address Jane's City, State, Zip Jane's Company xb2 5 I Herman's Address Herman's City, State, Zip Herman's Company 6 Laird's Address Laird's City, State, Zip Laird's Company 7 Curtis's Address Curtis's City, State, Zip Curtis's Company 8 Jared's Address Jared's City, State, Zip Jared's Company

9 Stefanie's Address Stefanie's City, State, Zip Stefanie's Company 10 Peter's Address Peter's City, State, Zip Peter's Company • • � u ... -• ... ,.. ..-............ A lr.,. ... l,. ,..1••• ,. .• ,. • .,. "'tl- ",,_,_ ........ --·-··

Now, when you select 02:05 and double-click the fill handle, you get this:

A B

Address City ...

Bob's Address Bob's City, State, Zip Judy's Address Judy's City, State, Zip

Jane's Address Jane's City, State, Zip

Herman's Address Herman's City, State, Zip Laird's Address Laird's City, State, Zip Curtis's Address Curtis's City, State, Zip Jared's Address Jared's City, state, Zip Stefanle's Address Stefanle's City, State, Zip

Peter's City, State, Zip

Allee's City, State, Zip

Joan's City, State, Zip

Reid's City, State, Zip

Now you can change x to =:

1

2

3

4

A

Address

Bob's Address

Judy's Address Jane's Address

B

City ...

Bob's City, State, Zip

Judy's City, State, Zip

Jane's City, State, Zip

c D

Company Bob's Company xc2

Judy's Company xa2

Jane's Company xb2 Herman's Company

Laird's Company xc3

Curtis's Company xa3

Jared's Company xb3

Stefanie's C�mpany Peter's Company Xc4 Alice's Company xa4

Joan's Company xb4 Reid's Company

c

Company Bob's Company xc2 Judy's Company xa2 Jane's Company xb2

5 Her

6 Laird

7 Curt

8 Jare

9 Stet

10 Pete

11 Aile

12 Joan 13 Reid

14 1 "v

---

find dod Replace

I Fins! r ReQiace I

..

fi!ld wh&: X

R�iace woth: -

[ Repi�ce e,ll I [ 130 This isn't Excel, it's Magic/

B.epiace I I

�� v

v

[ Options » I F!(ld All I [I Find Next I I Close I

Page 132: This isn't Excel it's Magic! - Bob Umlas

This gives (formulas are showing)

0 ':.::d::.d:,:re:.:s::=s:.,...,.---

-!City,.:c.··'-::c,-----::-

---=,----

--+.:C�o:.:n:.:l,p;my'-----

,.....,,.,.... lob's Address Bob's Ci , State, Zip Bob's Company =C2 udy's Address Judy's C ity, State, Zip Judy's Company =A2 ��������������--�����L--- 1 ane's =B2 . . - .- " - ' . - '"' ' � term an .aird's :urtis's are d's :tefani 'eter's .lice's oan's

Find and, Replace [1Jl[J Find Rej!lace �==============� FiQd what: �·=================i=v;ij A.§.Piace with: L·-------------�;===�v�

[ Op�ons » I

=C3 =A3 =B3

=C4 =A4 =B4

teid's f ��ei.�.i:i.�iOI I B.ep loce I F[nd AI I I Eind Next a-.�a�V �e�rn�!;;;����!!�������.����������� �=C5 :li's Address Eli's City, State, Zip Eli's Company =A5 �� � ��--������� �---� �����--- 1 >on's Address Don's City, State, Zip Don's Company =B5

And without formulas showing, we have:

A

1 Address

Bob's Address

3 Judy's Address

B c City... Company

Bob's City, State, Zip Bob's company

Judy's City, State, Zip Judy's Company

Jane's City, State, Zip Jane's Company

Herman's Address Herman's City, State, Zip Herman's Company

6 Laird's Address Laird's City, State, Zip Laird's Company

7 Curtis's Address Curtis's City, State, Zip Curtis's Company

8 Jared's Address �red's City, sta_t�, Zip.-,---rJ".red's Co�pany

9 Stefanie's Address Stefanie's City, State, Zip Stefanie's Company

Sneaky, eh?

Peter'� <:ity, State, Zip Peter's COmpany

Alice's City, State, Zip Alice's Company

Joan's City, State, Zip Joan's company

D

Bob's Company Bob's Address

Bob's City, state, Zip

Judy's Compa·ny

Judy's Address

Judy's City, State, Zip

Jane's_Company

Jane's Address

Jane's City, State, Zip

But this was touted as mailing labels. The format is okay, but how can you make these fit on address label paper? Well, you can tweak the row height of the blank cells. First, you need to make column D be the print area, from the top label to the last line of the bottom label. Check how it would look now, using Print Preview. Make sure there are no labels which are split across pages. You can also adjust the top & bottom margins. If it needs adjustment, select column D, use FS(Goto), Special, select Blanks, and click OK. Now only the blanks are selected. Now use Home Tab, Cells Group, Format com­mand, Row Height and make your adjustment, taller or smaller and print preview again. [Excel 2003: FormatiRowiHeight]

This isn't Excel, it's Magic/ 1 3 1

Page 133: This isn't Excel it's Magic! - Bob Umlas

• 64. Mailing Label tricks - 2

OK, what about this set of addresses?

A 1 Jones, Jim 2 addrt 3 Cltyl, Statel, 2ipl 4 S Smith, Bill

6IAddr2 7 Addr2 part 2 8 Clty2, State2 Zlp2 9 emailaddr

10 11 Johnson, Alice 12 addr3

B c

How can you possibly sort these by name?

i

D

13 Clty3, State3 Zlp3 I __ 14 emalll I 15 1emall2 I I I 16 POBox 33333 I l I 17 I I 18 Zedwlch, Paul I l 19 addr4 I I 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 number 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 1 2 Jones, Jim 3 addr1 4 Cityl, Statel, Zipl s 6 Smith, Bill 7 Addr2 8 Addr2 part 2 9 Clty2, State2 Zip_2 f 10 emalladdr • •

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

I I

B c '

How can you 1 possibly sort these by name?

r I ,-

Page 134: This isn't Excel it's Magic! - Bob Umlas

This is so we can enter a very simple formula in B2:

B2

i A

1 2 Jones, Jim 3 addrl 4 Cityl, Statel, Zipl s 6 Smith, Bill

7 Addr2 8 Addr2part 2

9 Clty2, State2 Zip2

"' I =IF(Al="" ,A2,Bl}

l B I c

!Jones, Jim I •

10 emailaddr 11

The formula takes advantage of the blank between address-sets, hence the need to insert a row. It says that if the row above is empty, use the name (from A2), otherwise use the row above. Watch what happens when we fill this down (important-include one extra blank row at the bottom to keep the separation between addresses when we sort)

B2 . " "' I =IF(Al="",A2,Bl}

A I B c

__!__ � Jones, Jim Jones, Jim

3 addrl Jones, Jim

4 Cltyl, statel, Zipl Jones, Jim S Jones, Jim ..2_ Smith, Bill

7_ Addr2 8 Addr2 part 2

Smith, Bill

Smith, Bill

Smith, Bill

9 Clty2, State2 Zip2 Smith, Bill

1q_ emalladdr 11 12 Johnson, Alice

13 addr3 1� Clty3, state3 Zip3

1S emalll

Smith, Bill

Smith, Bill

.Johnson, Alice

Johnson, Alice Johnson, Alice

Johnson, Alice

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

Page 135: This isn't Excel it's Magic! - Bob Umlas

Why, now we have a field to sort on!

__;;-_A 8 :::J c

� �-------------, 2 Jones, Jim Jones, JIm l addrl Jones, Jim

tyl. State I, Zlpl Joo�s. Jim

0 E F G H J K

------------- --Jones, Jim Smith, Bill Smltl\. Bill

Sorl �J rK r'lpar12 Smith, Bill c.o.... s..t On a-...

__ , _11'-'·tv2. St•te2. Zlpl Smith. Btll ..,, by -.,..,.,�:l.!·�:;;;:;rv�, · �: ...,..::,;;�������v�l "1•::.:.,:;;,,---�� oladdr Smith, Bill .:; 11 Smith, Bill 12 ohnson, Alice Johnson, Ahc

13 itddr3 Johnson, AUc 14 ·ty3, State3, 2Jp3 Johnson, Aile 15 emaill 16 email2 17 POBox 33333

resulting in:

Johnson, Aile John$0n. Aile Johnson, Aile '.... . . . ''•

A B 1

2 Johnson, Alice Johnson, Alice 3 addr3 Johnson, Alice

4 Clty3, State3, Zlp3 Johnson, Allee

S email1 Johnson, Alice

6 email2

7 POBox 33333

8

9 Jones, Jim

10 addr1 11 dtyl, Statel, Zipl

12 13 Smith, Bill

14 Addr2

Johnson, Alice

Johnson, Alice

Johnson, Allee

Jones, Jim

Jones, Jim

Jones, Jim

Jones, Jim

Smith, Bill

Smith, Bill 1S Addr2 part2 Smith, Bill 16 Clty2, State2, Zlp2 Smith, Bill

17 email addr 18 19 Zedwlck, Paul 20 addr4

Smith, Bill Smith, Bill Zedwlck, Paul

Zedwick, Paul

All there is left to do is clear column B!

13 4 This isn't Excel, it's Magic/

'"' I I cance�

v

Page 136: This isn't Excel it's Magic! - Bob Umlas

• 65. Bulk formula change

Suppose you have a worksheet with references to many sheets like this:

A1 • (' fx I '=Shee\2!$1:$1043576 I � I-'! I ..£ I

_ !._[=Sheet21$1:?J.048576 ! 2 =Shee\3 1$1:$�048576 ' 3 ,Sheet4 1 $1:$�048576 4 =SheetS!$1: $1048576

5 =Shee\6!$1:$1048576

6 =Sheetl!$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 =Sheet BI$1:$10435 76

13 =Shee\14 !$1:$1043576

14 =Shee\15!$1:$1043576 - -- . And you want to put in column B these formulas corresponding to what's in column A: =COUNTA(INDIRECT("Sheet2!1 :1 048576")) in B1 through =COUNTA(INDIRECT("Sheet16!1 :1 048576")) in B16. It could be done with a VBA routine, but here's a way to do it with formulas: Look at the formulas in B here (The cells are all selected from the result of a Fill/Down):

B1 fx I ="=COUNT A( INDIRECT(""" &MIO(Al,2,255)&"""))"

i A B -1 �heet2!$1:$1048576 =COUNT A( IN 01 RECT( "She et2 !$1:$10485 76" II •

2 �heet3!$1:$1048576 =COUNTA(INOIRECT("Sheet3 !$1:$1048576"))

3 �heet4!$1:$1048576 =COUNTA(INDIRECT("Sheet4!$1:$1048576"))

4 �heets!$1:$1048576 =COUNTA(INDIRECT("Sheets!$1:$1048576"))

5 �heet6!$1:$1048576 =COUNTA(INDIRECT("Sheet6!$1:$1048576"))

6 �heet7!$1:$1048576 =COUNTA()NOIRECT("Sheet7!$1:$1048576"tJ

7 �heetS!$1:$1048576 =COUNTA(INOIRECT("Sheet8!$1:$1048576"))

8 �heet9!$1:$1048576 =COUNTA(INOIRECT("Sheet9!?1:$1048576"))

9 �heetl0!$1:$1048576 =COUNTA(INDIRECT("Sheetl0!$1:$1048576"))

10 �heetl1!$1:$1048576 =COUNTA(INDIRECT("Sheetll!$1:$1048576"}) -11 �heetl2!$1:$1048576 =COUNTA(INDIRECT("Sheetl2!$1:$1048576")) . ... -t"t-. ....... �ot "\ tf"o1 .c'1 t\_.tH:"7C _ ,...1"'\1 I "I'T A I I" I r"\ 1 n ,.�l li t" I.. .... ,....a.- 1 ... I cA-1 , t'-1 n .. nc-,c II'\

The formula in B1 is ="=COUNTA(INDI RECT("""&MI D(A 1 ,2,255)&"""))" This is understood by Excel to simply be a bunch of text made to look like a formula, but it does not act like one. Since it looks like the right one, let's copy/paste special values (by the trick of dragging the border away & back to the same spot which gives a dropdown to choose values):

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

Page 137: This isn't Excel it's Magic! - Bob Umlas

I ="=COUNT A( INDIRECT(""" &MIO(Al,2,255)&""") )" B c I 0 I E

�------------�--��------�--�-+-� �--����-­=COUNTA(INOIRECT("Sheet2!$1:$1048576")) =COUNTA(INOIRECT("Sheet3!$1:$1048576")) =COUNTA(INOIRECT("Sheet4!$1:$1048576")) =COUNTA(INOIRECT("Sheets!$1:$1048576")) =COUNTA(INOIRECT("Sheet6!$1:$1048576")) =COUNTA(INOIRECT("Sheet7!$1:$1048576")) =COUNTA(INOIRECT("SheetS!$1:$1048576")) =COUNTA(INOIRECT("Sheet9!$1:$1048576")) =COUNTA(INOIRECT("Sheetl0!$1:$1048576")) =COUNTA(INOIRECT("Sheetll!$1:$1048576"))

Move Here

.!;opy Here

Copy Here as �alues Only

Copy Here as formats Only

1ink Here

Create !jype�ink Here

�tuft Ot> n ancJ Cop_

So now it looks like the formula we want, even in the formula bar:

Bl • fx =COUNTA(INOIRECT("Sheet2!$1:$10485.

A B

1 =Sheetl!$1:$1048576 =COUNTA(INDIRECT("Sheetl!$1:$1048571

2 =Sheet3!$1:$1048576 =COUNTA{INDIRECT("Sheet3!$1:$1048571

3 =Sheet4!$1:$1048576 =COUNTA(INDIRECT("Sheet4!$1:$1048571

4 =SheetS!$1:$1048576 =COUNTA{INDIRECT("SheetS!$1:$1048571

5 =Sheet6!$1:$1048576 =COUNTA(INDIRECT{"Sheet6!$1:$1048571

6 =Sheet7!$1:$1048576 =COUNTA(INDIRECT("Sheet7!$1:$104857•

But it's not. We once again need to Replace"=" with"=":

- L - rg btl • ¥ !ID-Sort & Find &

ot • (2 · Filter · Select •

= � •

= � ac q

� �

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

find ...

Replace ...

�o To ...

Go To Special ...

Formylas

Comments

Conditional Formatting

Constants

Data Validation

Select Qbjects

Selection fane . ..

-

Page 138: This isn't Excel it's Magic! - Bob Umlas

And the final result is:

81 �( fx A

1 =Sheet2!$1:$1048576 2 =Sheet3!$1:$1048576 3 =Sheet41$1:$1048576 4 =SheetS!$1:$1048576 5 =Sheet6!$1:$1048576 6 =Sheet7!$1:$1048576 7 =SheetS!$1:$1048576 8 =Sheet<J !$1:$1048576 9 =Sheet10!$1:$1048576 10 =Sheetll!$1:$1048576 11 =Sheet12!$1:$1048576 1? :<;h<> <>t1 ':II �1·�11\411 <;7/i

=COUNT A( INDIRECT("Sheetl!$1:$1048576"))

8 c D 45 I

0 1 1 1 1 1 1 1 1 1 1

This isn't Excel, it's Magic/ 13 7

Page 139: This isn't Excel it's Magic! - Bob Umlas

• 66. Fun with relatively defined names

If, while on cell A 1, you define a name, z, to be =!A 1 :Z1 00 like shown:

then you can worksheet!

,.,.�··�·�-..,..� New Name�- ,

---�� .... ;._'!:._,. ..... �----'"""'��

�: z I �ope: lwort<book �I C�: ,..

-

-

aefers to: ltAI:ZIOO [��� [ - � I I OK Canc el

use this name to scroll the active cell to the top left of the

For example, suppose you have a worksheet which looks like this:

;•, l -�- ;. i IS>� ,t �0 - 1 .1 c .L 0 I ( l ' 0 " J � l .... � t�<t�:! , ... ,. d•:• dat::� d.ltil d .. � • • d)tla

) d .J:;:! C�1.J dUI d)!ll (1..;11:1 ...... "'"' J 1d.)UI ..... Cl•l.l dau cu • I» til di!.� -• 'CftiUI cf)1<1 dlol<l dt.lo <I• tit chta dJlA ·� .S -(u:.a 4.1�.1 doll .. .,,,. CI.U:t d.l !.- dill� -�d�t� on.- .,. .. d&tl (t,n;t dJtf �.,.

1 4.1"..., - 6J14 ..... data 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 .,.,. ... ,. d.i�• "''"' ....

M cbt..a C'.Jt.1 ..... - d.) I ,\ d.at• �:.. d>U l.S �tl .... dm 4-W.li 4.la ...... .... �'!� tJ�l d>l>l �t� 4.1�2 16 �Jt"' ... ,. d1U .... .,.,. ""'' d.ttf c:..-:�2 �t:;tl d.Jt..2 d .. �.l � .. �: " ct .. :.:.1 cla:.-2 d>u> d.1ta2 dJit.l1 11 �: .. : 1!��1: -·

cb.al d.-t.l) d.-�J " dt!.-t &Ul <l&U2 .. w d .. tt1

;o d4: .. z C..St-11 �:.a d;):.C d.at.l.l

n 4-f�.-2 t\1:...1 d.ii\#1 d.at� CU'::OIJ 21 d.tt .. 1 .:.Jt-�2 d>t>l d.-:#l. "'"' 2l dl�d d.lW ...... , d.l:42 t.:.�.,1 - - . :o.s d�!.\1 e� .t .. a dnll d.1l.t7 4.1-�.u

I - N

c!JtU IC.lt.f) chtll dJu: d.tt.tl d.J•:.u

4Jt�-J """'t ...... d.U.U'

and you'd like to see more of the data starting in cell 115. Certainly you can scroll both horizontally and vertically, but you can also take advantage of this newly defined name, z. Click on cell l15, then use FS and Goto z.The result will be this:

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

Page 140: This isn't Excel it's Magic! - Bob Umlas

115 ·� fx I data2

J I K l I M N 15 data2 data2 data2 data2 data2 data2 data

16 data2 data2 data2 data2 data2 data2 data -

17 data2 data2 data2 data2 data2 data2 data

18 data2 data2 data2 data2 data2 data2 data

19 data2 data2 data2 data2 data2 data2 data -20 data2 data2 data2 data2 data2 data2 data -21 data2 data2 data2 data2 data2 data2 data

22 data2 data2 data2 data2 data2 data2 data

23 data2 data2 data2 data2 data2 data2 data

24 data2 data2 data2 data2 data2 data2 data -25 data2 data2 data2 data2 data2 data2 data

26 data2 data2 data2 data2 data2 data2 data

27 data2 data2 data2 data2 data2 data2 data

28 data2 data2 data2 data2 data2 data2 data

'q rl�t<>7 rl�t�') rl �t::t? ri::lt::t' ri ::l t ::l ., rl�t�7 rl�t<>

Notice that the cell has been scrolled to the top left. That's because, from cell 115, the definition of z is =!I1S:AH1 1 4 as in this illustration:

tjew... I [ t<ll. ·· I [ Qelt<e fi l t e r ..

Veluo Refe.-s TO ComMent

/ - a relative reference to the active cell resized by 100 rows and 26 col­umns. In order for Excel to show as much as it can of this range, it scrolls the worksheet! Z is defined with a leading exclamation mark so that the sheet name is not appended to the name, and you can use z to be a 1 00x26 shape in any sheet!

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

Page 141: This isn't Excel it's Magic! - Bob Umlas

• 6 7. Using notes inside formulas

via the N-function

The N function, shown here:

��"'-=• l!J�,I!fl_,t�nc,ti�!l =� �� �arch for a functcon:

Or sele<t a !;.ategory: LIA_n _________ ����� 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).

·

I

converts non-number to a number, dates to serial numbers, True to 1 , anything else to 0. Well, you can take advantage of this knowledge inside a formula. For example:

, -'"',] •VLOOK U P ( B22,x y ztable, 3,FALSE)+ N(" T his will search the table for the z·factor") - c l o l e F ! G ' H : : J 1 � I o.otamJ

This formula now explains that the VLOOKUP is searching xyztable's third column for the occurrence of cell B22's value for the z-factor (whatever that is). The point being that the part of the formula, N ("This will search the table for the z-factor") will be zero. not effecting the result. So you can use the N-function inside formulas like this to document or comment on a part of the formula by effectively adding 0.

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

Page 142: This isn't Excel it's Magic! - Bob Umlas

• 68. New Table features

If you have entered a table (new to 2007), it is automatically assigned a name, like Table1, etc. You can reference parts of the table in formulas. Here is a list of some of the new features. If you enter the beginning of a formula for a table and include the opening bracket, like =table1 �Excel provides an intellisense tool tip:

l 5 4 � 1

8 c 0

. ..,. ·liN;�· •:ot.ak "n.,. II.Oort

The small text says:

£ f G I ( J ,K_. l t l l M

"Returns the entire contents of the table, or specified table columns includ­ing column headers, data and total rows" It provides a reference to the entire table, so you can sum it, for example, without knowing the cell addresses. =SUM(Table1 [#All]) might include a total row, if present, so the above illustration would give 20 in this example. Using =SUM(Table1 [#Data]) would yield 10.

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

Page 143: This isn't Excel it's Magic! - Bob Umlas

To get the headers, you could ctrl/shift/enter =table1 [#Headers] if there were more than one column in the table, or simply enter the formula (with­out ctrl+shift) if there was only one column:

,

IAI Illata

I Totals .tllis Row

1 2 3 4 5

Here are the last 2:

Data #All #Data #Headers

01

1 2 3 4

B I c data2 a

4 3 2 1,

fx lt=Table1(#Headers]} ' 0 E I F loata data2 !

[ Returns the total rows for the table or specified table columns I

03

2 1 3 2 4 3 5 4

14 2 This isn't Excel, it's Magic/

5 1 2 3,

,. c 0 E F

I 3!

Page 144: This isn't Excel it's Magic! - Bob Umlas

• 69. New Excel functions

Excel 2007 comes with 5 new built-in functions (excluding the new CUBE functions): SUMIFS,AVERAGEIFS, COUNTIFS,AVERAGEIF, and IFERROR. Let's take a brief look at them in action:

E3 � fx I =SUMIFS(Amount,Region,''South",Oate, "<4/06")

A

1 Region 2 East

3 North 4 East

5 West

6 South 7 West

East

11 East

12 West 13 East

14 East

15 North

16 South

17 West 18 North

8 c

Amount Date

558 29·May·05 43 14-Apr-07

826 28-0ct-04

765 3·Apr·09

271 14-Feb-10 415 17-Jun-05

402 16-Mar-07

633 15-Nov-05

16 9-Aug-05

198 20-Jan-06

741 26-0ct-10

559 5-0eo-08

263 30-Apr-08

809 27·NOV·08

884 23-Aug-07 894 10-0ec-08 942 13·Mar·ll

0 I E I F G H

I 111&51 •

508.4090909

481.2837838

22

Not Found

Not Found

Here, we see the SUMIFS function. Its syntax is SUMIFS (Sum_range,criteria_ range1,criteria1, ... ), which basically states which range to sum based on pairs of criteria ranges and their criteria. This example uses Amount (column B) as the range to sum, and there are 2 pairs of criteria: the region (column A) must be "South," and the Date (Column C) must be prior to April, 2006. The next function we take a brief look at is the AVERAGEIFS, which is basi­cally the same as the SUMIFS, but the Average is taken instead of the Sum:

ES fx =AVERAGEIFS(Amount,Region, "South",Oate,"<4/06")

A 8 c 1 Region Amount Date

East 558 29-May-05 North 43 14-Apr-07

826 28-0ct-04 765 3-Apr-09

271 14-Feb-10

0 E F G H

111&5

I sos.4o909o9! The AVERAGEIF function is like the AVERAGEIFS function, except there's only one pair of criteria:

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

Page 145: This isn't Excel it's Magic! - Bob Umlas

E7 • "' =A VERA GEl F( Region, "East",Amount}

A I B c I D I E I F j 1 Region Amount Date

2 East 558 29-May-05

3 North 43 14-Apr-07 ll185

4 East 826 28-0ct-04 s West 765 3-Apr-09 508-4090909 6 South 271 14-Feb-10 Jlwest 415 17-Jun-05 1481-2837838! R F�<l 40, 11\-M�r-07

The COUNTIFS function 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 • "' =COUNT I FS( 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 11 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(Vl00KUP{"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 I Not Found !

to this: I =IFERROR(VLOOKUP("Herman",A2:C50,2,FALSE},"Not Found"}

D E F G H I

I Not 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 English, it's "If the VLOOKUP returns an error, show "Not Found." Other­wise, do the VLOOKUP." But this requires you to code the sameVLOOKUP formula twice in the same function. The IFERROR avoids that!

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

Page 146: This isn't Excel it's Magic! - Bob Umlas

70. Ctri/Shiftl-, 1,2,3,4,5,6

for quick formatting

These simple keyboard shortcuts can help with number formatting (here, the value 1.5 was entered in the cell):

Ctrl+sh ift+: Resulting Format: - General 1 2 decimals 2 Time format 3 Date format 4 Currency 5 Percent 6 Scientific

Example: 1.5 1.50 1 2:00 PM 1 -Jan-00 $1.50 150% 1 .50E+OO

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

Page 147: This isn't Excel it's Magic! - Bob Umlas

71. Borders from keyboard

Ctri/Sh ift/7 creates outline border Ctri/Shiftl- removes border

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

Page 148: This isn't Excel it's Magic! - Bob Umlas

72. 1nserting Date & Time shortcuts

Ctri/Semicolon (Ctrl/;) will insert the date in m/d/yyyy format; Ctri/Colon (Ctrl/:) will insert the time in h:mm AM/PM format.

This isn't Excel, it's Magic! 14 7

Page 149: This isn't Excel it's Magic! - Bob Umlas

73. Click the AutoSum button

from the keyboard

Altl= is the same as clicking the AutoSum tool. Altl= twice (quickly) will also enter the result.

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

Page 150: This isn't Excel it's Magic! - Bob Umlas

7 4. Bringing the selection into view

It's possible you've selected some area of cells and then scrolled away so you can't see it any more. Ctri/Backspace brings that selection into view, and shift/Backspace brings selection into view as well but reduces the selection to the active cell. So, if this is the before picture:

I A I B I c 1 2 3 I I 4 5 6 •

then shift/backspace will simply have cell B3 selected.

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

Page 151: This isn't Excel it's Magic! - Bob Umlas

75. Ctrll[ more powerful than

its "equivalent,, Go To Precedents

If a cell has =SUM(B2:E4), then with that cell selected, use FS (Goto) I OSpecial and select Precedents. The result is that cells B2:E4 will be selected. Ctrll[ does the same thing. However, if a cell has a link to a cell in a closed workbook (the entire path would be shown in the cell), then using FS (Goto)ISpeciai/Precedents would give an error message:

-Microsoft Excel � _G No cells were found.

�." .......... " ............. 1 i OK i '

whereas ctrll[ would open the file, switch to the appropriate sheet, and select the cell!

The FS (Goto) I Special dialog also has an "All levels" option button when you select Precedents (or Dependents). This means that if, in the first exam­ple above, cell C3 had a formula which referenced H12, the all-levels option would also select cell H 1 2 (in addition to B2:E4).

-G.o To Special C8J Select 0 !:;_omments

0 C2f'St4ntS

0 Eotmulas

Oal�n�

0 Current (B!jion

0 Current �rray

Oo�Vects

0 Ro� differences

0 Column differences

0 erecedents

0 Dependents

O D!redonly

0 iAif!eveiSl ·-·-···-·· .. --. 0 La�t cell

0 Visible cells onl�::

0 Conditional formats

0 Data �alidation

All Same

.-----� OK J [ Cancel ] The equivalent keyboard shortcut is ctrl/shift/[.

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

Page 152: This isn't Excel it's Magic! - Bob Umlas

7 6. Show Corners of Selection Easily

Ctrllperiod successively selects corners of the selection, even if the entire selection is large, as in A 1 :DD799.

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

Page 153: This isn't Excel it's Magic! - Bob Umlas

77. Anchoring the active cell

Holding the shift key down while you click a cell, or double-click a border, or even in the Go To dialog (FS) will keep that cell as the active cell. If cell C4 is active, as shown, and you use the Go To (FS) dialog and enter e9 as the cell to go to:

I c D

I I •

E I F I G H �-q�T!J �� !iO to:

.... �

I_ vi !l.eference:

1•91 I I SPecial. • . l It O K J I Ca ncel l . . . .

. .

.

.

.

.

.

.

then if you hold the Shift key down when you click the OK button, this will be your result:

A 1

I 8 c

2 3 -

4 I 5 ----1 6

7 11 10 I

In other words, the original active cell will still be the active cell.

If you shift click cell A2, now, the selection will be A2:C4, with C4 being the active cell. Since Ctrl/down arrow (or right/left/up arrow) takes you to the end of a

block, shift/ctrl/arrow will also take you to the end of the block, but the active cell won't change!

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

Page 154: This isn't Excel it's Magic! - Bob Umlas

• 78. Finding after the Find dialog

is closed

Shift/F4 repeats the Find command after a find was done; Shift/Ctri/F4 repeats find backwards! That is, if you did a normal Find command to find something: � fi.t��t .!'!'��.._�P}��_e_,.���

I Opl;io,">S » II

then if you close the find command and use Shift/F4, it will still find the same text, and Sh ift/Ctri/F4 will find the same text backwards.

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

Page 155: This isn't Excel it's Magic! - Bob Umlas

• 79. A few miscellaneous Shortcuts

• Ctrl/' (single apostrophe)-this copies the cell above exactly. So, if cell A 1 has =SUM($B2:C7), then pressing Ctrl/' from cell A2 will put =SUM($B2:C7) in cell A2. • Ctrll" (quote)-this copies the value from the cell above. So if cell A 1 has =SUM(E1 :E1 0) and its value is 350, then pressing Ctrl/" from cell A2 will put the plain number 350 in cell A2. • Ctrl/; will put in today's date. • Ctrl/: will put in the time. • If you press Ctrl/; followed by a space then Ctrl/:, you'll have the date and the time. • Shift/F2 will insert a Comment. • F9 will calculate the open workbooks; Shift/F9 will calculate the active workbook. • Ctri/T or Ctri/L will insert a Table. • Alt/T/0 will get you to 2003's equivalent ofTools/Options. • Alt/T/1 will get you to 2003's equivalent ofTools/Add-ins. • Alt!V/U is Full Screen • Alt/F/<1-n> is File/Open <last used file ... >.

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

Page 156: This isn't Excel it's Magic! - Bob Umlas

80. Sorting columns

This is useful for rearranging columns and is often easier that cut/insert paste to move the columns around.

You may have to use a "dummy" row to enter the sort sequence. In this worksheet, a dummy row was inserted (row 1) to enter the sort sequence. We want Name, then Address. then City, State, and Zip:

A I B c 0 E

1 21 1 4 3 5 •

2 Address Name State City Zip 3 123 Main Name1 Fl Orlando 12345 4 124 Main Name2 NV Albany 12346 5 125 Main Name3 WA Redmond 12347 6 126 Main Name4 TX Houston 12348 7 127 Main NameS CA San Diego 12349 8 128 Main Name6 Fl Tallahassee 12350

Use Home tab, Editing section, Sort & Filter, and Custom Sort [Excel 2003: Data/Sort]:

• �: u � Sort & Find & 0.. • Filt er • Select •

� � �ort Smallest to largest X� S2rt largest to Smallest

inJ Custom Sort ...

Y= filter

1� f:e•ppty

Click the "Options" button, click Sort Left-to-Right,

I .)!1 Add lev el ][ X !!dote LOYd JI-b �Y level II ,) • I Qptions... I Coi.Jmn Sortby ·,---- � � ,_____ 0 , ••• ...,sitiv.

Orie:nUa tion 0 Sort \Of> t4 bottom ®1' ....... _ ....... ,_, •..•. ,_,1 • t��u��-�.!!2�J

OK I I Cancel

ard .. , .. to z

0 MydatahastJoaclors

OK c ancel

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

Page 157: This isn't Excel it's Magic! - Bob Umlas

click OK,

--Sort 0 'Row SOrt by l� t

• I Qptions. ·• I SOrt On Order

then pick the row containing the desired column sequence (Row 1 case), and finally click OK:

A I B

1 I 11 2 - • 2 Name Address

3 Name1 123 Main

Name2 124 Main

Name3 125 Main

Name4 126 Main

7 NameS 127 Main

8 Name6 128 Main

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

c 0 E

3 4 5

City State Zip

Orlando Fl 12345

Albany NV 12346

Redmond WA 12347

Houston TX 12348

San Diego CA 12349

Tallahasse FL 12350

in this

Page 158: This isn't Excel it's Magic! - Bob Umlas

81. Making exact copies of ranges

with relative or mixed references

This technique is useful if you have many cells to copy-otherwise, it's pretty simple to copy the formula directly from the formula bar. Usually, if you copy a range which has relative or mixed references to a new range, the referenc­es will adjust. That is, if A 1 contains =C7 and you copy A 1:82 to C2:D3, then C2 will contain =ES. Here's how you can have C2 still contain =C7. We'll use the above references as an example.

To copy A 1: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 1 =C7 =D$7

2 =$C8 =$0$8 :� I

And here's the worksheet displayed normally:

.--.:..:.A�� 8

1 labc ! def 2 ghi jkl

3

4

s

6

7

8

9

abc

ghi

c

B

def

jld

D

This isn't Excel, it's Magic/ 15 7

Page 159: This isn't Excel it's Magic! - Bob Umlas

1 . Use a 2nd worksheet in group edit mode. To do that. Ctrl/click a second (unused) sheet tab:

I

c6;;\ [) Q � • J £3 .2iJ .J> ; Book1 [Group] - Micrc -� Home j Insert I Page layou-1 formulas I Data I Review

, Vi!w �vel

� � _j '-cl Paste J •

Clipboard r.

A1

A 1

Cahbri • 11 •

I B I u ·I K .£1 IEB · I �· A · Font r.

•f .fx I =C7

B ! c ldef

� �����·I Alignment r.

% 1 Numbu Sl)

D I E I F --.-jabc - • 2 3 4 5 6

-

7 -8 9 10

ghi jkl

abc ghl

def ]kl

•• • � �11 Sheetl / Sheet2 7 Sheet3 7 tl7 lil4 1 Ready Num lock � l�!m [Q]J!!!JL lOOj

(Notice both sheets 1 and 2 are selected, and there's another indication you're in group mode-at the very top of the screen you can see "[Group]."

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

Page 160: This isn't Excel it's Magic! - Bob Umlas

2. Select A 1 :B2, use Across Worksheets in the Editing section of the Home tab (this is dimmed when you're not in group edit mode) [Excel 2003: Edirl Fill/Across Worksheets]:

Home

Sort & Find & • Folter Select ·

Edotm

3.You're presented with this dialog

tiJ Down

= 11! BighE

= IQI llP � ),eft I �cross Worksheets ...

�eries ...

!usttfy

Fill Across Works he . . . Fill 0: ...... : !AIH ·- . � ..... ,

0 Contents 0 Formats

[ OK I [ Cancel I

4. Now, Sheet2 contains the exact same references in A 1 :B2 as Sheet1 contains. S. Activate the 2nd worksheet (not in group edit)-you do this by shift/click­ing on Sheet2's tab. Since we didn't copy C7:D8 as well, you only see O's in Sheet2, but that's fine. 6. In Sheet2, Cut A 1 :B2 and paste to C2:

[

Al �f I A

1 0

2 0

3

B

fx I =C7

I 0

0 •

c

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

Page 161: This isn't Excel it's Magic! - Bob Umlas

You can see in the formula bar that cell C2 still contains the reference to C7. This is because the references don't change in a cut/paste, only in copy/paste. 7. Back to group edit (with Sheet2 active, ctrl/cl ick Sheet1 ), select C2:D 3, use Across Worksheets from the Editing section of the Home tab, [Excel 2003: EditiFilljAcross Worksheets]

[QI Down � .Bight tm Up

� .!,eft l!cross Workshee!s.,.=-o:l

·l �eries ... lu�tlfy

filling the 2nd sheet back to first. Shift/click Sheet1 and you'll see:

rr!l l_ 2 3

4

5

6

7

8

9

C2 A

abc ghi

• � B -

def jkl

10 the formulas are ... ��: C2 •( 13 j:==

-14 1 =C7 =$C8 � ;.. 15 2

16 3 17 4 18 5 19 6 20 7 � 8

A

t� =C7

jl; � c· .li "o-1

I abc ghi

abc ghi

def jkl

def jkl

t. J =C7

-=0$7 =$0$8

r I

B

I •

E I 0 .. I

� . G

1:�8 I I

G. I

=0$7

=$0$8

[abc J�. e::::.:....f _

j gh.::_I ____ _Jijkl

H

0

I I

-

I •

Another way (maybe easier) would be to replace the"=" in the formulas with something like "x=" (turning formulas to text), then copy/paste to the new location, then replace "x=" with "=" in both ranges!

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

Page 162: This isn't Excel it's Magic! - Bob Umlas

82. Filling Holes

Suppose you have a worksheet something like this:

A1 · ( f.< J State

A 8 c

1 �ate JRegion Amount 2 PA North 300 3 104 4 159 s 749 6 SOuth 700 7 348 8 508 9 935 10 582 11 WA North 377 12 936 13 south 831 14 243 15 344 16 NY North 97 17 120 18 South 577 19 955

And you'd like to sort it by state! Yikes.You KNOW it would be quite messed up because of the holes (empty cells). ln this example it wouldn't take too long to fill PA down from A2:A 10, then WA from A 1 1 to A 1 S, etc. and then it'd be easy to sort, but if this extended to row 6000, forget it! Well, there's a pretty easy way: 1. Select cells, use FS key, click Special, select Blanks:

I 83 ·{ J.<l A 8 c

1 Stat e Region Amount 2 PA North 300 3 I 104 4 159 s 74 9 6 South 700 7 348 8 508 9 935 10 582 11 WA North 377 12 936 13 south 831 14 243 15 344 16 N Y North 97 17 120 18 south 577 19 955 ••

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

Page 163: This isn't Excel it's Magic! - Bob Umlas

2. Type "=," press the up-arrow, then press Ctri/Enter:

83 . c� .r. I =sz

1 �Stat: s_] c 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

14 WA South 243 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 A 12 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

1 State 2 NY 3 4 _, 5 6 PA

7

8 9

10 11

12 13 14 15 WA

16 17

18

19 on

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

I =• a �c'---.J-Reglon Amount

North 97

I 120 Sout h sn

955

North 300

South

North

south

104

1S9

749

700 348 508

93S

582

3 17

936

831

243

344

Page 164: This isn't Excel it's Magic! - Bob Umlas

83. Aligning objects

When a drawing object is selected, you will see the Drawing Tools context sensitive menu show up. If you've inserted buttons or option buttons, check­boxes and the like, then this isn't a "drawing object" so the context sensitive menu is not present, but you can still get the desired commands in the Page Layout tab, the Arrange group. In the Arrange group, is the Align button:

�9�t.J0Ut f:otnlulas D•t• RnltW Yi<W

16 Ci ,L..J 1 � =• .. :1 IS OntWtiOn Sao """' lfu"-1 &actoround Print

a.ru· T•Utl Pagt Sttup '"

Orrtfop�r ........ ..... . • ., . Wtdth: AUto•mc -} U Ht1ghl: Automlti< • aJ Sal" '"""

SUi t to fll "

Gridlin.t:J 1iudin9s � Vl.w .J View

Pnnt

'S h f.tt Opt!:

4 Srif\0 to front • � AMon ·I �S.endt - !ljGroup•

tKtion Pane • o'•tt Atrangt

(by the way, if one object is selected, you can select all objects by ctrl/sh ift/ spacebar-if an object is not selected when you press ctrl/shift/spacebar, you will first select the current region, and if you do it again, you will select all cells): [Excel 2003:View1Too/bars1Drawing ToolbarlDraw menu ArrowlAiign or

Distribute]

Drawing Tools

1-Ins Format

A · 't;h Bring to Front • t\ -

• � - � Send to Back • _r - <:\ • � Selection Pane •

I� Align !,eft

.$. Align £enter

tyles r, �I Align Right

'iii Align!op

J K L M oJ\} Align Middle

wdl Align §ottom -

D!}c Distribute Horizontally

g Distribute Vertically

1:t Sna.2 to Grid

.S.nap to Shape

View Gridlines

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

Page 165: This isn't Excel it's Magic! - Bob Umlas

For example, if you use Distribute Vertically on the left worksheet with the objects selected... you 'II see them as on the right:

ct

·

1 • ··1.-.t:!Jtt�'i:!�:it! Ol , iJ ' 0 ®Option Button I ! � o· ·�o

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

@Option Button I

0 Option Button 2

0 Option Button 3

0 Option Button 4

0 Option Button 5

Page 166: This isn't Excel it's Magic! - Bob Umlas

84. Leaving cursor in the cell

after pressing enter.

If the cursor normally moves out of the cell when you enter a value and you temporarily want to keep it in the same cell, simply press ctrl/enter instead of enter! This assumes you have only 1 cell selected, else all the cells will be filled!

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

Page 167: This isn't Excel it's Magic! - Bob Umlas

85. Shortcut 3-D Formula

If you wanted to add up all the sheets' ceiiA1,you could enter this formula: =SUM (Sheet1 :Sheet6!A 1 ). But there's a shortcut where you can use a wild­card to do it and Excel will change what you type into the correct reference. One caveat: this shortcut excludes the sheet you're entering it on in the reference. Here's an Example. Enter =SUM('*'!A 1 ) and when you press enter it will change:

CUBEMEM . . . . ( ... :X ./ fx =sum('*'!al)

� Book3

IF:ll A I B I c I 0 1 =sum('*'!al}

2 -

Al ... fx �UM(Sheet2:Sheet6!Al}

� Book3 o I -r

A B c 0 E 1 0 ! • 2

But there's another advantage to the shortcut. If you enter it in Sheet3, for example, you'd see =SUM(Sheet1 :Sheet2!A 1 ,Sheet4:Sheet6!A 1 ) in the for­mula bar after entering =SUM ('*'!A 1 ).

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*'!A 1 ), 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

1 2

3

4 5 I ol

6

I

I � 4 � �11-_ Sheetl /Bobll Sheet2L l�yBobDatabase /Bonbon L"Sheet3 L Bonfire L�./1 166 This isn't Excel, it's Magic!

Page 168: This isn't Excel it's Magic! - Bob Umlas

86. Pulling cells together

If you have data separated by many rows that you want to put in a contigu­ous range of cells (see below), this will show you how you can do it easily.

A I B 1 l1 want I

• 2 3 these cells

4 5 6 7 to

8

9

10 all be

11 12

-. 13 together. • •

1. Select the column containing the data 2. Use FS (go to)/Special, selecting formulas or constants

c D E F - .----A _ _,I. s _! jwant I ------------

Go To Special @ •X 2 3 these cells 4 5 6 7 to 8 9 10 all be 11 12 1� together.

14 15 16 . ...

Seled Oconvnents ®'Constants'

� �

0Eormulas 0Nvmbers 0Te;!lt 0Logicals 0�rrors

Oelan�

0 Current tegion

0 Current �rray OoQ.lects

0 RO!! differences

0 Column differences 0 e_recedents 0 Qependents

D" ect or y A l-eve .­

Ola�cell

0 Visible cells onl�

0 Conditional fonnats

0 Data j!artdation

OK

All

Same

]j [ Cancel

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

Page 169: This isn't Excel it's Magic! - Bob Umlas

3. Copy

1 2 3 4

5

6

'l A • ·

h want these cells

7 to 8

·-

9 10 all be 11 12

I

' 13 together. r 14 I

4. Click in new location and paste

J �

2

3

'\-5 6

-

A . ._ .. ...,� -· - -· ---

I want • .... ... ... ... ... .. ... ... .

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

these cells: - - - - - - - -

- - - - - - - - '

7 ��-------: 8 9

- - - ------10 lall be : 11 12

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

-- - --- - - ..

13 lto"ether. : 1_ .. _ �;> _ _ _ _ _ _

14 ---. - I

B

B

·��:w= I want

-

these .cell -· """'-� -.,:.._ .... -

to ·-

all be .;. - ;,.. ·-

to2ether: ·-

i-----

j�--The results will always be constants, not formulas, even if they were origi­nally formulas.

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

Page 170: This isn't Excel it's Magic! - Bob Umlas

• 87.An oddity with the Camera Tool

In the following illustration, the grid lines were turned off, range A 1 :C12 was selected, the camera tool (See Print remote areas on same page, earlier in the book). was clicked, and the picture was "developed" in range E1.

P icture 1 .. ( tx I =$A$1:$C$u

A B c 0 E F G ,_ -· - • " •

1 info info info info info info -+i info info info

Info Info 3 info info info info info info info

4 info info info info info info -5 info info info info info info 6 info Info Info -7 info Info Info

info info info >. f info Info 111 0 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 '-' Info Info info info info info info info Info Info Info info

0 info info info info info info Info Info Info info info info

0

F "'

info info info info Info info info info info Info info info

0

G

0

0

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

Page 171: This isn't Excel it's Magic! - Bob Umlas
Page 172: This isn't Excel it's Magic! - Bob Umlas

• 88. Quicker data entry

If you need to enter large numbers, like 1 billion, it's pretty easy to enter the wrong number of zeroes. Instead of slowly typing the string of 9 zeroes while mentally counting, you can simply type 1 e9.That would go in as:

Al fx ltooooooooo A I

1 [l.OOE�9� 2

B c D

because excel sees this as scientific notation (which it is):

E

......__,. J Home Jnwt Page Layout Formulas Data Review View -----'---...::......:�

� J(, n Ollibrl

LJ� Pa�te � l B I

• 11 • rA A·1 p�- ... u �·l Scientific

Jl •][Ell •][ & • .6. •]IC: ;;;: ��!� ·��� A • 0/o

Developer

• J[�o8 +�8] Clipbo ard r. Font Number

="' Al A I

t..l loooooo��/�====r====r===;=== - D A- I F G H 8 J. c

1 I 1.00E+09l but a simple reformatting of the cell will fix that.

Al f,c 11000000000 A I __ �B--��c--��o--��E--

_!_[looooooooo! 2

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

Page 173: This isn't Excel it's Magic! - Bob Umlas

• 89. Miscellaneous,­

Changing cell reference

If you have a reference such as =SUM (A500:A525) and need to change it to =SUM(A525:A535), you would most likely edit the formula and change the 500 to 525 and the 525 to 535. And of course, that would work. Did you know you can just change the 500 to 535 and get the same result? That is, you would see this before pressing enter:

,.. X .J fx =sum(.A535:A525)

8 I .. C· I 0 l

but as soon as you entered the formula, you'd see:

8 k! =SUM(A525:A535)

I ol, ----!-1 i -

- Excel would change it for you!

1 7 2 This isn't Excel, it's M agicl

Page 174: This isn't Excel it's Magic! - Bob Umlas

• 90. More miscellaneous info

You can double-click a tab name to hide the ribbon:

Double click it again and it's back. Lastly, you should press F1 for help on all the new features of Excel 2007 There are so many!

�Excel Help - 1:1 X

.. @@('l:) � l l(i)J A\ � � --�--------------------�1 • P Starth •

Excel Hel� Md HOV ·tO =-=

llrowse £xcel tlelp I - ---- ---�;;j;'(sjj�;;j tnsll!llin9 FR ccnversaon and �tility

Worl<sheet and Excel toble ba51CS

'il Excel Help

Getting help Accessi>ility l'lorl:boolt �� Formula and name basics

c

- o X

���© � � A\ � � • �--�--------------------�1 • P Starch •

What's new

@ 1'/hafs new In Microsoft Office E<cel 2007

@ Use d1e Ribbon

@ E<eel speclflcadons and l1rrilll

@ Demo: Up to speed with Excd 2007

4items

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

Page 175: This isn't Excel it's Magic! - Bob Umlas

And don't forget to watch the demo!

�Excel Help - 1:1 X

;.:, -+ IX) I"� � !.(,) AA � til • --�--------------------� • P S•arch •

Demo: Up to speed with Excel 2007

---- -. - . . ::. . . . ... ..

-• --=:=-"'t==:;""t :-=�. -· -

. :::.:- .;:.-·::e..-:-_ .":''"- �:..:: ::..-:-·-·-- ·-· .. -· --- - -· -·---- -·

" Play Demo {9 . ' (You may experience a delay while

lhe demo is loading.}

·- o;;·;-:..o::�:.::-:;-:n··;;;-�::! .. --­. -.

Microsoft Office Excel2007 has a new design that makes your work

1 7 4 This isn't Excel, it's Magic/

Page 176: This isn't Excel it's Magic! - Bob Umlas

9 1. Copy Page Setups to other sheets

If Sheet1 has the setup you want and Sheet2 is to receive the same settings: Here's what the print preview looks like for sheet1 :

I Next Jl-"1 J Zoom ][.e<intc .. JILsetup ... ,] [•largin s J [PageB<eakPreview J [ Close J[ Help

11812005 ny· Cen.t:er Heade:r:

A I B I c

� 2 This contains page setup for iliQe'Seti.,i .d'iiiW " T ___ ._, .....

And sheet2:

1/112003 63 72 2/112'003 70 "' 3/1/2'003 17 sa 4/112003 •• .. .�/112003 81 104

S/1/2003 98 112

7/112003 105 120

8/-t/2003 112 128

So, you can see that Sheet2 is portrait and has no left/center header, while sheet1 has landscape, has an italicized center head er, a date for the left header, and the data is shown with gridlines and row & column headings. We'd like sheet2's settings to be the same as sheet1 's settings. Here's how to do it: 1. Put both sheets in group edit (with Sheet1 active, ctrl/click Sheet2-you can also shift/click, but if you're using sheets which aren't next to each other, ctrl/click will only put the 2nd sheet in group mode, whereas shift/click will put all the sheets in-between in group mode). 2. Use dialog arrow in the Page Setup section of the Page Layout Tab to bring up the Page Setup dialog: [Excel 2003: Fi/e[Page Setup]

Pa);e·La�ovt F ormUl aS •

[JJ �< -!D

tYi��:Qin( Orl��ati:Of{'· "

�·�� ,. ' •

. Data · R eV i eW'

.e.J � F-1 " .

.

. . . .. � .- . . , , •.. , . .. . Bteaks Ba.<.MJround '

. . . . . r

Vftw

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

Page 177: This isn't Excel it's Magic! - Bob Umlas

... which dis plays:

- �-

Page Setup �!fg] ra�.J [;.-or>s T Header/Footer T Sheet -1 Orientation

Scalonv 0 Ad� to: l�t=oo=:�l..:.;% normal size O�to: It �;lpage(s)wodeby �.:.1'_---.=.J: !tal

Paper sile: I letter, 8.5xll n. �� Pt1nt Quolty: �-.IM_ed _,u_m _______________ v=<JI Fi(.st pbQe number: [uto J

[ £!rint... I [ Print Previe<;! I [ Qptions .••

OK 11 [ Cancel I . -·

3. Click OK (you don't even have to look at the settings!) 4. Get out of group edit (shift click a sheet tab), or right-click a sheet tab and select Ungroup Sheets S.That's it. Really! Here's Sheet2 now:

l1Y center Header

H � 8

You can do this with >1 sheet at a time, or even the entire workbook. To do it for more than 1 sheet, simply put all the sheets in group mode and have the sheet with the settings you want to copy be the active sheet. Then Page setup/OK/get out of group mode!

1 7 6 This isn't Excel, it's Magic/

Page 178: This isn't Excel it's Magic! - Bob Umlas

To do the entire workbook, right-click a sheet tab, select "Select All Sheets," and repeat the process.

Jnsert ...

Qelete

Bename

Move or Copy ...

� �ewCode dJD Protect Sheet...

Iab Color �

Hide

!:,!nhide ...

====;( lelect All S heets-·'"""!) m C o : w am p = > o = w ==

Don't forget to get out of group mode!

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

Page 179: This isn't Excel it's Magic! - Bob Umlas

9 2. Copy Page Setups across workbooks

You can temporarily copy in the sheet from the desired settings to the sec­ond workbook and proceed as in previous tip. But this method brings in names, styles, number formats, and links as well. Here's another approach which avoids that problem.

UsingVBA, run this command: Application.Dialogs(xiDialogWorkgroup). Show. This puts all open work­books and worksheets in group edit mode. With workbooks Book1 and Book2 open, that produces this dialog:

� ----

G�oup [dit @liD Select !!roup:

[�!'.9. k.!.ls.b.�.e.t.?.:_., •. _, .. ....... . '

'

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

,

. . , .. . .. . [Book! ]Sheet3 • [Book2)Stieet I

[Book2)SheetZ Booi,Z Sheet3

._[ �0-K ----'J1l [ Cancel I Selecting the sheets which contain the page setups to be copied, you can then simply issue the File/Page Setup command as before. Once again, make sure that the sheet with the proper Page Setup is the active sheet, because selecting any other sheet will take you out of group mode.

And, once again, don't forget to get out of group edit mode!

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

Page 180: This isn't Excel it's Magic! - Bob Umlas

9 3. Print many worksheets at once

To do this, just put them in group mode: Right-click sheet tab & choose "Select All Sheets:"

Jnsert ... Delete Rename Move or Copy ...

cy YlewCode

� frotect Sheet...

Iab Color

t!ide

Or ctrl/click specific sheets to print. Then Print!

>

Don't forget to take the sheets out of Group Mode, which you can do by shift/clicking any sheet.

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

Page 181: This isn't Excel it's Magic! - Bob Umlas

94. Print remote areas on same page

To do this, use the camera tool. You can get it by putting it into the Quick Access toolbar. Click the Office button, then Excel Options: [Excel 2003: ViewiToolbarsiCustomizeiCommands tabiTools from CategoriesiCamera (-213 the way down) in Commands))

D t!<W

..,. L../ Qp•n

ltd 1�V<

� Save e,s •

�p erlnt •

� Prepare •

� Stn.sl •

:bJ PJ.lblish •

LJ �los•

Re<ent Do<umenb

1 oddityJ<ls

l For Oan.xls

� Atlanllc City l.xls

i Webinar2.xl�

i Movie Jeopardy3.xl�

§ Qui:.xls

z Cool fml.xl.s

!! FlowChart.XI!

l! 4-PivoU.xls

Classm'atfs.xlf

6-P!VCALCS.XLS Tabl•s and Pivot Tablfs.xls

l065·EOSO.xls

l·FlLTER.XLS 9·Cond Fmtg and Data Val.xls

3-Userl'orm.xls

Homtwork.xls

Org.xls

Pivot1.xhx P4voU.xh

-t:l -(:::1 -(:::1 -� t=l -\'::1 � -(;:1 -!):l � -D=I " -!):!1 -1):;1 -i):;J -1):;1 -(;:1 ..j):a -(;:1 -!:= �

which brings up the following dialog. You will have to select the Customize option, then select All Commands from the "choose commands from" drop­down, then scroll down until you see Camera (they're alphabetical):

�� CU1tornl::t tht Qu•cl; A<e:tss To01bar.

....

Tr�.ul Cen111

Q'loo'• (OI!Im<�n(h froM: 1 [All Comnu.tl(lt

( tfllfl CIUI\Ot Ql,ut 1�1)( ... '"'•"9" Colo" Clung-t O•t• $ouru..,

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

Cunomiu .Quid:A«-eu foolb.or:: !J" I FQI ��� (IQ(\IIIIffiU (0��11(.11 --_ _.Jv

a II(W Q S�wr U'J Un<lo ('..t A!do •. Qpcn

I• I•

L. J I •

Page 182: This isn't Excel it's Magic! - Bob Umlas

Next, select the remote cells, and click camera tool.

A 8 c 0 E G H K L M N 0 p 1 Areal Areal Areal Areal Aflll 2 At eat Areal Areal Areal Areal 3 Ateat Areal A Jill 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 At ell Areal Attll 12 Areal Areal Areal ArHl ... , ...

a2 lAtea2 Atea2 Ant2 Areal iArea2 Area2 Areal 13 14 15 15

ea2 !Areal Areal Area2 ea2 jArea2 Ana2 Area2 ea2 jArea2 Areal Areal rea2 ;Area2 An�l2 Areal

17

"Develop" the picture near the original range by clicking where you want the picture to go.

Picture 2

'I 1 2

_ 3 4 5 6 7 8 9 10 11 12 13 14

A Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Area2 Area2 Area2 Area2 Area2 �{

18 Area2 1Q

·( B

Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Area2 Area2 Area2 Area2 Area2 Area2

/.-c I =$M$11:$Q$16 l c I D I E I F

Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Areal Are al Areal Areal Area2 Area2 Area2 Area2 Area2 Area2 Area2 Area2 Area2_. Area2 Area2 Area2 Area2 Area2 Area2 Area2 Area2 Area2

If you hold the A It key, the picture will exactly line up with the closest cell grid. For best results, you want to turn off the gridlines and removing the border after the picture is shown. (Note the address in the formula bar).

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

Page 183: This isn't Excel it's Magic! - Bob Umlas

jPrlnt Area • ( fx I Areal -I A I B I c I 0 I E

1 Areal Areal Areal Areal Areal

2 Areal Areal Areal Areal Areal 3 Areal Areal Areal Areal Areal

4 Areal Areal Areal Areal Areal 5 Areal Areal Areal Areal Areal 6 Areal Areal Areal Areal Areal

7 Areal Areal Areal Areal Areal

8 Areal Areal Areal Areal Areal 9 Areal Areal Areal Areal Areal

10 Areal Areal Areal Areal Areal -11 Areal Areal Areal Areal Areal -12

_ Areal Areal Areal Areal Areal

13 Area2 Area2 Area2 Area2 Area2

14 Area2 Area2 Area2 Area2 Area2

15 Area2 Area2 Area2 Area2 Area2

16 Area2 Area2 Area2 Area2 Area2

!Z. Area2 Area2 Area2 Area2 Area2

18 Area2 Area2 Area2 Area2 !Area2 1Q

Now select the cells to print, including the cells "behind" the picture and set the print area, then print! It will print on one page instead of one page for each remote area!

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

Page 184: This isn't Excel it's Magic! - Bob Umlas

9 5. Reset all page breaks caution

If you have a Page Setup which includes a setting like Adjust to 80% normal size, this also gets reset to 100% by the Reset All Page Breaks command found in the Page setup section of the Page Layo ut tab: [Excel 2003: Select all cellsllnsert!Reset All Page Breaks]

Page Layout Formulas

I ~ -l] B

ns Orientation Size Print • • Area •

Page Setup

fx c I D E ..... -

Not nice!

Data Review View

El ~ C3L j:

"I= I &!] ;. t 0 •

Breaks Bac.kground Print f - Titles

Insert Page Break

gemove Page Break

I Reset All Page Breaks -

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

Page 185: This isn't Excel it's Magic! - Bob Umlas

96. Getting to your Visual Basic routine by FS (go to) from the worksheet

If you know the name of your Visual Basic subroutine you can get to it quickly just as if it were a range name! This assumes, of course, that the VBA project is not protected!

Edit!Goto (FS) and enter the name of the proced ure! This is also true if you type the name in the Name box.

�[!;;\ .. l&l"l . ' . �icrosofl YlsUoJI &sic · Bookl - [Modu"1 (Code)) � 1-iOIII• Cllutt htf 1 foun., Oilotl "-n v..w 0.,.... Ud-1 i; - � X 14 filt Edit � Jnsttt �mat

: !:l.dl)

! l!il iii . Q b

L��"�·==�-��==�"�·6:��--�=-�----==�==�·� m� � F A 8 C 0 E F G H•�-!_ Pt.R�ALXl.S{PCR SOf"fAL ;. - •l-.f6 KASOI'IAL.Xl.S (Pt:;RSClr'IA� -1 Areal Ate

.:l .\! V8Aho;cd (Book2) 2 An�al Are � e:JMierosdtfxttiOb:ie<b

3 Area1 Ate :;Go�to�' ,.- ----------. @I Sheet I (9leetl) Pr,...Jueo � Sheet2 (S'Ie 4 Areal Are

S Areal Are

6 Atet'l Ate

7 Areal Are

8 Areal Are

9 A1e11 Are

10 Ate at Ate Lao1 -.-,-,.. -, ---- .,...--::::::.-� 11 Areal Are ����-..,.-,�-..-:::.._ ___ __, 12 Ata:J2 Ar�· �====;-13A<U2 "'·I-··· I

. . .. _ ... ., ·-

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

5tle ' W) Oi' lboo l;

,,__ 6,_,., .It-t

a1 &1. V8AProj.ect (8tnFaces.wla.� < )

-

Q<Ouo

• • .J��� ·;; 'i � •

:::J 1•.....,. .. ·

0 tion E x l icit

End Sub

Page 186: This isn't Excel it's Magic! - Bob Umlas

97. Can't find the old Excel 2003

commands? Use this feature!

Press F1 (Help).Then click What's New. Then click "Reference: Locations of Exc el 2003 commands in Excel 2007." Then scroll to the very bottom and click "Interactive: Excel 2003 to Excel 2007 command reference guide." Then click Start the Guide (requires Adobe Flash Player 7.0 or later). Then click Start. You'll see Excel 2003 commands. When you try one, you'll see how/ where it's done in Excel 2007.

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

Page 187: This isn't Excel it's Magic! - Bob Umlas

98.Aiigning Userform objects

Selecting more than one object will show one with white handles, others with black handles. �

u.�erform3 �

• •

• •

• • •

• • •

Notice the 2nd one has white handles. This one is the one used for aligning:

�ign

�ak.e Same Size

lml Size to Fit

·§i Size to Grig Horizontal SpacinQ

l!erbcal SpaCing !:;enter in Form

Arrange Buttons

J:e:i !ifoup

Ifi b!ngroup

Order

' I -

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

Iools � l:f> � .g,

�I -

.IIJT

� -o(} • Jll&

-

� :fll: �

Add-Ins Window Help !,efts t@ Centers �:.. k ::: _:-

Rights

!ops

Middles �ttoms

to §rid

• •

• • •

I •

Page 188: This isn't Excel it's Magic! - Bob Umlas

This becomes:

�s�rform3 �

• •

• • •

• •

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

Page 189: This isn't Excel it's Magic! - Bob Umlas

99. Put pictures in Userforms

from the clipboard

Copy any picture into the clipboard.

Access the Userform, and click in the Picture property.

Even though the picture you want is in the clipboard, the Paste command in the Edit menu is dim. But you can paste into the picture property with ctrl/v!

Propert ies - U s erform

luserform3 UserForm Alph�betlc CateQorlzed

&None) 0 • fmMcJUSeP'ointll (None) 2 ·

You can remove the picture via ctrl/x .

Userform3 " " "

. . . . . . . . . . . . . . . . . . . . . . . • • • • • • • • 0 • • • • • • • • • • • • • •

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

• • • • • • • • • • 0 • • • • • • • • • • 0 ' • • • • ' • • • • • 0 • • • • • • • • • • • • . ' . . . . . . . . . . . . . . . . . . . . . • • • • • 0 • • 0 • • • • • • • • • • • • • •

. . . . . .. . . . . . . . . . . , , . . . . , . .. , . ., . . . . . ,_. . . ,_, '" "' . . · . . . · . . . .

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

Page 190: This isn't Excel it's Magic! - Bob Umlas

100. Make your own tools for forms

You're always creating and OK and Cancel pair of buttons, right? Well, you can save them! Select them both and drag directly onto the toolbox!

--Toolbol< {8)

Controls I � A abl � IHll P" r< j=!LJ....J ..!..l..:J;��

. . . . . . . • • • • • • • 0 • • • • • • • • 0 • • • • • • • • 0 • • •

. . . . . . .. . . . . . . - . . . .

. . . . . - . . . . . . . . . - . . • • • • • • • • • • - • • • • - • 0

• • • • • 0 • • • • • • • • • • • •

. . . . . . . . . . . . . . . . . • • • • • • • • 0 0 • • • • • 0 • •

. . . . . . . • 0 • • • • 0 • • • • • • • • • • • • 0 • • • 0 • • • • • rnl L...,,....---___;L.L��......., 0 • • • • • 0 • • • 0

. . . . . . . . erForm4

&dditlonal Controls ...

Delete New Group

•c I Customize New Group I� A bl!!ril p r. ...J CJ_j ,...

� • d �� ,..

�00 �

You can then use this new tool to drag both OK & Cancel buttons onto any new Userform. If you right-mouse click this new tool, you get

Controls I � A abl !ili1 IHll P" r< r!LJ....J ..!.J • I AI .....J zJ �� rn ��fi!.L-:-------L.L....:�<�<-'-;: :

e rrorm� erForm4

&dditional Controls ...

Delete New Group

Customize New Group •c I

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

Page 191: This isn't Excel it's Magic! - Bob Umlas

and by selecting "Customize New Group," you will see these options:

--

Customize Control �

Tool Tip TeKt

!New Group Previewl I iiD I

� dK Picture... I !.,oad Picture... I

which you can edit (Edit Picture) to become:

If"• ' • I [� Colors 1101 Ill •• ••• ll!l

Controls ] �lear

•••ll

C�tu:e l �A abl � � rv r. ...J LJ _J r ...!..J � ,., .!lfcll �

rn OK Ctll

You can save any combinations for easy future development.And they're available in all future sessions of Excel to drag out of the toolbox onto your form. Only the design is kept, not any code behind the objects.

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

Page 192: This isn't Excel it's Magic! - Bob Umlas

You can also place these on your own Controls "page"-if you right-click the Controls tab you 'II see thi s:

New Page

Delete Page

Rename . . .

Move .•.

�mport Page . . .

Export Page .•.

Selecting New Page and right-clicking this tab, you'll see:

which yields:

Controls

UserForm3

NewPage

Delete Page

Rename ...

�ave ... !mport Page . • •

!;_xport Page ..•

Rename � Caption: IM.v Cool Control�

Control !ip Text:

OK I Cancel

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

Page 193: This isn't Excel it's Magic! - Bob Umlas

or:

I I I I

Controls My Cool Controls j OK

And now you can see you can store a whole library of controls:

Controls My Cool Controls

I Option Buttons I

UsefForm3

'1Mnn11IP.< I

v •

I

just drag them from the control toolbox onto your userform!

19 2 This isn't Excel, it's Magic/

Page 194: This isn't Excel it's Magic! - Bob Umlas

10 1. Using invisible objects

Suppose you have this simple form:

'.·��--· J•P.�!!.:_t: k���� r Done II

Change Aspect Ratio I

Wouldn't it be cool to show text simply by hovering (no click necessary) the mouse over an object/ We'll show how you can have "Here's the explana­tion you wanted .. . blah blah blah" when the cursor moves over the "Change Aspect Ratio" button:

� t1V.�J��!���---�� r0o�;;11

Change Aspect Ratio I Here's the explanation you wanted •.• blah blah blah

Here's the "magic" code to do that. First, the label has its "visible" property set to False, so it doesn't show up when you first show the form. Here's the code for the MouseMove event over the Change Aspect Ratio button:

Private Sub CommandButton2_MouseMove(ByVal Button As Integer, ByYal Shift As Integer, By Val X As Single, By Val Y As Single)

Me.Labei1.Visible =True End Sub

The "meat" of this command is simply to make the label ("Label1") visible. So whenever the mouse hovers over the button you see it. But you also need to make the label invisible when the mouse is no longer hovering over the button. There's no MouseNoLongerMove event! So, you need to place another mouse move event over the form itself:

Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, By Val X As Single, ByVal Y As Single)

Me.Labei1.Visible = False End Sub

Now, when the mouse is over the form the label disappears, and when it's over the button it shows up!

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

Page 195: This isn't Excel it's Magic! - Bob Umlas

102. lnitialize Listboxes, Comboboxes with Months via GetCustomListContents

Much more efficient than setting up some range containing the list of months, you can put this code into the initialize event of the form: Private Sub UserForm_lnitializeQ Me.ListBox1 .List = Application.GetCustomlistContents(4) End Sub

� ------- --- -P�Curos.;..-_,�

-· ,�, Mlteh :O:tl t·�)' )./'< >'­AI.I)H. � .ett bel O««<t ·­""'"'�

IL e+: Jl

Application.GetCustomlistContents(4) refers to the 4th item in the Cus­tom Lists (accessed from Office Button/Excel Options/Popular/Edit Custom Lists) [Excel 2003: ToolsiOptionsiCustom Usts J

··-9J!�Lons. ;;,;�-� r@� Color Save J Error Checb-.g

Gener at Transition

List tnboes: , -Fet.tu..-t•arct, ,;.pr l'•t Ju; e JUly tu'1JSt S�te-.bet -

"' f I

I

Sewrity ] Chart

Ad;;

o�:e I

If you want to show days of the week, you'd use Application .GetCustomlist­Contents(2)!

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

Page 196: This isn't Excel it's Magic! - Bob Umlas

103. Using Microsoft Visual

Basic bookmarks

Microsoft Visual Basic has an Edit Tool bar which has, among other things, the ability to put bookmarks into your code, temporarily (they won't save).

"6 Par�er Info Ctti+SNft+l . r-=====�=======================

0 &H800()()()0j I· � F� Done

Ctri+Space •

;r.xuilQM..,;, A. �e'mtr-(;o. "'"'

Cit: !I A Soc.:..r1u1r.$

It makes getting to a location in code very easy to access. It shows up as a blue flag in the margin of the code:

Pr·ivatc Sub Co andButton2_MouseMove(ByVal Buti

A1�.11isible : Tr·uc

vatc Sub Uscr•Form_MouseMove(ByVal Button As: Me.Labell. Visible : False

End Sub

You can mark code even across projects, and as you click the Next or Previ­ous Bookmark button, it will immediately take you to that section of code. You can even bookmark the immediate window(!), but you won't see the indicator because the immediate window has no margin. But you'll see the cursor blinking in the immediate window!

This isn't Excel, it's Magic/ 19 5

Page 197: This isn't Excel it's Magic! - Bob Umlas

• 104. VBA Array

Suppose you needed to access a strange sequence of numbers, like 4,1 3,1 9,20,28,44,123. Perhaps these are rows you need to work on. You can get to them in a loop with this technique:

Sub AccessRowsO For· i = 0 To 6

j = ArTay(4. 13, 19. 20, 28. 44, 123)(i) RowsG).Font.Bold = Tr·ue 'for• example

1\lext End Sub

The statement Array(4,13, 19,20,28,44,123) has 7 elements in it, num­bered 0 through 6 (unless Option Base 1 is supplied at the top of the module). So the first element has a subscript of 0 and can be referenced by Array(4, 1 3, 1 9,20,28,44, 1 23)(0), which would be a 4. The 123 is Ar-ray(4, 1 3, 1 9,20,28,44, 1 23)(6). So, using i as a subscript, j takes on the succes­sive values i n the array list. Here's another way to do the same thing. And since loops are so fast, you might simply prefer this way:

Sub AccessRowsO For· i = 4 To 123

Select Cose i Cose 4, 13, 19, 20, 28. 44. 123

Rows(i).Font.Bold =True End Select

Next End Sub

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

Page 198: This isn't Excel it's Magic! - Bob Umlas

• 105. Ensuring users don't open your work­

book with the shift key down to

prevent your macros from kicking in!

Here's a simple technique to ensure they allow your macros to run. Save the workbook with only one sheet showing, and that sheet may look like this:

....

You may not use this workbook

without enabling macros! Reopen

and don't hold the shift key!

Prevent them from unhiding any other sheets by protecting the workbook's structure with a password. Use Protect Workbook/Protect Structure and Windows from the Changes section of the Review tab [Excel 2003:Tools/Protection/Protect Workbook]:

m � 81 ti}iJ Protect and Share Workbook

�Allow Users to Edit Ranges Protect Protect Share

Sheet Workbook • Workbook ·�P Track Changes· -

Restrict Editing

Protect Structure and Windows

I Restrict Permission

Jj Unrestricted Access

,Bestricted Access

Manage Credentials

Then supply a password:

Protect worl<book for

0 S,tructure

O�indows

eassword (optional): I···

0

M

OK J] [ Cancel ]

I N

This isn't Excel, it's Magic/ 19 7

Page 199: This isn't Excel it's Magic! - Bob Umlas

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\lextl Sheets{l).Visible: False

End Sub

Pr·ivate Sub Wor·kbook_Befol'eCiose{Concel As Boolean) Sheets{l).Visible: Tr·ue For· i : 2 To Sheets.Count

Sheets(i). Visible : False Next ThisWor·kbook.Pr·otect "abc" sh·uctut·e::Tr·ue '

End Sub

Notice also that before the workbook is closed, it also resets the sheets back for the next time, hiding all sheets except the message sheet. It's turned to visible first because you can't hide all the sheets in a workbook!

Lastly, you can protect access to the VBA code by using this in the VBE:

�ebug B,un

I � IJ a

0 ,.. &:1 � IT [workb• � Pri I I

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

Iools I Add-Ins Window Help c B,eferences ... , Cc

�ltronal Controls ... <i=:-. ,

Macros ... I== Qptions ... 1-

In( VBAProject Pro perties .. . Digital Signature ... "<

..-. � � � . � .n11n

Page 200: This isn't Excel it's Magic! - Bob Umlas

And then:

.....- �. !��P.!.� i£!;.L:J>.!�i !:,<;1J'J:2 P �Qi_e�--* .;.� General Proteclion I

Lock project

� Lock pt O)eCt for VIewing

I Password to view project properties------------,

Password I"''"'" Confirm password , ... ,.

OK I '

H elp . ' -

So now, if the user opens the workbook with the shift key down, it's a fairly useless workbook!

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

Page 201: This isn't Excel it's Magic! - Bob Umlas

106. Bulk removal of leading apostrophe

When a cell's contents contains a leading apostrophe, it doesn't show up in the cell, only in the formula bar. This has the effe ct of making the cell be treated as pure text. That is, if you enter '=1 0/2, you would see =1 0/2, not 5.

Getting rid of the' by Find and Replace doesn't work because Excel treats the apostrophe as if it weren't there and would say it wasn't found! So re­moving it is a matter of editing the cell.

But what if you have many cells with the leading apostrophe? Each of the cells in A 1 :A 10 contain a leading apostrophe:

fx I '=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: Datal Text to Columns]:

Data Review View Developer Add-Ins

;., Clear

��Reapply

.":V Advanced Iter

--=�=-1:=-.: I !�� 1�1 Data Validation •

� �o Consolidate Text to Remove

Columns Duplicates � What-If Analysis •

Data Tools

When you get the Text to Columns wizard, just click Finish!

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

Page 202: This isn't Excel it's Magic! - Bob Umlas

• 107. Multi-select offset

Did you ever have an odd selection and wanted to have the same selection 2 columns over (or 1 or a few rows down, etc) to repeat some action? Here's an oddly shaped selection, all filled with 123:

814 ·� /x 1123

A B c 1 123 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 D1. The easiest way to do it is using the VBE's immediate window to execute a simple one-liner command:

Immediate selection.offset(O ,3 ).select

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

Page 203: This isn't Excel it's Magic! - Bob Umlas

The result:

A B l 123

2 123

3 123 4 123

5 123

6 7 123

8 123

� 123

10 123

11 123

12 123

13 123 . � 123

l 15

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

c ·- o�tJ-=-t�]�F �• I I

I I

I 123 I

I

r i

l I -i I

J I ., I ·;

Page 204: This isn't Excel it's Magic! - Bob Umlas

• 108. VBA Boolean test

Instead of using this to turn a Boolean variab le to True/False:

Sub BoolcanTestQ Dim MyBool As Boolean

If Range("A12").Voluc > 12 Then MyBool = True

Else MyBool = False

End If End Sub

You can use this t o do the same thing:

Sub BooleanTestO Dim MyBool As Boolean

MyBool : (Range("A12").Vo.lue > 12)

End Sub

The expression (Range(''A 12").Value > 12) will be evaluated and if it is great­er than 1 2, My Boo I will be set to True, else it will be set to False, the same as in the first example! Quite a bit sh orter!

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

Page 205: This isn't Excel it's Magic! - Bob Umlas

• 109. VBA Shortcut to fill ranges

Suppose you need to fill cells A 1 :D1 (using VBA) so it looks like this:

A l B c ___::l_�:.N:.:;a;.;.;m;.;.;e;..._. A ceo u nt # Date

2

Most folk'sVBA would look something like this:

Sub FiiiRangeQ

D Amount

Range("A1").Value ="Name" Range("B1"). Value = "Account #" Range("C1").Value = "Date" Range("D1").Value ="Amount"

End Sub

... and that would work fine. But look at this version:

Sub FiiiRangeQ Range("Al:Dl").Value : Ar·r·ay("Name", "Account#", "Date", "Amount")

End Sub

Not only is this shorter, but if the code needed to fill range A 1 :Z1, there'd be a lot less typing!

What if you wanted to fill A 1 :A4 with the same information? You might now be inclined to use this:

Sub FiiiRongeQ Range{" At: Dl"). Value : Ar·r·ay("Narne", "Account #", "Date", "Amount")

End Sub

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

Page 206: This isn't Excel it's Magic! - Bob Umlas

But that would surprisingly result in:

I A 1_::: �B=.�..=2c��=o: �Name-r 2 1Name

I 3 jName -1 4 1 Name

• " I <--F .

... 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 ieat ion.T r•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.T r·anspose

Appl ication. Wor·ksheetFunction.T r·anspose

W o r• ksheet Fu11ction. T r·anspose

The latter two will give the intellisense dropdown:

Wo r· kshe�t Function� : .. -----·····--·-............... : � ""�!Acos :a, : ------·····�··-··- · · ··---�

·.:.� Acosh

""� And �

®J Application .. ,,� Asc

'"� Asin

"'� Asinh

The reason I chose the first one (without the intellisense) is that it's the shortest amount of typing!

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

Page 207: This isn't Excel it's Magic! - Bob Umlas

• 1 10. Some VBA Shortcuts

Suppose you have a variable defined as this:

Dim savStr·ingFor·Holding TheDescr·iption As Stt'ing

... and you wan ted to use It, obviously, later m your code, you can simply start typing it, then press ctri/Spacebar, which will give you this:

Dim so.vSh•ingFoi·HoldingTheDescl·iption As St1·ing

sa vi ��

-�� Savesening

r!§t savStringForHoldingTheDescr1ptlon

"'� Second

·�� Seek

rf!JJ Selection '"� SendKeys

... and you can use the down arrow to select it, then the tab key (or enter key) to put in into your code:

sav <·� SavePicture

,,� SaveSetting

rtf} "� Second

"·� SeeK

rtf} Selection

.:� SencJKeys

.�

If what you typed is unique enough so there's really no choice (like if you typed savs then pressed ctrl/spacebar), Excel will simply put the entire vari­able right into the module.

As a matter of fact, it's not just for variables. How often do you type out Ap­plication? Simply typing Appl and pressing ctrl/spacebar will put Application right in the code!

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

Page 208: This isn't Excel it's Magic! - Bob Umlas

"App" isn't quite enough for uniqueness:

oppl l!ii' ApplicatiOn

.,� Asc .o� AscB ... �AscW r5J Assistant

"-� Aln v

And, if you have nothing on the line and press ctrl/spacebar, you will still get the beginning of the list:

:.-..�;Ails .. ---.... - ·-.. -·-···--.... -.... - .... -... -.... -... ·--·-····- .. ·-- .. -·-···-·! � ---·-�·-M·----·-···-····-·-· .. - .... - ..... _, _ _ ., ___ .. ____ ,_,, __ _ .,_ ,1 _

� AcliVeCell

� ActiveChart ll1ii' AcbvePrinter

� ActiveSheet

� AcliveWlndow

� ActiveWorkbook

-

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

Page 209: This isn't Excel it's Magic! - Bob Umlas

1 1 1. A few VBA Keyboard Shortcuts

AltlQ will bring you from the VBE to Excel. However, Alt/F11 is a toggle back and forth from/to VBE and Excel, so I prefer that one!

Ctri/G will bring up the Immediate Pane. If the cursor is IN the immediate window, then Ctri/A and then backspace will dear it.

If you right-dick on a variable, you will see a dropdown where you can re­quest the definition:

savStr· .

I

End Sub

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

. .-d. q_ !h. ..!. ti]. ;J I � � J,

.... t:1

I

' ' I I• • 'T'I. " CUt Copy P.aste U;t Properties/Metb.o.ds

Li�t Constants ' .

Quick Info

Parameter'lnfo

Complete �ord

lO�JQie Qbject Browser

Add Watch ... Qefinition Last Position !:!ide

.

. ption

I

Page 210: This isn't Excel it's Magic! - Bob Umlas

3D formulas, 166 Aligning 0 bjects, 163

Apostrophe Bulk removal, 200

Apply Names, lli Autosum

Enter from keyboard, 148

Auto-Sum Features, �

Borders Shortcut, 146

Bringing cells together, 167

Camera Tool Oddity, 169

Characters All in Font, 110.

Closing workbooks, � Comment

Inside formula, 140 Comments, Formatting, 6A Copy formulas

With mixed references, 157

Cursor Movement Remaining Stationary, 165

Custom Lists, lB. Cut, Copy

Via Borders, 21

Data entry quicker, 171

Date & Time Shortcut, 147

Dates As range. 2B. Change those like 20050923, 3..6. End of month, 21.

Double space, 1il

End of Month, 21. Excel 2003 commands

How to find, 185

Fill down Alternate references, 11.5.

Fill Handle Insert/Delete rows, 22 Right-click drag, ].]_

Fill right Alternate references, llJ.

Filling Holes, 161

Filter Advanced, H

Find after Find dialog gone, 153

Formatting #VALU E, 70 Comments, li Fill, Z5. I ndenting, l.A Number, Advanced, I.1 Text, H Time, Hours over ll [h), D.

Formula Bulk change, 1 3 5 Change cell reference, 172

Extract part of string, 1JM. Inner Series, 80. Long, !U. MATCH, using wildcard, 1QB. Named, � Note inside, 140 Numbering Questions, 125

REPT. 1 02 Show picture, 11i SUMPRODUCT, 1 05 TEXT, 1QZ

Functions New to 2007, 143

Hiding ribbon, 173

Indenting Text, 1.A

Justify, ll

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

Page 211: This isn't Excel it's Magic! - Bob Umlas

List Custom, za

Lookup More than 1 value, 1Q.Q

Mailing labels Trick1 , 128

Trick2.132

MATCH Formula,lQB. Merged Cells

Row Height, S1 Multiple selection

Selecting offset, 201

Names Creating, U Defining. Scrolling, 118 Defining Large areas, 2..2. Global vs Local, .2.0. Long. !d. Relative definition, 138 Self-D efining. l 01 XLM, 92

Page Breaks Reset Caution, 183

Page Setup Copy to other sheets, 175 Copy to other workbooks, 178

Paste Special Bring cells together, 167 Skip Blanks, .25.

PictoGraphs. il Picture

Show by formula, l.l.i Printing

Many sheets at once, 179 Remote areas on same page, 180 Reset page breaks, Caution, 183

Protection Range , 1 24

Random sampling, 8.1

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

Range protection, 124 REPT. 1 02 Ribbon (Hiding), 173 Right-Mouse

Border. � Row Height, 8..6.

Scrolling, � Drag, 56.

Selection All Specific Text, 1.6. Anchoring active cell, 1 5 2 Bring into view, 149

Select successive corners, 1 5 1 Shift key

While opening workbook, 197 Shift-Click, 4i Shortcut

3D formula, 166 Autosum, 148 Borders. 146 Date & Time, 147 Formatting, 145 Miscellaneous, 154 Select Precedents, 150

Sorting,

Columns, 155 Space character

Intersection, 103 Split screens (In VBA, too ), 18. SUM PRODUCT, 105

Table

New features, 141 TEXT, 1QI

Tools Double-clicking, ll Unique Entries, 3B. Values, .2..5. Userform Aligning objects, 186 Initializing listboxes, etc., 194

Page 212: This isn't Excel it's Magic! - Bob Umlas

Invisible objects, 193 Make your own tools, 189

Using pictures, 188

Visual Basic Arrays, 196 Boolean test, 203

Filling ranges, 204

Get to routine, 1 84 Shortcuts, Part 1, 206 Shortcuts, Part 2, 208 Using bookmarks, 195

Window Arrange, Except this one, 51 Arrange, Order, 60. Title, ·1, ·2, 11.

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

Page 213: This isn't Excel it's Magic! - Bob Umlas
Page 214: This isn't Excel it's Magic! - Bob Umlas

ISBN-1 0: 0-9792153-2-3

ISBN-13: 978-0-9792153-2-2 5 1 4