excel 2010 : the missing manualthe missing credits xix introduction i partone:worksheetbasics...

15
Excel 2010 Matthew MacDonald —n in in i f- M „^ TECHNISCHE iNFOHMATIONSBJBLiOTHEK . UNIVERSTITATSBIBLIOTHEK HANNOVER POGUE PRESS'" O'REILLY8 Beijing Cambridge Farnham Koln Sebastopol Taipei Tokyo

Upload: others

Post on 09-May-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Excel 2010

Matthew MacDonald

—n in in i f- M....

„^

TECHNISCHE

iNFOHMATIONSBJBLiOTHEK

. UNIVERSTITATSBIBLIOTHEK

HANNOVER

POGUE PRESS'"

O'REILLY8

Beijing • Cambridge • Farnham • Koln • Sebastopol • Taipei • Tokyo

Page 2: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Table of Contents

The Missing Credits xix

Introduction I

Part One: WorksheetBasics

Chapter l: Creating Your First Spreadsheet. 19

Creating a Basic Worksheet 19

Starting a New Workbook 21

Adding the Column Titles 22

Adding Data 24

Editing Data 25

Moving Around the Grid 26

Shortcut Keys 26

The Go To Feature 28

A Tour of the Excel Window 29

The Tabs of the Ribbon 29

The Formula Bar 31

The Status Bar 32

Going Backstage 36

Excel Options 37

Saving Files 37

The Excel File Format 39

Sharing Your Spreadsheet with Excel 2007 41

Saving Your Spreadsheet for Excel 2003 43

Saving a Spreadsheet in Other Formats 44

Saving Your Spreadsheet As a PDF 44

Saving Your SpreadsheetAs an HTML File 47

Saving Your Spreadsheet with a Password 50

Disaster Recovery 53

Page 3: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Opening Files 55

Opening Recent Documents 56

Protected View 57

Opening Files—with a Twist 58

Working with Multiple Open Spreadsheets 60

Chapter 2: Adding Information to Worksheets 63

Adding Different Types of Data 63

How Excel Identifies Text 66

How Excel Identifies Numbers 67

How Excel Identifies Dates and Times 68

Regional Dating 70

Handy Timesavers 71

AutoComplete 72

AutoCorrect 73

AutoFill 75

AutoFit 78

Dealing with Change: Undo, Redo, and AutoRecover 79

Undo and Redo 79

AutoRecover 82

Spell Check 85

Spell Checking Options 87

Adding Hyperlinks 90

Creating a Link to a Web Page or Document 91

Creating a Link to a Worksheet Location 93

Chapter 3: Moving Data 95

Selecting Cells 95

Moving Cells Around 102

Adding and Moving Columns or Rows 113

Chapter 4: Managing Worksheets 117

Worksheets and Workbooks 118

Adding and Removing Worksheets 119

Hiding Worksheets 121

Naming and Rearranging Worksheets 121

Moving Worksheets from One Workbook to Another 123

Grouping Worksheets 125

Find and Replace 127

The Basic Find 128

Find All 129

More Advanced Searches 130

Finding Formatted Cells 133

Finding and Replacing Values 134

vi TABLE OF CONTENTS

Page 4: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Chapter 5: Formatting Cells 137

Formatting Cell Values 138

Changing the Cell Value Format 139

Formatting Numbers 141

Formatting Dates and Times 146

Special Formats for Special Numbers 149

Custom Formats 150

Formatting Cell Appearance 158

Alignment and Orientation 159

Fonts and Color 162

Borders and Fills 167

Drawing Borders by Hand 169

Chapter 6: Smart Formatting Tricks 173

The Format Painter 173

Styles and Themes. .

174

Custom Styles 176

Modifying Styles 178

Transferring Styles Between Workbooks 179

Themes: A Package of Styles 180

Modifying Themes 183

Conditional Formatting 186

The Basics of Conditional Formatting 187

Highlighting Specific Values 187

Using Multiple Rules 192

Chapter 7: Viewing and Printing Worksheets 195

Controlling Your View 195

Zooming 196

Viewing Distant Parts of a Spreadsheet at Once 198

Freezing Columns or Rows 201

Hiding Data 204

Saving View Settings 205

Viewing Multiple Workbooks at Once 207

Printing 210

How to Print an Excel File 211

Page Layout View: A Better Print Preview 217

Creating Headers and Footers 220

Controlling Pagination 222

Page Breaks 222

Scaling 223

Page Break Preview: A Bird's-Eye View of Your Worksheet 224

TABLE OF CONTENTS

Page 5: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Part Two: Formulas and Functions

Chapter 8: Building Basic Formulas 227

Creating a Basic Formula 227

Excel's Order of Operations 229

Cell References 231

How Excel Formats Cells That Contain Cell References 232

Functions 234

Using a Function in a Formula 234

Using Cell References with a Function 236

Using Cell Ranges with a Function 237

Excel Compatibility Functions 239

Formula Errors 240

Logical Operators 243

Formula Shortcuts 245

Point-and-Click Formula Creation 245

Point-and-Click Formula Editing 246

The Formulas Tab 247

Using the Insert Function Button 249

Copying Formulas 252

Absolute Cell References 254

Partially Fixed References 256

Referring to Other Worksheets 258

Referring to Other Workbooks 258

Chapter 9: Math and Statistical Functions 263

Rounding Numbers 263

ROUND(), ROUNDDOWN(), ROUNDUPO: Rounding Numbers 264

MROUND0, CEILINGO, and FLOOR(): More Rounding Functions 265

INTO and TRUNCO: Chopping Off Non-Whole Numbers 266

EVENO and ODD(): Rounding Up to Even or Odd Values 268

Groups of Numbers 268

SUMO: Summing Up Numbers 268

COUNT0, COUNTAO, and COUNTBLANK0: Counting Items in a List 269

MAXO and MINO: Finding Maximum and Minimum Values 271

LARGEO, SMALLO, and RANKO: Ranking Numbers 272

AVERAGEO and MEDIAN(): Finding Average or Median Values 274

PERCENT!LEO and PERCENTRANK(): Advanced Ranking Functions 275

FREQUENCYO: Putting Numbers into Grouped Ranges 277

MODE(): Finding Numbers That Frequently Occur in a List 279

General Math Functions 279

PRODUCTO, FACTO, POWER(), and SQRTO: Products, Factorials,

Powers, and Square Roots 280

QUOTIENTO and MOD(): Higher Division 281

ABS() and SIGN(): Absolute Value and Determining a Number's Sign 281

RANDQ and RANDBETWEENQ: Generating Random Numbers 282

Viii TABLE OF CONTENTS

Page 6: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

GCDO and LCM(): Greatest and Least Common Denominator 284

COMBINO and PERMUTQ: Figuring Combinations and Permutations 285

Trigonometry and Advanced Math 286

Advanced Statistics 289

Chapter 10: Financial Functions 295

The World of Finance 295

Financial Functions 296

FV(): Future Value 297

PV(): Present Value 300

PMTO, PPMTO, and IPMT(): Calculating the Number of PaymentsYou Need to Make 302

NPER(): Figuring Out How Much Time You'll Need to Pay Off

a Loan or Meet an Investment Target 304

RATE(): Figuring the Interest Rate You Need to Achieve Future Value 305

NPVO and IRR(): Net Present Value and Internal Rate of Return 306

Depreciation 309

Other Financial Functions 312

Chapter 11: Manipulating Dates, Times, and Text 315

Manipulating Text 315

CONCATENATED: Joining Strings of Text Together 316

LEFTO, MIDO, and RIGHTO: Copying Portions of a Text String 316

LENO, FINDO, and SEARCH(): Counting Characters in a String 317

UPPERO, LOWERO, and PROPER©: Changing Capitalization 319

TRIMO and CLEAN(): Removing Unwanted Spaces and Non-Printing Characters..

320

SUBSTITUTEO: Replacing One Sequence of Characters with Another 320

TEXTO, VALUE(X F1XED0, and DOLLARO: Converting Text to Numbers

and Vice Versa 321

Other Text Functions 323

Manipulating Dates and Times 324

Math with Dates and Times 325

Using Dates and Times with Ordinary Functions 325

Date and Time Functions 326

TODAY0 and NOWy: Inserting the Current Date and Time 327

DATEO and TIME(): Dates and Times in Calculations 327

DAYO, MONTHO, and YEARO: More Date Calculations 329

HOUR0,MINUTE0,SECOND(): More Time Calculations 330

WEEKDAY(): Determiningthe Day of the Week 330

DATEDIFO: Calculating the Difference Between Dates 332

DATEVALUEO and TIMEVALUEO: Converting Dates and Times

into Serial Numbers 333

DAYS360(): Finding Out the Number of Days Between Two Dates 335

EDATEO: Calculating Future Dates 335

YEARFRAC(): Calculating the Percentage of a Year Between Two Dates 336

EOMONTHQ: Finding the Last Day of Any Month 337

TABLE OF CONTENTS

Page 7: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

NETWORKDAYSO: Counting the Number of Business Days 337

WORKDAYO: Figuring Out When Days Will Fall in the Future 338

WEEKNUMO: Figuring Out in Which Week a Date Falls 338

Chapter 12: Lookup, Reference, and Information Functions... 339

The Basic Lookup 340

VLOOKUPO: Vertical Lookups 341

HLOOKUPQ: Horizontal Lookups 344

Advanced Lookups 344

MATCH(): Finding the Position of Items in a Range 345

INDEX(): Retrieving the Value from a Cell 346

Performing a "Left Lookup" 346

Performing a Double Lookup 347

OFFSET(): Shifting Cell References 349

Other Reference and Lookup Functions 350

INDIRECT() and ADDRESS(): Working with Cell References Stored

As Text 351

TRANSPOSED: Changing Rows into Columns and Vice Versa 353

The HYPERLINKO Function: Creating a Dynamic Link 355

Information Functions 356

The "IS" Functions: Checking the Value Inside a Cell 356

TYPEO and ERROR.TYPE(): Finding a Value's Data Type or Error Type 357

INFOfJ and CELLO: Gathering Info AboutYour Computer

and Your Worksheet's Cells 358

Tutorial: Generating Invoices from a Product Catalog 359

Chapter 13: Advanced Formula Writing and Troubleshooting. .363

Conditions in Formulas 363

IFQ: Building Conditional Formulas 364

COUNTIFO: Counting Only the Cells You Specify 365

SUMIFO: Adding Only the Cells You Specify 367

COUNTIFSO and SUMIFSO: Counting and Summing Using Multiple Criteria....

368

Descriptive Names for Cell References 371

Creating and Using a Named Range 372

Creating Slightly Smarter Named Ranges 373

Naming Formulas and Constants 375

Managing Named Ranges 376

Automatically Creating Named Ranges 378

Applying Names to Existing Formulas 380

Variable Data Tables 382

Creating a One-Variable Data Table 382

Creating a Two-Variable Data Table 384

Controlling Recalculation 386

Solving Formula Errors 387

Step-by-Step Evaluation 387

Tracing Precedents and Dependents 389

Error Checking 392

x TABLE OF CONTENTS

Page 8: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Part Three: Organizing Worksheets

Chapter 14: Tables: List Management Made Easy 395

The Basics of Tables 396

Creating a Table 396

Formatting a Table 399

Editing a Table 402

Selecting Parts of a Table 404

Sorting and Filtering a Table 405

Applying a Simple Sort Order 406

Sorting with Multiple Criteria 407

Sorting by Color 410

Filtering with the List of Values 411

Creating Smarter Filters 413

Dealing with Duplicate Rows 415

Highlighting Duplicates 416

Removing Duplicates Automatically 417

Performing Table Calculations 418

Dynamic Calculations 419

Column Names 421

Table Names 421

The Total Row 422

The SUBTOTAL0 Function 423

The Database Functions 425

Chapter 15: Grouping and Outlining Data 429

Basic Data Grouping 429

Creating a Group 430

Nesting Groups Within Groups 434

Summarizing Your Data 436

Combining Data from Multiple Tables 438

Grouping Timesavers 440

Auto Outline 441

Automatic Subtotaling 441

Chapter 16: Templates 445

Understanding Templates 446

Creating a New Workbook from a Template 447

Downloading Templates (Method 1: From Backstage View) 448

Downloading Templates (Method 2: The Office Online Website) 450

Creating Templates 454

Understanding Custom Templates 454

Building a Custom Template 456

Sharing Templates with Others 458

TABLE OF CONTENTS

Page 9: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Part Four: Charts and Graphics

Chapter 17: Creating Basic Charts 461

Charting 101 462

Embedded and Standalone Charts 463

Creating a Chart with the Ribbon 463

The Chart Tools Ribbon Tabs 465

Basic Tasks with Charts 466

Moving and Resizing a Chart 466

Creating a Standalone Chart 468

Editing and Adding to Chart Data 470

Changing the Chart Type 470

Printing Charts 471

Practical Charting 472

Charts with Multiple Series of Numbers 473

Controlling the Data Excel Plots on the X-Axis 473

Data That Uses a Date or Time Scale 476

Noncontiguous Chart Ranges 478

Changing the Order of Your Data Series 480

Changing the Way Excel Plots Blank Values 481

Chart Types 481

Column 482

Bar 484

Line 484

Pie 486

Area 486

XY (Scatter) 488

Stock 489

Surface 490

Donut 491

Bubble 492

Radar 493

Chapter 18: Formatting and Perfecting Charts 495Chart Styles and Layouts 495

Chart Styles 496

Chart Layouts 497

Adding Chart Elements 497

Adding Titles 499

Adding a Legend 500

Adding Data Labels to a Series 501

Adding Individual Data Labels 504

Adding a Data Table 506

Selecting Chart Elements 507

xii TABLE OF CONTENTS

Page 10: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Formatting Chart Elements 509

Coloring the Background 509

Fancy Fills 510

Fancy Borders and Lines 514

Formatting Data Series and Data Points 516

Reusing Your Favorite Charts with Templates 518

Improving Your Charts 520

Controlling a Chart's Scale 520

Adding a Trendline 523

Adding Error Bars to Scientific Data 526

Formatting 3-D Charts 528

Changing the Shape of a 3-D Column 529

Advanced Charting 530

Exploding Slices in a Pie 530

Grouping Slices in a Pie 531

Gaps, Widths, and Overlays in a Column Chart 532

Creating Combination Charts 534

Chapter 19: Inserting Graphics 557

Adding Pictures to a Worksheet 538

Inserting a Picture 538

Positioning and Resizing a Picture 540

Picture Touch-Up 543

Compressing Pictures 545

Cropping and Shaping a Picture 547

Picture Borders, Effects, and Styles 550

Excel's Clip Art Library 551

Drawing Shapes 554

Drawing a Shape 556

Adding Text to a Shape 559

Selecting and Arranging Shapes 560

Connecting Shapes 564

SmartArt 565

Part Five: AdvancedDataAnalysis

Chapter 20: Visualizing Your Data 569

Data Bars 570

Editing a Formatting Rule 572

Fine-Tuning Data Bars 573

Color Scales 578

Fine-Tuning Color Scales 578

Icon Sets 579

Fine-Tuning Icon Sets 581

TABLE OF CONTENTS

Page 11: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Sparklines 583

Creating a Sparkline 585

Changing the Axis 588

Markers 590

Chapter 21: Scenarios and Goal Seeking 593

Using Scenarios 594

Creating a New Scenario 594

Managing Scenarios 597

Creating a Summary Report 598

Using Goal Seek 599

Goal Seeking with Complex Equations 603

Solver 604

Understanding Solver 605

Defining a Problem in Solver 606

More Advanced Solver Problems 612

Saving Solver Models 615

Configuring Solver 617

Chapter 22: Pivot Tables 621

SummaryTables Revisited 622

Life Without Pivot Tables 622

Life with Pivot Tables 624

Building Pivot Tables 624

Preparing a Pivot Table 626

Pivot Table Regions 628

Laying Out a Pivot Table 629

Formatting a Pivot Table 632

Rearranging a Pivot Table 633

Getting to the Source 633

Multi-Layered Pivot Tables 635

Hiding and Showing Details 637

Fine-Tuning Pivot Table Calculations 639

Changing the Type of Calculation 639

Adding a Calculated Field 640

Filtering a Pivot Table 643

Report Filtering 643

Slicers 645

Group Filtering 650

Pivot Charts 652

Creating a Pivot Chart 653

Manipulating a Pivot Chart 654

XiV TABLE OF CONTENTS

Page 12: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Chapter 25: Analyzing Databases, XML, and Web Pages 657

Excel and Databases 658

Connecting to an Access Database 659

Refreshing Data 661

Data Source Security 664

Connecting to a SQL 5erver Database 665

Reusing Your Database Connection 668

Understanding XML 671

What Is XML, Really? 671

Three Rules of XML 672

XML Files and Schemas 675

Excel and XML 676

Mapping a Simple Document 677

Importing and Exporting XML 681

Mapping Lists 683

Gaining the Benefits of XML Mapping 685

Web Queries 686

The Limitations of Web Queries 687

Creating a Web Query 687

The Research Pane-A Web Query Alternative 690

Part Six: Stating Data with the Rest of the World

Chapter 24: Protecting Your Workbooks 693

Understanding Excel's Safeguards 693

Data Validation 694

Settings 695

Input Message 696

Error Alert 698

Data Validation with Formulas and Cell References 700

Data Validation with Lists 702

Locked and Hidden Cells 703

Protecting a Worksheet 705

Protecting the Entire Workbook 707

Protecting Cell Ranges (with More Passwords) 709

Allowing Specific Windows Users to Edit a Range 711

Chapter 25: Worksheet Collaboration 715

Your Excel Identity 716

Preparing Your Workbook 716

Workbook Protection 717

Checking for Issues 718

Document Properties 719

TABLE OF CONTENTS

Page 13: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Distributing a Document 722

Sending by Email 723

Uploading to the Web 724

Adding Comments 724

Inserting a Comment 725

Showing and Hiding Comments 726

Fine-Tuning Comments 727

Reviewing Comments 728

Printing Comments 729

Tracking Changes 729

Switching On Change Tracking 731

Understanding the Change Log 732

Highlighting Changes 734

Examining the Change Log 735

Accepting and Rejecting Changes 737

Merging Multiple Revisions into One Workbook 739

Sharing Your Workbook 741

Multiple Users Without Workbook Sharing 742

Turning On Workbook Sharing 743

Workbook Sharing in Action 745

Chapter 26: Using Excel on the Web 749

Putting Your Files Online 750

Introducing SkyDrive 751

Your Web Workflow 753

Uploading a File to SkyDrive (Using Your Browser) 753

Uploading a Workbook to SkyDrive (Using Excel) 756

Uploading a Workbook to a SharePoint Server 759

Viewing a File in Your SkyDrive Account 760

Viewing a File in Someone Else's SkyDrive Account 762

Using the Excel Web App 764

Supported Features 765

Saving Files 768

Collaboration: The Excel Web App's Specialty 768

Taking a Workbook Back to Desktop Excel 770

Unsupported Features 771

Partially Supported Features 773

Chapter 27: Exchanging Data with Other Programs 775

Sharing Information in Windows 775

Embedding and Linking Objects 777

Exporting Charts Out of Excel 778

Editing a Linked Object 781

Editing an Embedded Object 782

Importing Objects into Excel 784

TABLE OF CONTENTS

Page 14: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Transferring Data 785

Exporting Tables of Data 786

Importing Tables of Data 787

Importing Text Files 787

Part Seven: Programming Excel

Chapter 28: Automating Tasks with Macros. , 793

Macros 101 793

Macro-Free and Macro-Enabled Workbooks 795

The Macro Recorder 795

Relative and Absolute Recording 796

Where Macros Live 797

Recording a Macro 799

Playing a Macro 802

Macro Security 803

Trusted Documents 804

Temporary Trust 806

The Trust Center 806

Setting Up a Trusted Location 809

Creating Practical Macros 810

Inserting a Header 811

Alternating Row Formatting 812

A Combined Task 813

Placing a Macro on the Quick Access Toolbar 814

Attaching a Macro to a Button Inside a Worksheet 816

Chapter 29: Programming Spreadsheets with VBA 819

The Visual Basic Editor 820

The Project Window 820

Modules and Macros 822

Finding and Moving Macros 824

Debugging a Macro 824

Understanding Macro Code 826

The Anatomy of a Macro 826

Objects 101 828

Using Properties and Methods 829

Hunting for Objects 830

Exploring the VBA Language 830

Entering Text in the Current Cell 831

Interacting with Other Cells 832

Editing Specific Cells 833

TABLE OF CONTENTS

Page 15: Excel 2010 : the missing manualThe Missing Credits xix Introduction I PartOne:WorksheetBasics Chapter l: CreatingYourFirst Spreadsheet. 19 Creatinga BasicWorksheet 19 Starting aNewWorkbook

Formatting Cells 834

Using Variables 834

Making Decisions 836

Repeating Actions with a Loop 838

Creating Custom Functions 839

Part Eight: Appendix

Appendix A: Customizing the Ribbon 843

Index 855

TABLE OF CONTENTS