Microsoft© Office
Excel 2007 ®
Gary B. Shelly Thomas J. Cashman Jeffrey J. Quasney
THOMSON COURSE TECHNOLOGY
25 THOMSON PLACE
BOSTON MA 02210
Australia • Canada • Denmark • Japan • Mexico • New Zealand • Philippines • Puerto Rico • Singapore • South Africa • Spain • United Kingdom • United States
C6394_FM_CTP.4c.indd i
8/8/07 3:59:18 PM
Microsoft Office Excel 2007 Comprehensive Concepts and Techniques Gary B. Shelly Thomas J. Cashman Jeffrey J. Quasney Executive Editor Alexandra Arnold
Director of Production Patty Stephan
Art Director Bruce Bond
Senior Product Manager Mali Jones
Senior Production Editor Catherine G. DiMassa
Cover and Text Design Joel Sadagursky
Associate Product Manager Klenda Martinez
Developmental Editor Lyn Markowicz
Cover Photo Jon Chomitz
Editorial Assistant Jon Farnham
Proofreader Green Pen Quality Assurance
Compositor GEX Publishing Services
Senior Marketing Manager Joy Stark-Vancs
Indexer Rich Carlson
Printer Banta Menasha
Marketing Coordinator Julie Schuster
QA Manuscript Reviewers John Freitas, Serge Palladino, Chris Scriver, Danielle Shaw, Marianne Snow, Teresa Storch
Print Buyer Julio Esperas COPYRIGHT © 2008 Thomson Course Technology, a division ofThomson Learning, Inc. Thomson LearningTM is a trademark used herein under license. Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 BM 09 08 07 For more information, contact Thomson Course Technology 25 Thomson Place Boston, Massachusetts 02210 Or find us on the World Wide Web at: www.course.com
C6394_FM_CTP.4c.indd ii
ALL RIGHTS RESERVED. No part of this work covered by the copyright hereon may be reproduced or used in any form or by any means — graphic, electronic, or mechanical, including photocopying, recording, taping, Web distribution, or information storage and retrieval systems — without the written permission of the publisher. For permission to use material from this text or product, submit a request online at http://www.thomsonrights.com
Thomson Course Technology, the Thomson Course Technology logo, the Shelly Cashman Series® are registered trademarks used under license. All other names used herein are for identification purposes only and are trademarks of their respective owners. Thomson Course Technology reserves the right to revise this publication and make changes from time to time in its content without notice. ISBN 13: 978-1-4188-4344-1 ISBN: 1-4188-4344-X
Any additional questions about permissions can be submitted by email to
[email protected]
8/8/07 3:59:21 PM
Excel 2007 ®
Contents Preface To the Student
Microsoft Office
ix xiv
Excel 2007
CHAPTER ONE Creating a Worksheet and an Embedded Chart Objectives What Is Microsoft Office Excel 2007? Project — Worksheet with an Embedded Chart Overview Starting Excel To Start Excel The Excel Workbook The Worksheet Worksheet Window Status Bar Ribbon Formula Bar Mini Toolbar and Shortcut Menus Quick Access Toolbar Office Button Key Tips Selecting a Cell Entering Text To Enter the Worksheet Titles Entering Text in a Cell Correcting a Mistake while Typing AutoCorrect To Enter Column Titles To Enter Row Titles Entering Numbers To Enter Numbers Calculating a Sum To Sum a Column of Numbers Using the Fill Handle to Copy a Cell to Adjacent Cells To Copy a Cell to Adjacent Cells in a Row To Determine Multiple Totals at the Same Time Saving the Project To Save a Workbook Formatting the Worksheet Font Type, Style, Size, and Color To Change a Cell Style To Change the Font Type To Bold a Cell To Increase the Font Size of a Cell Entry To Change the Font Color of a Cell Entry To Center Cell Entries across Columns by Merging Cells
EX 1 EX 2 EX 2 EX 4 EX 6 EX 6 EX 7 EX 7 EX 9 EX 9 EX 9 EX 12 EX 12 EX 13 EX 14 EX 15 EX 15 EX 15 EX 17 EX 18 EX 19 EX 19 EX 19 EX 21 EX 22 EX 23 EX 24 EX 25 EX 26 EX 27 EX 28 EX 29 EX 30 EX 33 EX 34 EX 35 EX 36 EX 38 EX 38 EX 39 EX 40
To Format Column Titles and the Total Row To Format Numbers in the Worksheet To Adjust the Column Width Using the Name Box to Select a Cell To Use the Name Box to Select a Cell Other Ways to Select Cells Adding a 3-D Clustered Column Chart to the Worksheet To Add a 3-D Clustered Column Chart to the Worksheet Changing Document Properties and Saving Again To Change Document Properties To Save an Existing Workbook with the Same File Name Printing a Worksheet To Print a Worksheet Quitting Excel To Quit Excel with One Workbook Open Starting Excel and Opening a Workbook To Open a Workbook from Excel AutoCalculate To Use the AutoCalculate Area to Determine a Maximum Correcting Errors Correcting Errors while You Are Typing Data into a Cell Correcting Errors after Entering Data into a Cell Undoing the Last Cell Entry Clearing a Cell or Range of Cells Clearing the Entire Worksheet Excel Help To Search for Excel Help Chapter Summary Learn It Online Apply Your Knowledge Extend Your Knowledge Make It Right In the Lab Cases and Places
EX 42 EX 44 EX 46 EX 47 EX 47 EX 48 EX 49 EX 50 EX 54 EX 55 EX 56 EX 57 EX 58 EX 59 EX 59 EX 60 EX 60 EX 62 EX 62 EX 63 EX 63 EX 63 EX 65 EX 66 EX 66 EX 67 EX 67 EX 69 EX 70 EX 70 EX 72 EX 73 EX 74 EX 79
CHAPTER TWO Formulas, Functions, Formatting, and Web Queries Objectives Introduction Project — Worksheet with Formulas, Functions, and Web Queries Overview Entering the Titles and Numbers into the Worksheet
EX 81 EX 82 EX 82 EX 84 EX 87
iii
C6394_FM_CTP.4c.indd iii
8/8/07 3:59:22 PM
Contents iv
Microsoft Office Excel 2007 Comprehensive
Entering Formulas To Enter a Formula Using the Keyboard Arithmetic Operations Order of Operations To Enter Formulas Using Point Mode To Copy Formulas Using the Fill Handle Smart Tags and Option Buttons Using the AVERAGE, MAX, and MIN Functions To Determine the Average of a Range of Numbers Using the Keyboard and Mouse To Determine the Highest Number in a Range of Numbers Using the Insert Function Box To Determine the Lowest Number in a Range of Numbers Using the Sum Menu To Copy a Range of Cells across Columns to an Adjacent Range Using the Fill Handle Verifying Formulas Using Range Finder To Verify a Formula Using Range Finder Formatting the Worksheet To Change the Workbook Theme To Change the Background Color and Apply a Box Border to the Worksheet Title and Subtitle To Center Data in Cells and Format Dates Formatting Numbers Using the Ribbon To Apply an Accounting Style Format and Comma Style Format Using the Ribbon To Apply a Currency Style Format with a Floating Dollar Sign Using the Format Cells Dialog Box To Apply a Percent Style Format and Use the Increase Decimal Button Conditional Formatting To Apply Conditional Formatting Conditional Formatting Operators Changing the Widths of Columns and Heights of Rows To Change the Widths of Columns To Change the Heights of Rows Checking Spelling To Check Spelling on the Worksheet Additional Spell Checker Considerations Preparing to Print the Worksheet To Change the Worksheet’s Margins, Header, and Orientation in Page Layout View Previewing and Printing the Worksheet To Preview and Print a Worksheet To Print a Section of the Worksheet Displaying and Printing the Formulas Version of the Worksheet To Display the Formulas in the Worksheet and Fit the Printout on One Page Importing External Data from a Web Source Using a Web Query To Import Data from a Web Source Using a Web Query Changing the Worksheet Names To Change the Worksheet Names E-Mailing a Workbook from within Excel To E-Mail a Workbook from within Excel Chapter Summary Learn It Online Apply Your Knowledge Extend Your Knowledge Make It Right In the Lab Cases and Places
EX 90 EX 91 EX 92 EX 92 EX 93 EX 95 EX 96 EX 98 EX 99 EX 101 EX 102 EX 104 EX 106 EX 106 EX 107 EX 109 EX 110 EX 113 EX 114 EX 115 EX 116 EX 118 EX 118 EX 119 EX 121 EX 122 EX 122 EX 125 EX 127 EX 127 EX 129 EX 129 EX 130 EX 132 EX 132 EX 134 EX 135 EX 136 EX 137 EX 138 EX 140 EX 141 EX 142 EX 142 EX 143 EX 144 EX 145 EX 147 EX 148 EX 149 EX 156
CHAPTER THREE What-If Analysis, Charting, and Working with Large Worksheets Objectives Introduction
C6394_FM_CTP.4c.indd iv
EX 161 EX 162
Project — Financial Projection Worksheet with What-If Analysis and Chart Overview Rotating Text and Using the Fill Handle to Create a Series To Rotate Text and Use the Fill Handle to Create a Series of Month Names Using the Auto Fill Options Menu To Increase Column Widths and Enter Row Titles Copying a Range of Cells to a Nonadjacent Destination Area To Copy a Range of Cells to a Nonadjacent Destination Area Using the Paste Options Menu Using Drag and Drop to Move or Copy Cells Using Cut and Paste to Move Cells Inserting and Deleting Cells in a Worksheet To Insert a Row Inserting Columns Inserting Single Cells or a Range of Cells Deleting Columns and Rows Deleting Individual Cells or a Range of Cells Entering Numbers with Format Symbols To Enter Numbers with Format Symbols Freezing Worksheet Titles To Freeze Column and Row Titles Displaying a System Date To Enter and Format the System Date Absolute versus Relative Addressing To Enter a Formula Containing Absolute Cell References Making Decisions — The IF Function To Enter an IF Function To Copy Formulas with Absolute Cell References Using the Fill Handle Nested Forms of the IF Function Formatting the Worksheet To Assign Formats to Nonadjacent Ranges To Format the Worksheet Titles Copying a Cell’s Format Using the Format Painter Button To Copy a Cell’s Format Using the Format Painter Button Adding a 3-D Pie Chart to the Workbook To Draw a 3-D Pie Chart on a Separate Chart Sheet To Insert a Chart Title and Data Labels To Rotate the 3-D Pie Chart To Apply a 3-D Format to the Pie Chart To Explode the 3-D Pie Chart and Change the Color of a Slice Renaming and Reordering the Sheets and Coloring Their Tabs To Rename and Reorder the Sheets and Color Their Tabs Checking Spelling, Saving, Previewing, and Printing the Workbook Changing the View of the Worksheet To Shrink and Magnify the View of a Worksheet or Chart To Split a Window into Panes What-If Analysis To Analyze Data in a Worksheet by Changing Values To Goal Seek Goal Seeking Chapter Summary Learn It Online Apply Your Knowledge Extend Your Knowledge Make It Right In the Lab Cases and Places
EX 162 EX 165 EX 168 EX 169 EX 171 EX 173 EX 174 EX 175 EX 176 EX 177 EX 177 EX 177 EX 177 EX 179 EX 179 EX 180 EX 180 EX 180 EX 181 EX 181 EX 182 EX 183 EX 185 EX 186 EX 187 EX 189 EX 190 EX 192 EX 195 EX 195 EX 196 EX 199 EX 201 EX 201 EX 204 EX 205 EX 206 EX 209 EX 211 EX 213 EX 216 EX 216 EX 218 EX 220 EX 220 EX 222 EX 223 EX 224 EX 225 EX 227 EX 228 EX 229 EX 229 EX 230 EX 232 EX 233 EX 245
8/8/07 3:59:26 PM
Microsoft Office Excel 2007 Comprehensive Contents v
WEB FEATURE Creating Web Pages Using Excel Objectives Web Feature Introduction Project — Workbook with Chart Saved as a Web Page Overview Using Web Page Preview and Saving an Excel Workbook as a Web Page To Add a Button to the Quick Access Toolbar To Preview the Web Page To Save an Excel Workbook as a Web Page in a Newly Created Folder Saving Workbooks as Web Pages File Management Tools in Excel To View and Manipulate the Web Page Using a Browser Feature Summary In the Lab
CHAPTER FIVE Creating, Sorting, and Querying a Table EX 249 EX 250 EX 251 EX 252 EX 252 EX 252 EX 255 EX 256 EX 258 EX 259 EX 260 EX 261 EX 262
CHAPTER FOUR Financial Functions, Data Tables, and Amortization Schedules Objectives Introduction Project — Loan Payment Calculator with Data Table and Amortization Schedule Overview Adding Custom Borders and a Background Color to a Range To Add Custom Borders and a Background Color to a Range Creating Cell Names Based on Row Titles To Create Names Based on Row Titles More About Cell Names To Enter the Loan Amount Formula Using Names To Enter the PMT Function Other Financial Functions Using a Data Table to Analyze Worksheet Data To Create a Percent Series Using the Fill Handle To Define a Range as a Data Table More About Data Tables Adding a Pointer to the Data Table Using Conditional Formatting To Add a Pointer to the Data Table Creating an Amortization Schedule To Enter the Formulas in the Amortization Schedule To Copy the Formulas to Fill the Amortization Schedule Printing Sections of the Worksheet To Set Up a Worksheet to Print More About Print Options To Set the Print Area To Name and Print Sections of a Worksheet Protecting the Worksheet To Protect a Worksheet More About Worksheet Protection To Hide and Unhide a Sheet To Hide and Unhide a Workbook Formula Checking More About Background Formula Checking Chapter Summary Learn It Online Apply Your Knowledge Extend Your Knowledge Make It Right In the Lab Cases and Places
C6394_FM_CTP.4c.indd v
EX 265 EX 266 EX 266 EX 267 EX 272 EX 272 EX 276 EX 276 EX 278 EX 279 EX 280 EX 281 EX 284 EX 286 EX 288 EX 290 EX 291 EX 292 EX 294 EX 297 EX 301 EX 307 EX 307 EX 308 EX 309 EX 310 EX 313 EX 313 EX 315 EX 316 EX 317 EX 318 EX 320 EX 322 EX 323 EX 323 EX 325 EX 326 EX 327 EX 335
Objectives Introduction Project — Silver Photography Accessories Sales Rep Table Overview To Format a Range as a Table To Validate Data Data Validation Errors and Criteria To Modify a Table Quick Style To Enter Records into a Table Adding Computational Fields to the Table To Add New Fields to a Table Adding a Lookup Table To Use the VLOOKUP Function to Determine Letter Grades Guidelines for Creating a Table in Excel Conditional Formatting To Add a Conditional Formatting Rule with an Icon Set Working with Tables in Excel To Use the Total Row Check Box To Print the Table Sorting a Table To Sort a Table in Ascending Sequence by Name Using the Sort & Filter Button To Sort a Table Using the Sort Command on a Column Heading AutoFilter Menu To Sort a Table on Multiple Fields Using the Custom Sort Command Displaying Automatic Subtotals in a Table To Display Automatic Subtotals in a Table To Zoom Out on a Subtotaled Table and Use the Outline Feature To Remove Automatic Subtotals from a Table Querying a Table Using AutoFilter To Query a Table Using AutoFilter More About AutoFilter To Show All Records in a Table To Enter Custom Criteria Using AutoFilter Using a Criteria Range on the Worksheet To Create a Criteria Range on the Worksheet To Query a Table Using the Advanced Filter Dialog Box Extracting Records To Create an Extract Range and Extract Records More About the Criteria Range A Blank Row in the Criteria Range Using Multiple Comparison Criteria with the Same Field Comparison Criteria in Different Rows and below Different Fields Using Database Functions More About Using Database Functions Other Database Functions Using the SUMIF and COUNTIF Functions Saving a Workbook in Different File Formats To Save a Workbook in CSV File Format To Use Notepad to Open and Print the CSV File Chapter Summary Learn It Online Apply Your Knowledge Extend Your Knowledge Make It Right In the Lab Cases and Places
EX 337 EX 338 EX 338 EX 341 EX 346 EX 348 EX 350 EX 351 EX 353 EX 355 EX 355 EX 356 EX 359 EX 361 EX 361 EX 362 EX 364 EX 365 EX 368 EX 369 EX 369 EX 371 EX 372 EX 374 EX 375 EX 377 EX 379 EX 380 EX 380 EX 382 EX 382 EX 383 EX 385 EX 385 EX 386 EX 387 EX 388 EX 390 EX 390 EX 390 EX 390 EX 391 EX 392 EX 393 EX 393 EX 395 EX 396 EX 398 EX 399 EX 400 EX 400 EX 402 EX 404 EX 405 EX 414
8/8/07 3:59:29 PM
Contents vi
Microsoft Office Excel 2007 Comprehensive
CHAPTER SIX Creating Templates and Working with Multiple Worksheets and Workbooks Objectives Introduction Project — Profit Potential Worksheets with Cone Chart Overview Creating the Template To Enter Dummy Data in the Template Using the Fill Handle The ROUND Function and Entering Formulas in the Template To Enter Formulas Using Point Mode and Determine Totals in the Template To Save the Template Formatting the Template To Assign a Currency Style Using the Format Dialog Box To Create and Assign a Custom Format Code and a Comma Style Format To Create a New Style To Apply a New Style More About Using Styles Using Templates Creating a Workbook from a Template To Open a Template and Save It as a Workbook To Add a Worksheet to a Workbook To Copy the Contents of a Worksheet to Other Worksheets in a Workbook To Drill an Entry through Worksheets Referencing Cells in Other Sheets in a Workbook Entering a Sheet Reference To Enter and Copy 3-D References Using the Paste Button Menu More About Pasting Drawing the Clustered Cone Chart To Draw the Clustered Cone Chart To Add a Chart Title Using the WordArt Tool To Add a Text Box, Arrow, and Brace to the Chart Adding a Header and Footer, Changing the Margins, and Printing the Workbook To Add a Header and Footer, Change Margins, and Center the Printout Horizontally Selecting and Deselecting Sheets To Insert and Remove a Page Break To Hide Page Breaks Saving a Workbook as a PDF or XPS file The Find and Replace Commands To Find a String Working with the Find and Replace Dialog Box To Replace a String with Another String Consolidating Data by Linking Workbooks To Search for and Open Workbooks To Create a Workspace File Updating Links Chapter Summary Learn It Online Apply Your Knowledge Extend Your Knowledge Make It Right In the Lab Cases and Places
EX 417 EX 418 EX 418 EX 421 EX 423 EX 426 EX 428 EX 429 EX 433 EX 434 EX 436 EX 438 EX 440 EX 443 EX 444 EX 444 EX 446 EX 446 EX 447 EX 449 EX 451 EX 456 EX 456 EX 457 EX 460 EX 461 EX 462 EX 466 EX 469 EX 471 EX 472 EX 476 EX 478 EX 479 EX 480 EX 481 EX 481 EX 483 EX 483 EX 485 EX 486 EX 488 EX 490 EX 491 EX 492 EX 492 EX 494 EX 495 EX 496 EX 504
GRAPHICS FEATURE SmartArt and Images Objectives Graphics Feature Introduction
C6394_FM_CTP.4c.indd vi
EX 507 EX 508
Project — Adding SmartArt and Images to a Worksheet Overview Working with SmartArt Graphics To Open a Workbook, Turn Off Gridlines, and Insert an Organization Chart To Add Shapes and Modify Text in the Organization Chart To Change the Position of Shapes and Add Effects to the Organization Chart Using Images on a Worksheet To Insert and Modify an Image in the Worksheet Feature Summary In the Lab
EX 508 EX 508 EX 510 EX 510 EX 514 EX 518 EX 521 EX 522 EX 525 EX 526
CHAPTER SEVEN Using Macros and Visual Basic for Applications (VBA) with Excel Objectives Introduction Project — Caliber Steel 401(k) Investment Model Worksheet Overview Learning More about a Workbook Created by Someone Else To Unprotect a Password-Protected Worksheet Phase 1 — Recording a Macro and Assigning It to a Toolbar Button and Menu Command To Display the Developer Tab, Enable Macros, and Save a Workbook as a Macro-Enabled Workbook To Record a Macro to Print the Worksheet in Portrait Orientation Using the Fit to Option To Set the Macro Security Level to Medium More About Macro Security To Open a Workbook with a Macro and Execute the Macro To View and Print a Macro’s VBA Code To Add a Button to the Quick Access Toolbar, Assign the Button a Macro, and Use the Button Phase 2 — Creating a Procedure to Automate the 401(k) Investment Model Data Entry To Add a Command Button Control to the Worksheet To Set the Command Button Control Properties About the Command Button Control Code To Enter the New Data Button Procedure Using the Visual Basic Editor More About Visual Basic for Applications To Enter 401(k) Investment Model Data Using the New Data Button Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry To Add Controls to a User Interface Preparing to Set Properties To Set Properties of the Label Controls and Check Box Control To Set the Command Button Control Properties To Set the Employee Investment Scroll Bar Control Properties To Set the Employer Match Scroll Bar Control Properties To Set the Check Box Control Properties To Set Properties for the Annual Return and Years of Service Spin Button Controls To Set the Variable Label Control Properties To Resize and Reposition the Controls in the Personalization Center To Enter the Enter Name and Salary Button Procedure To Enter the Employee Investment Scroll Bar Procedure
EX 529 EX 530 EX 530 EX 533 EX 536 EX 538 EX 539 EX 540 EX 542 EX 545 EX 546 EX 546 EX 548 EX 549 EX 552 EX 554 EX 556 EX 558 EX 559 EX 562 EX 563
EX 567 EX 569 EX 574 EX 575 EX 582 EX 583 EX 584 EX 585 EX 586 EX 588 EX 590 EX 592 EX 594
8/8/07 3:59:32 PM
Microsoft© Office
Excel 2007 ®
Gary B. Shelly Thomas J. Cashman Jeffrey J. Quasney
THOMSON COURSE TECHNOLOGY
25 THOMSON PLACE
BOSTON MA 02210
Australia • Canada • Denmark • Japan • Mexico • New Zealand • Philippines • Puerto Rico • Singapore • South Africa • Spain • United Kingdom • United States
C6394_FM_CTP.4c.indd i
8/8/07 3:59:18 PM
Microsoft Office Excel 2007 Comprehensive Contents vii
To Enter the Employer Match Check Box Procedure To Enter the Employer Match Scroll Bar Procedure To Enter the Annual Return Spin Button Procedure To Enter the Years of Service Spin Button Procedure Digital Signatures Chapter Summary Learn It Online Apply Your Knowledge Extend Your Knowledge Make It Right In the Lab Cases and Places
EX 595 EX 596 EX 597 EX 599 EX 602 EX 604 EX 605 EX 605 EX 607 EX 609 EX 611 EX 622
CHAPTER EIGHT Formula Auditing, Data Validation, and Complex Problem Solving Objectives EX 625 Introduction EX 626 Project — Perfected Packaging Order Optimization Worksheet EX 627 Overview EX 630 About the Order Optimization Worksheet EX 632 Formula Auditing EX 633 To Trace Precedents EX 633 To Remove the Precedent Arrows EX 635 To Trace Dependents EX 636 To Remove the Dependent Arrows EX 637 Buttons in the Formula Auditing Group EX 637 Data Validation, Trial and Error, and Goal Seek EX 638 To Add Data Validation to Cells EX 639 To Open the Watch Window and Add Cell Watches EX 641 To Use Trial and Error to Attempt to Solve a Complex Problem EX 643 To Use the Goal Seek Command to Attempt to Solve a Complex Problem EX 645 To Circle Invalid Data and Clear Validation Circles EX 647 Using Solver to Solve Complex Problems EX 648 To Use Solver to Find the Optimal Solution to a Complex Problem EX 651 Working with Solver Options EX 656 To View the Solver Answer Report for Order 1 EX 658 Saving the Workbook with Passwords EX 659 To Save the Workbook with Passwords EX 660 Using Scenario Manager to Analyze Data EX 662 To Save the Current Data as a Scenario EX 663 To Add the Data for a New Scenario EX 666 To Use Solver to Find a New Solution EX 669 To View the Solver Answer Report for Order 2 EX 671 To Save the Second Solver Solution as a Scenario EX 672 To Show a Saved Scenario EX 675 Summarizing Scenarios EX 676 To Create a Scenario Summary Worksheet EX 678 Working with an Outlined Worksheet EX 679 To Create a Scenario PivotTable Worksheet EX 680 Preparing a Workbook for Distribution EX 682 To Inspect a Document for Hidden and Personal Information EX 683 Information Rights Management EX 685 To Check Compatibility and Save a Workbook Using the Excel 97-2003 Workbook File Format and Mark a Workbook as Final EX 686 Chapter Summary EX 689 Learn It Online EX 690 Apply Your Knowledge EX 690 Extend Your Knowledge EX 692 Make It Right EX 694
C6394_FM_CTP.4c.indd vii
In the Lab Cases and Places
EX 696 EX 702
CHAPTER NINE Importing Data, Working with PivotCharts, PivotTables, and Trendlines Objectives Introduction Project — FasToast Ovens Repairs Revenue Analysis Overview About the FasToast Ovens Repair Revenue Analysis Worksheet Importing Files To Import Data from a Text File into a Worksheet To Import Data from an Access Table into a Worksheet To Import Data from a Web Page into a Worksheet To Copy and Transpose Data from a Word Document to a Worksheet To Convert Text to Columns Importing XML Data To Replicate Formulas Collaborating and Tracking Changes on a Workbook To Share a Workbook and Collaborate on a Workbook To Insert a Comment To Turn On Track Changes Reviewing Tracked Changes To Open a Workbook and Review Tracked Changes Creating and Formatting PivotTables and PivotCharts To Create a PivotTable To Add Data to the PivotTable More About PivotTables To Change the View of a PivotTable To Filter a PivotTable Using a Page Field To Format a PivotTable To Switch Summary Functions in a PivotTable Summary Functions for PivotCharts and PivotTables To Create a PivotChart, Change the PivotChart Type, and Format the Chart To Change the View of a PivotChart Comparing and Merging Workbooks To Compare Workbooks To Merge Workbooks Adding a Trendline to a Chart To Add a Trendline to a Chart Saving Custom Views and Formatting a Worksheet Background To Save a Custom View of a Workbook To Format a Worksheet Background Chapter Summary Learn It Online Apply Your Knowledge Extend Your Knowledge Make It Right In the Lab Cases and Places
EX 705 EX 706 EX 707 EX 710 EX 713 EX 713 EX 713 EX 718 EX 721 EX 725 EX 729 EX 732 EX 733 EX 734 EX 735 EX 739 EX 740 EX 742 EX 742 EX 745 EX 746 EX 748 EX 748 EX 749 EX 752 EX 753 EX 755 EX 756 EX 756 EX 759 EX 760 EX 761 EX 763 EX 765 EX 765 EX 766 EX 767 EX 768 EX 770 EX 771 EX 771 EX 773 EX 775 EX 777 EX 783
COLLABORATION FEATURE Using SharePoint and Excel Services Objectives Collaboration Feature Introduction Project — Using SharePoint and Office SharePoint Server with Excel Overview SharePoint Services Creating a SharePoint List Viewing and Using a SharePoint List
EX 785 EX 786 EX 786 EX 788 EX 788 EX 789 EX 791
8/8/07 3:59:34 PM
Contents viii
Microsoft Office Excel 2007 Comprehensive
Saving a Workbook to a SharePoint Services Web Site Opening a Workbook from a SharePoint Services Web Site Working with Excel Services Choosing to Work with Excel Services Capabilities of Excel Services Feature Summary In the Lab
EX 792 EX 795 EX 797 EX 797 EX 797 EX 799 EX 799
APPENDIX A Project Planning Guidelines APP 1 APP 1 APP 1 APP 2 APP 2 APP 2
APPENDIX B Introduction to Microsoft Office 2007 What Is Microsoft Office 2007? Office 2007 and the Internet, World Wide Web, and Intranets Online Collaboration Using Office Using Microsoft Office 2007 Microsoft Office Word 2007 Microsoft Office Excel 2007 Microsoft Office Access 2007 Microsoft Office PowerPoint 2007 Microsoft Office Publisher 2007 Microsoft Office Outlook 2007 Microsoft Office 2007 Help Collaboration and SharePoint
APP 3 APP 4 APP 4 APP 4 APP 4 APP 5 APP 5 APP 6 APP 6 APP 6 APP 7 APP 7
APPENDIX C Microsoft Office Excel 2007 Help Using Microsoft Office Excel Help To Open the Excel Help Window The Excel Help Window Search Features Toolbar Buttons Searching Excel Help To Obtain Help Using the Type Words to Search for Text Box To Obtain Help Using the Help Links To Obtain Help Using the Help Table of Contents Obtaining Help while Working in Excel Use Help
C6394_FM_CTP.4c.indd viii
Using Web Folders to Publish Office 2007 Web Pages Using FTP to Publish Office 2007 Web Pages
APP 19 APP 20
APPENDIX E Customizing Microsoft Office Excel 2007
Appendices Using Project Planning Guidelines Determine the Project’s Purpose Analyze your Audience Gather Possible Content Determine What Content to Present to your Audience Summary
APPENDIX D Publishing Office 2007 Web Pages to a Web Server
APP 9 APP 10 APP 11 APP 11 APP 12 APP 13 APP 13 APP 15 APP 16 APP 17 APP 18
Changing Screen Resolution To Change the Screen Resolution Screen Resolution and the Appearance of the Ribbon in Office 2007 Programs Customizing the Excel Window To Minimize the Ribbon in Excel Customizing and Resetting the Quick Access Toolbar To Change the Location of the Quick Access Toolbar To Add Commands to the Quick Access Toolbar Using the Customize Quick Access Toolbar Menu To Add Commands to the Quick Access Toolbar Using the Shortcut Menu To Add Commands to the Quick Access Toolbar Using Excel Options To Remove a Command from the Quick Access Toolbar To Reset the Quick Access Toolbar Changing the Excel Color Scheme To Change the Excel Color Scheme
APP 21 APP 21 APP 24 APP 25 APP 25 APP 26 APP 26
APP 27 APP 28 APP 29 APP 32 APP 33 APP 34 APP 34
APPENDIX F Steps for the Windows XP User For the XP User of this Book To Start Excel To Save a Workbook To Open a Workbook To Insert a Picture
APP 35 APP 35 APP 36 APP 38 App 39
APPENDIX G Microsoft Business Certification Program What Is the Microsoft Business Certification Program? What Is the Microsoft Certified Application Specialist Certification? What Is the Microsoft Certified Application Professional Certification? Index Quick Reference Summary
APP 40 APP 40 APP 40 IND 1 QR 1
8/8/07 3:59:37 PM
Preface The Shelly Cashman Series® offers the finest textbooks in computer education. We are proud of the fact that our series of Microsoft Office 4.3, Microsoft Office 95, Microsoft Office 97, Microsoft Office 2000, Microsoft Office XP, and Microsoft Office 2003 textbooks have been the most widely used books in education. With each new edition of our Office books, we have made significant improvements based on the software and comments made by instructors and students. Microsoft Office 2007 contains more changes in the user interface and feature set than all other previous versions combined. Recognizing that the new features and functionality of Microsoft Office 2007 would impact the way that students are taught skills, the Shelly Cashman Series development team carefully reviewed our pedagogy and analyzed its effectiveness in teaching today’s Office student. An extensive customer survey produced results confirming what the series is best known for: its step-by-step, screen-by-screen instructions, its project-oriented approach, and the quality of its content. We learned, though, that students entering computer courses today are different from students taking these classes just a few years ago. Students today read less, but need to retain more. They need not only to be able to perform skills, but to retain those skills and know how to apply them to different settings. Today’s students need to be continually engaged and challenged to retain what they’re learning. As a result, we’ve renewed our commitment to focusing on the user and how they learn best. This commitment is reflected in every change we’ve made to our Office 2007 books.
Objectives of This Textbook Microsoft Office Excel 2007: Comprehensive Concepts and Techniques is intended for a ten-to-fifteen-week period in a course that teaches Excel 2007 as the primary component. No experience with a computer is assumed, and no mathematics beyond the high school freshman level is required. The objectives of this book are: • To offer an comprehensive presentation of Microsoft Office Excel 2007 • To expose students to practical examples of the computer as a useful tool • To acquaint students with the proper procedures to create workbooks and worksheets suitable for coursework, professional purposes, and personal use • To help students discover the underlying functionality of Excel 2007 so they can become more productive • To develop an exercise-oriented approach that allows learning by doing
The Shelly Cashman Approach Features of the Shelly Cashman Series Microsoft Office Excel 2007 books include:
• Project Orientation Each chapter in the book presents a project with a practical problem and complete solution in an easy-to-understand approach. • Plan Ahead Boxes The project orientation is enhanced by the inclusion of Plan Ahead boxes. These new features prepare students to create successful projects by encouraging them to think strategically about what they are trying to accomplish before they begin working. • Step-by-Step, Screen-by-Screen Instructions Each of the tasks required to complete a project is clearly identified throughout the chapter. Now, the step-by-step instructions provide a context beyond point-and-click. Each step explains why students are performing a task, or the result of performing a certain action. Found on the screens accompanying each step, call-outs give students the information they need to know when they need to know it. Now, we’ve used color to distinguish the content in the call-outs. The Explanatory call-outs (in black) summarize
C6394_FM_CTP.4c.indd ix
8/8/07 3:59:39 PM
Q&A
Preface x
Microsoft Office Excel 2007 Comprehensive
What is a maximized window? A maximized window fills the entire screen. When you maximize a window, the Maximize button changes to a Restore Down button.
Other Ways 1. Click Italic button on Mini toolbar 2. Right-click selected text, click Font on shortcut menu, click Font tab, click Italic in Font style list, click OK button 3. Click Font Dialog Box Launcher, click Font tab, click Italic in Font style list, click OK button
BTW
4. Press CTRL+I
Minimizing the Ribbon If you want to minimize the Ribbon, right-click the Ribbon and then click Minimize the Ribbon on the shortcut menu, double-click the active tab, or press CTRL+F1. To restore a minimized Ribbon, right-click the Ribbon and then click Minimize the Ribbon on the shortcut menu, double-click any top-level tab, or press CTRL+F1. To use commands on a minimized Ribbon, click the top-level tab.
what is happening on the screen and the Navigational call-outs (in red) show students where to click.
• Q&A Found within many of the step-by-step sequences, Q&As raise the kinds of questions students may ask when working through a step sequence and provide answers about what they are doing, why they are doing it, and how that task might be approached differently. • Experimental Steps These new steps, within our step-by-step instructions, encourage students to explore, experiment, and take advantage of the features of the Office 2007 new user interface. These steps are not necessary to complete the projects, but are designed to increase the confidence with the software and build problem-solving skills. • Thoroughly Tested Projects Unparalleled quality is ensured because every screen in the book is produced by the author only after performing a step, and then each project must pass Thomson Course Technology’s Quality Assurance program. • Other Ways Boxes and Quick Reference Summary The Other Ways boxes displayed at the end of most of the step-by-step sequences specify the other ways to do the task completed in the steps. Thus, the steps and the Other Ways box make a comprehensive reference unit. A Quick Reference Summary at the end of the book contains all of the tasks presented in the chapters, and all ways identified of accomplishing the tasks. • BTW These marginal annotations provide background information, tips, and answers to common questions that complement the topics covered, adding depth and perspective to the learning process. • Integration of the World Wide Web The World Wide Web is integrated into the Excel 2007 learning experience by (1) BTW annotations that send students to Web sites for up-to-date information and alternative approaches to tasks; (2) a Microsoft Business Certification Program Web page so students can prepare for the certification examinations; (3) a Quick Reference Summary Web page that summarizes the ways to complete tasks (mouse, Ribbon, shortcut menu, and keyboard); and (4) the Learn It Online section at the end of each chapter, which has chapter reinforcement exercises, learning games, and other types of student activities. • End-of-Chapter Student Activities Extensive student activities at the end of each chapter provide the student with plenty of opportunities to reinforce the materials learned in the chapter through hands-on assignments. Several new types of activities have been added that challenge the student in new ways to expand their knowledge, and to apply their new skills to a project with personal relevance.
Organization of This Textbook Microsoft Office Excel 2007: Comprehensive Concepts and Techniques consists of nine chapters on Microsoft Office Excel 2007, three special features, seven appendices, and a Quick Reference Summary.
End-of-Chapter Student Activities A notable strength of the Shelly Cashman Series Microsoft Office Excel 2007 books is the extensive student activities at the end of each chapter. Well-structured student activities can make the difference between students merely participating in a class and students retaining the information they learn. The activities in the Shelly Cashman Series Office books include the following. A concluding paragraph, followed by a listing of the tasks completed within a chapter together with the pages on which the step-by-step, screen-by-screen explanations appear. CHAPTER SUMMARY
C6394_FM_CTP.4c.indd x
8/8/07 3:59:41 PM
Every chapter features a Learn It Online section that is comprised of six exercises. These exercises include True/False, Multiple Choice, Short Answer, Flash Cards, Practice Test, and Learning Games. LEARN IT ONLINE
Preface
Microsoft Office Excel 2007 Comprehensive Preface xi
This exercise usually requires students to open and manipulate a file from the Data Files that parallels the activities learned in the chapter. To obtain a copy of the Data Files for Students, follow the instructions on the inside back cover of this text. APPLY YOUR KNOWLEDGE
This exercise allows students to extend and expand on the skills learned within the chapter. EXTEND YOUR KNOWLEDGE
This exercise requires students to analyze a document, identify errors and issues, and correct those errors and issues using skills learned in the chapter. MAKE IT RIGHT
Three all new in-depth assignments per chapter require students to utilize the chapter concepts and techniques to solve problems on a computer. IN THE LAB
Five unique real-world case-study situations, including Make It Personal, an open-ended project that relates to student’s personal lives, and one small-group activity. CASES AND PLACES
Instructor Resources CD-ROM The Shelly Cashman Series is dedicated to providing you with all of the tools you need to make your class a success. Information about all supplementary materials is available through your Thomson Course Technology representative or by calling one of the following telephone numbers: Colleges, Universities, and Continuing Ed departments, 1-800-648-7450; High Schools, 1-800-824-5179; and Career Colleges, Business, Government, Library and Resellers, 1-800-477-3692. The Instructor Resources CD-ROM for this textbook include both teaching and testing aids. The contents of each item on the Instructor Resources CD-ROM (ISBN 1-4239-1226-8) are described on the following pages. The Instructor’s Manual consists of Microsoft Word files, which include chapter objectives, lecture notes, teaching tips, classroom activities, lab activities, quick quizzes, figures and boxed elements summarized in the chapters, and a glossary page. The new format of the Instructor’s Manual will allow you to map through every chapter easily. INSTRUCTOR’S MANUAL
The Lecture Success System consists of intermediate files that correspond to certain figures in the book, allowing you to step through the creation of a project in a chapter during a lecture without entering large amounts of data. LECTURE SUCCESS SYSTEM
Sample syllabi, which can be customized easily to a course, are included. The syllabi cover policies, class and lab assignments and exams, and procedural information. SYLLABUS
Illustrations for every figure in the textbook are available in electronic form. Use this ancillary to present a slide show in lecture or to print transparencies for use in lecture with an overhead projector. If you have a personal computer and LCD device, this ancillary can be an effective tool for presenting lectures. FIGURE FILES
PowerPoint Presentations is a multimedia lecture presentation system that provides slides for each chapter. Presentations are based on chapter objectives. Use this presentation system to present well-organized lectures that are both interesting and knowledge based. PowerPoint Presentations provides consistent coverage at schools that use multiple lecturers. POWERPOINT PRESENTATIONS
Solutions are included for the end-of-chapter exercises, as well as the Chapter Reinforcement exercises. Rubrics and annotated solution files, as described below, are also included. SOLUTIONS TO EXERCISES
C6394_FM_CTP.4c.indd xi
8/8/07 3:59:42 PM
Preface xii
Microsoft Office Excel 2007 Comprehensive
The grading rubrics provide a customizable framework for assigning point values to the laboratory exercises. Annotated solution files that correspond to the grading rubrics make it easy for you to compare students’ results with the correct solutions whether you receive their homework as hard copy or via e-mail. RUBRICS AND ANNOTATED SOLUTION FILES
In the ExamView test bank, you will find our standard question types (40 multiple-choice, 25 true/false, 20 completion) and new objective-based question types (5 modified multiple-choice, 5 modified true/false and 10 matching). Critical Thinking questions are also included (3 essays and 2 cases with 2 questions each) totaling the test bank to 112 questions for every chapter with page number references, and when appropriate, figure references. A version of the test bank you can print also is included. The test bank comes with a copy of the test engine, ExamView, the ultimate tool for your objective-based testing needs. ExamView is a state-of-the-art test builder that is easy to use. ExamView enables you to create paper-, LAN-, or Web-based tests from test banks designed specifically for your Thomson Course Technology textbook. Utilize the ultraefficient QuickTest Wizard to create tests in less than five minutes by taking advantage of Thomson Course Technology’s question banks, or customize your own exams from scratch. TEST BANK & TEST ENGINE
The Lab Tests/Test Out exercises parallel the In the Lab assignments and are supplied for the purpose of testing students in the laboratory on the material covered in the chapter or testing students out of the course. LAB TESTS/TEST OUT
All the files that are required by students to complete the exercises are included. You can distribute the files on the Instructor Resources CD-ROM to your students over a network, or you can have them follow the instructions on the inside back cover of this book to obtain a copy of the Data Files for Students. ADDITIONAL ACTIVITIES FOR STUDENTS These additional activities consist of Chapter Reinforcement Exercises, which are true/false, multiple-choice, and short answer questions that help students gain confidence in the material learned. DATA FILES FOR STUDENTS
Assessment & Training Solutions SAM 2007
SAM 2007 helps bridge the gap between the classroom and the real world by allowing students to train and test on important computer skills in an active, hands-on environment. SAM 2007’s easy-to-use system includes powerful interactive exams, training or projects on critical applications such as Word, Excel, Access, PowerPoint, Outlook, Windows, the Internet, and much more. SAM simulates the application environment, allowing students to demonstrate their knowledge and think through the skills by performing real-world tasks. Designed to be used with the Shelly Cashman series, SAM 2007 includes built-in page references so students can print helpful study guides that match the Shelly Cashman series textbooks used in class. Powerful administrative options allow instructors to schedule exams and assignments, secure tests, and run reports with almost limitless flexibility.
Student Edition Labs Our Web-based interactive labs help students master hundreds of computer concepts, including input and output devices, file management and desktop applications, computer ethics, virus protection, and much more. Featuring up-to-the-minute content, eye-popping graphics, and rich animation, the highly interactive Student Edition Labs offer students an alternative way to learn through dynamic observation, step-by-step practice, and challenging review questions.
May not be copied, scanned, or duplicated, in whole or in part.
C6394_FM_CTP.4c.indd xii
8/8/07 3:59:42 PM
Microsoft Office Excel 2007 Comprehensive Preface xiii
Online Content Blackboard is the leading distance learning solution provider and class-management platform today. Thomson Course Technology has partnered with Blackboard to bring you premium online content. Instructors: Content for use with Microsoft Office Excel 2007: Comprehensive Concepts and Techniques is available in a Blackboard Course Cartridge and may include topic reviews, case projects, review questions, test banks, practice tests, custom syllabi, and more. Thomson Course Technology also has solutions for several other learning management systems. Please visit http://www.course.com today to see what’s available for this title.
CourseCasts Learning on the Go. Always Available…Always Relevant. Want to keep up with the latest technology trends relevant to you? Visit our site to find a library of podcasts, CourseCasts, featuring a “CourseCast of the Week,” and download them to your portable media player at http://coursecasts.course.com. Our fast-paced world is driven by technology. You know because you are an active participant — always on the go, always keeping up with technological trends, and always learning new ways to embrace technology to power your life. Ken Baldauf, a faculty member of the Florida State University (FSU) Computer Science Department, is responsible for teaching technology classes to thousands of FSU students each year. He knows what you know; he knows what you want to learn. He is also an expert in the latest technology and will sort through and aggregate the most pertinent news and information so you can spend your time enjoying technology, rather than trying to figure it out. Visit us at http://coursecasts.course.com to learn on the go!
CourseNotes Course Technology’s CourseNotes are six-panel quick reference cards that reinforce the most important and widely used features of a software application in a visual and user-friendly format. CourseNotes will serve as a great reference tool during and after the student completes the course. CourseNotes for Microsoft Office 2007, Word 2007, Excel 2007, Access 2007, PowerPoint 2007, Windows Vista, and more are available now!
About Our New Cover Look Learning styles of students have changed, but the Shelly Cashman Series’ dedication to their success has remained steadfast for over 30 years. We are committed to continually updating our approach and content to reflect the way today’s students learn and experience new technology. This focus on the user is reflected in our bold new cover design, which features photographs of real students using the Shelly Cashman Series in their courses. Each book features a different user, reflecting the many ages, experiences, and backgrounds of all of the students learning with our books. When you use the Shelly Cashman Series, you can be assured that you are learning computer skills using the most effective courseware available. We would like to thank the administration and faculty at the participating schools for their help in making our vision a reality. Most of all, we’d like to thank the wonderful students from all over the world who learn from our texts and now appear on our covers.
C6394_FM_CTP.4c.indd xiii
8/8/07 3:59:43 PM
Preface xiv
Microsoft Office Excel 2007 Comprehensive
To the Student . . . Getting the Most Out of Your Book
Welcome to Microsoft Office Excel 2007: Comprehensive Concepts and Techniques. You can save yourself a lot of time and gain a better understanding of the Office 2007 programs if you spend a few minutes reviewing the figures and callouts in this section. 1 PROJECT ORIENTATION
Each chapter’s project presents a practical problem and shows the solution in the first figure of the chapter. The project orientation lets you see firsthand how problems are solved from start to finish using application software and computers.
1
2 2 PROJECT PLANNING GUIDELINES AND PLAN AHEAD BOXES
Overall planning guidelines at the beginning of a chapter and Plan Ahead boxes throughout encourage you to think critically about how to accomplish the next goal before you actually begin working.
3 4
3 CONSISTENT STEP-BY-STEP, SCREEN-BY-SCREEN PRESENTATION
Chapter solutions are built using a step-by-step, screen-by-screen approach. This pedagogy allows you to build the solution on a computer as you read through the chapter. Generally, each step includes an explanation that indicates the result of the step.
5
4 4 MORE THAN JUST STEP-BY-STEP
4
C6394_FM_CTP.4c.indd xiv
BTW annotations in the margins of the book, Q&As in the steps, and substantive text in the paragraphs provide background information, tips, and answers to common questions that complement the topics covered, adding depth and perspective. When you finish with this book, you will be ready to use the Office programs to solve problems on your own. Experimental steps provide you with opportunities to step out on your own to try features of the programs, and pick up right where you left off in the chapter.
8/8/07 3:59:44 PM
5 OTHER WAYS BOXES AND QUICK REFERENCE SUMMARY
Preface
Microsoft Office Excel 2007 Comprehensive Preface xv
Other Ways boxes that follow many of the step sequences and a Quick Reference Summary at the back of the book explain the other ways to complete the task presented, such as using the mouse, Ribbon, shortcut menu, and keyboard.
5
6 EMPHASIS ON GETTING HELP WHEN YOU NEED IT
6
The first project of each application and Appendix C show you how to use all the elements of Office Help. Being able to answer your own questions will increase your productivity and reduce your frustrations by minimizing the time it takes to learn how to complete a task.
7
7 REVIEW, REINFORCEMENT, AND EXTENSION
7
7 7
After you successfully step through a project in a chapter, a section titled Chapter Summary identifies the tasks with which you should be familiar. Terms you should know for test purposes are bold in the text. The SAM Training feature provides the opportunity for addional reinforcement on important skills covered in each chapter. The Learn It Online section at the end of each chapter offers reinforcement in the form of review questions, learning games, and practice tests. Also included are exercises that require you to extend your learning beyond the book.
8
8
C6394_FM_CTP.4c.indd xv
8 LABORATORY EXERCISES
If you really want to learn how to use the programs, then you must design and implement solutions to problems on your own. Every chapter concludes with several carefully developed laboratory assignments that increase in complexity.
8/8/07 3:59:50 PM
This page intentionally left blank
C6394_FM_CTP.4c.indd xvi
8/8/07 3:59:57 PM
Microsoft Office Excel 2007
1
Creating a Worksheet and an Embedded Chart
Objectives You will have mastered the material in this chapter when you can: • Start and quit Excel
• Change document properties
• Describe the Excel worksheet
• Save a workbook a second time using the same file name
• Enter text and numbers • Use the Sum button to sum a range of cells
• Print a worksheet • Open a workbook
• Copy the contents of a cell to a range of cells using the fill handle
• Use the AutoCalculate area to determine statistics
• Save a workbook
• Correct errors on a worksheet
• Format cells in a worksheet
• Use Excel Help to answer questions
• Create a 3-D Clustered Column chart
C6179_Excel1_CTP.4c.indd 1
4/3/07 1:59:46 PM
Microsoft Office Excel 2007
1
Creating a Worksheet and an Embedded Chart What Is Microsoft Office Excel 2007? Microsoft Office Excel 2007 is a powerful spreadsheet program that allows users to organize data, complete calculations, make decisions, graph data, develop professional looking reports (Figure 1–1), publish organized data to the Web, and access real-time data from Web sites. The four major parts of Excel are: • Workbooks and Worksheets Workbooks are a collection of worksheets. Worksheets allow users to enter, calculate, manipulate, and analyze data such as numbers and text. The terms worksheet and spreadsheet are interchangeable. • Charts Excel can draw a variety of charts. • Tables Tables organize and store data within worksheets. For example, once a user enters data into a worksheet, an Excel table can sort the data, search for specific data, and select data that satisfies defined criteria. • Web Support Web support allows users to save Excel worksheets or parts of a worksheet in HTML format, so a user can view and manipulate the worksheet using a browser. Excel Web support also provides access to real-time data, such as stock quotes, using Web queries. This latest version of Excel makes it much easier than in previous versions to perform common functions by introducing a new style of user interface. It also offers the capability of creating larger worksheets, improved formatting and printing, improved charting and table functionality, industry-standard XML support that simplifies the sharing of data within and outside an organization, improved business intelligence functionality, and the capability of performing complex tasks on a server. In this chapter, you will create a worksheet that includes a chart. The data in the worksheet and chart includes sales data for several stores that a company owns and operates.
Project Planning Guidelines
The process of developing a worksheet that communicates specific information requires careful analysis and planning. As a starting point, establish why the worksheet is needed. Once the purpose is determined, analyze the intended users of the worksheet and their unique needs. Then, gather information about the topic and decide what to include in the worksheet. Finally, determine the worksheet design and style that will be most successful at delivering the message. Details of these guidelines are provided in Appendix A. In addition, each project developed in this book provides practical applications of these planning considerations.
Project — Worksheet with an Embedded Chart The project in this chapter follows proper design guidelines and uses Excel to create the worksheet shown in Figure 1–1. The worksheet contains sales data for Walk and Rock Music stores. The Walk and Rock Music product line includes a variety of MP3 music players, called Rock-It MP3, including players that show pictures and video, as well as a complete line of headphones and other accessories. The company sells its products at kiosks in several malls throughout the United States. By concentrating its stores near EX 2
C6179_Excel1_CTP.4c.indd 2
4/3/07 1:59:47 PM
Microsoft Office Excel 2007
colleges and universities and keeping the newest items in stock, the Walk and Rock Music stores quickly became trendy. As sales continued to grow in the past year, senior management requested an easy-to-read worksheet that shows product sales for the first quarter by region. In addition, they asked for a chart showing first quarter sales, because the president of the company likes to have a graphical representation of sales that allows him quickly to identify stronger and weaker product types by region.
data in worksheet
3-D Clustered Column chart
Figure 1–1
The first step in creating an effective worksheet is to make sure you understand what is required. The person or persons requesting the worksheet should supply their requirements in a requirements document. A requirements document includes a needs
EX 3
C6179_Excel1_CTP.4c.indd 3
4/3/07 1:59:47 PM
BTW
EX 4 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Excel 2007 Features With its what-if analysis tools, research capabilities, collaboration tools, streamlined user interface, smart tags, charting features, Web capabilities, hundreds of functions, and enhanced formatting capabilities, Excel 2007 is one of the easier and more powerful spreadsheet packages available.
statement, source of data, summary of calculations, and any other special requirements for the worksheet, such as charting and Web support. Figure 1–2 shows the requirements document for the new workbook to be created in this chapter.
BTW
requirements document
Worksheet Development Cycle Spreadsheet specialists do not sit down and start entering text, formulas, and data into a blank Excel worksheet as soon as they have a spreadsheet assignment. Instead, they follow an organized plan, or methodology, that breaks the development cycle into a series of tasks. The recommended methodology for creating worksheets includes: (1) analyze requirements (supplied in a requirements document); (2) design solution; (3) validate design; (4) implement design; (5) test solution; and (6) document solution.
Plan Ahead
Figure 1–2
Overview As you read this chapter, you will learn how to create the worksheet shown in Figure 1–1 by performing these general tasks: • Enter text in the worksheet • Add totals to the worksheet • Save the workbook that contains the worksheet • Format the text in the worksheet • Insert a chart in the worksheet • Save the workbook a second time using the same file name • Print the worksheet General Project Guidelines While creating an Excel worksheet, you need to make several decisions that will determine the appearance and characteristics of the finished worksheet. As you create the worksheet shown in Figure 1–1, you should follow these general guidelines: 1. Select titles and subtitles for the worksheet. Follow the less is more guideline. The less text in the titles and subtitles, the more impact the titles and subtitles will have. Use the fewest words possible to specify the information presented in the worksheet to the intended audience. (continued)
C6179_Excel1_CTP.4c.indd 4
4/3/07 1:59:49 PM
sketch of worksheet
Walk and Rock Music First Quarter Rock-It MP3 Sales Northeast
Southeast
Midwest
South
West
Total
Video $ 99,999.99 Mini Micro Flash Accessories
$ 99,999.99
$ 99,999.99
$ 99,999.99
$ 99,999.99
$ 99,999.99
Total
$999,999.99
$999,999.99
$999,999.99
$999,999.99
$999,999.99
$999,999.99
Excel Chapter 1
Project — Worksheet with an Embedded Chart EX 5
Legend of Product Types
Northeast
Southeast
Midwest
South
West
Figure 1–3 (continued) 2. Determine the contents for rows and columns. Rows typically contain information that is analogous to items in a list, such as the products sold by a company. Columns typically contain descriptive information about items in rows or contain information that helps to group the data in the worksheet, such as company regions.
Plan Ahead
3. Determine the calculations that are needed. You can decide to total data in a variety of ways, such as across rows or in columns. You also can include a grand total. 4. Determine where to save the workbook. You can store a workbook permanently, or save it, on a variety of storage media including a hard disk, USB flash drive, or CD. You also can indicate a specific location on the storage media for saving the workbook. 5. Identify how to format various elements of the worksheet. The overall appearance of a worksheet significantly affects its ability to communicate clearly. Examples of how you can modify the appearance, or format, of text include changing its shape, size, color, and position on the worksheet. 6. Decide on the type of chart needed. Excel includes the capability of creating many different types of charts, such as bar charts and pie charts. Each chart type relays a different message about the data in the worksheet. Choose a chart type that relays the message that you want to convey. 7. Establish where to position and how to format the chart. The position and format of the chart should command the attention of the intended audience. If possible, position the chart so that it prints with the worksheet data on a single page. When necessary, more specific details concerning the above guidelines are presented at appropriate points in the chapter. The chapter also will identify the actions performed and decisions made regarding these guidelines during the creation of the worksheet shown in Figure 1–1 on page EX 3.
C6179_Excel1_CTP.4c.indd 5
4/3/07 1:59:51 PM
EX 6 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
After carefully reviewing the requirements document (Figure 1–2 on page EX 4) and necessary decisions, the next step is to design a solution or draw a sketch of the worksheet based on the requirements, including titles, column and row headings, location of data values, and the 3-D Clustered Column chart, as shown in Figure 1–3 on page EX 5. The dollar signs, 9s, and commas that you see in the sketch of the worksheet indicate formatted numeric values. With a good understanding of the requirements document, an understanding of the necessary decisions, and a sketch of the worksheet, the next step is to use Excel to create the worksheet and chart.
Starting Excel If you are using a computer to step through the project in this chapter and you want your screen to match the figures in this book, you should change your computer’s resolution to 1024 ⳯ 768. For information about how to change a computer’s resolution, read Appendix E.
To Start Excel The following steps, which assume Windows Vista is running, start Excel based on a typical installation of Microsoft Office on your computer. You may need to ask your instructor how to start Excel for your computer. Note: If you are using Windows XP, see Appendix F for alternate steps.
1 • Click the Start button on the Windows Vista taskbar to display the Start menu.
• Click All Programs at the bottom of left pane on the the Start menu to display the All Programs list.
• Click Microsoft Office in the All Programs list to display the Microsoft Office list (Figure 1–4). Windows Vista displays programs and folders on the Start menu above the Start button
Microsoft Office folder Microsoft Office list shows contents of Microsoft Office folder Microsoft Office Excel 2007 command
Windows Vista taskbar
Start button
C6179_Excel1_CTP.4c.indd 6
All Programs list is displayed in left pane of Start menu
Figure 1–4
right pane of Start menu shows commonly used folders and commands
4/3/07 1:59:52 PM
Close button
2 • Click Microsoft Office Excel 2007 to start Excel and display a new blank workbook titled Book1 in the Excel window (Figure 1–5).
• If the Excel window is not maximized, click the Maximize button next to the Close button on its title bar to maximize the window.
title bar
title of blank workbook is Book1
maximized Excel window
Maximize button changed to Restore Down button because window is maximized
Excel Chapter 1
The Excel Workbook EX 7
mouse pointer
• If the worksheet window in Excel is
Q&A
not maximized, click the Maximize button next to the Close button on its title bar to maximize the worksheet window within Excel. What is a maximized window? A maximized window fills the entire screen. When you maximize a window, the Maximize button changes to a Restore Down button. When you restore a maximized window, the window returns to its previous size and the Restore Down button changes to a Maximize button.
blank worksheet
Windows Vista taskbar displays Microsoft Excel program button, indicating Excel is running
Figure 1–5 Other Ways 1. Double-click Excel 2007 icon on desktop, if one is present
The Excel Workbook
The Worksheet The worksheet is organized into a rectangular grid containing vertical columns and horizontal rows. A column letter above the grid, also called the column heading, identifies each column. A row number on the left side of the grid, also called the row heading, identifies
C6179_Excel1_CTP.4c.indd 7
BTW
The Excel window consists of a variety of components to make your work more efficient and worksheets more professional. These include the document window, Ribbon, Mini toolbar and shortcut menus, Quick Access Toolbar, and Office Button. Some of these components are common to other Microsoft Office 2007 programs; others are unique to Excel. When Excel starts, it creates a new blank workbook, called Book1. The workbook (Figure 1–6) is like a notebook. Inside the workbook are sheets, each of which is called a worksheet. Excel opens a new workbook with three worksheets. If necessary, you can add additional worksheets as long as your computer has enough memory to accommodate them. Each worksheet has a sheet name that appears on a sheet tab at the bottom of the workbook. For example, Sheet1 is the name of the active worksheet displayed in the Book1 workbook. If you click the sheet tab labeled Sheet2, Excel displays the Sheet2 worksheet. The project in this chapter uses only the Sheet1 worksheet.
2. Click Microsoft Office Excel 2007 on Start menu
Excel Help Help with Excel is no further away than the Help button on the right side of the Ribbon. Click the Help button, type help in the ‘Type words to search for’ box, and then press the ENTER key. Excel responds with a list of topics you can click to learn about obtaining Help on any Excel-related topic. To find out what is new in Excel 2007, type what is new in Excel in the ‘Type words to search for’ box.
4/3/07 1:59:54 PM
EX 8 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
each row. With the screen resolution set to 1024 ⳯ 768 and the Excel window maximized, Excel displays 15 columns (A through O) and 25 rows (1 through 25) of the worksheet on the screen, as shown in Figure 1–6. Sheet 1 worksheet
Name box with active cell reference mouse pointer
row heading 11
column heading N
heavy border surrounds active cell
worksheet window
highlighted row and column headings indicate cell A1 is active
gridlines
cell D11
scroll boxes
number of worksheets available in workbook limited only by amount of memory on computer
view buttons; default is Normal view
tab scrolling buttons
scroll bars
tab split box adjusts size of displayed document
sheet tabs mode indicator status bar
Microsoft Excel program button
scroll arrows
BTW
Figure 1–6 Worksheet Development The key to developing a useful worksheet is careful planning. Careful planning can reduce your effort significantly and result in a worksheet that is accurate, easy to read, flexible, and useful. When analyzing a problem and designing a worksheet solution, you should follow these steps: (1) define the problem, including need, source of data, calculations, charting, and Web or special requirements; (2) design the worksheet; (3) enter the data and formulas; and (4) test the worksheet.
C6179_Excel1_CTP.4c.indd 8
The intersection of each column and row is a cell. A cell is the basic unit of a worksheet into which you enter data. Each worksheet in a workbook has 16,384 columns and 1,048,576 rows for a total of 17,179,869,180 cells. Only a small fraction of the active worksheet appears on the screen at one time. A cell is referred to by its unique address, or cell reference, which is the coordinates of the intersection of a column and a row. To identify a cell, specify the column letter first, followed by the row number. For example, cell reference D11 refers to the cell located at the intersection of column D and row 11 (Figure 1–6). One cell on the worksheet, designated the active cell, is the one into which you can enter data. The active cell in Figure 1–6 is A1. The active cell is identified in three ways. First, a heavy border surrounds the cell; second, the active cell reference shows immediately above column A in the Name box; and third, the column heading A and row heading 1 are highlighted so it is easy to see which cell is active (Figure 1–6). The horizontal and vertical lines on the worksheet itself are called gridlines. Gridlines make it easier to see and identify each cell in the worksheet. If desired, you can turn the gridlines off so they do not show on the worksheet, but it is recommended that you leave them on for now. The mouse pointer in Figure 1–6 has the shape of a block plus sign. The mouse pointer appears as a block plus sign whenever it is located in a cell on the worksheet. Another common shape of the mouse pointer is the block arrow. The mouse pointer turns into the block arrow whenever you move it outside the worksheet or when you drag cell contents between rows or columns. The other mouse pointer shapes are described when they appear on the screen.
4/3/07 1:59:56 PM
The Worksheet Size and Window Excel’s 16,384 columns and 1,048,576 rows make for a huge worksheet that – if you could imagine – takes up the entire side of a building to display in its entirety. Your computer screen, by comparison, is a small window that allows you to view only a minute area of the worksheet at one time. While you cannot see the entire worksheet, you can move the window over the worksheet to view any part of it.
Increasing the Viewing Area You can increase the size of the Excel window or viewing area to show more of the worksheet. Two ways exist to increase what you can see in the viewing area: (1) on the View tab on the Ribbon, click Full Screen; and (2) change to a higher resolution. See Appendix E for information about how to change to a higher resolution.
You view the portion of the worksheet displayed on the screen through a worksheet window (Figure 1–6). The default (preset) view is normal view. Below and to the right of the worksheet window are scroll bars, scroll arrows, and scroll boxes that you can use to move the worksheet window around to view different parts of the active worksheet. To the right of the sheet tabs at the bottom of the screen is the tab split box. You can drag the tab split box to increase or decrease the view of the sheet tabs (Figure 1–6). When you decrease the view of the sheet tabs, you increase the length of the horizontal scroll bar, and vice versa.
Status Bar The status bar is located immediately above the Windows Vista taskbar at the bottom of the screen (Figure 1–6). The status bar presents information about the worksheet, the function of the button the mouse pointer is pointing to, or the mode of Excel. Mode indicators, such as Enter and Ready, appear on the status bar and specify the current mode of Excel. When the mode is Ready, Excel is ready to accept the next command or data entry. When the mode indicator reads Enter, Excel is in the process of accepting data through the keyboard into the active cell. Keyboard indicators, such as Scroll Lock, show which toggle keys are engaged. Keyboard indicators appear to the right of the mode indicator. Toward the right edge of the status bar are buttons and controls you can use to change the view of a document and adjust the size of the displayed document.
Ribbon The Ribbon, located near the top of the Excel window, is the control center in Excel (Figure 1–7a). The Ribbon provides easy, central access to the tasks you perform while creating a worksheet. The Ribbon consists of tabs, groups, and commands. Each tab surrounds a collection of groups, and each group contains related commands. Home tab
formula bar
Excel Chapter 1
BTW
Worksheet Window
BTW
Worksheet Window EX 9
top-level tabs
Ribbon
Name box
(a) The Excel Ribbon
groups
formula bar sizing handle
formula bar expand button
top-level tabs
Ribbon minimized
(b) The Excel Ribbon Minimized Figure 1–7
C6179_Excel1_CTP.4c.indd 9
4/3/07 2:00:00 PM
BTW
EX 10 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Minimizing the Ribbon If you want to minimize the Ribbon, right-click the Ribbon and then click Minimize the Ribbon on the shortcut menu, double-click the active tab, or press CTRL+F1. To restore a minimized Ribbon, right-click the Ribbon and then click Minimize the Ribbon on the shortcut menu, double-click any top-level tab, or press CTRL+F1. To use commands on a minimized Ribbon, click the top-level tab.
When you start Excel, the Ribbon displays seven top-level tabs: Home, Insert, Page Layout, Formulas, Data, Review, and View. The Home tab, called the primary tab, contains groups with the more frequently used commands. To display a different tab on the Ribbon, click the top-level tab. That is, to display the Insert tab, click Insert on the Ribbon. To return to the Home tab, click Home on the Ribbon. The tab currently displayed is called the active tab. To display more of the document in the document window, some users prefer to minimize the Ribbon, which hides the groups on the Ribbon and displays only the toplevel tabs (Figure 1–7b). To use commands on a minimized Ribbon, click the top-level tab. Each time you start Excel, the Ribbon appears the same way it did the last time you used Excel. The chapters in this book, however, begin with the Ribbon appearing as it did at the initial installation of the software. If you are stepping through this chapter on a computer and you want your Ribbon to match the figures in this book, read Appendix E. In addition to the top-level tabs, Excel displays other tabs, called contextual tabs, when you perform certain tasks or work with objects such as charts or tables. If you insert a chart in the worksheet, for example, the Chart Tools tab and its related subordinate Design tab appear (Figure 1–8). When you are finished working with the chart, the Chart Tools and Design tabs disappear from the Ribbon. Excel determines when contextual tabs should appear and disappear, based on the tasks you perform. contextual tab gallery scroll arrows
button
in-Ribbon gallery
button arrow
More button
Figure 1–8
Ribbon commands include buttons, boxes (text boxes, check boxes, etc.), and galleries (Figure 1–8). A gallery is a set of choices, often graphical, arranged in a grid or in a list. You can scroll through choices on an in-Ribbon gallery by clicking the gallery’s scroll arrows. An in-Ribbon gallery shows common gallery choices on the Ribbon rather than in a dropdown list. Or, you can click a gallery’s More button to view more gallery options on the screen at a time. Some buttons and boxes have arrows that, when clicked, also display a gallery; others always cause a gallery to be displayed when clicked. Most galleries support live preview, which is a feature that allows you to point to a gallery choice and see its effect in the worksheet without actually selecting the choice (Figure 1–9).
C6179_Excel1_CTP.4c.indd 10
4/3/07 2:00:02 PM
Some commands on the Ribbon display an image to help you remember their function. When you point to a command on the Ribbon, all or part of the command glows in shades of yellow and orange, and an Enhanced ScreenTip appears on the screen. An Enhanced ScreenTip is an on-screen note that provides the name of the command, available keyboard shortcut(s), a description of the command, and sometimes instructions for how to obtain Help about the command (Figure 1–10). Enhanced ScreenTips are more detailed than a typical ScreenTip, which usually displays only the name of the command. The lower-right corner of some groups on the Ribbon has a small arrow, called a Dialog Box Launcher, that when clicked displays a dialog box or a task pane (Figure 1–11). A dialog box contains additional commands and options for the group. When presented with a dialog box, you make selections and must close the dialog box before returning to the worksheet. A task pane, by contrast, is a window that contains additional commands and can stay open and visible while you work on the worksheet.
Excel Chapter 1
Worksheet Window EX 11 clicking Themes button displays gallery
as you move mouse pointer from one gallery option to next, Excel shows preview of style in document, so you can decide whether you want to select option
worksheet style changes to Foundry as you point to that style in the gallery
Figure 1–9
mouse pointer on Paste button arrow Enhanced ScreenTip for Paste button arrow image of clipboard helps to identify Paste button
clicking Dialog Box Launcher in Clipboard group displays Clipboard task pane
clicking Dialog Box Launcher in Font group displays Format Cells dialog box
Figure 1–10
Format Cells dialog box
Clipboard task pane
Figure 1–11
C6179_Excel1_CTP.4c.indd 11
4/3/07 2:00:03 PM
EX 12 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Formula Bar The formula bar appears below the Ribbon (Figure 1–12a). As you type, Excel displays the entry in the formula bar. You can make the formula bar larger by dragging the sizing handle (Figure 1–7) on the formula bar or clicking the expand button to the right of the formula bar. Excel also displays the active cell reference in the Name box on the left side of the formula bar.
Mini Toolbar and Shortcut Menus The Mini toolbar, which appears automatically based on tasks you perform (such as selecting text), contains commands related to changing the appearance of text in a worksheet. All commands on the Mini toolbar also exist on the Ribbon. The purpose of the Mini toolbar is to minimize mouse movement. For example, if you want to format text using a command that currently is not displayed on the active tab, you can use the command on the Mini toolbar — instead of switching to a different tab to use the command. When the Mini toolbar appears, it initially is transparent (Figure 1–12a). If you do not use the transparent Mini toolbar, it disappears from the screen. To use the Mini toolbar, move the mouse pointer into the toolbar, which causes the Mini toolbar to change from a transparent to bright appearance (Figure 1–12b).
formula bar
sizing handle commands on Mini toolbar are also on Ribbon
Name box transparent Mini toolbar
bright Mini toolbar
(b) Bright Mini Toolbar
(a) Transparent Mini Toolbar Figure 1–12
A shortcut menu, which appears when you right-click an object, is a list of frequently used commands that relate to the right-clicked object. If you right-click an item in the document window such as a cell, Excel displays both the Mini toolbar and a shortcut menu (Figure 1–13). right-clicked text Mini toolbar
shortcut menu
Figure 1–13
C6179_Excel1_CTP.4c.indd 12
4/3/07 2:00:06 PM
The Quick Access Toolbar, located by default above the Ribbon, provides easy access to frequently used commands (Figure 1–14a). The commands on the Quick Access Toolbar always are available, regardless of the task you are performing. Initially, the Quick Access Toolbar contains the Save, Undo, and Redo buttons. If you click the Customize Quick Access Toolbar button, Excel provides a list of commands you quickly can add to and remove from the Quick Access Toolbar (Figure 1–14b). You also can add other commands to or delete commands from the Quick Access Toolbar so that it contains the commands you use most often. As you add commands to the Quick Access Toolbar, its commands may interfere with the workbook title on the title bar. For this reason, Excel provides an option of displaying the Quick Access Toolbar below the Ribbon (Figure 1–14c). Save button
Undo button
Redo button Quick Access Toolbar positioned above Ribbon
Customize Quick Access Toolbar button
Quick Access Toolbar Commands To add a Ribbon command as a button to the Quick Access Toolbar, right-click the command on the Ribbon and then click Add to Quick Access Toolbar on the shortcut menu. To delete a button from the Quick Access Toolbar, right-click the button on the Quick Access Toolbar and then click Remove from Quick Access Toolbar on the shortcut menu. To display the Quick Access Toolbar below the Ribbon, right-click the Quick Access Toolbar and then click Show Quick Access Toolbar Below the Ribbon on the shortcut menu.
Excel Chapter 1
Quick Access Toolbar
BTW
Worksheet Window EX 13
(a) Quick Access Toolbar above Ribbon
commands you quickly can add to or delete from Quick Access Toolbar
Customize Quick Access Toolbar menu
Quick Access Toolbar positioned below Ribbon
(c) Quick Access Toolbar below Ribbon
(b) Customize Quick Access Toolbar Menu Figure 1–14
Each time you start Excel, the Quick Access Toolbar appears the same way it did the last time you used Excel. The chapters in this book, however, begin with the Quick Access Toolbar appearing as it did at the initial installation of the software. If you are stepping through this chapter on a computer and you want your Quick Access Toolbar to match the figures in this book, you should reset your Quick Access Toolbar. For more information about how to reset the Quick Access Toolbar, read Appendix E.
C6179_Excel1_CTP.4c.indd 13
4/3/07 2:00:09 PM
EX 14 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Office Button While the Ribbon is a control center for creating worksheets, the Office Button is a central location for managing and sharing workbooks. When you click the Office Button, located in the upper-left corner of the window, Excel displays the Office Button menu (Figure 1–15). A menu contains a list of commands. Office Button
list of recent Excel workbooks will appear here
clicking command with no arrow to its right will display dialog box
Office Button menu
Figure 1–15
When you click the New, Open, Save As, and Print commands on the Office Button menu, Excel displays a dialog box with additional options. The Save As, Print, Prepare, Send, and Publish commands have an arrow to their right. If you point to a button that includes an arrow, Excel displays a submenu, which is a list of additional commands associated with the selected command (Figure 1–16). For the Prepare, Send, and Publish commands that do not display a dialog box when clicked, you can point either to the command or the arrow to display the submenu.
submenu
pointing to command with arrow causes a submenu to be displayed
for commands that contain an arrow, pointing to command or to arrow causes submenu to be displayed
Figure 1–16
C6179_Excel1_CTP.4c.indd 14
4/3/07 2:00:13 PM
Key Tips If you prefer using the keyboard, instead of the mouse, you can press the alt key on the keyboard to display a Key Tip badge, or keyboard code icon, for certain commands (Figure 1–17). To select a command using the keyboard, press its displayed code letter, or Key Tip. When you press a Key Tip, additional Key Tips related to the selected command appear. For example, to select the New command on the Office Button menu, press the alt key, then press the f key, then press the n key.
Excel Chapter 1
Entering Text EX 15
Key Tip badges appear when you press ALT key on keyboard
Figure 1–17
Selecting a Cell To enter data into a cell, you first must select it. The easiest way to select a cell (make it active) is to use the mouse to move the block plus sign mouse pointer to the cell and then click. An alternative method is to use the arrow keys that are located just to the right of the typewriter keys on the keyboard. An arrow key selects the cell adjacent to the active cell in the direction of the arrow on the key. You know a cell is selected, or active, when a heavy border surrounds the cell and the active cell reference appears in the Name box on the left side of the formula bar. Excel also changes the active cell’s column heading and row heading to a gold color.
BTW
To remove the Key Tip badges from the screen, press the alt key or the esc key on the keyboard until all Key Tip badges disappear or click the mouse anywhere in the Excel window.
Selecting a Cell You can select any cell by entering its cell reference, such as b4, in the Name box on the left side of the formula bar.
Entering Text In Excel, any set of characters containing a letter, hyphen (as in a telephone number), or space is considered text. Text is used to place titles, such as worksheet titles, column titles, and row titles, on the worksheet.
C6179_Excel1_CTP.4c.indd 15
4/3/07 2:00:15 PM
EX 16 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Plan Ahead
Select titles and subtitles for the worksheet. As previously stated, worksheet titles and subtitles should be as brief and meaningful as possible. As shown in Figure 1–18, the worksheet title, Walk and Rock Music, identifies the company for whom the worksheet is being created in Chapter 1. The worksheet subtitle, First Quarter Rock-It MP3 Sales, identifies the type of report.
Plan Ahead
Determine the contents of rows and columns. As previously mentioned, rows typically contain information that is similar to items in a list. For the Walk and Rock Music sales data, the list of product types meets this criterion. It is more likely that in the future, the company will add more product types as opposed to more regions. Each product type, therefore, should be placed in its own row. The row titles in column A (Video, Mini, Micro, Flash, Accessories, and Total) identify the numbers in each row. Columns typically contain descriptive information about items in rows or contain information that helps to group the data in the worksheet. In the case of the Walk and Rock Music sales data, the regions classify the sales of each product type. The regions, therefore, are placed in columns. The column titles in row 3 (Northeast, Southeast, Midwest, South, West, and Total) identify the numbers in each column.
worksheet title worksheet subtitle column titles
row titles
Figure 1–18
C6179_Excel1_CTP.4c.indd 16
4/3/07 2:00:16 PM
To Enter the Worksheet Titles The following steps show how to enter the worksheet titles in cells A1 and A2. Later in this chapter, the worksheet titles will be formatted so they appear as shown in Figure 1–18.
Excel Chapter 1
Entering Text EX 17
1 • Click cell A1 to make cell A1 the active cell (Figure 1–19).
heavy border indicates cell A1 selected
Figure 1–19
2 • Type Walk and Rock Music in cell
Cancel box
Q&A
A1, and then point to the Enter box in the formula bar. Why did the appearance of the formula bar change? Excel displays the title in the formula bar and in cell A1. When you begin typing a cell entry, Excel displays two additional boxes in the formula bar: the Cancel box and the Enter box. Clicking the Enter box completes an entry. Clicking the Cancel box cancels an entry. Q&A
Enter box
text displayed in formula bar ScreenTip identifies box to which mouse pointer is pointing
insertion point text in active cell overflows into adjacent cells to right
What is the vertical line in cell A1? In Figure 1–20, the text in cell A1 is followed by the insertion point. The insertion point is a blinking vertical line that indicates where the next typed character will appear.
Figure 1–20
C6179_Excel1_CTP.4c.indd 17
4/3/07 2:00:19 PM
EX 18 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
3 • Click the Enter box to complete the
Enter box and Cancel box no longer displayed
entry and enter the worksheet title in cell A1 (Figure 1–21).
text entered into cell A1
Figure 1–21
4 • Click cell A2 to select it. • Type First Quarter Rock-It MP3 Sales as the cell entry.
• Click the Enter box to complete the entry and enter the worksheet subtitle in cell A2 (Figure 1–22).
worksheet subtitle entered into cell A2
Figure 1–22
Other Ways 1. To complete entry, click any cell other than active cell 2. To complete entry, press ENTER key 3. To complete entry, press HOME, PAGE UP, PAGE DOWN, or END key 4. To complete entry, press UP, DOWN, LEFT, or RIGHT key.
C6179_Excel1_CTP.4c.indd 18
Entering Text in a Cell When you complete a text entry into a cell, a series of events occurs. First, Excel positions the text left-aligned in the cell. Left-aligned means the cell entry is positioned at the far left in the cell. Therefore, the W in the worksheet title, Walk and Rock Music, begins in the leftmost position of cell A1. Second, when the text is longer than the width of a column, Excel displays the overflow characters in adjacent cells to the right as long as these adjacent cells contain no data. In Figure 1–22, the width of cell A1 is approximately nine characters. The text consists of 19 characters. Therefore, Excel displays the overflow characters from cell A1 in cells B1 and C1, because cells B1 and C1 are empty. If cell B1 contained data, Excel would hide the overflow characters, so that only the first nine characters in cell A1 would appear
4/3/07 2:00:21 PM
Correcting a Mistake while Typing If you type the wrong letter and notice the error before clicking the Enter box or pressing the enter key, use the backspace key to delete all the characters back to and including the incorrect letter. To cancel the entire entry before entering it into the cell, click the Cancel box in the formula bar or press the esc key. If you see an error in a cell after entering the text, select the cell and retype the entry. Later in this chapter, additional error-correction techniques are discussed.
AutoCorrect The AutoCorrect feature of Excel works behind the scenes, correcting common mistakes when you complete a text entry in a cell. AutoCorrect makes three types of corrections for you: 1. Corrects two initial capital letters by changing the second letter to lowercase. 2.
Capitalizes the first letter in the names of days.
3.
Replaces commonly misspelled words with their correct spelling. For example, it will change the misspelled word recieve to receive when you complete the entry. AutoCorrect will correct the spelling of hundreds of commonly misspelled words automatically.
BTW
on the worksheet. Excel stores the overflow characters in cell A1 and displays them in the formula bar whenever cell A1 is the active cell. Third, when you complete an entry by clicking the Enter box, the cell in which the text is entered remains the active cell.
Excel Chapter 1
Entering Text EX 19
The ENTER Key When you first install Excel, the ENTER key not only completes the entry, but it also moves the selection to an adjacent cell. You can instruct Excel not to move the selection after pressing the ENTER key by clicking the Excel Options button on the Office Button menu, clicking the Advanced option, removing the checkmark from the ‘After pressing Enter, move selection’ check box, and then clicking the OK button.
To Enter Column Titles To enter the column titles in row 3, select the appropriate cell and then enter the text. The following steps enter the column titles in row 3.
1 • Click cell B3 to make cell B3 the active cell (Figure 1–23).
active cell reference in Name box changes to B3
B3 is active cell
Figure 1–23
C6179_Excel1_CTP.4c.indd 19
4/3/07 2:00:23 PM
EX 20 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
2 • Type Northeast in cell B3 (Figure 1–24).
Northeast displayed in formula bar and cell B3
Figure 1–24
3 • Press the RIGHT ARROW key to
Q&A
enter the column title, Northeast, in cell B3 and make cell C3 the active cell (Figure 1–25). Why is the RIGHT ARROW key used to complete the entry in the cell? If the next entry is in C3 is column active cell title an adjacent cell, use the arrow keys to complete the entry in a cell. When you press an arrow key to complete an entry, the adjacent cell in the direction of the arrow (up, down, left, or right) becomes Figure 1–25 the active cell. If the next entry is in a nonadjacent cell, complete an entry by clicking the next cell in which you plan to enter data. You also can click the Enter box or press the ENTER key and then click the appropriate cell for the next entry.
C6179_Excel1_CTP.4c.indd 20
4/3/07 2:00:24 PM
4 • Repeat Steps 2 and 3 to enter the remaining column titles in row 3; that is, enter Southeast in cell C3, Midwest in cell D3, South in cell E3, West in cell F3, and Total in cell G3 (complete the last entry in cell G3 by clicking the Enter box in the formula bar) (Figure 1–26).
Excel Chapter 1
Entering Text EX 21
column titles left-aligned in cells
Figure 1–26
To Enter Row Titles The next step in developing the worksheet for this project is to enter the row titles in column A. This process is similar to entering the column titles. The following steps enter the row titles in the worksheet.
1 • Click cell A4 to select it. • Type Video and then press the DOWN ARROW key to enter the row title and make cell A5 the active cell (Figure 1–27).
row title, Video, entered in cell A4
A5 is active cell
C6179_Excel1_CTP.4c.indd 21
Figure 1–27
4/3/07 2:00:26 PM
EX 22 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
2 • Repeat Step 1 to enter the remaining
Q&A
row titles in column A; that is, enter Mini in cell A5, Micro in cell A6, Flash in cell A7, Accessories in cell A8, and Total in cell A9 (Figure 1–28). Why is the text left-aligned in the cells? When you enter text, Excel automatically left-aligns the text in the cell. Excel treats any combination of numbers, spaces, and nonnumeric characters as text. For example, the following entries are text:
row titles left-aligned in cells
401AX21, 921-231, 619 321, 883XTY You can change the text alignment in a cell by realigning it. Several alignment techniques are discussed later in the chapter.
BTW
Figure 1–28
Numeric Limitations In Excel, a number can be between approximately –1 ⫻ 10308 and 1 ⫻ 10308, that is, between a negative 1 followed by 308 zeros and a positive 1 followed by 308 zeros. To enter a number such as 6,000,000,000,000,000, you can type 6,000,000,000,000,000, or you can type 6E15, which stands for 6 ⫻ 1015.
C6179_Excel1_CTP.4c.indd 22
Entering Numbers In Excel, you can enter numbers into cells to represent amounts. A number can contain only the following characters: 0123456789+-(),/.$%Ee If a cell entry contains any other keyboard character (including spaces), Excel interprets the entry as text and treats it accordingly. The use of the special characters is explained when they are used in this book.
4/3/07 2:00:29 PM
EX 23
To Enter Numbers The Walk and Rock Music First Quarter Rock-It MP3 Sales numbers used in Chapter 1 are summarized in Table 1–1. These numbers, which represent sales revenue for each of the product types and regions, must be entered in rows 4, 5, 6, 7, and 8.
Excel Chapter 1
Entering Numbers
Table 1–1 Walk and Rock Music First Quarter Rock-It MP3 Sales Northeast
Southeast
Midwest
South
West
Video
66145.15
79677.10
34657.66
52517.20
99455.49
Mini
31375.24
82937.72
66137.50
30681.82
43595.24
Micro
27596.37
92716.32
88294.78
87984.79
83380.72
Flash
27885.59
98800.57
24111.33
69737.51
51003.09
9715.12
31284.20
66527.37
40374.83
46321.88
Accessories
The following steps enter the numbers in Table 1–1 one row at a time.
1 • Click cell B4. • Type 66145.15 and then press the RIGHT ARROW key to enter the
Q&A
data in cell B4 and make cell C4 the active cell (Figure 1–29). Do I need to enter dollar signs, commas, or trailing zeros for the quarterly sales numbers? You are not required to type dollar signs, commas, or trailing zeros. C4 is active cell When you enter a dollar value that 66145.15 has cents, however, you must add entered the decimal point and the numbers in cell B4 representing the cents. Later in this chapter, the numbers will be forFigure 1–29 matted to use dollar signs, commas, and trailing zeros to improve the appearance and readability of the numbers.
2 • Enter 79677.1 in cell C4, 34657.66 in cell D4, 52517.2 in cell E4, and 99455.49 in cell F4 (Figure 1–30).
quarterly sales for Video product type entered in row 4 numbers right-aligned in cells
Figure 1–30
C6179_Excel1_CTP.4c.indd 23
4/3/07 2:00:30 PM
EX 24 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
3 • Click cell B5. • Enter the remaining first quarter sales numbers provided in Table 1–1 for each of the four remaining offerings in rows 5, 6, 7, and 8 to display the quarterly sales in the worksheet (Figure 1–31).
data entered into worksheet row title partially displayed because adjacent cell on right contains data
Figure 1–31
Calculating a Sum The next step in creating the worksheet is to perform any necessary calculations, such as calculating the column and row totals.
BTW
Entering Numbers as Text Sometimes, you will want Excel to treat numbers, such as Zip codes and telephone numbers, as text. To enter a number as text, start the entry with an apostrophe (‘).
BTW
Plan Ahead
Calculating Sums Excel calculates sums for a variety of data types. For example, Boolean values, such as TRUE and FALSE, can be summed. Excel treats the value of TRUE as 1 and the value of FALSE as 0. Times also can be summed. For example, Excel treats the sum of 1:15 and 2:45 as 4:00.
C6179_Excel1_CTP.4c.indd 24
Determine calculations that are needed. As stated in the requirements document in Figure 1–2 on page EX 4, totals are required for each region, each product type, and the company. The first calculation is to determine the quarterly sales for the stores in the Northeast region in column B. To calculate this value in cell B9, Excel must add, or sum, the numbers in cells B4, B5, B6, B7, and B8. Excel’s SUM function, which adds all of the numbers in a range of cells, provides a convenient means to accomplish this task. A range is a series of two or more adjacent cells in a column or row or a rectangular group of cells. For example, the group of adjacent cells B4, B5, B6, B7, and B8 is called a range. Many Excel operations, such as summing numbers, take place on a range of cells. After the total quarterly sales for the stores in the Northeast region in column B is determined, the totals for the remaining regions and totals for each product type will be determined.
4/3/07 2:00:33 PM
To Sum a Column of Numbers The following steps sum the numbers in column B.
1 • Click cell B9 to make
Home tab active
EX 25
Excel Chapter 1
Calculating a Sum
Sum button
it the active cell and then point to the Sum button on the Ribbon (Figure 1–32).
B9 is active cell
Figure 1–32
2 • Click the Sum
Q&A
button on the Ribbon to display =SUM(B4: B8) in the formula bar and in the active cell B9 (Figure 1–33).
SUM function in formula bar
B4:B8 in parentheses indicates range to be summed
How does Excel know which cells to sum? When you enter the SUM function using the Sum button, proposed range to sum surrounded Excel autoby moving border called marquee matically selects what it considers to be your choice of the range ScreenTip to sum. When proposing the range to sum, Excel first looks for a range of cells with numbers above the active cell and then to the left. If Excel proposes the wrong range, you can correct it by dragging through the correct range before pressing the ENTER key. You also can enter the correct range by typing the beginning cell reference, a colon (:), and the ending cell reference.
C6179_Excel1_CTP.4c.indd 25
SUM function displayed in active cell
Figure 1–33
4/3/07 2:00:34 PM
EX 26 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
3 • Click the Enter box in
Q&A
the formula bar to enter the sum of the first quarter sales for the five product types for the Northeast region in cell B9 (Figure 1-34).
SUM function assigned to active cell B9 shows in formula bar Sum button arrow
What is the purpose of the Sum button arrow?
sum of numbers in cells B4, B5, B6, B7, and B8
If you click the Sum button arrow on the right side of the Sum button (Figure 1–34), Excel displays a list of often-used functions from which you can choose. The list includes functions that allow you to determine the average, the number of items in the selected range, the minimum value, or the maximum value of a range of numbers.
Figure 1–34
Other Ways 1. Click Insert Function button in formula bar, select SUM in Select a function list, click OK button, select range, click OK button
Using the Fill Handle to Copy a Cell to Adjacent Cells
2. Click Sum button arrow on Ribbon, click More Functions, select SUM in Select a function list, click OK button, select range, click OK button
Excel also must calculate the totals for the Southeast in cell C9, the Midwest in cell D9, the South in cell E9, and for the West in cell F9. Table 1–2 illustrates the similarities between the entry in cell B9 and the entries required to sum the totals in cells C9, D9, E9, and F9.
3. Type = s in cell, select SUM from list, select range
Table 1–2 Sum Function Entries in Row 9
4. Press ALT + EQUAL SIGN (=) twice
Cell
Sum Function Entries
Remark
B9
=SUM(B4:B8)
Sums cells B4, B5, B6, B7, and B8
C9
=SUM(C4:C8)
Sums cells C4, C5, C6, C7, and C8
D9
=SUM(D4:D8)
Sums cells D4, D5, D6, D7, and D8
E9
=SUM(E4:E8)
Sums cells E4, E5, E6, E7, and E8
F9
=SUM(F4:F8)
Sums cells F4, F5, F6, F7, and F8
C6179_Excel1_CTP.4c.indd 26
4/3/07 2:00:37 PM
To place the SUM functions in cells C9, D9, E9, and F9, you could follow the same steps shown previously in Figures 1–32 through 1–34. A second, more efficient method is to copy the SUM function from cell B9 to the range C9:F9. The cell being copied is called the source area or copy area. The range of cells receiving the copy is called the destination area or paste area. Although the SUM function entries in Table 1–2 are similar, they are not exact copies. The range in each SUM function entry uses cell references that are one column to the right of the previous column. When you copy cell references, Excel automatically adjusts them for each new position, resulting in the SUM function entries illustrated in Table 1–2. Each adjusted cell reference is called a relative reference.
Excel Chapter 1
Using the Fill Handle to Copy a Cell to Adjacent Cells EX 27
To Copy a Cell to Adjacent Cells in a Row The easiest way to copy the SUM formula from cell B9 to cells C9, D9, E9, and F9 is to use the fill handle. The fill handle is the small black square located in the lower-right corner of the heavy border around the active cell. The following steps use the fill handle to copy cell B9 to the adjacent cells C9:F9.
1 • With cell B9 active, point to the fill handle (Figure 1–35).
mouse pointer changes to cross-hair indicating fill handle is selected
Figure 1–35
2 • Drag the fill handle to select the destination area, range C9:F9, to display a shaded border around the destination area, range C9:F9, and the source area, cell B9 (Figure 1–36). Do not release the mouse button. mouse pointer as dragging takes place, Excel displays border around destination area and source area
source area (cell B9)
destination area (range C9:F9)
Figure 1–36
C6179_Excel1_CTP.4c.indd 27
4/3/07 2:00:38 PM
EX 28 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
3 • Release the mouse button to copy the
Q&A
SUM function in cell B9 to the range C9:F9 (Figure 1–37) and calculate the sums in cells C9, D9, E9, and F9. no transparent blue background for cell B9 because it is active cell
What is the purpose of the Auto Fill Options button? When you copy one range to another, Excel displays an Auto Fill Options button (Figure 1–37). The Auto Fill Options button allows you to choose whether you want to copy the values from the source area to the destination area with formatting, without formatting, or copy only the format. To view the available fill options, click the Auto Fill Options button. The Auto Fill Options button disappears when you begin another activity.
heavy border and transparent blue background indicate range B9: F9 remains selected Auto Fill Options button remains on screen until you begin next activity
SUM function SUM(C4:C8) assigned to cell
SUM function SUM(D4:D8) assigned to cell
SUM function SUM(F4:F8) assigned to cell SUM function SUM(E4:E8) assigned to cell
Figure 1–37 Other Ways 1. Select source area, click Copy button on Ribbon, select destination area, click Paste button on Ribbon
2. Right-click source area, click Copy on shortcut menu, right-click destination area, click Paste on shortcut menu
3. Select source area and then point to border of range; while holding down CTRL key, drag source area to destination area
To Determine Multiple Totals at the Same Time The next step in building the worksheet is to determine the quarterly sales for each product type and total quarterly sales for the company in column G. To calculate these totals, you can use the SUM function much as it was used to total the quarterly sales by region in row 9. In this example, however, Excel will determine totals for all of the rows at the same time. The following steps illustrate this process.
1 • Click cell G4 to make it the active cell (Figure 1–38). mouse pointer is block plus sign
G4 is active cell
Figure 1–38
C6179_Excel1_CTP.4c.indd 28
4/3/07 2:00:40 PM
EX 29
2 • With the mouse pointer in cell G4 and in the shape of a block plus sign, drag the mouse pointer down to cell G9 to highlight the range G4:G9 with a transparent view (Figure 1–39).
Excel Chapter 1
Saving the Project
range G4:G9 selected
Figure 1–39
3 • Click the Sum
Sum button
button on the Ribbon to calculate and display the sums of the corresponding rows of sales in cells G4, G5, G6, G7, G8, and G9 (Figure 1–40).
4 • Select cell A10 to
totals for each row of numbers
Why does Excel create totals for each row? If each cell in a selected range is next to a row of numbers, Excel assigns the SUM function to each cell when you click the Sum button.
Figure 1–40
Saving the Project While you are building a worksheet in a workbook, the computer stores it in memory. When you save a workbook, the computer places it on a storage medium such as a USB flash drive, CD, or hard disk. A saved workbook is referred to as a file. A file name is the name assigned to a file when it is saved. It is important to save the workbook frequently for the following reasons: • The worksheet in memory will be lost if the computer is turned off or you lose electrical power while Excel is open.
BTW
Q&A
deselect the range G4:G9.
Saving Excel allows you to save a workbook in more than 30 different file formats. Choose the file format by clicking the ‘Save as type’ box arrow at the bottom of the Save As dialog box (Figure 1–41 on the next page). Excel Workbook is the default file format.
• If you run out of time before completing your workbook, you may finish your worksheet at a future time without starting over.
C6179_Excel1_CTP.4c.indd 29
4/3/07 2:00:43 PM
EX 30 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Plan Ahead
Determine where to save the workbook. When saving a workbook, you must decide which storage medium to use. • If you always work on the same computer and have no need to transport your projects to a different location, then your computer’s hard drive will suffice as a storage location. It is a good idea, however, to save a backup copy of your projects on a separate medium in case the file becomes corrupted or the computer’s hard drive fails. • If you plan to work on your workbooks in various locations or on multiple computers, then you should save your workbooks on a portable medium, such as a USB flash drive or CD. The workbooks used in this book are saved to a USB flash drive, which saves files quickly and reliably and can be reused. CDs are easily portable and serve as good backups for the final versions of workbooks because they generally can save files only one time.
To Save a Workbook You have performed many tasks while creating this project and do not want to risk losing the work completed thus far. Accordingly, you should save the workbook. The following steps save a workbook on a USB flash drive using the file name, Walk and Rock Music 1st Quarter Sales. Note: If you are using Windows XP, see Appendix F for alternate steps.
1 • With a USB flash drive connected to one of the computer’s USB Save button ports, click the Save button on the Quick Access Toolbar to display the Save As Navigation pane (your list may dialog box differ) (Figure 1–41).
Save As dialog box
Folders button is a toggle that causes Folders list to appear or disappear each time you click it
Documents is default folder (your default folder may differ)
Book1 displayed as default file name and selected in File name text box
• If the Navigation pane is not displayed in the Save As dialog box, click the Browse Folders button to expand the dialog box.
Details pane
default file type is Excel Workbook
• If a Folders list is
Q&A
displayed below the Folders button, click the Folders button to remove the Folders list. Do I have to save to a USB flash drive?
Browse Folders button changed to Hide Folders button because dialog box is expanded
Figure 1–41
No. You can save to any device or folder. A folder is a specific location on a storage medium. You can save to the default folder or a different folder. You also can create your own folders, which is explained later in this book.
C6179_Excel1_CTP.4c.indd 30
4/3/07 2:00:45 PM
2 • Type Walk and Rock
Q&A
Music 1st Quarter Sales in the File name text box to change the file name. Do not press the ENTER key after typing the file name (Figure 1–42).
Excel Chapter 1
Saving the Project EX 31
selected words in default file name automatically are replaced when you type new file name
What characters can I use in a file name?
clicking Cancel button will close Save As dialog box
A file name can have a maximum of 255 characters, including spaces. The only invalid characters are the backslash (\ ), slash (/), colon (:), asterisk (*), question mark (?), quotation mark (“), less than symbol (<), greater than symbol (>), and vertical bar (|).
text boxes allow you to add to or change Authors and Tags file properties, which can be displayed in dialog boxes that have a File list
Figure 1–42
3 • If Computer is not displayed in the Favorite Links section, drag the top or bottom edge of the Save As dialog box until Computer is displayed.
Favorite Links section
Navigation pane
• Click Computer in the
list of available drives (your list may differ)
Favorite Links section to display a list of available drives (Figure 1–43).
• If necessary, scroll until
Q&A
UDISK 2.0 (E :) appears in the list of available drives.
Computer selected workbook to be saved on USB flash drive
Why is my list of files, folders, and drives arranged and named differently from those shown in the figure?
Figure 1–43
Q&A
Your computer’s configuration determines how the list of files and folders is displayed and how drives are named. You can change the save location by clicking links on the Favorite Links section. How do I save the file if I am not using a USB flash drive? Use the same process, but be certain to select your device in the list of available drives.
C6179_Excel1_CTP.4c.indd 31
4/3/07 2:00:47 PM
EX 32 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
4 • Double-click
Q&A
UDISK 2.0 (E:) in the Save in list to select the USB flash drive, Drive E in this case, as the new save location (Figure 1–44). What if my USB flash drive has a different name or letter? It is very likely that your USB flash drive will have a different name and drive letter and be connected to a different port.
USB flash drive is new save location displayed in Address bar
Excel files currently saved on USB flash drive (Data Files for Students) are displayed in File list
Save button
Figure 1–44
5 • Click the Save button in the Save As
Q&A
dialog box to save the workbook on the USB flash drive with the file name, Walk and Rock Music 1st Quarter Sales (Figure 1–45). How do I know that Excel saved the workbook? While Excel is saving your file, it briefly displays a message on the status bar indicating the amount of the file saved. In addition, your USB drive may have a light that flashes during the save process.
workbook name changed from Book1 to new file name, Walk and Rock Music 1st Quarter Sales
saved worksheet remains in memory and displayed on screen
Figure 1–45 Other Ways 1. Click Office Button, click Save, type file name, select drive or folder, click Save button 2. Press CTRL+S or press SHIFT+F12, type file name, select drive or folder, click Save button
C6179_Excel1_CTP.4c.indd 32
4/3/07 2:00:50 PM
Formatting the Worksheet The text, numeric entries, and functions for the worksheet now are complete. The next step is to format the worksheet. You format a worksheet to emphasize certain entries and make the worksheet easier to read and understand. Figure 1–46a shows the worksheet before formatting. Figure 1–46b shows the worksheet after formatting. As you can see from the two figures, a worksheet that is formatted not only is easier to read but also looks more professional.
Excel Chapter 1
Formatting the Worksheet EX 33
(a) Before Formatting
(b) After Formatting Figure 1–46
C6179_Excel1_CTP.4c.indd 33
4/3/07 2:00:52 PM
EX 34 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Plan Ahead
Identify how to format various elements of the worksheet. To change the unformatted worksheet in Figure 1–46a to the formatted worksheet in Figure 1–46b, the following tasks must be completed: 1. Change the font type, change the font style to bold, increase the font size, and change the font color of the worksheet titles in cells A1 and A2. These changes make the worksheet title prominently display to the user and inform the user of the purpose of the worksheet. 2. Center the worksheet titles in cells A1 and A2 across columns A through G. 3. Format the body of the worksheet. The body of the worksheet, range A3:G9, includes the column titles, row titles, and numbers. Formatting the body of the worksheet changes the numbers to use a dollars-and-cents format, with dollar signs in the first row (row 4) and the total row (row 9); adds underlining that emphasizes portions of the worksheet; and modifies the column widths to make the text and numbers readable.
BTW
BTW
The remainder of this section explains the process required to format the worksheet. Although the format procedures are explained in the order described above, you should be aware that you could make these format changes in any order. Modifying the column widths, however, usually is done last.
Fonts In general, use no more than two font types in a worksheet.
Fonts and Themes Excel uses default recommended fonts based on the workbook’s theme. A theme is a collection of fonts and color schemes. The default theme is named Office, and the two recommended fonts for the Office theme are Calibri and Cambria. Excel, however, allows you to apply any font to a cell or range as long as the font is installed on your computer.
C6179_Excel1_CTP.4c.indd 34
Font Type, Style, Size, and Color The characters that Excel displays on the screen are a specific font type, style, size, and color. The font type, or font face, defines the appearance and shape of the letters, numbers, and special characters. Examples of font types include Calibri, Cambria, Times New Roman, Arial, and Courier. Font style indicates how the characters are emphasized. Common font styles include regular, bold, underline, or italic. The font size specifies the size of the characters on the screen. Font size is gauged by a measurement system called points. A single point is about 1/72 of one inch in height. Thus, a character with a point size of 10 is about 10/72 of one inch in height. The font color defines the color of the characters. Excel can display characters in a wide variety of colors, including black, red, orange, and blue. When Excel begins, the preset font type for the entire workbook is Calibri, with a font size, font style, and font color of 11-point regular black. Excel allows you to change the font characteristics in a single cell, a range of cells, the entire worksheet, or the entire workbook.
4/3/07 2:00:54 PM
To Change a Cell Style Excel includes the capability of changing several characteristics of a cell, such as font type, font size, and font color, all at once by assigning a predefined cell style to a cell. The following steps assign the Title cell style to the worksheet title in cell A1.
1 • Click cell A1 to make
Home tab active
Excel Chapter 1
Formatting the Worksheet EX 35
Cell Styles button
cell A1 the active cell.
• Click the Cell Styles button on the Ribbon to display the A1 is Cell Styles active cell gallery (Figure 1–47).
Cell Styles gallery
Figure 1–47
2 • Point to the Title cell style in the Titles and Headings area of the Cell Styles gallery to see a live preview of the cell style in cell A1 (Figure 1–48).
live preview of Title cell style in cell A1
Title cell style
I Experiment • Point to several other
Q&A
cell styles in the Cell Styles gallery to see a live preview of other cell styles in cell A1.
Titles and Headings area
Why does the font type, font size, and font color change in cell A1 when I point to it? The change in cell A1 is a result of live preview. Live preview is a feature of Excel 2007 that allows you to preview cell styles as you point to them in the Cell Styles gallery.
C6179_Excel1_CTP.4c.indd 35
Figure 1–48
4/3/07 2:00:55 PM
EX 36 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
3 • Click the Title cell style
highlighted Bold button indicates bold font style selected
Cambria font type selected in Font box
font size 18 selected in Font Size box
Q&A
to apply the cell style to cell A1 (Figure 1–49). Why do several items in the Font group on the Ribbon change? The changes to the Font box, Bold button, and Font Size box indicate the font changes applied to the active cell, cell A1, as a result of applying the Title cell style.
Title cell style applied to cell A1
Figure 1–49
To Change the Font Type Different font types often are used in a worksheet to make it more appealing to the reader. The following steps show how to change the worksheet subtitle’s font type from Calibri to Cambria.
1 • Click cell A2 to make
Font box arrow
cell A2 the active cell.
• Click the Font box
Q&A
arrow on the Ribbon to display the Font gallery (Figure 1–50). Which fonts are displayed in the Font gallery?
Font gallery
Because many applications supply A2 is additional font types active cell beyond what comes with the Windows Vista operating system, the number of font types available on your computer will depend on the applications Figure 1–50 installed. This book uses only font types that come with the Windows Vista operating system and Microsoft Office.
C6179_Excel1_CTP.4c.indd 36
4/3/07 2:00:58 PM
2 • Point to Cambria in the Theme
Calibri font selected in the Font gallery
Fonts area of the Font gallery to see a live preview of the Cambria font in cell A2 (Figure 1–51).
Theme Fonts area
Cambria recommended for heading cells
Excel Chapter 1
Formatting the Worksheet EX 37
I Experiment • Point to several other fonts in the
Q&A
Font gallery to see a live preview of other fonts in cell A2. What is the Theme Fonts area? Excel applies the same default theme to any new workbook that you start. A theme is a collection of cell styles and other styles that have common characteristics, such as a color scheme and font type. The default theme for an Excel workbook is the Office theme. The Theme Fonts area of the Font gallery includes the fonts included in the default Office theme. Cambria is recommended for headings and Calibri is recommended for cells in the body of the worksheet (Figure 1–51).
Calibri recommended for body cells
cell A2 displays live preview of Cambria font
Figure 1–51
3 • Click Cambria in the Theme Fonts
font type in cell A2
area to change the font type of the worksheet subtitle in cell A2 from Calibri to Cambria (Figure 1–52).
Cambria font assigned to worksheet subtitle in cell A2
Figure 1–52 Other Ways 1. Select font type from Font list on Mini toolbar 2. Right-click cell, click Format Cells on shortcut menu, click Font tab, click desired font type, click OK button
C6179_Excel1_CTP.4c.indd 37
4/3/07 2:01:01 PM
EX 38 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
To Bold a Cell You bold an entry in a cell to emphasize it or make it stand out from the rest of the worksheet. The following step shows how to bold the worksheet subtitle in cell A2.
1 • With cell A2 active, click the Bold button on the Ribbon to change the font style of the worksheet subtitle to bold (Figure 1–53).
Bold button changes to transparent orange background when active cell is bold
Q&A
What if a cell already includes a bold style?
Q&A
If you point to the Bold button and the active cell already is bold, then Excel displays the button with a transparent orange font style of background. How do I remove the bold style from a cell?
worksheet subtitle in cell A2 changed to bold
Clicking the Bold button a second time removes the bold font style. Figure 1–53 Other Ways 1. Click Bold button on Mini toolbar 2. Right-click cell, click Format Cells on shortcut menu,
click Font tab, click Bold, click OK button 3. Press CTRL+B
To Increase the Font Size of a Cell Entry Increasing the font size is the next step in formatting the worksheet subtitle. You increase the font size of a cell so the entry stands out and is easier to read. The following steps increase the font size of the worksheet subtitle in cell A2.
1 • With cell A2 selected, click the Font
Font Size box arrow
Size box arrow on the Ribbon to display the Font Size list.
• Point to 14 in the Font Size list to see a live preview of cell A2 with a font size of 14 (Figure 1–54).
I Experiment
14 point
• Point to several other font sizes in the Font Size list to see a live preview of other font sizes in cell A2.
Font Size list live preview of cell A2 with font size 14
Figure 1–54
C6179_Excel1_CTP.4c.indd 38
4/3/07 2:01:03 PM
2 • Click 14 in the Font Size list to
font in active cell A2 is 14-point Cambria bold
Q&A
change the font in cell A2 from 11 point to 14 point (Figure 1–55).
Excel Chapter 1
Formatting the Worksheet EX 39
Can I assign a font size that is not in the Font Size list? Yes. An alternative to clicking a font size in the Font Size list is to click the Font Size box, type the font size, and then press the ENTER key. This procedure allows you to assign a font size not available in the Font Size list to a selected cell entry.
font changes from 11 point to 14 point
Figure 1–55 Other Ways 1. Click Increase Font Size button or Decrease Font Size button on Ribbon 2. Select font size from Font Size list on Mini toolbar
3. Right-click cell, click Format Cells on shortcut menu, click Font tab, select font size in Size box, click OK button
To Change the Font Color of a Cell Entry The next step is to change the color of the font in cell A2 from black to dark blue. The following steps change the font color of a cell entry.
1 • With cell A2 selected, click the Font
Font Color button arrow
Color button arrow on the Ribbon to display the Font Color palette.
• Point to Dark Blue, Text 2 (dark blue color in column 4, row 1) in the Theme Colors area of the Font Color palette to see a live preview of the font color in cell A2 (Figure 1–56).
live preview of font color in active cell A2 is dark blue
desired font color is dark blue (column 4, row 1)
Font Color palette
I Experiment • Point to several other colors in the
Q&A
Font Color palette to see a live preview of other font colors in cell A2. Which colors does Excel make available on the Font Color palette?
Figure 1–56
You can choose from more than 60 different font colors on the Font Color palette (Figure 1–56). Your Font Color palette may have more or fewer colors, depending on color settings of your operating system. The Theme Colors area includes colors that are included in the current workbook’s theme.
C6179_Excel1_CTP.4c.indd 39
4/3/07 2:01:06 PM
EX 40 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
2 • Click Dark Blue, Text 2 (column 4,
Font Color button changes to reflect selected color
Q&A
row 1) on the Font Color palette to change the font of the worksheet subtitle in cell A2 from black to dark blue (Figure 1–57). Why does the Font Color button change after I select the new font color? When you choose a color on the Font Color palette, Excel changes the Font Color button on the Formatting toolbar to the chosen color. Thus, to change the font color of the cell entry in another cell to the same color, you need only to select the cell and then click the Font Color button.
font color in active cell A2 is dark blue
Figure 1–57
Other Ways 1. Select font color from Font Color list on Mini toolbar
2. Right-click cell, click Format Cells on shortcut menu, click Font tab, select color on Font Color palette, click OK button
To Center Cell Entries across Columns by Merging Cells The final step in formatting the worksheet title and subtitle is to center them across columns A through G. Centering a title across the columns used in the body of the worksheet improves the worksheet’s appearance. To do this, the seven cells in the range A1:G1 are combined, or merged, into a single cell that is the width of the columns in the body of the worksheet. The seven cells in the range A2:G2 also are merged in a similar manner. Merging cells involves creating a single cell by combining two or more selected cells. The following steps center the worksheet title and subtitle across columns by merging cells.
1 • Select cell A1 and then drag to cell
Q&A
G1 to highlight the range A1:G1 (Figure 1–58). What if a cell in the range B1:G1 contained data?
A1 is active cell
For the Merge & Center button to work properly, all the cells except the leftmost cell in the selected range must be empty.
range A1:G1 selected
Figure 1–58
C6179_Excel1_CTP.4c.indd 40
4/3/07 2:01:08 PM
2 • Click the Merge & Center button
Q&A
on the Ribbon to merge cells A1 through G1 and center the contents of cell A1 across columns A through G (Figure 1–59).
formats assigned to active cell A1
Merge & Center button
Excel Chapter 1
Formatting the Worksheet EX 41
A1 is active cell
What happened to cells B1 through G1? After the merge, cells B1 through G1 no longer exist. Cell A1 now extends across columns A through G.
cells A1 through G1 merged to create new cell A1
heavy border indicates new dimensions of cell A1
entry in cell A1 centered across columns A through G
Figure 1–59
3 • Repeat Steps 1 and 2
Q&A
to merge and center the worksheet subtitle across cells A2 through G2 (Figure 1–60). Are cells B1 through G1 and B2 through G2 lost forever?
A2 is active cell
cells A2 through G2 merged to
No. The opposite of create new cell A2 merging cells is splitting a merged cell. After you have merged multiple cells to create entry in cell one merged cell, you A2 centered across columns can unmerge, or split, A through G the merged cell to display the original cells Figure 1–60 on the worksheet. You split a merged cell by selecting it and clicking the Merge & Center button. For example, if you click the Merge & Center button a second time in Step 2, it will split the merged cell A1 to cells A1, B1, C1, D1, E1, F1, and G1. Other Ways 1. Right-click selection, click Merge & Center button on Mini toolbar
C6179_Excel1_CTP.4c.indd 41
2. Right-click selection, click Format Cells on shortcut menu, click Alignment tab, select Center Across Selection in Horizontal list, click OK button
4/3/07 2:01:10 PM
EX 42 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
To Format Column Titles and the Total Row The next step to format the worksheet is to format the column titles in row 3 and the total row, row 9. Column titles and the total row should be formatted so anyone who views the worksheet can quickly distinguish the column titles and total row from the data in the body of the worksheet. The following steps format the column titles and total row using cell styles in the default worksheet theme.
1 • Click cell A3 and then drag the mouse pointer to cell G3 to select the range A3:G3.
Cell Styles button
• Point to the Cell Styles
Q&A
button on the Ribbon (Figure 1–61). Why is cell A3 selected in the range for the column headings?
range A3:G3 selected
The style to be applied to the column headings includes an underline that will help to distinguish the column headings from the rest of the worksheet. IncludFigure 1–61 ing cell A3 in the range ensures that the cell will include the underline, which is visually appealing and further helps to separate the data in the worksheet.
2 • Click the Cell Styles button to display the Cell Styles gallery.
• Point to the Heading 3 cell style in the Titles and Headings area of the Cell Styles gallery to see a live preview of the cell style in the range A3:G3 (Figure 1–62).
I Experiment • Point to other cell
Heading 3 cell style
live preview of Heading 3 cell style in range A3:G3
Total cell style
Titles and Headings area
styles in the Titles and Headings area of the Cell Styles gallery to see a live preview of other cell styles in the range A3:G3. Figure 1–62
C6179_Excel1_CTP.4c.indd 42
4/3/07 2:01:14 PM
3 • Click the Heading 3 cell style to
Cell Styles button
apply the cell style to the range A3:G3.
Excel Chapter 1
Formatting the Worksheet EX 43
• Click cell A9 and then drag the mouse pointer to cell G9 to select the range A9:G9.
• Point to the Cell Styles button on
Heading 3 cell style applied to range A3:G3
Q&A
the Ribbon (Figure 1–63). Why should I choose Heading 3 instead of another heading cell style?
range A9:G9 selected
Excel includes many types of headings, such as Heading 1 and Heading 2, because worksheets often include many levels of headings above columns. In the case of the worksheet created for this project, the Heading 3 title includes formatting that makes the column titles’ font size smaller than the title and subtitle and makes the column titles stand out from the data in the body of the worksheet. Figure 1–63
4 • Click the Cell Styles button on the Ribbon to display the Cell Styles gallery and then click the Total cell style in the Titles and Headings area to apply the Total cell style to the cells in the range A9:G9.
• Click cell A11 to select the cell (Figure 1–64).
Total cell style applied to range A9:G9 A11 is active cell
Figure 1–64
C6179_Excel1_CTP.4c.indd 43
4/3/07 2:01:17 PM
EX 44 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
To Format Numbers in the Worksheet As previously noted, the numbers in the worksheet should be formatted to use a dollar-and-cents format, with dollar signs in the first row (row 4) and the total row (row 9). Excel allows you to format numbers in a variety of ways, and these methods are discussed in other chapters in this book. The following steps use buttons on the Ribbon to format the numbers in the worksheet.
1 • Select cell B4 and drag
Accounting Number Format button
the mouse pointer to cell G4 to select the range B4:G4.
• Point to the Accounting Number Format button on the Ribbon to display the Enhanced ScreenTip (Figure 1–65).
Enhanced ScreenTip
range B4:G4 selected
Figure 1–65
2 • Click the Accounting Number Format button on the Ribbon to apply the Accounting Number format to the cells in the range B4:G4.
Q&A
• Select the range B5:G8 (Figure 1–66). What effect does the Accounting Number format have on the selected cells? The Accounting Number format causes the cells to display with two decimal places so that decimal places in cells below the selected cells align vertically. Cell widths are automatically adjusted to accommodate the new formatting.
Accounting Number format applied to range B4:G4
range B5:G8 selected
cell widths automatically adjusted to accommodate new formatting
Figure 1–66
C6179_Excel1_CTP.4c.indd 44
4/3/07 2:01:20 PM
3 • Click the Comma Style button on the Ribbon to apply the Comma Style to the range B5:G8.
Excel Chapter 1
Formatting the Worksheet EX 45
• Select the range B9:G9 Comma Style button
Q&A
(Figure 1–67). What effect does the Comma Style format have on the selected cells?
range B9:G9 selected
The Comma Style format causes the cells to display with two decimal places and commas as thousands separators.
Comma Style format applied to range B5:G8
Figure 1–67
4 • Click the Accounting
Accounting Number Format button
Number Format button on the Ribbon to apply the Accounting Number format to the cells in the range B9:G9.
• Select cell A11 (Figure 1-68).
Accounting Number format applied to range B9:G9 A11 is active cell
Figure 1–68 Other Ways 1. Click Accounting Number Format or Comma button on Mini toolbar
2. Right-click selection, click Format Cells on the shortcut menu, click Number tab, select Accounting in Category list or select Number and click Use 1000 Separator, click OK button
May not be copied, scanned, or duplicated, in whole or in part.
C6179_Excel1_CTP.4c.indd 45
4/3/07 2:01:22 PM
EX 46 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
To Adjust the Column Width The last step in formatting the worksheet is to adjust the width of column A so that the word Accessories in cell A8 is shown in its entirety in the cell. Excel includes several methods for adjusting cell widths and row heights, and these methods are discussed later in this book. The following steps adjust the width of column A so that the contents of cell A8 are displayed in the cell.
1 • Point to the boundary on the right side of the column A heading above row 1 to change the mouse pointer to a split double arrow (Figure 1–69).
mouse pointer is split double arrow
current right border of column A
Figure 1–69
2 • Double-click on the boundary to
Q&A
adjust the width of column A to the width of the largest item in the column (Figure 1–70). What if none of the items in column A extended through the entire width of the column?
mouse pointer
If all of the items in column A were shorter in length than the width of the column when you double-click the right side of the column A heading, then Excel still would adjust the column width to the largest item in the column. That is, Excel would reduce the width of the column to the largest item.
new column A width
Figure 1–70
C6179_Excel1_CTP.4c.indd 46
4/3/07 2:01:25 PM
Using the Name Box to Select a Cell The next step is to chart the quarterly sales for the five product types sold by the company. To create the chart, you must select the cell in the upper-left corner of the range to chart (cell A3). Rather than clicking cell A3 to select it, the next section describes how to use the Name box to select the cell.
Excel Chapter 1
Using the Name Box to Select a Cell EX 47
To Use the Name Box to Select a Cell As previously noted, the Name box is located on the left side of the formula bar. To select any cell, click the Name box and enter the cell reference of the cell you want to select. The following steps select cell A3.
1 • Click the Name box
Q&A
in the formula bar and then type a3 as the cell to select (Figure 1–71).
a3 typed in Name box
Why is cell A11 still selected? Even though cell A11 is the active cell, Excel displays the typed cell reference a3 in the Name box until you press the ENTER key.
A11 is active cell
Figure 1–71
2 • Press the ENTER key to change the active cell from A11 to cell A3 (Figure 1–72).
A3 is active cell
Figure 1–72
C6179_Excel1_CTP.4c.indd 47
4/3/07 2:01:27 PM
EX 48 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Other Ways to Select Cells
BTW
As you will see in later chapters, in addition to using the Name box to select any cell in a worksheet, you also can use it to assign names to a cell or range of cells. Excel supports several additional ways to select a cell, as summarized in Table 1–3. Find & Select You can find and select cells based on their content. Click the Find & Select button on the Home tab on the Ribbon. Then, click the Go To Special command. Choose your desired option in the Select area of the Go To Special dialog box and then click the OK button.
Plan Ahead
Table 1–3 Selecting Cells in Excel Key, Box, or Command
Function
ALT+PAGE DOWN
Selects the cell one worksheet window to the right and moves the worksheet window accordingly.
ALT+PAGE UP
Selects the cell one worksheet window to the left and moves the worksheet window accordingly.
ARROW
Selects the adjacent cell in the direction of the arrow on the key.
CTRL+ARROW
Selects the border cell of the worksheet in combination with the arrow keys and moves the worksheet window accordingly. For example, to select the rightmost cell in the row that contains the active cell, press CTRL+RIGHT ARROW. You also can press the END key, release it, and then press the appropriate arrow key to accomplish the same task.
CTRL+HOME
Selects cell A1 or the cell one column and one row below and to the right of frozen titles and moves the worksheet window accordingly.
Find command on Find and Select menu or SHIFT+F5
Finds and selects a cell that contains specific contents that you enter in the Find dialog box. If necessary, Excel moves the worksheet window to display the cell. You also can press CTRL+F to display the Find dialog box.
Go To command on Find and Select menu or F5
Selects the cell that corresponds to the cell reference you enter in the Go To dialog box and moves the worksheet window accordingly. You also can press CTRL+G to display the Go To dialog box.
HOME
Selects the cell at the beginning of the row that contains the active cell and moves the worksheet window accordingly.
Name box
Selects the cell in the workbook that corresponds to the cell reference you enter in the Name box.
PAGE DOWN
Selects the cell down one worksheet window from the active cell and moves the worksheet window accordingly.
PAGE UP
Selects the cell up one worksheet window from the active cell and moves the worksheet window accordingly.
Decide on the type of chart needed. Excel includes 11 chart types from which you can choose including column, line, pie, bar, area, X Y (scatter), stock, surface, doughnut, bubble, and radar. The type of chart you choose depends on the type of data that you have, how much data you have, and the message you want to convey. A column chart is a good way to compare values side-by-side. A Clustered Column chart can go even further in comparing values across categories. In the case of the Walk and Rock Music quarterly sales data, comparisons of product types within each region can be made side-by-side with a Clustered Column chart. Establish where to position and how to format the chart. • When possible, try to position charts so that both the data and chart appear on the screen on the worksheet together and so that the data and chart can be printed in the most readable manner possible. By placing the chart below the data on the Walk and Rock Music 1st Quarter Sales worksheet, both of these goals are accomplished. • When choosing/selecting colors for a chart, consider the color scheme of the rest of the worksheet. The chart should not present colors that are in stark contrast to the rest of the worksheet. If the chart will be printed in color, minimize the amount of dark colors on the chart so that the chart both prints quickly and preserves ink.
C6179_Excel1_CTP.4c.indd 48
4/3/07 2:01:30 PM
Adding a 3-D Clustered Column Chart to the Worksheet As outlined in the requirements document in Figure 1–2 on page EX 4, the worksheet should include a 3-D Clustered Column chart to graphically represent quarterly sales for each product type that the company sells. The 3-D Clustered Column chart shown in Figure 1–73 is called an embedded chart because it is drawn on the same worksheet as the data.
Excel Chapter 1
Adding a 3-D Clustered Column Chart to the Worksheet EX 49
3-D Clustered Column chart columns developed from values in worksheet
chart scale along y-axis
dash represents 0
each color represents a row (product type) in worksheet
The chart uses different colored columns to represent sales for different product types. Each region uses the same color scheme for identifying product types, which allows for easy identification and comparison. For the Northeast sales region, for example, the dark blue column representing Video products shows quarterly sales of $66,145.15; for the Southeast sales region, the maroon column representing Mini products shows quarterly sales of $82,937.72; for the Midwest sales region, the pale green column representing Micro products shows quarterly sales of $88,294.78; for the South sales region, the violet column representing Flash products shows quarterly sales of $69,737.51; and for the West sales region, the light blue column representing Accessories shows quarterly sales of $46,321.88. Because the same color scheme is used in each region to represent the five product types, you easily can compare sales of product types among the sales regions. The totals from the worksheet are not represented, because the totals are not in the range specified for charting.
C6179_Excel1_CTP.4c.indd 49
BTW
Figure 1–73 Cell Values and Charting When you change a cell value on which a chart is dependent, Excel redraws the chart instantaneously, unless automatic recalculation is disabled. If automatic recalculation is disabled, then you must press the F9 key to redraw the chart. To enable or disable automatic recalculation, click the Calculations Options button on the Formulas tab on the Ribbon.
4/3/07 2:01:31 PM
EX 50 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Excel derives the chart scale based on the values in the worksheet and then displays the scale along the vertical axis (also called the y-axis or value axis) of the chart. For example, no value in the range B4:F8 is less than 0 or greater than $100,000.00, so the scale ranges from 0 to $100,000.00. Excel also determines the $10,000.00 increments of the scale automatically. For the numbers along the y-axis, Excel uses a format that includes representing the 0 value with a dash (Figure 1–73 on the previous page).
To Add a 3-D Clustered Column Chart to the Worksheet The commands to insert a chart are located on the Insert tab. With the range to chart selected, you click the Column button on the Ribbon to initiate drawing the chart. The area on the worksheet where the chart appears is called the chart location. As shown in Figure 1–73, the chart location in this worksheet is the range A11:G22, immediately below the worksheet data. The following steps draw a 3-D Clustered Column chart that compares the quarterly sales by product type for the five sales regions.
1 • Click cell A3 and then drag the mouse pointer to the cell F8 to select the range A3:F8 (Figure 1–74).
range A3:F8 selected
Figure 1–74
C6179_Excel1_CTP.4c.indd 50
4/3/07 2:01:33 PM
2 • Click the Insert tab to
Q&A
make the Insert tab the active tab (Figure 1–75).
Insert tab becomes active tab
What tasks can I perform with the Insert tab?
EX 51
Excel Chapter 1
Adding a 3-D Clustered Column Chart to the Worksheet
Insert tab groups and commands
The Insert tab includes commands that allow you to insert various objects, such as shapes, tables, illustrations, and charts, into a worksheet. These objects will be discussed as they are used throughout this book.
Figure 1–75
3 • Click the Column
Column button
button on the Ribbon to display the Column gallery.
• Point to the 3-D Clustered Column chart type in the 3-D Column area of the Column gallery (Figure 1–76).
Column gallery 3-D Column area
3-D Clustered Column chart type
Enhanced ScreenTip
Figure 1–76
C6179_Excel1_CTP.4c.indd 51
4/3/07 2:01:34 PM
EX 52 Excel Chapter 1 Creating a Worksheet and an Embedded Chart Chart Tools contextual tab
4 • Click the 3-D Clustered Column chart type in the 3-D Column area of the Column gallery to add a 3-D Clustered Column chart to the middle of the worksheet in a selection rectangle.
Design tab
when chart is selected, colored borders in worksheet indicate chart range
• Click the top-right edge of the
mouse pointer changes to crosshair with four arrowheads
selection rectangle but do not release the mouse to grab the chart and change the mouse pointer to a crosshair with four arrowheads (Figure 1–77). Q&A
Why is a new tab displayed on the Ribbon? When you select objects such as shapes or charts, Excel displays contextual tabs that include special commands that are used to work with the type of object selected. Because a chart is selected, Excel displays the Chart Tools contextual tab. The three tabs below the Chart Tools contextual tab, Design, Layout, and Format, are tabs that include commands to work with charts.
sizing handles
initial 3-D Clustered Column chart
selection rectangle
Figure 1–77
5 • Continue holding down the left mouse button while dragging the chart down and to the left to position the upper-left corner of the dotted line rectangle over the upper-left corner of cell A11. Release the mouse button to complete the move of the chart.
• Click the middle sizing handle on
upper-left corner of chart area moved to upper-left corner of cell A11
Q&A
the right edge of the chart and do not release the mouse button (Figure 1–78). How does Excel know how to create the chart? Excel automatically selects the entries in the topmost row of the chart range (row 3) as the titles for the horizontal axis (also called the x-axis or category axis) and draws a column for each of the 25 cells in the range containing numbers.
mouse pointer changes to a crosshair
Figure 1–78
C6179_Excel1_CTP.4c.indd 52
4/3/07 2:01:37 PM
6 • While continuing to hold down the mouse button, press the ALT key and drag the right edge of the chart to the right edge of column G and then release the mouse button to resize the chart.
Excel Chapter 1
Adding a 3-D Clustered Column Chart to the Worksheet EX 53
Chart Styles gallery More button
• Point to the middle
Q&A
sizing handle on the bottom edge of the selection rectangle and do not release the mouse button (Figure 1–79).
chart resized so that right edge of chart aligns with right edge of column G
Why should I hold the ALT key down while I resize a chart? Holding down the ALT key while you drag a chart snaps (aligns) the edge of the chart area to the worksheet gridlines. If you do not hold down the ALT key, then you can place an edge of a chart in the middle of a column or row.
7 • While continuing to hold down the mouse button, press the ALT key and drag the bottom edge of the chart up to the bottom edge of row 22 and then release the mouse button to resize the chart.
mouse pointer changes to a crosshair
Figure 1–79
Style 2 chart style
Chart Styles gallery
• Click the More button in the Chart Styles gallery to expand the gallery and point to Style 2 in the gallery (column 2, row 1) (Figure 1–80).
chart resized so that bottom edge of chart aligns with bottom edge of row 22
Figure 1–80
C6179_Excel1_CTP.4c.indd 53
4/3/07 2:01:40 PM
EX 54 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
8 • Click Style 2 in the Chart Styles
Home tab is active tab and Chart Tools contextual tab and related tabs disappear
gallery to apply the chart style Style 2 to the chart.
I Experiment • Select other chart styles in the Chart Styles gallery to apply other chart styles to the chart, but select Style 2 as your final choice. I9 is active cell
• Click cell I9 to deselect the chart
Q&A
and complete the worksheet (Figure 1–81). What is the purpose of the items on the right side of the chart? The items to the right of the column chart in Figure 1–81 are the legend, which identifies the colors assigned to each bar in the chart. Excel automatically selects the entries in the leftmost column of the chart range (column A) as titles within the legend.
legend defines columns in chart area
Style 2 chart style applied to chart
Figure 1–81
BTW
Changing Document Properties and Saving Again Document Properties Excel allows you to assign additional document properties by clicking the Document Properties button arrow in the Document Information Panel and then clicking Advanced Properties. You can assign custom properties, such as Department, Purpose, and Editor. Or, you can create your own document properties.
C6179_Excel1_CTP.4c.indd 54
Excel helps you organize and identify your files by using document properties, which are the details about a file. Document properties, also known as metadata, can include such information as the project author, title, or subject. Keywords are words or phrases that further describe the document. For example, a class name or worksheet topic can describe the file’s purpose or content. Document properties are valuable for a variety of reasons: • Users can save time locating a particular file because they can view a document’s properties without opening the workbook. • By creating consistent properties for files having similar content, users can better organize their workbooks. • Some organizations require Excel users to add document properties so that other employees can view details about these files. Five different types of document properties exist, but the more common ones used in this book are standard and automatically updated properties. Standard properties are associated with all Microsoft Office documents and include author, title, and subject. Automatically updated properties include file system properties, such as the date you create or change a file, and statistics, such as the file size.
4/3/07 2:01:43 PM
To Change Document Properties The Document Information Panel contains areas where you can view and enter document properties. You can view and change information in this panel at any time while you are creating your workbook. Before saving the workbook again, you want to add your name and class name as document properties. The following steps use the Document Information Panel to change document properties.
Excel Chapter 1
Changing Document Properties and Saving Again EX 55
1 • Click the Office Button to display the Office Button menu.
clicking Properties command will open Document Information Panel
• Point to Prepare on
Q&A
the Office Button menu to display the Prepare submenu (Figure 1–82). What other types of actions besides changing properties can you take to prepare a document for distribution?
Office Button
Prepare submenu displays list of tasks that can be used to prepare files for distribution
Prepare command
The Prepare submenu provides commands related to sharing a document with Office Button menu others, such as allowing or restrictFigure 1–82 ing people to view and modify your document, checking to see if your worksheet will work in earlier versions of Excel, and searching for hidden personal information.
2 • Click Properties on the
Document Information Panel is displayed at top of document
Q&A
Prepare submenu to display the Document Information Panel (Figure 1–83). Why are some of the document properties in my Document Information Panel already filled in? The person who installed Microsoft Office 2007 on your computer or network may have set or customized the properties.
course number and section will be typed in Subject text box
student name will be typed in Author text box
Figure 1–83
C6179_Excel1_CTP.4c.indd 55
4/3/07 2:01:44 PM
EX 56 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
3 • Click the Author text box and then type your name as the Author property. If a name already is displayed in the Author text box, delete it before typing your name.
• Click the Subject text
keywords entered
student name entered
Close the Document Information Panel button
course and section entered
box, if necessary delete any existing text, and then type your course and section as the Subject property.
• Click the Keywords
Q&A
text box, if necessary delete any existing text, and then type First Quarter Rock-It MP3 Sales (Figure 1-84). What types of document properties does Excel collect automatically?
Figure 1–84
Excel records such details as how long you worked at creating your project, how many times you revised the document, and what fonts and themes are used.
4 • Click the Close the Document Information Panel button so that the Document Information Panel no longer is displayed.
To Save an Existing Workbook with the Same File Name Saving frequently cannot be overemphasized. Several modifications have been made to the workbook since it was saved earlier in the chapter. Earlier in this chapter, the Save button on the Quick Access Toolbar caused the Save As dialog box to appear, and the file name, Walk and Rock Music 1st Quarter Sales, was entered. Clicking the Save button on the Quick Access Toolbar causes Excel to save the changes made to the workbook since the last time it was saved. The following step saves the workbook again.
C6179_Excel1_CTP.4c.indd 56
4/3/07 2:01:47 PM
1 • With your USB flash drive connected
Save button
to one of the computer’s USB ports, click the Save button on the Quick Access Toolbar to overwrite the previous Walk and Rock Music 1st Quarter Sales file on the USB flash drive (Figure 1–85). Q&A
EX 57
Excel Chapter 1
Printing a Worksheet
Excel saves workbook with same file name, Walk and Rock Music 1st Quarter Sales
Why did the Save As dialog box not appear? Excel overwrites the document using the settings specified the first time the document was saved. To save the file with a different file name or on different media, display the Save As dialog box by clicking the Office Button and then clicking Save As on the Office Button menu. Then, fill in the Save As dialog box as described in Steps 2 through 5 on pages EX 31 and EX 32.
Figure 1–85 Other Ways 1. Press CTRL+S or press SHIFT+F12, press ENTER
After you create a worksheet, you often want to print it. A printed version of the worksheet is called a hard copy or printout. Printed copies of your worksheet can be useful for the following reasons: • Many people prefer proofreading a hard copy of the worksheet rather than viewing the worksheet on the screen to check for errors and readability. • Someone without computer access can view the worksheet’s content. • Copies can be distributed as handouts to people during a meeting or presentation. • Hard copies can serve as reference material if your storage medium is lost or becomes corrupted and you need to recreate the worksheet. It is a good practice to save a workbook before printing it, in the event you experience difficulties with the printer.
C6179_Excel1_CTP.4c.indd 57
BTW
Printing a Worksheet Conserving Ink and Toner You can print a presentation in black and white to conserve ink or toner by clicking the Office Button, pointing to Print on the Office Button menu, and then clicking Print Preview on the Print submenu. Click the Page Setup button on the Print Preview tab, click the Sheet tab, and then click the Black and White check box in the Print area. Click the OK button to close the Page Setup dialog box. Click the Office Button, point to Print, and then click Quick Print.
4/3/07 2:01:48 PM
EX 58 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
To Print a Worksheet With the completed worksheet saved, you may want to print it. The following steps print the worksheet in the saved Walk and Rock Music 1st Quarter Sales workbook.
1 • Click the Office Button to display the Office Button menu.
• Point to Print on the
Office Button
Office Button menu to display the Print Office Button submenu menu (Figure 1–86).
Print submenu
Print button
Figure 1–86
2 • Click Quick Print on
Q&A
the Print submenu to print the document (Figure 1–87). Can I print my document in black and white to conserve ink or toner? Yes. Click the Office Button and then click the Excel Options button on the Office Button menu. When the Excel Options dialog box is displayed, click Advanced, scroll to the Print area, place a check mark in the Use draft quality check box if it is displayed, and then click the OK button. Click the Office Button, point to Print, and then click Quick Print.
Figure 1–87 Other Ways 1. Press CTRL+P, press ENTER
C6179_Excel1_CTP.4c.indd 58
4/3/07 2:01:50 PM
Quitting Excel When you quit Excel, if you have made changes to a workbook since the last time the file was saved, Excel displays a dialog box asking if you want to save the changes you made to the file before it closes that window. The dialog box contains three buttons with these resulting actions: • Yes button — Saves the changes and then quits Excel
Excel Chapter 1
Quitting Excel EX 59
• No button — Quits Excel without saving changes • Cancel button — Closes the dialog box and redisplays the worksheet without saving the changes If no changes have been made to an open workbook since the last time the file was saved, Excel will close the window without displaying a dialog box.
To Quit Excel with One Workbook Open The Walk and Rock 1st Quarter Sales worksheet is complete. The following steps quit Excel if only one workbook is open.
1 • Point to the Close
Close button
button on the right side of the Excel title bar (Figure 1–88).
2 • Click the Close Q&A
button to quit Excel. What if I have more than one Excel workbook open? You would click the Close button on the Excel title bar for each open workbook. When you click the Close button with the last workbook open, Excel also quits. As an alternative, you could click the Office Button and then click the Exit Excel button on the Office Button menu, which closes all open workbooks and then quits Excel.
Figure 1–88
Other Ways 1. Double-click Office Button 2. With multiple workbooks open, click Office Button, click Exit Excel on Office Button menu
C6179_Excel1_CTP.4c.indd 59
3. Right-click Microsoft Excel button on Windows Vista taskbar, click Close on shortcut menu 4. Press ALT+F4
4/3/07 2:01:54 PM
BTW
EX 60 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Print Preview You can preview the printout on your screen using the Print Preview command on the Print submenu (Figure 1–86 on page EX 58), make adjustments to the worksheet, and then print it only when it appears exactly as you want. Each time you preview rather than print, you save both ink and paper.
Starting Excel and Opening a Workbook Once you have created and saved a workbook, you may need to retrieve it from your storage medium. For example, you might want to revise a worksheet or reprint it. Opening a workbook requires that Excel is running on your computer.
To Start Excel The following steps, which assume Windows Vista is running, start Excel. Note: If you are using Windows XP, please see Appendix F for alternate steps.
1 Click the Start button on the Windows Vista taskbar to display the Start menu. 2 Click All Programs at the bottom of the left pane on the Start menu to display the All Programs list and then click Microsoft Office in the All Programs list to display the Microsoft Office list.
3 Click Microsoft Office Excel 2007 in the Microsoft Office list to start Excel and display a new blank worksheet in the Excel window.
4 If the Excel window is not maximized, click the Maximize button on its title bar to maximize the window.
To Open a Workbook from Excel Earlier in this chapter, the workbook was saved on a USB flash drive using the file name, Walk and Rock Music 1st Quarter Sales. The following steps open the Walk and Rock Music 1st Quarter Sales file from the USB flash drive. Office Button
blank Book1 opened in Microsoft Excel window
1 • With your USB flash drive connected
Q&A
to one of the computer’s USB ports, click the Office Button to display the Office Button menu (Figure 1–89).
Open command
What files are shown in the Recent Documents list? Excel displays the most recently opened document Office Button file names in this menu list. If the name of the file you want to open appears in the Recent Documents list, you could double-click it to open the file.
Recent Documents list displays names of recently opened Excel files
Figure 1–89
C6179_Excel1_CTP.4c.indd 60
4/3/07 2:01:55 PM
2 • Click Open on the Office Button
Open dialog box
menu to display the Open dialog box.
Address bar shows USB flash drive as selected device
• If the Folders list is displayed below
Excel Chapter 1
Starting Excel and Opening a Workbook EX 61
the Folders button, click the Folders button to remove the Folders list.
• If necessary, click Computer in the Favorite Links section and then scroll until UDISK 2.0 (E:) appears in the list of available drives.
selected file
Computer selected
• Double-click UDISK 2.0 (E:) to select
File list shows files on USB flash drive (your list may differ)
the USB flash drive, Drive E in this case, as the new open location.
• Click Walk and Rock Music
Q&A
1st Quarter Sales to select the file name (Figure 1–90). How do I open the file if I am not using a USB flash drive?
Folders button is a toggle that causes Folders list to appear or disappear each time you click it
Use the same process, but be certain to select your device in the Computer list.
3 • Click the Open button to open
Open button
Figure 1–90
worksheet appears
title of saved workbook is displayed on title bar
Q&A
the selected file and display the worksheet in the Excel window (Figure 1–91). Why do I see the Microsoft Excel icon and name on the Windows Vista taskbar? When you open an Excel file, the application name (Microsoft Excel) is displayed on a selected button on the Windows Vista taskbar. If you point to this button, the file name also appears in a ScreenTip.
Other Ways 1. Click Office Button, double-click file name in Recent Documents list 2. Press CTRL+O, select file name, press ENTER
C6179_Excel1_CTP.4c.indd 61
Microsoft Excel program button is displayed on Windows Vista taskbar
Figure 1–91
4/3/07 2:01:57 PM
BTW
EX 62 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
AutoCalculate Use the AutoCalculate area on the status bar to check your work as you enter data in a worksheet. If you enter large amounts of data, you select a range of data and then check the AutoCalculate area to provide insight into statistics about the data you entered. Often, you will have an intuitive feel for whether the numbers are accurate or if you may have made a mistake while entering the data.
AutoCalculate You easily can obtain a total, an average, or other information about the numbers in a range by using the AutoCalculate area on the status bar. First, select the range of cells containing the numbers you want to check. Next, right-click the AutoCalculate area to display the Status Bar Configuration shortcut menu (Figure 1–92). The check mark to the left of the active functions (Average, Count, and Sum) indicates that the sum, count, and average of the selected range are displayed in the AutoCalculate area on the status bar. The functions of the AutoCalculate commands on the Status Bar Configuration shortcut menu are described in Table 1–4. Table 1–4 AutoCalculate Shortcut Menu Commands Command
Function
Average
AutoCalculate area displays the average of the numbers in the selected range
Count
AutoCalculate area displays the number of nonblank cells in the selected range
Numerical Count
AutoCalculate area displays the number of cells containing numbers in the selected range
Minimum
AutoCalculate area displays the lowest value in the selected range
Maximum
AutoCalculate area displays the highest value in the selected range
Sum
AutoCalculate area displays the sum of the numbers in the selected range
To Use the AutoCalculate Area to Determine a Maximum The following steps show how to display the largest quarterly sales for any region for the Micro product type.
1 • Select the range B6:F6
Q&A
and then right-click the AutoCalculate area on the status bar to display the Status Bar Configuration shortcut menu (Figure 1–92). What is displayed on the Status Bar Configuration shortcut menu? This shortcut menu includes several commands that allow you to control the items displayed on the Customize Status Bar shortcut menu. The AutoCalculate area of the shortcut menu includes six commands as well as the result of the associated calculation on the right side of the menu.
Customize Status Bar shortcut menu
selected range is B6:F6
calculated values appear on shortcut menu
Maximum command AutoCalculate area
AutoCalculate area on status bar
Figure 1–92
C6179_Excel1_CTP.4c.indd 62
4/3/07 2:02:00 PM
2 • Click Maximum on the shortcut menu to display the Maximum value in the range B6:F6 in the AutoCalculate area of the status bar.
Excel Chapter 1
Correcting Errors EX 63
selected range is B6:F6
• Click anywhere on the worksheet to cause the shortcut menu to disappear (Figure 1–93).
3 • Right-click the AutoCalculate area and then click Maximum on the shortcut menu to cause the Maximum value to no longer appear in the AutoCalculate area. AutoCalculate area displays maximum value in range B6:F6 (92,716.32)
Figure 1–93
Correcting Errors You can correct errors on a worksheet using one of several methods. The method you choose will depend on the extent of the error and whether you notice it while typing the data or after you have entered the incorrect data into the cell.
Correcting Errors while You Are Typing Data into a Cell If you notice an error while you are typing data into a cell, press the backspace key to erase the incorrect characters and then type the correct characters. If the error is a major one, click the Cancel box in the formula bar or press the esc key to erase the entire entry and then reenter the data from the beginning.
Correcting Errors after Entering Data into a Cell If you find an error in the worksheet after entering the data, you can correct the error in one of two ways: 1. If the entry is short, select the cell, retype the entry correctly, and then click the Enter box or press the enter key. The new entry will replace the old entry. 2. If the entry in the cell is long and the errors are minor, using Edit mode may be a better choice than retyping the cell entry. Use the Edit mode as described below. a. Double-click the cell containing the error to switch Excel to Edit mode. In Edit mode, Excel displays the active cell entry in the formula bar and a flashing
C6179_Excel1_CTP.4c.indd 63
4/3/07 2:02:02 PM
BTW
EX 64 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
In-Cell Editing An alternative to doubleclicking the cell to edit it is to select the cell and then press the F2 key.
insertion point in the active cell (Figure 1–94). With Excel in Edit mode, you can edit the contents directly in the cell — a procedure called in-cell editing. b. Make changes using in-cell editing, as indicated below. (1) To insert new characters between two characters, place the insertion point between the two characters and begin typing. Excel inserts the new characters at the location of the insertion point. (2) To delete a character in the cell, move the insertion point to the left of the character you want to delete and then press the delete key or place the insertion point to the right of the character you want to delete and then press the backspace key. You also can use the mouse to drag through the character or adjacent characters you want to delete and then press the delete key or click the Cut button on the Home tab on the Ribbon. (3) When you are finished editing an entry, click the Enter box or press the enter key.
contents of cell B3 appear in formula bar
insertion point displayed in cell after double-clicking
BTW
Figure 1–94
Editing the Contents of a Cell Rather than using in-cell editing, you can select the cell and then click the formula bar to edit the contents.
C6179_Excel1_CTP.4c.indd 64
When Excel enters the Edit mode, the keyboard usually is in Insert mode. In Insert mode, as you type a character, Excel inserts the character and moves all characters to the right of the typed character one position to the right. You can change to Overtype mode by pressing the insert key. In Overtype mode, Excel overtypes, or replaces, the character to the right of the insertion point. The insert key toggles the keyboard between Insert mode and Overtype mode. While in Edit mode, you may have reason to move the insertion point to various points in the cell, select portions of the data in the cell, or switch from inserting characters to overtyping characters. Table 1–5 summarizes the more common tasks used during in-cell editing.
4/3/07 2:02:03 PM
Table 1–5 Summary of In-Cell Editing Tasks Task
Mouse
Keyboard
1
Move the insertion point to the beginning of data in a cell.
Point to the left of the first character and click.
Press HOME
2
Move the insertion point to the end of data in a cell.
Point to the right of the last character and click.
Press END
3
Move the insertion point anywhere in a cell.
Point to the appropriate position and click the character.
Press RIGHT ARROW or
4
Highlight one or more adjacent characters.
Drag the mouse pointer through adjacent characters.
Press SHIFT+RIGHT ARROW or SHIFT+LEFT ARROW
5
Select all data in a cell.
Double-click the cell with the insertion point in the cell if there are no spaces in the data in the cell.
6
Delete selected characters.
Click the Cut button on the Home tab on the Ribbon.
7
Delete characters to the left of the insertion point.
Press BACKSPACE
8
Delete characters to the right of the insertion point.
Press DELETE
9
Toggle between Insert and Overtype modes.
Press INSERT
Excel Chapter 1
Correcting Errors EX 65
LEFT ARROW
Press DELETE
Undoing the Last Cell Entry Excel provides the Undo command on the Quick Access Toolbar (Figure 1–95), which allows you to erase recent cell entries. Thus, if you enter incorrect data in a cell and notice it immediately, click the Undo button and Excel changes the cell entry to what it was prior to the incorrect data entry. Undo button
Undo button arrow
Redo button Undo list contains recent actions
Clear button
Select All button
Figure 1–95
Excel remembers the last 100 actions you have completed. Thus, you can undo up to 100 previous actions by clicking the Undo button arrow to display the Undo list and then clicking the action to be undone (Figure 1–95). You can drag through several actions in the Undo list to undo all of them at once. If no actions are available for Excel to undo, then the Undo button is dimmed and inoperative. The Redo button, next to the Undo button on the Quick Access Toolbar, allows you to repeat previous actions.
C6179_Excel1_CTP.4c.indd 65
4/3/07 2:02:05 PM
BTW
BTW
EX 66 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential – proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
Clearing a Cell or Range of Cells If you enter data into the wrong cell or range of cells, you can erase, or clear, the data using one of the first four methods listed below. The fifth method clears the formatting from the selected cells.
TO CLEAR CELL ENTRIES USING THE FILL HANDLE 1. Select the cell or range of cells and then point to the fill handle so the mouse pointer changes to a crosshair. 2. Drag the fill handle back into the selected cell or range until a shadow covers the cell or cells you want to erase. Release the mouse button. TO CLEAR CELL ENTRIES USING THE SHORTCUT MENU 1. Select the cell or range of cells to be cleared. 2. Right-click the selection. 3. Click Clear Contents on the shortcut menu. TO CLEAR CELL ENTRIES USING THE DELETE KEY 1. Select the cell or range of cells to be cleared. 2. Press the delete key. TO CLEAR CELL ENTRIES AND FORMATTING USING THE CLEAR BUTTON 1. Select the cell or range of cells to be cleared. 2. Click the Clear button on the Home tab (Figure 1–95 on the previous page). 3. Click Clear Contents on the menu.
BTW
TO CLEAR FORMATTING USING THE CELL STYLES BUTTON 1. Select the cell or range of cells from which you want to remove the formatting. 2. Click the Cell Styles button on the Home tab and point to Normal. 3. Click Normal in the Live Preview Gallery.
Getting Back to Normal If you accidentally assign unwanted formats to a range of cells, you can use the Normal cell style selection in the Cell Styles gallery. Click Cell Styles on the Home tab on the Ribbon and then click Normal. Doing so changes the format to Normal style. To view the characteristics of the Normal style, right-click the style in the Cell Styles gallery and then click Modify, or press ALT+APOSTROPHE (‘).
C6179_Excel1_CTP.4c.indd 66
The Clear button on the Home tab is the only command that clears both the cell entry and the cell formatting. As you are clearing cell entries, always remember that you should never press the spacebar to clear a cell. Pressing the spacebar enters a blank character. A blank character is text and is different from an empty cell, even though the cell may appear empty.
Clearing the Entire Worksheet If required worksheet edits are extremely extensive, you may want to clear the entire worksheet and start over. To clear the worksheet or delete an embedded chart, use the following steps.
TO CLEAR THE ENTIRE WORKSHEET 1. Click the Select All button on the worksheet (Figure 1–95). 2. Click the Clear button on the Home tab to delete both the entries and formats.
4/3/07 2:02:06 PM
TO DELETE AN EMBEDDED CHART 1. Click the chart to select it. 2. Press the delete key.
Excel Help The best way to become familiar with Excel Help is to use it. Appendix C includes detailed information about Excel Help and exercises that will help you gain confidence in using it.
Excel Chapter 1
The Select All button selects the entire worksheet. Instead of clicking the Select All button, you also can press ctrl+a. To clear an unsaved workbook, click the workbook’s Close Window button or click the Close command on the Office Button menu. Click the No button if the Microsoft Excel dialog box asks if you want to save changes. To start a new, blank workbook, click the New command on the Office Button menu. To delete an embedded chart, complete the following steps.
BTW
Excel Help EX 67
Excel Help At any time while using Excel, you can find answers to questions and display information about various topics through Excel Help. This section introduces you to Excel Help.
To Search for Excel Help Using Excel Help, you can search for information based on phrases such as save a workbook or format a chart, or key terms such as copy, save, or format. Excel Help responds with a list of search results displayed as links to a variety of resources. The following steps, which use Excel Help to search for information about formatting a chart, assume you are connected to the Internet. Excel Help window allows you to search for information based on phrases or key terms
1 • Click the Microsoft Office Excel
Microsoft Office Excel Help button
Help button near the upper-right corner of the Excel window to open the Excel Help window.
• Type format a chart in the Type words to search for text box at the top of the Excel Help window (Figure 1–96).
Type words to search for text box
Maximize button
Figure 1–96
C6179_Excel1_CTP.4c.indd 67
4/3/07 2:02:07 PM
EX 68 Excel Chapter 1 Creating a Worksheet and an Embedded Chart Excel Help window maximized
2 • Press the ENTER key to display the
clicking these links will display other pages with links about formatting a chart
search results. first 25 results of search are displayed
• Click the Maximize button on
Q&A
the Excel Help window title bar to maximize the Help window (Figure 1–97).
Format chart elements link
Where is the Excel window with the Walk and Rock Music 1st Quarter Sales worksheet? Excel is open in the background, but the Excel Help window is overlaid on top of the Microsoft Excel window. When the Excel Help window is closed, the worksheet will reappear. search results display different icons, depending on type of link
Microsoft Excel window in background
3 • Click the Format
Back, Forward, Stop, Refresh, and Home buttons
Q&A
chart elements link to display information regarding formatting chart elements (Figure 1–98).
Figure 1–97 Print button
Help topic links will expand, or display additional information, if you click Show All link in this window
Close button Show All link
What is the purpose of the buttons at the top of the Excel Help window? Use the buttons in the upper-left corner of the Excel Help window to navigate through the Help system, change the display, show the Excel Help table of contents, and print the contents of the window. Figure 1–98
4 • Click the Close button on the Excel Help window title bar to close the Excel Help window and make Excel active. Other Ways 1. Press F1
C6179_Excel1_CTP.4c.indd 68
4/3/07 2:02:09 PM
BTW
To Quit Excel The following steps quit Excel.
1 Click the Close button on the right side of the title bar to quit Excel; or if you have multiple Excel workbooks open, click the Office Button and then click the Exit Excel button on the Office Button menu to close all open workbooks and quit Excel.
2 If necessary, click the No button in the Microsoft Office Excel dialog box so that any changes you have made are not saved.
Quitting Excel Do not forget to remove your USB flash drive from the USB port after quitting Excel, especially if you are working in a laboratory environment. Nothing can be more frustrating than leaving all of your hard work behind on a USB flash drive for the next user.
Excel Chapter 1
Chapter Summary EX 69
Chapter Summary In this chapter you have learned about the Excel window, how to enter text and numbers to create a worksheet, how to select a range, how to use the Sum button, save a workbook, format cells, insert a chart, print a worksheet, quit Excel, and use Excel Help. The items listed below include all the new Excel skills you have learned in this chapter. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.
Start Excel (EX 6) Enter the Worksheet Titles (EX 17) Enter Column Titles (EX 19) Enter Row Titles (EX 21) Enter Numbers (EX 23) Sum a Column of Numbers (EX 25) Copy a Cell to Adjacent Cells in a Row (EX 27) Determine Multiple Totals at the Same Time (EX 28) Save a Workbook (EX 30) Change a Cell Style (EX 35) Change the Font Type (EX 36) Bold a Cell (EX 38) Increase the Font Size of a Cell Entry (EX 38) Change the Font Color of a Cell Entry (EX 39) Center Cell Entries across Columns by Merging Cells (EX 40) Format Column Titles and the Total Row (EX 42) Format Numbers in the Worksheet (EX 44) Adjust the Column Width (EX 46) Use the Name Box to Select a Cell (EX 47)
20. Add a 3-D Clustered Column Chart to the Worksheet (EX 50) 21. Change Document Properties (EX 55) 22. Save an Existing Workbook with the Same File Name (EX 58) 23. Print a Worksheet (EX 58) 24. Quit Excel with One Workbook Open (EX 59) 25. Open a Workbook from Excel (EX 60) 26. Use the AutoCalculate Area to Determine a Maximum (EX 62) 27. Clear Cell Entries Using the Fill Handle (EX 66) 28. Clear Cell Entries Using the Shortcut Menu (EX 66) 29. Clear Cell Entries Using the delete Key (EX 66) 30. Clear Cell Entries and Formatting Using the Clear Button (EX 66) 31. Clear Formatting Using the Cell Styles Button (EX 66) 32. Clear the Entire Worksheet (EX 66) 33. Delete an Embedded Chart (EX 67) 34. Search for Excel Help (EX 67)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this chapter.
C6179_Excel1_CTP.4c.indd 69
4/3/07 2:02:12 PM
EX 70 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Learn It Online
STUDENT ASSIGNMENTS
Test your knowledge of chapter content and key terms. Instructions: To complete the Learn It Online exercises, start your browser, click the Address bar, and then enter the Web address scsite.com/ex2007/learn. When the Excel 2007 Learn It Online page is displayed, click the link for the exercise you want to complete and then read the instructions.
Chapter Reinforcement TF, MC, and SA A series of true/false, multiple choice, and short answer questions that test your knowledge of the chapter content.
Who Wants To Be a Computer Genius? An interactive game that challenges your knowledge of chapter content in the style of a television quiz show.
Flash Cards An interactive learning environment where you identify chapter key terms associated with displayed definitions.
Wheel of Terms An interactive game that challenges your knowledge of chapter key terms in the style of the television show Wheel of Fortune.
Practice Test A series of multiple choice questions that test your knowledge of chapter content and key terms.
Crossword Puzzle Challenge A crossword puzzle that challenges your knowledge of key terms presented in the chapter.
Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter.
Changing the Values in a Worksheet Instructions: Start Excel. Open the workbook Apply 1-1 Bicycle Shop 3rd Quarter Sales (Figure 1–99a). See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required in this book. 1. Make the changes to the worksheet described in Table 1–6 so that the worksheet appears as shown in Figure 1–99b. As you edit the values in the cells containing numeric data, watch the totals in row 8, the totals in column G, and the chart change. 2. Change the worksheet title in cell A1 to the Title cell style and then merge and center it across columns A through G. Use commands in the Font group on the Home tab on the Ribbon to change the worksheet subtitle in cell A2 to 16-point Corbel red, bold font and then center it across columns A through G. Use the Accent 1 theme color (column 5, row 1 on the Font palette) for the red font color. 3. Update the document Table 1–6 New Worksheet Data properties with your name, course number, and name Cell Change Cell Contents To for the workbook. Save the A1 Spoke-Up Bicycle Shop workbook using the file name, B4 11869.2 Apply 1-1 Spoke-Up Bicycle E4 9157.83 Shop 3rd Quarter Sales. D6 5217.92 Submit the assignment as requested by your instructor. F6 6239.46 B7
C6179_Excel1_CTP.4c.indd 70
3437.64
4/3/07 2:02:13 PM
Excel Chapter 1 STUDENT ASSIGNMENTS
Apply Your Knowledge EX 71
(a) Before
(b) After Figure 1–99
C6179_Excel1_CTP.4c.indd 71
4/3/07 2:02:14 PM
EX 72 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Extend Your Knowledge
STUDENT ASSIGNMENTS
Extend the skills you learned in this chapter and experiment with new skills. You may need to use Help to complete the assignment.
Formatting Cells and Inserting Multiple Charts Instructions: Start Excel. Open the workbook Extend 1-1 Pack-n-Away Shipping. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required in this book. Perform the following tasks to format cells in the worksheet and to add two charts to the worksheet. 1. Use the commands in the Font group on the Home tab on the Ribbon to change the font of the title in cell A1 to 24-point Arial, red; bold and subtitle of the worksheet to 16-point Arial Narrow, blue, bold. 2. Select the range A3:E8, click the Insert tab on the Ribbon, and then click the Dialog Box Launcher in the Charts group on the Ribbon to open the Insert Chart dialog box (Figure 1–100). Stacked Line chart type
3-D Area chart type
Figure 1–100
3. Insert a Stacked Line chart by clicking the Stacked Line chart in the gallery and then clicking the OK button. Move the chart either below or to the right of the data in the worksheet. Click the Design tab and apply a chart style to the chart. 4. With the same range selected, follow Step 3 above to insert a 3-D Area chart in the worksheet. You may need to use the scroll box on the right side of the Insert Chart dialog box to view the Area charts in the gallery. Move the chart either below or to the right of the data so that each chart does not overlap the Stacked Line chart. Choose a different chart style for this chart than the one you selected for the Stacked Line chart.
C6179_Excel1_CTP.4c.indd 72
4/3/07 2:02:17 PM
6. Update the document properties with your name, course number, and name for the workbook. 7. Save the workbook using the file name, Extend 1-1 Pack-n-Away Shipping Charts. Submit the assignment as requested by your instructor.
Make It Right Analyze a workbook and correct all errors and/or improve the design.
Correcting Formatting and Values in a Worksheet Instructions: Start Excel. Open the workbook Make It Right 1-1 Book Sales. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required for this book. Correct the following formatting problems and data errors (Figure 1–101) in the worksheet, while keeping in mind the guidelines presented in this chapter.
Excel Chapter 1
5. Resize each chart so that each snaps to the worksheet gridlines. Make certain that both charts are visible with the worksheet data without the need to scroll the worksheet.
STUDENT ASSIGNMENTS
Make It Right EX 73
spelling mistake in cell A1
column headings and total row require proper formatting
worksheet titles not formatted
grand total does not display
chart improperly sized and placed
incorrect total in cell E9
Figure 1–101
1. Merge and center the worksheet title and subtitle appropriately. 2. Format the worksheet title with a cell style appropriate for a worksheet title. 3. Format the subtitle using commands in the Font group on the Ribbon. 4. Correct the spelling mistake in cell A1 by changing Bool to Books. 5. Apply proper formatting to the column headers and total row.
Continued >
C6179_Excel1_CTP.4c.indd 73
4/3/07 2:02:19 PM
EX 74 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Make It Right
continued
6. Adjust column sizes so that all data in each column is visible. 7. Use the SUM function to create the grand total for annual sales.
STUDENT ASSIGNMENTS
8. The SUM function in cell E9 does not sum all of the numbers in the column. Correct this error by editing the range for the SUM function in the cell. 9. Resize and move the chart so that it is below the worksheet data and does not extend past the right edge of the worksheet data. Be certain to snap the chart to the worksheet gridlines by holding down the alt key as you resize the chart. 10. Update the document properties with your name, course number, and name for the workbook. Save the workbook using the file name, Make It Right 1-1 Eric’s Used Books Annual Sales. Submit the assignment as requested by your instructor.
In the Lab Design and/or create a workbook using the guidelines, concepts, and skills presented in this chapter. Labs 1, 2, and 3 are listed in order of increasing difficulty.
Lab 1: Annual Cost of Goods Worksheet Problem: You work part-time as a spreadsheet specialist for Kona’s Expresso Coffee, one of the up-and-coming coffee franchises in the United States. Your manager has asked you to develop an annual cost of goods analysis worksheet similar to the one shown in Figure 1–102.
Figure 1–102
C6179_Excel1_CTP.4c.indd 74
4/3/07 2:02:21 PM
Instructions: Perform the following tasks. 1. Start Excel. Enter the worksheet title, Kona’s Expresso Coffee, in cell A1 and the worksheet subtitle, Annual Cost of Goods, in cell A2. Beginning in row 3, enter the store locations, costs of goods, and supplies categories shown in Table 1–7.
Excel Chapter 1
In the Lab EX 75
New York
Chicago
Denver
Seattle
San Franscisco
34146.39
43253.53
43522.72
53075.94
47654.32
964.84
1009.97
864.65
1215.39
1429.98
Condiments
21843.43
37627.87
9817.67
12793.47
11565.13
Pastries
47381.28
52420.37
38389.12
23074.84
22805.06
Coffee Beans Containers
2. Use the SUM function to determine the totals for each store location, type of supply, and company grand total.
STUDENT ASSIGNMENTS
Table 1–7 Kona’s Expresso Coffee Annual Cost of Goods
3. Use Cell Styles in the Styles group on the Home tab on the Ribbon to format the worksheet title with the Title cell style. Center the title across columns A through G. Do not be concerned if the edges of the worksheet title are not displayed. 4. Use buttons in the Font group on the Home tab on the Ribbon to format the worksheet subtitle to 14-point Calibri dark blue, bold font, and center it across columns A through G. 5. Use Cell Styles in the Styles group on the Home tab on the Ribbon to format the range A3:G3 with the Heading 2 cell style, the range A4:G7 with the 20% - Accent1 cell style, and the range A8:G8 with the Total cell style. Use the buttons in the Number group on the Home tab on the Ribbon to apply the Accounting Number format to the range B4:G4 and the range B8:G8. Use the buttons in the Number group on the Home tab on the Ribbon to apply the Comma Style to the range B5:G7. Adjust any column widths to the widest text entry in each column. 6. Select the range A3:F7 and then insert a 3-D Clustered Column chart. Apply the Style 8 chart style to the chart. Move and resize the chart so that it appears in the range A10:G22. If the labels along the horizontal axis (x-axis) do not appear as shown in Figure 1-102, then drag the right side of the chart so that it is displayed in the range A10:H22. 7. Update the document properties with your name, course number, and name for the workbook. 8. Save the workbook using the file name Lab 1-1 Konas Expresso Coffee Annual Cost of Goods. 9. Print the worksheet. 10. Make the following two corrections to the sales amounts: $9,648.12 for Seattle Condiments (cell E6), $12,844.79 for Chicago Pastries (cell C7). After you enter the corrections, the company totals in cell G8 should equal $462,135.04. 11. Print the revised worksheet. Close the workbook without saving the changes. Submit the assignment as requested by your instructor.
In the Lab Lab 2: Annual Sales Analysis Worksheet Problem: As the chief accountant for Scissors Office Supply, Inc., you have been asked by the sales manager to create a worksheet to analyze the annual sales for the company by location and customer type category (Figure 1–103). The office locations and corresponding sales by customer type for the year are shown in Table 1–8. Continued >
C6179_Excel1_CTP.4c.indd 75
4/3/07 2:02:22 PM
EX 76 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
In the Lab
continued
Instructions: Perform the following tasks. 1. Create the worksheet shown in Figure 1–103 using the data in Table 1–8.
STUDENT ASSIGNMENTS
2. Use the SUM function to determine totals sales for the four offices, the totals for each customer type, and the company total. Add column and row headings for the totals row and totals column, as appropriate. Table 1–8 Scissors Office Supply Annual Sales Boston
Miami
Consumer
206348.81
Small Business
235573.28
Large Business Government Nonprofit
St. Louis
Santa Fe
113861.40
69854.13
242286.82
133511.24
199158.35
228365.51
237317.55
234036.08
126519.10
111773.38
178798.04
144548.80
135470.86
132599.75
15180.63
28837.75
63924.48
21361.42
3. Format the worksheet title with the Title cell style and center it across columns A through F. Use the Font group on the Ribbon to format the worksheet subtitle to 16-point Cambria green, and bold font. Center the title across columns A through F.
Figure 1–103
4. Format the range A3:F3 with the Heading 2 cell style, the range A4:F8 with the 20% Accent3 cell style, and the range B9:F9 with the Total cell style. Use the Number group on the Ribbon to format cells B4:F4 and B9:F9 with the Accounting Number Format and cells B5:F8 with the Comma Style numeric format. 5. Chart the range A3:E8. Insert a 100% Stacked Column chart for the range A3:E8, as shown in Figure 1–103, by using the Column button on the Insert tab on the Ribbon. Use the chart location A11:F22.
C6179_Excel1_CTP.4c.indd 76
4/3/07 2:02:22 PM
6. Update the document properties with your name, course number, and name for the workbook. 7. Save the workbook using the file name, Lab 1-2 Scissors Office Supply Annual Sales. Print the worksheet.
STUDENT ASSIGNMENTS
8. Two corrections to the figures were sent in from the accounting department. The correct sales are $98,342.16 for Miami’s annual Small Business sales (cell C5) and $48,933.75 for St. Louis’s annual Nonprofit sales (cell D8). After you enter the two corrections, the company total in cell F9 should equal $2,809,167.57. Print the revised worksheet.
Excel Chapter 1
In the Lab EX 77
9. Use the Undo button to change the worksheet back to the original numbers in Table 1–8. Use the Redo button to change the worksheet back to the revised state. 10. Close Excel without saving the latest changes. Start Excel and open the workbook saved in Step 7. Double-click cell E6 and use in-cell editing to change the Santa Fe annual Large Business sales (cell E6) to $154,108.49. Write the company total in cell F9 at the top of the first printout. Click the Undo button. 11. Click cell A1 and then click the Merge & Center button to split cell A1 into cells A1, B1, C1, D1, E1, and F1. To merge the cells into one again, select the range A1:F1 and then click the Merge & Center button on the Home tab on the Ribbon. 12. Close the workbook without saving the changes. Submit the assignment as requested by your instructor.
In the Lab Lab 3: College Cost and Financial Support Worksheet Problem: Attending college is an expensive proposition and your resources are limited. To plan for your four-year college career, you have decided to organize your anticipated resources and costs in a worksheet. The data required to prepare your worksheet is shown in Table 1–9. Table 1–9 College Cost and Resources Cost
Freshman
Sophomore
Junior
Senior
Books
450.00
477.00
505.62
535.95
Room & Board
7500.00
7950.00
8427.00
8932.62
Tuition
8200.00
8692.00
9213.52
9766.33
Entertainment
1325.00
1404.50
1488.77
1578.10
Miscellaneous
950.00
1007.00
1067.42
1131.47
Clothes
725.00
768.50
814.61
863.49
Freshman
Sophomore
Junior
Senior
3400.00
3604.00
3820.24
4049.45
Financial Support Job Savings
4350.00
4611.00
4887.66
5180.92
Parents
4700.00
4982.00
5280.92
5597.78
Financial Aid
5500.00
5830.00
6179.80
6550.59
Other
1200.00
1272.00
1348.32
1429.22
Continued >
C6179_Excel1_CTP.4c.indd 77
4/3/07 2:02:24 PM
EX 78 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
STUDENT ASSIGNMENTS
In the Lab
continued
Instructions Part 1: Using the numbers in Table 1–9, create the worksheet shown in columns A through F in Figure 1–104. Format the worksheet title as Calibri 24-point bold red. Merge and center the worksheet title in cell A1 across columns A through F. Format the worksheet subtitles in cells A2 and A11 as Calibri 16-point bold green. Format the ranges A3:F3 and A12:F12 with the Heading 2 cell style, the ranges A4:F9 and A13:F17 with the 20% - Accent cell style, and the ranges A10:F10 and A18:F18 with the Total cell style. Update the document properties, including the addition of at least one keyword to the properties, and save the workbook using the file name, Lab 1-3 Part 1 College Cost and Financial Support. Print the worksheet. Submit the assignment as requested by your instructor.
Figure 1–104
After reviewing the numbers, you realize you need to increase manually each of the Junior-year expenses in column D by $600. Change the Junior-year expenses to reflect this change. Manually change the financial aid for the Junior year by the amount required to cover the increase in costs. The totals in cells F10 and F18 should equal $87,373.90. Print the worksheet. Close the workbook without saving changes. Instructions Part 2: Open the workbook Lab 1-3 Part 1 College Cost and Financial Support and then save the workbook using the file name, Lab 1-3 Part 2 College Cost and Financial Support. Insert an Exploded pie in 3-D chart in the range G3:K10 to show the contribution of each category of cost for the Freshman year. Chart the range A4:B9 and apply the Style 8 chart style to the chart. Add the Pie chart title as shown in cell G2 in Figure 1–104. Insert an Exploded pie in 3-D chart in the range G12:K18 to show the contribution of each category of financial support for the Freshman year. Chart the range A13:B17 and apply the Style 8 chart style to the chart. Add the Pie chart title shown in cell G11 in Figure 1–104. Update the identification area with the exercise part number and save the workbook. Print the worksheet. Submit the assignment as requested by your instructor. Instructions Part 3: Open the workbook Lab 1-3 Part 2 College Cost and Financial Support. Do not save the workbook in this part. A close inspection of Table 1–9 shows that both cost and financial support figures increase 6% each year. Use Excel Help to learn how to enter the data for the last three years using a formula and the Copy and Paste buttons on the Home tab on the Ribbon. For example, the formula to enter in cell C4 is =B4*1.06. Enter formulas to replace all the numbers in the range C4:E9
C6179_Excel1_CTP.4c.indd 78
4/3/07 2:02:25 PM
STUDENT ASSIGNMENTS
and C13:E17. If necessary, reformat the tables, as described in Part 1. The worksheet should appear as shown in Figure 1–104, except that some of the totals will be off by 0.01 due to rounding errors. Save the worksheet using the file name, Lab 1-3 Part 3 College Cost and Financial Support. Print the worksheet. Press ctrl+accent mark ( `) to display the formulas. Print the formulas version. Submit the assignment as requested by your instructor. Close the workbook without saving changes.
Excel Chapter 1
Cases and Places EX 79
Cases and Places Apply your creative thinking and problem solving skills to design and implement a solution.
• EASIER •• MORE DIFFICULT • 1: Design and Create a Workbook to Analyze Yearly Sales You are working as a summer intern for Hit-the-Road Mobile Services. Your manager has asked you to prepare a worksheet to help her analyze historical yearly sales by type of product (Table 1–10). Use the concepts and techniques presented in this chapter to create the worksheet and an embedded 3-D Clustered Column chart. Table 1–10 Hit-the-Road Mobile Services Sales 2005
2006
2007
2008
Standard Mobile Phones
87598
99087
129791
188785
Camera Phones
71035
75909
96886
100512
Music Phones
65942
24923
34590
15696
Wireless PDAs
67604
58793
44483
35095
Satellite Radios
15161
27293
34763
43367
9549
6264
2600
4048
47963
108059
100025
62367
Headsets Other Accessories
• 2: Design and Create a Worksheet and Chart to Analyze a Budget To estimate the funds needed by your school’s Environmental Club to make it through the upcoming year, you decide to create a budget for the club itemizing the expected quarterly expenses. The anticipated expenses are listed in Table 1–11. Use the concepts and techniques presented in this chapter to create the worksheet and an embedded 3-D Column chart using an appropriate chart style that compares the quarterly cost of each expense. Use the AutoCalculate area to determine the average amount spent per quarter on each expense. Manually insert the averages with appropriate titles in an empty area on the worksheet. Table 1–11 Quarterly Environmental Club Budget Jan – Mar
April – June
July – Sept
Oct – Dec
300
300
150
450
Copies and Supplies
390
725
325
640
Travel
450
755
275
850
Refreshments
105
85
215
155
Speaker Fees
200
200
0
500
Miscellaneous
125
110
75
215
Meeting Room Rent
C6179_Excel1_CTP.4c.indd 79
Continued >
4/3/07 2:02:26 PM
EX 80 Excel Chapter 1 Creating a Worksheet and an Embedded Chart
Cases and Places
continued
STUDENT ASSIGNMENTS
• • 3: Create a 3-D Pie Chart to Analyze Quarterly Revenue In-the-Villa DVD Rental is a DVD movie rental store. The owner of the store is trying to decide if it is feasible to hire more employees during certain times of the year. You have been asked to develop a worksheet totaling all the revenue received last year by quarter. The revenue per quarter is: Quarter 1, $52,699.23; Quarter 2, $111,244.32; Quarter 3, $70,905.03; and Quarter 4, $87,560.10. Create a 3-D Pie chart to illustrate quarterly revenue contribution by quarter. Use the AutoCalculate area to find the average, maximum, and minimum quarterly revenue and manually enter them and their corresponding identifiers in an empty area of the worksheet.
• • 4: Design and Create a Workbook to Analyze Your Field of Interest Make It Personal
Based on your college major, area of interest, or career, use an Internet search engine or other research material to determine the total number of people employed in your chosen field of interest in the country over the past five years. For each year, break the yearly number down into two or more categories. For example, the number for each year can be broken into management and nonmanagement employees. Create an Excel worksheet that includes this data. Place the data in appropriate rows and columns for each year and category. Create totals for each row, totals for each column, and a grand total. Format the worksheet title, column headings, and data using the concepts presented in this chapter. Create a properly formatted Clustered Cone chart for the data and place it below the data in the worksheet. Make certain that years are on the X axis and number of employees is on the Y axis.
• • 5: Design and Create a Workbook to Analyze Your School Working Together
Visit the registrar’s office at your school and obtain data, such as age, gender, and full-time versus part-time status, for the students majoring in at least six different academic departments this semester. Have each member of your team divide the data into different categories. For example, separate the data by: 1. Age, divided into four different age groups 2. Gender, divided into male and female 3. Status, divided into full-time and part-time After coordinating the data as a group, have each member independently use the concepts and techniques presented in this chapter to create a worksheet and appropriate chart to show the total students by characteristics by academic department. As a group, critique each worksheet and have each member modify his or her worksheet based on the group recommendations.
C6179_Excel1_CTP.4c.indd 80
4/3/07 2:02:27 PM
Microsoft Office Excel 2007
2
Formulas, Functions, Formatting, and Web Queries
Objectives You will have mastered the material in this chapter when you can: • Enter formulas using the keyboard and Point mode
• Set margins, headers and footers in Page Layout View
• Apply the AVERAGE, MAX, and MIN functions
• Preview and print versions of a worksheet
• Verify a formula using Range Finder
• Use a Web query to get real-time data from a Web site
• Apply a theme to a workbook • Add conditional formatting to cells • Change column width and row height
• Rename sheets in a workbook • E-mail the active workbook from within Excel
• Check the spelling of a worksheet
C6180_Excel2_CTP.4c.indd 81
4/4/07 3:59:37 PM
Microsoft Office Excel 2007
2
Formulas, Functions, Formatting, and Web Queries Introduction In Chapter 1, you learned how to enter data, sum values, format the worksheet to make it easier to read, and draw a chart. You also learned about using Help and saving, printing, and opening a workbook. This chapter continues to highlight these topics and presents some new ones. The new topics covered in this chapter include using formulas and functions to create a worksheet. A function is a prewritten formula that is built into Excel. Other new topics include smart tags and option buttons, verifying formulas, applying a theme to a worksheet, adding borders, formatting numbers and text, using conditional formatting, changing the widths of columns and heights of rows, spell checking, e-mailing from within an application, renaming worksheets, using alternative types of worksheet displays and printouts, and adding page headers and footers to a worksheet. One alternative worksheet display and printout shows the formulas in the worksheet, instead of the values. When you display the formulas in the worksheet, you see exactly what text, data, formulas, and functions you have entered into it. Finally, this chapter covers Web queries to obtain real-time data from a Web site.
Project — Worksheet with Formulas, Functions, and Web Queries The project in the chapter follows proper design guidelines and uses Excel to create the two worksheets shown in Figure 2–1. The Silver Dollars Stock Club was started and is owned by a national academic fraternity, which pools contributions from a number of local chapters. Each local chapter contributes $150 per month; the money is then invested in the stock market for the benefit of the organization and as a tool to help members learn about investing. At the end of each month, the club’s treasurer summarizes the club’s financial status in a portfolio summary. This summary includes information such as the stocks owned by the club, the cost of the stocks to the club, and the gain or loss that the club has seen over time on the stock. As the complexity of the task of creating the summary increases, the treasurer wants to use Excel to create the monthly portfolio summary. The treasurer also sees an opportunity to use Excel’s built-in capability to access real-time stock quotes over the Internet. Recall that the first step in creating an effective worksheet is to make sure you understand what is required. The people who will use the worksheet usually provide requirements. The requirements document for the Silver Dollars Stock Club Portfolio Summary worksheet includes the following: needs, source of data, summary of calculations, Web requirements, and other facts about its development (Figure 2–2 on page EX 84). The real-time stock quotes (shown in Figure 2–1b) will be accessed via a Web query. The stock quotes will be returned to the active workbook on a separate worksheet. Microsoft determines the content and format of the Real-Time Stock Quotes worksheet. EX 82
C6180_Excel2_CTP.4c.indd 82
4/4/07 3:59:39 PM
Microsoft Office Excel 2007
worksheet with formulas and functions
worksheet automatically created by Web query includes real-time stock quotes
(a) Worksheet
(b) Web Query Figure 2–1 EX 83
C6180_Excel2_CTP.4c.indd 83
4/4/07 3:59:39 PM
EX 84 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
BTW
Figure 2–2
Aesthetics versus Function In designing a worksheet, functional considerations should come first, before visual aesthetics. The function, or purpose, of a worksheet is to provide a user with direct ways to accomplish tasks. Avoid the temptation to use flashy or confusing visual elements within the worksheet, unless they will help the user more easily complete a task.
C6180_Excel2_CTP.4c.indd 84
Overview As you read this chapter, you will learn how to create the worksheet shown in Figure 2–1 by performing these general tasks: • Enter formulas and apply functions in the worksheet • Add conditional formatting to the worksheet • Apply a theme to the worksheet • Work with the worksheet in Page Layout View • Print a part of the worksheet • Perform a Web query to get real-time data from a Web site and create a new worksheet • E-mail the worksheet
4/4/07 3:59:43 PM
General Project Decisions While creating an Excel worksheet, you need to make several decisions that will determine the appearance and characteristics of the finished worksheet. As you create the worksheet required to meet the requirements shown in Figure 2–2, you should follow these general guidelines:
Plan Ahead
Excel Chapter 2
Project — Worksheet with Formulas, Functions, and Web Queries EX 85
1. Plan the layout of the worksheet. As discussed in Chapter 1 and shown in Figure 2–3, rows typically contain items analogous to items in a list. In the case of the stock club’s data, the individual stocks serve this purpose and each stock should be placed in a row. As the club adds more stocks, the number of rows in the worksheet will increase. Information about each stock and associated calculations should appear in columns. 2. Determine the necessary formulas and functions needed. Values such as initial cost and current value are calculated from known values. The formulas for these calculations should be known in advance of creating the worksheet. Values such as the average, highest, and lowest values can be calculated using Excel functions as opposed to relying on complex formulas. 3. Identify how to format various elements of the worksheet. As discussed in Chapter 1 and shown in Figure 2–3, the appearance of the worksheet affects its ability to communicate clearly. Numeric data should be formatted in generally accepted formats, such as using commas as thousands separators and parentheses for negative values. 4. Establish rules for conditional formatting. Conditional formatting allows you to format a cell based on the contents of the cell. Decide under which circumstances you would like a cell to stand out from similar cells and determine in what way the cell will stand out. In the case of the Percent Gain/Loss column on the worksheet, placing a different background color in cells that show losses is an appropriate format for the column. 5. Specify how the printed worksheet should appear. When it is possible that a person will want to print a worksheet, care should be taken in the development of the worksheet to ensure that the contents can be printed in a readable manner. Excel prints worksheets in landscape or portrait orientation and margins can be adjusted to fit more or less data on each page. Headers and footers add an additional level of customization to the printed page. (continued)
Xs indicate text data
9s indicate numeric data
$ not adjacent to Z indicates a fixed dollar sign
Zs indicate numeric data with 0s suppressed $ adjacent to Z indicates floating dollar sign
Figure 2–3
C6180_Excel2_CTP.4c.indd 85
4/4/07 3:59:45 PM
EX 86 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
Plan Ahead
(continued) 6. Gather information regarding the needed Web query. You must also know what information the Web query requires in order for it to generate results that you can use in Excel. 7. Choose names for the worksheets. When a workbook includes multiple worksheets, each worksheet should be named. A good worksheet name is succinct, unique to the workbook, and meaningful to any user of the workbook. In addition, using a sketch of the worksheet can help you visualize its design. The sketch for Silver Dollars Stock Club Portfolio Summary worksheet (Figure 2–3 on the previous page) includes a title, a subtitle, column and row headings, and the location of data values. It also uses specific characters to define the desired formatting for the worksheet as follows: 1. The row of Xs below the leftmost column defines the cell entries as text, such as stock names and stock symbols. 2. The rows of Zs and 9s with slashes, dollar signs, decimal points, commas, and percent signs in the remaining columns define the cell entries as numbers. The Zs indicate that the selected format should instruct Excel to suppress leading 0s. The 9s indicate that the selected format should instruct Excel to display any digits, including 0s. 3. The decimal point means that a decimal point should appear in the cell entry and indicates the number of decimal places to use. 4. The commas indicate that the selected format should instruct Excel to display a comma separator only if the number has enough digits to the left of the decimal point. 5. The slashes in the third column identify the cell entry as a date. 6. The dollar signs that are not adjacent to the Zs in the first row below the column headings and in the total row signify a fixed dollar sign. The dollar signs that are adjacent to the Zs below the total row signify a floating dollar sign, or one that appears next to the first significant digit. 7. The percent sign (%) in the far right column indicates a percent sign should appear after the number. When necessary, more specific details concerning the above guidelines are presented at appropriate points in the chapter. The chapter also will identify the actions you perform and decisions made regarding these guidelines during the creation of the worksheet shown in Figure 2–3 on page EX 85.
With a good understanding of the requirements document, an understanding of the necessary decisions, and a sketch of the worksheet, the next step is to use Excel to create the worksheet.
To Start Excel If you are using a computer to step through the project in this chapter and you want your screen to match the figures in this book, you should change your computer’s resolution to 1024 ⫻ 768. For information about how to change a computer’s resolution, read Appendix E. The following steps, which assume Windows Vista is running, start Excel based on a typical installation of Microsoft Office on your computer. You may need to ask your instructor how to start Excel for your computer. Note: If you are using Windows XP, see Appendix F for alternate steps.
C6180_Excel2_CTP.4c.indd 86
4/4/07 3:59:47 PM
Click the Start button on the Windows Vista taskbar to display the Start menu.
2
Point to All Programs at the bottom of the left pane on the Start menu to display the All Programs list.
3
Click Microsoft Office in the All Programs list to display the Microsoft Office list.
4
Click Microsoft Office Excel to start Excel and display a blank worksheet in the Excel window.
5
If the Excel window is not maximized, click the Maximize button next to the Close button on its title bar to maximize the window.
6
If the worksheet window in Excel is not maximized, click the Maximize button next to the Close button on its title bar to maximize the worksheet window within Excel.
Entering the Titles and Numbers into the Worksheet The first step in creating the worksheet is to enter the titles and numbers into the worksheet.
Starting Excel You can use a command-line switch to start Excel and control how it starts. First, click the Start button on the Windows Vista taskbar, and then click the Start Search box. Next, enter the complete path to Excel’s application file including the switch (for example, C:\Program Files\Microsoft Office\ Office12\Excel.exe/e). The switch /e starts Excel without opening a new workbook; /i starts Excel with a maximized window; /p “folder” sets the active path to folder and ignores the default folder; /r “filename” opens filename in readonly mode; and /s starts Excel in safe mode.
Excel Chapter 2
1
BTW
Entering the Titles and Numbers into the Worksheet EX 87
To Enter the Worksheet Title and Subtitle The following steps enter the worksheet title and subtitle into cells A1 and A2.
1
If necessary, select cell A1. Type Silver Dollars Stock Club in the cell and then press the DOWN ARROW key to enter the worksheet title in cell A1.
2
Type Portfolio Summary in cell A2 and then press the DOWN ARROW key to enter the worksheet subtitle in cell A2 (Figure 2–4 on page EX 89).
To Enter the Column Titles The column titles in row 3 begin in cell A3 and extend through cell J3. The column titles in Figure 2–3 include multiple lines of text. To start a new line in a cell, press ALT+ENTER after each line, except for the last line, which is completed by clicking the Enter box, pressing the ENTER key, or pressing one of the arrow keys. When you see ALT+ENTER in a step, press the ENTER key while holding down the ALT key and then release both keys. The stock names and the row titles Totals, Average, Highest, and Lowest in the leftmost column begin in cell A4 and continue down to cell A16. This data is entered into rows 4 through 12 of the worksheet. The remainder of this section explains the steps required to enter the column titles, stock data, and row titles as shown in Figure 2–4 on page EX 89 and then save the workbook.
1
With cell A3 selected, type Stock and then press the RIGHT ARROW key.
2
Type Symbol in cell B3 and then press the RIGHT ARROW key.
C6180_Excel2_CTP.4c.indd 87
4/4/07 3:59:48 PM
BTW
EX 88 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
Wrapping Text If you have a long text entry, such as a paragraph, you can instruct Excel to wrap the text in a cell, rather than pressing ALT+ENTER to end a line. To wrap text, right-click in the cell, click Format Cells on the shortcut menu, click the Alignment tab, click Wrap text, and then click OK. Excel will increase the height of the cell automatically so the additional lines will fit. If you want to control where each line ends in the cell, rather than letting Excel wrap based on the cell width, however, then you must end each line with ALT+ENTER.
3
In cell C3, type Date and then press ALT+ENTER. Type Acquired and then press the RIGHT ARROW key.
4
In cell D3, type Shares and then press the RIGHT ARROW key.
5
In cell E3, type Initial and then press ALT+ENTER. Type Price and then press ALT+ENTER. Type Per Share and then press the RIGHT ARROW key.
6 7 8 9
Type Initial in cell F3 and then press ALT+ENTER. Type Cost and then press the RIGHT
ARROW key.
In cell G3, type Current and then press ALT+ENTER. Type Price and then press ALT+ENTER. Type Per Share and then press the RIGHT ARROW key. Type Current in cell H3 and then press ALT+ENTER. Type Value and then press the RIGHT
ARROW key.
In cell I3, type Gain/Loss and then press the RIGHT ARROW key.
10 In cell J3, type Percent and then press ALT+ENTER. Type Gain/Loss.
BTW
BTW
To Enter the Portfolio Summary Data Two-Digit Years When you enter a two-digit year value, Excel changes a twodigit year less than 30 to 20xx and a two-digit year of 30 and greater to 19xx. Use four-digit years to ensure that Excel interprets year values the way you intend, if necessary.
Formatting a Worksheet With early worksheet programs, users often skipped rows to improve the appearance of the worksheet. With Excel it is not necessary to skip rows because you can increase row heights to add white space between information.
C6180_Excel2_CTP.4c.indd 88
The portfolio summary data in Table 2–1 includes a purchase date for each stock. Excel considers a date to be a number and, therefore, it displays the date right-aligned in the cell. The following steps enter the portfolio summary data shown in Table 2–1.
1
Select cell A4, type Apple Computers, and then press the RIGHT ARROW key.
2
Type AAPL in cell B4 and then press the RIGHT ARROW key.
3
Type 12/1/04 in cell C4 and then press the RIGHT ARROW key.
4
Type 440 in cell D4 and then press the RIGHT ARROW key.
5
Type 64.59 in cell E4 and then click cell G4.
6
Type 82.99 in cell G4 and then click cell A5.
7
Enter the portfolio summary data in Table 2–1 for the eight remaining stocks in rows 5 through 12 (Figure 2–4).
To Enter the Row Titles 1
Select cell A13. Type Totals and then press the DOWN ARROW key. Type Average in cell A14 and then press the DOWN ARROW key.
2
Type Highest in cell A15 and then press the DOWN ARROW key. Type Lowest in cell A16 and then press the ENTER key. Select cell F4 (Figure 2–4).
4/4/07 3:59:49 PM
Table 2–1 Silver Dollars Stock Club Portfolio Summary Data Shares
12/1/04
440
64.59
82.99
T
12/16/03
870
28.71
27.99
Citigroup
C
1/17/03
960
49.46
44.675
Comcast
CMCSA
12/11/02
380
33.62
41.39
Google
GOOG
2/20/04
920
390.32
492.55
Home Depot
HD
11/14/05
770
34.54
31.72
IBM
IBM
9/14/04
990
74.08
81.47
Merck
MRK
1/14/05
950
42.125
38.34
Sprint Nextel
S
9/10/03
560
17.79
21.18
Symbol
Apple Computers
AAPL
AT&T
column titles on multiple lines within cell
Initial Price Per Share
Current Price Per Share
Date Acquired
Stock
Excel Chapter 2
Entering the Titles and Numbers into the Worksheet EX 89
height of row 3 automatically increased to fit multiple lines of text
worksheet title and subtitle
numbers
dates entered with twodigit year are displayed with four-digit year automatically
Figure 2–4
C6180_Excel2_CTP.4c.indd 89
4/4/07 3:59:51 PM
EX 90 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
BTW
To Change Workbook Properties and Save the Workbook
Entering Numbers in a Range An efficient way to enter data into a range of cells is to select a range and then enter the first number in the upper-left cell of the range. Excel responds by entering the value and moving the active cell selection down one cell. When you enter the last value in the first column, Excel moves the active cell selection to the top of the next column.
With the data entered into the worksheet, the following steps save the workbook using the file name, Silver Dollars Stock Club Portfolio Summary. As you are building a workbook, it is a good idea to save it often so that you do not lose your work if the computer is turned off or if you lose electrical power. The first time you save a workbook, you should change the workbook properties.
1
Click the Office Button, click Prepare on the Office Button menu, and then click Properties.
2
Update the document properties with your name and any other information required.
3
Click the Close button on the Document Properties pane.
Note: If you are using Windows XP, see Appendix F for alternate steps.
4
With a USB flash drive connected to one of the computer’s USB ports, click the Save button on the Quick Access Toolbar.
5
When Excel displays the Save As dialog box, type Silver Dollars Stock Club Portfolio Summary in the File name text box.
6
If the Folders list is displayed below the Folders button, click the Folders button to remove the Folders list.
7
If Computer is not displayed in the Favorite Links section, drag the top or bottom edge of the Save As dialog box until Computer is displayed.
8
Click Computer in the Favorite Links section. If necessary, scroll until UDISK 2.0 (E:) appears in the list of available drives. Double-click UDISK 2.0 (E:) (your USB flash drive may have a different name and letter). Click the Save button in the Save As dialog box to save the workbook on the USB flash drive using the file name, Silver Dollars Stock Club Portfolio Summary.
Entering Formulas One of the reasons Excel is such a valuable tool is that you can assign a formula to a cell and Excel will calculate the result. Consider, for example, what would happen if you had to multiply 440 ⫻ 64.59 and then manually enter the product, 28,419.60, in cell F4. Every time the values in cells D4 or E4 changed, you would have to recalculate the product and enter the new value in cell F4. By contrast, if you enter a formula in cell F4 to multiply the values in cells D4 and E4, Excel recalculates the product whenever new values are entered into those cells and displays the result in cell F4. Plan Ahead
Determine the necessary formulas and functions needed. The formulas needed in the worksheet are noted in the requirements document as follows: 1. Initial Cost (column F) = Shares ⫻ Initial Price Per Share 2. Current Value (column H) = Shares ⫻ Current Price Per Share 3. Gain/Loss (column I) = Current Value – Initial Cost 4. Percent Gain/Loss (column J) = Gain/Loss / Initial Cost The necessary functions to determine the average, highest, and lowest numbers are discussed shortly.
C6180_Excel2_CTP.4c.indd 90
4/4/07 3:59:54 PM
To Enter a Formula Using the Keyboard The initial cost for each stock, which appears in column F, is equal to the number of shares in column D times the initial price per share in column E. Thus, the initial cost for Apple Computers in cell F4 is obtained by multiplying 440 (cell D4) by 64.59 (cell E4) or =D4*E4. The following steps enter the initial cost formula in cell F4 using the keyboard.
Excel Chapter 2
Entering Formulas EX 91
1 • With cell F4 selected, type =d4*e4
Q&A
in the cell to display the formula in the formula bar and in cell F4 and to display colored borders around the cells referenced in the formula (Figure 2–5).
formula begins with equal sign
What is happening on the worksheet as I enter the formula? The equal sign (=) preceding d4*e4 is an important part of the formula. It alerts Excel that you are entering a formula or function and not text. Because the most common error when entering a formula is to reference the wrong cell in a formula mistakenly, Excel colors the borders of the cells referenced in the formula. The coloring helps in the reviewing process to ensure the cell references are correct. The asterisk (*) following d4 is the arithmetic operator that directs Excel to perform the multiplication operation.
as formula is typed, it appears in the formula bar and in active cell F4
colored cell borders indicate cells included in formula in active cell
Figure 2–5
2 • Press the RIGHT ARROW key twice to complete the arithmetic operation indicated by the formula, display the result, 28419.6, and to select cell H4 (Figure 2–6).
value of formula (440 x 64.59)
active cell is H4 after pressing RIGHT ARROW key twice
Figure 2–6
C6180_Excel2_CTP.4c.indd 91
4/4/07 3:59:55 PM
EX 92 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
Arithmetic Operations Table 2–2 describes multiplication and other valid Excel arithmetic operators. Table 2–2 Summary of Arithmetic Operators Meaning
Example of Usage
Meaning
–
Negation
–34
Negative 34
%
Percentage
=72%
Multiplies 72 by 0.01
^
Exponentiation
=4 ^ 6
Raises 4 to the sixth power
*
Multiplication
=22.6 * F4
Multiplies the contents of cell F4 by 22.6
/
Division
=C3 / C6
Divides the contents of cell C3 by the contents of cell C6
+
Addition
=7 + 3
Adds 7 and 3
–
Subtraction
=F12 – 22
Subtracts 22 from the contents of cell F12
BTW
Arithmetic Operator
Troubling Formulas If Excel does not accept a formula, remove the equal sign from the left side and complete the entry as text. Later, after you have entered additional data or determined the error, reinsert the equal sign to change the text back to a formula and edit the formula as needed.
You can enter the cell references in formulas in uppercase or lowercase, and you can add spaces before and after arithmetic operators to make the formulas easier to read. The formula, =d4*e4, is the same as the formulas, =d4 * e4, =D4 * e4, or =D4 * E4.
Order of Operations When more than one arithmetic operator is involved in a formula, Excel follows the same basic order of operations that you use in algebra. Moving from left to right in a formula, the order of operations is as follows: first negation (–), then all percentages (%), then all exponentiations (^), then all multiplications (*) and divisions (/), and finally, all additions (+) and subtractions (–). You can use parentheses to override the order of operations. For example, if Excel follows the order of operations, 5 * 9 + 8 equals 53. If you use parentheses, however, to change the formula to 5 * (9 + 8), the result is 85, because the parentheses instruct Excel to add 9 and 8 before multiplying by 5. Table 2–3 illustrates several examples of valid Excel formulas and explains the order of operations.
Table 2–3 Examples of Excel Formulas Formula
Meaning
=K12
Assigns the value in cell K12 to the active cell.
=10 + 4^2
Assigns the sum of 10 + 16 (or 26) to the active cell.
=3 * C20 or =C20 * 3 or =(3 * C20)
Assigns three times the contents of cell C20 to the active cell.
=50% * 12
Assigns the product of 0.50 times 12 (or 6) to the active cell.
– (H3 * Q30)
Assigns the negative value of the product of the values contained in cells H3 and Q30 to the active cell.
=12 * (N8 – O8)
Assigns the product of 12 times the difference between the values contained in cells N8 and O8 to the active cell.
=M9 / Z8 – C3 * Q19 + A3 ^ B3
Completes the following operations, from left to right: exponentiation (A3 ^ B3), then division (M9 / Z8), then multiplication (C3 * Q19), then subtraction (M9 / Z8) – (C3 * Q19), and finally addition (M9 / Z8 – C3 * Q19) + (A3 ^ B3). If cells A3 = 2, B3 = 4, C3 = 6, M9 = 3, Q19 = 4, and Z8 = 3, then Excel assigns the active cell the value 18; that is, 3 / 3 – 6 * 4 + 2 ^ 4 = -7.
C6180_Excel2_CTP.4c.indd 92
4/4/07 3:59:58 PM
To Enter Formulas Using Point Mode The sketch of the worksheet in Figure 2–3 on page EX 85 calls for the current value, gain/loss, and percent gain/loss of each stock to appear in columns H, I, and J respectively. All three of these values are calculated using formulas in row 4: Current Value (cell H4) = Shares ⫻ Current Price Per Share or =D4*G4 Gain/Loss (cell I4) = Current Value – Initial Cost or H4-F4 Percent Gain/Loss (cell J4) = Gain/Loss / Initial Cost or I4/F4 An alternative to entering the formulas in cells H4, I4, and J4 using the keyboard is to enter the formulas using the mouse and Point mode. Point mode allows you to select cells for use in a formula by using the mouse. The following steps enter formulas using Point mode.
Excel Chapter 2
Entering Formulas EX 93
1 • With cell H4 selected, type = (equal sign) to begin the formula and then click cell D4 to add a reference to cell D4 to the formula (Figure 2–7).
cell reference D4 appended to formula
marquee surrounds selected cell D4
Figure 2–7
2 • Type * (asterisk) and then click cell G4 to add a multiplication operator and reference to cell G4 to the formula (Figure 2–8).
formula appears in formula bar
border of cell and its cell reference in formulas are colored blue
marquee surrounds selected cell G4
cell reference G4 appended to formula
Figure 2–8
C6180_Excel2_CTP.4c.indd 93
4/4/07 3:59:59 PM
EX 94 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
3 • Click the Enter box and then click cell I4 to select cell I4.
• Type = (equal sign) and then click cell H4 to add a reference to cell H4 to the formula. formula appears in formula bar
• Type — (minus sign) and then click cell F4 to add a subtraction operator and reference to cell F4 to the formula (Figure 2–9).
Enter box
value of formula (440 x 82.99)
Q&A
When should I use Point mode to enter formulas? Using Point mode to enter marquee formulas often is faster and more surrounds selected cell F4 accurate than using the keyboard to type the entire formula when the cell you want to select does Figure 2–9 not require you to scroll. In many instances, as in these steps, you may want to use both the keyboard and mouse when entering a formula in a cell. You can use the keyboard to begin the formula, for example, and then use the mouse to select a range of cells.
cell reference F4 appended to formula
4 • Click the Enter box to enter the formula in cell I4.
• Select cell J4. Type = (equal sign) and then click cell I4 to add a reference to cell I4 to the formula.
• Type / (forward slash) and then
formula assigned to cell J4 value of formula (8096 / 28419.6)
click cell F4 to add a reference to cell F4 to the formula.
• Click the Enter box to enter the Q&A
formula in cell J4 (Figure 2–10). Why do only six decimal places show in cell J4?
value of formula
(36515.6 – 28419.6) The actual value assigned by Excel to cell J4 from the division operation in Step 4 is 0.284873819. Figure 2–10 While not all the decimal places appear in Figure 2–10, Excel maintains all of them for computational purposes. Thus, if referencing cell J4 in a formula, the value used for computational purposes is 0.284873819, not 0.284874. Excel displays the value in cell J4 as 0.284874 because the cell formatting is set to display only six digits after the decimal point. If you change the cell formatting of column J to display nine digits after the decimal point, then Excel displays the true value 0.284873819.
C6180_Excel2_CTP.4c.indd 94
4/4/07 4:00:02 PM
To Copy Formulas Using the Fill Handle The four formulas for Apple Computers in cells F4, H4, I4, and J4 now are complete. You could enter the same four formulas one at a time for the eight remaining stocks. A much easier method of entering the formulas, however, is to select the formulas in row 4 and then use the fill handle to copy them through row 12. Recall from Chapter 1 that the fill handle is a small rectangle in the lower-right corner of the active cell or active range. The following steps copy the formulas using the fill handle.
Excel Chapter 2
Entering Formulas EX 95
1 • Select cell F4 and then point to the fill handle.
• Drag the fill handle down through cell F12 and continue to hold the mouse button to select the destination range (Figure 2–11).
source area is cell F4
initial location of fill handle
destination area range F5:F12
fill handle dragged through cell F12
Figure 2–11
2 • Release the mouse button to copy the formula in cell F4 to the cells in the range F5:F12.
• Select the range H4:J4 and then point to the fill handle (Figure 2–12). initial costs of individual stocks
range H4:J4 selected as source area
Auto Fill Options button appears after copying cell F4 to range F5:F12
Figure 2–12
C6180_Excel2_CTP.4c.indd 95
4/4/07 4:00:06 PM
EX 96 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
3 • Drag the fill handle
Q&A
down through the range H5:J12 to copy the three formulas =D4*G4 in cell H4, =H4-F4 in cell I4, and =I4/F4 in cell J4 to the range H5:J12 (Figure 2–13). How does Excel adjust the cell references in the formulas in the destination area?
current value, gain/loss, and percent gain/loss formulas in range H4:J4 copies to range H5:J12
Auto Fill Options
button appears after Recall that when copying the range you copy a formula, H4:J4 to range H5:J12 Excel adjusts the cell references so the new formulas contain references corresponding to the new location and Figure 2–13 performs calculations using the appropriate values. Thus, if you copy downward, Excel adjusts the row portion of cell references. If you copy across, then Excel adjusts the column portion of cell references. These cell references are called relative cell references.
Other Ways 1. Select source area, click Copy button on Ribbon, select destination area, click Paste button on Ribbon
BTW
2. Select source area, right-click copy area, click Copy on shortcut menu, select destination area, right-click paste area, click Paste on shortcut menu
Automatic Recalculation Every time you enter a value into a cell in the worksheet, Excel automatically recalculates all formulas. You can change to manual recalculation by clicking the Calculation Options button on the Formulas tab on the Ribbon and then clicking Manual. In manual calculation mode, press the F9 key to instruct Excel to recalculate all formulas.
C6180_Excel2_CTP.4c.indd 96
Smart Tags and Option Buttons Excel can identify certain actions to take on specific data in workbooks using smart tags. Data labeled with smart tags includes dates, financial symbols, people’s names, and more. To use smart tags, you must turn on smart tags using the AutoCorrect Options in the Excel Options dialog box. To change AutoCorrect options, click the Office Button, click the Excel Options button on the Office Button menu, point to Proofing, and then click AutoCorrect Options. Once smart tags are turned on, Excel places a small purple triangle, called a smart tag indicator, in a cell to indicate that a smart tag is available. When you move the insertion point over the smart tag indicator, the Smart Tag Actions button appears. Clicking the Smart Tag Actions button arrow produces a list of actions you can perform on the data in that specific cell. In addition to smart tags, Excel also displays Options buttons in a workbook while you are working on it to indicate that you can complete an operation using automatic features such as AutoCorrect, Auto Fill, error checking, and others. For example, the Auto Fill Options button shown in Figure 2–13 appears after a fill operation, such as dragging the fill handle. When an error occurs in a formula in a cell, Excel displays the Trace Error button next to the cell and identifies the cell with the error by placing a green triangle in the upper left of the cell. Table 2–4 summarizes the smart tag and Options buttons available in Excel. When one of these buttons appears on your worksheet, click the button arrow to produce the list of options for modifying the operation or to obtain additional information.
4/4/07 4:00:08 PM
Table 2–4 Smart Tag and Options Buttons in Excel Button
Name
Menu Function
Auto Fill Options
Gives options for how to fill cells following a fill operation, such as dragging the fill handle.
AutoCorrect Options
Undoes an automatic correction, stops future automatic corrections of this type, or causes Excel to display the AutoCorrect Options dialog box.
Insert Options
Lists formatting options following an insertion of cells, rows, or columns.
Paste Options
Specifies how moved or pasted items should appear (for example, with original formatting, without formatting, or with different formatting).
Smart Tag Actions
Lists information options for a cell containing data recognized by Excel, such as a stock symbol.
Trace Error
Lists error checking options following the assignment of an invalid formula to a cell.
Excel Chapter 2
Entering Formulas EX 97
The next step is to determine the totals in row 13 for the initial cost in column F, current value in column H, and gain/loss in column I. To determine the total initial cost in column F, the values in the range F4 through F12 must be summed. To do so, enter the function =sum(f4:f12) in cell F13 or select cell F13 and then click the Sum button on the Ribbon and then press the ENTER key. Recall that a function is a prewritten formula that is built into Excel. Similar SUM functions or the Sum button can be used in cells H13 and I13 to determine total current value and total gain/loss, respectively.
1
Select cell F13. Click the Sum button on the Ribbon and then click the Enter button.
2
Select the range H13:I13. Click the Sum button on the Ribbon to display the totals in row 13 as shown in Figure 2–14.
BTW
To Determine Totals Using the Sum Button Selecting a Range You can select a range using the keyboard. Press the F8 key and then use the arrow keys to select the desired range. After you are finished, make sure to press the F8 key to turn off the selection or you will continue to select ranges.
Sum button
total initial cost
total current value total gain/loss
Figure 2–14
C6180_Excel2_CTP.4c.indd 97
4/4/07 4:00:10 PM
EX 98 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
To Determine the Total Percent Gain/Loss
1
Select cell J12 and then point to the fill handle.
2
Drag the fill handle down through cell J13 to copy the formula in cell J12 to cell J13 (Figure 2–15).
Q&A
With the totals in row 13 determined, the next step is to copy the percent gain/loss formula in cell J12 to cell J13 as performed in the following steps.
Why was the formula I13/F13 not copied to cell J13 earlier? The formula, I13/F13, was not copied to cell J13 when cell J4 was copied to the range J5:J12 because both cells involved in the computation (I13 and F13) were blank, or zero, at the time. A blank cell in Excel has a numerical value of zero, which would have resulted in an error message in cell J13. Once the totals were determined, both cells I13 and F13 (especially F13, because it is the divisor) had nonzero numerical values.
formula is =I12/F12
formula is =I13/F13
BTW
BTW
Auto Fill Options button appears after copying cell J12 to cell J13
Entering Functions You can drag the Function Arguments dialog box (Figure 2–20 on page EX 101) out of the way in order to select a range. You also can click the Collapse Dialog button to the right of the Number 1 box to hide the Function Arguments dialog box. After selecting the range, click the Collapse Dialog button a second time. Statistical Functions Excel usually considers a blank cell to be equal to 0. The statistical functions, however, ignore blank cells. Excel thus calculates the average of 3 cells with values of 7, blank, and 5 to be 6 or (7 + 5) / 2 and not 4 or (7 + 0 + 5) / 3.
C6180_Excel2_CTP.4c.indd 98
Figure 2–15
Using the AVERAGE, MAX, and MIN Functions The next step in creating the Silver Dollars Stock Club Portfolio Summary worksheet is to compute the average, highest value, and lowest value for the number of shares listed in the range D4:D12 using the AVERAGE, MAX, and MIN functions in the range D14:D16. Once the values are determined for column D, the entries can be copied across to the other columns. Excel includes prewritten formulas called functions to help you compute these statistics. A function takes a value or values, performs an operation, and returns a result to the cell. The values that you use with a function are called arguments. All functions begin with an equal sign and include the arguments in parentheses after the function name. For example, in the function =AVERAGE(D4:D12), the function name is AVERAGE, and the argument is the range D4:D12. With Excel, you can enter functions using one of five methods: (1) the keyboard or mouse; (2) the Insert Function box in the formula bar; (3) the Sum menu; (4) the AutoSum command on the Formulas tab on the Ribbon; and (5) the Name box area in the formula
4/4/07 4:00:13 PM
bar (Figure 2–16). The method you choose will depend on your typing skills and whether you can recall the function name and required arguments. In the following pages, each of the first three methods will be used. The keyboard and mouse method will be used to determine the average number of shares (cell D14). The Insert Function button in the formula bar method will be used to determine the highest number of shares (cell D15). The Sum menu method will be used to determine the lowest number of shares (cell D16).
Excel Chapter 2
Using the AVERAGE, MAX, and MIN Functions EX 99
To Determine the Average of a Range of Numbers Using the Keyboard and Mouse The AVERAGE function sums the numbers in the specified range and then divides the sum by the number of nonzero cells in the range. The following steps use the AVERAGE function to determine the average of the numbers in the range D4:D12.
1 • Select cell D14. • Type =av in the cell to display the Formula AutoComplete list.
• Point to the
Q&A
AVERAGE function name (Figure 2–16).
Name box changes to Function box as soon as = (equal sign) is entered to start function
What is happening as I type? As you type the equal sign followed by the characters in the name of a function, Excel displays the Formula AutoComplete list. This list contains those functions that alphabetically match the letters you have typed. Because you typed =av, Excel displays all the functions that begin with the letters av.
C6180_Excel2_CTP.4c.indd 99
ScreenTip includes description of currently selected function in Formula AutoComplete list =av typed in cell D14
Formula AutoComplete list AVERAGE function name
Figure 2–16
4/4/07 4:00:15 PM
EX 100 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
2 • Double-click AVERAGE in the Formula AutoComplete list to select the AVERAGE function.
• Select the range D4:D12 to insert
Q&A
the range as the argument to the AVERAGE function (Figure 2–17). As I drag, why does the function in cell D14 change? When you click cell D4, Excel appends cell D4 to the left parenthesis in the formula bar and surrounds cell D4 with a marquee. When you begin dragging, Excel appends to the argument a colon (:) and the cell reference of the cell where the mouse pointer is located.
3 • Click the Enter box to compute
marquee surrounds selected range D4:D12
AVERAGE function ScreenTip
Q&A
the average of the nine numbers in the range D4:D12 and display the result in cell D14 (Figure 2–18). Can I use the arrow keys to complete the entry instead?
Figure 2–17 Function box changes back to Name box
No. When you use Point mode you cannot use the arrow keys to complete the entry. While in Point mode, the arrow keys change the selected cell reference in the range you are selecting. Q&A
AVERAGE function with range to average shows in active cell and formula bar
Enter box
when cell D14 is active cell, formula bar displays AVERAGE function
right parenthesis automatically appended when Enter box clicked or ENTER key pressed
What is the purpose of the parentheses in the function? The AVERAGE function requires that the argument (in this case, the range D4:D12) be included within parentheses following the function name. Excel automatically appends the right parenthesis to complete the AVERAGE function when you click the Enter box or press the ENTER key.
average shares per stock
Figure 2–18 Other Ways 1. Click Insert Function box in formula bar, click AVERAGE function 2. Click Sum button arrow on Ribbon, click Average function
C6180_Excel2_CTP.4c.indd 100
3. Click Formulas tab on Ribbon, click AutoSum button arrow, click Average function
4/4/07 4:00:17 PM
To Determine the Highest Number in a Range of Numbers Using the Insert Function Box The next step is to select cell D15 and determine the highest (maximum) number in the range D4:D12. Excel has a function called the MAX function that displays the highest value in a range. Although you could enter the MAX function using the keyboard and Point mode as described in the previous steps, an alternative method to entering the function is to use the Insert Function box in the formula bar, as performed in the following steps.
Excel Chapter 2
Using the AVERAGE, MAX, and MIN Functions EX 101
1 • Select cell D15. • Click the Insert Function box in the
Insert Function button
formula bar to display the Insert Function dialog box.
Insert Function dialog box
Or select a category box
Search for a function box
• When Excel displays the Insert Function dialog box, click MAX in the ‘Select a function’ list (Figure 2–19).
MAX selected in Select a function list
equal sign automatically inserted in active cell and formula bar Help on this function link
OK button
Figure 2–19
2 • Click the OK button. Function Arguments dialog box
• When Excel displays the Function
range typed in Number1 box
Q&A
Arguments dialog box, type d4:d12 in the Number1 box (Figure 2–20).
Collapse Dialog button
Why did numbers appear in the Function Arguments dialog box? As shown in Figure 2–20, Excel displays the value the MAX function will return to cell D15 in the Function Arguments dialog box. It also lists the first few numbers in the selected range, next to the Number1 box.
first few numbers in selected range
result of function
Help on this function link
last part of function appears in active cell
OK button
Figure 2–20
C6180_Excel2_CTP.4c.indd 101
4/4/07 4:00:21 PM
EX 102 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
3 • Click the OK button to display the
Q&A
highest value in the range D4:D12 in cell D15 (Figure 2–21). Why should I not just enter the highest value that I see in the range D4:D12 in cell D15?
MAX function determines highest value in range D4:D12
In this example, rather than entering the MAX function, you easily could scan the range D4:D12, determine that the highest number of shares is 990, and manually enter the number 990 as a constant in cell D15. Excel would display the number the same as in Figure 2–21. Because it contains a constant, however, Excel will continue to display 990 in cell D15, even if the values in the range D4:D12 change. If you use the MAX function, Excel will recalculate the highest value in the range D4:D9 each time a new value is entered into the worksheet.
highest value in range D4:D12
Figure 2–21
Other Ways 1. Click Sum button arrow on Ribbon, click Max function
2. Click Formulas tab on Ribbon, click AutoSum button arrow, click Max function
3. Type =MAX in cell
To Determine the Lowest Number in a Range of Numbers Using the Sum Menu The next step is to enter the MIN function in cell D16 to determine the lowest (minimum) number in the range D4:D12. Although you can enter the MIN function using either of the methods used to enter the AVERAGE and MAX functions, the following steps perform an alternative using the Sum button on the Ribbon.
1 • Select cell D16.
Sum button arrow
• Click the Sum button arrow on the
Q&A
Ribbon to display the Sum button menu (Figure 2–22). Sum button menu
Why should I use the Sum button menu? Using the Sum button menu allows you to enter one of five often-used functions easily into a cell, without having to memorize its name or the required arguments.
Min function
D16 is active cell
Figure 2–22
C6180_Excel2_CTP.4c.indd 102
4/4/07 4:00:24 PM
2 • Click Min to display the function
Q&A
=MIN(D14:D15) in the formula bar and in cell D16 (Figure 2–23).
Excel Chapter 2
Using the AVERAGE, MAX, and MIN Functions EX 103
Why does Excel select the range D14:D15? The range D14:D15 automatically selected by Excel is not correct. Excel attempts to guess which cells you want to include in the function by looking for adjacent ranges to the selected cell that contain numeric data.
MIN function appears in formula bar
Excel selects range D14:D15 because it includes numbers and is adjacent to cell D16
MIN function appears in active cell D16
Figure 2–23
3 • Click cell D4 and then drag
Enter box
through cell D12 to display the function in the formula bar and in cell D14 with the new range (Figure 2–24).
range D4:D12 selected using Point mode
selected range appears in active cell and in formula bar
Figure 2–24
C6180_Excel2_CTP.4c.indd 103
4/4/07 4:00:28 PM
EX 104 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
4 • Click the Enter box to determine
Q&A
the lowest value in D4:D12 and display the result in the formula bar and in cell D14 (Figure 2–25). How can I use other functions? Excel has more than 400 additional functions that perform just about every type of calculation you can imagine. These functions are categorized in the Insert Function dialog box shown in Figure 2–19 on page EX 101. To view the categories, click the ‘Or select a category‘ box arrow. To obtain a description of a selected function, select its name in the Insert Function dialog box. Excel displays the description of the function below the Select a function list in the dialog box.
MIN function determines lowest value in range D4:D12
result of MIN function appears in cell
Figure 2–25 Other Ways 1. Click Insert Function box in formula bar, click MIN function
2. Click Formulas tab on Ribbon, click AutoSum button arrow, click Min function
3. Type =MIN in cell
To Copy a Range of Cells across Columns to an Adjacent Range Using the Fill Handle The next step is to copy the AVERAGE, MAX, and MIN functions in the range D14:D16 to the adjacent range E14:J16. The following steps use the fill handle to copy the functions.
1 • Select the range D14:D16.
copy range D14:D16 selected
• Drag the fill handle in the lower-right corner of the selected range through cell J16 and continue to hold down the mouse button (Figure 2–26).
fill handle dragged to select destination area, range E14:J16
mouse pointer
Figure 2–26
C6180_Excel2_CTP.4c.indd 104
4/4/07 4:00:30 PM
2 • Release the mouse button to copy
Q&A
the three functions to the range E14:J16 (Figure 2–27).
Excel Chapter 2
Using the AVERAGE, MAX, and MIN Functions EX 105
How can I be sure that the function arguments are proper for the cells in range E14:J16? Remember that Excel adjusts the cell references in the copied functions so each function refers to the range of numbers above it in the same column. Review the numbers in rows 14 through 16 in Figure 2–27. You should see that the functions in each column return the appropriate values, based on the numbers in rows 4 through 12 of that column.
AVERAGE, MAX, and MIN functions in range D14:D16 copied to range E14:J16
Auto Fill Options button
Figure 2–27
3 • Select cell J14 and press the DELETE key to delete the
Save button
Q&A
average of the percent gain/loss (Figure 2–28). Why is the formula in cell J14 deleted? The average of the percent gain/ loss in cell J14 is deleted because an average of percentages of this type is mathematically invalid. Other Ways 1. Select source area and point to border of range, while holding down CTRL key, drag source area to destination area 2. Select source area, on Ribbon click Copy button, select destination area, on Ribbon click Paste button 3. Right-click source area, click Copy on shortcut menu, right-click destination area, click Paste on shortcut menu 4. Select source area, press CTRL+C, select destination area, press CTRL+V
C6180_Excel2_CTP.4c.indd 105
average percents in range J4:J12 mathematically invalid
Figure 2–28
4/4/07 4:00:33 PM
EX 106 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
To Save a Workbook Using the Same File Name
1
Click the Save button on the Quick Access Toolbar to save the workbook on the USB flash drive using the file name, Silver Dollars Stock Club Portfolio Summary.
Q&A
Earlier in this project, an intermediate version of the workbook was saved using the file name, Silver Dollars Stock Club Portfolio Summary. The following step saves the workbook a second time using the same file name.
Why did Excel not display the Save As dialog box? When you save a workbook a second time using the same file name, Excel will not display the Save As dialog box as it does the first time you save the workbook. Excel automatically stores the latest version of the workbook using the same file name, Silver Dollars Stock Club Portfolio Summary. You also can click Save on the Office Button menu or press SHIFT+F12 or CTRL+S to save a workbook again.
Verifying Formulas Using Range Finder One of the more common mistakes made with Excel is to include a wrong cell reference in a formula. An easy way to verify that a formula references the cells you want it to reference is to use Excel’s Range Finder. Use the Range Finder to check which cells are referenced in the formula assigned to the active cell. Range Finder allows you to make immediate changes to the cells referenced in a formula. To use Range Finder to verify that a formula contains the intended cell references, double-click the cell with the formula you want to check. Excel responds by highlighting the cells referenced in the formula so you can check that the cell references are correct.
To Verify a Formula Using Range Finder The following steps use Range Finder to check the formula in cell J4.
1 • Double-click cell J4 to activate
cells referenced in formula in active cell are highlighted with corresponding colors
Range Finder (Figure 2–29).
2 • Press the ESC key to quit Range Finder and then select cell A18.
color of cell references corresponds to color of highlighted cells
Figure 2–29
C6180_Excel2_CTP.4c.indd 106
4/4/07 4:00:37 PM
Formatting the Worksheet Although the worksheet contains the appropriate data, formulas, and functions, the text and numbers need to be formatted to improve their appearance and readability. In Chapter 1, cell styles were used to format much of the worksheet. This section describes how to change the unformatted worksheet in Figure 2–30a to the formatted worksheet in Figure 2–30b using a theme and other commands on the Ribbon. A theme is a predefined set of colors, fonts, chart styles, cell styles, and fill effects that can be applied to an entire workbook. Every new workbook that you create is assigned a default theme named Office. The colors and fonts that are used in the worksheet shown in Figure 2–30b are those that are associated with the Concourse theme.
Excel Chapter 2
Formatting the Worksheet EX 107
(a) Unformatted Worksheet
turquoise background
Title cell style applied to title and subtitle thick box border surrounds worksheet title and subtitle
column titles centered
row height increased
negative numbers displayed with lightred background
Heading 3 cell style applied to row 3
Comma style format
Total cell style applied to row 13
row height increased
data centered in cells dates formatted to mm/dd/yy style
Currency style format Percent style format
column width changed
(b) Formatted Worksheet Figure 2–30
C6180_Excel2_CTP.4c.indd 107
4/4/07 4:00:39 PM
EX 108 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
Plan Ahead
Identify how to format various elements of the worksheet. The following outlines the formatting suggested in the sketch of the worksheet in Figure 2–3 on page EX 85: 1. Workbook theme - Concourse 2. Worksheet title and subtitle a. Alignment — center across columns A through J b. Cell style —Title c. Font size — title 18; subtitle 16 d. Background color (range A1:J2) — Turquoise Accent 1, Lighter 60% e. Border — thick box border around range A1:J2 3. Column titles
BTW
a. Cell style — Heading 3 Colors Knowing how people perceive colors helps you emphasize parts of your worksheet. Warmer colors (red and orange) tend to reach toward the reader. Cooler colors (blue, green, and violet) tend to pull away from the reader. Bright colors jump out of a dark background and are easiest to see. White or yellow text on a dark blue, green, purple, or black background is ideal.
b. Alignment — center 4. Data a. Alignment — center data in column B b. Dates in column C — mm/dd/yy format c. Numbers in top row (range E4:I4) — Accounting style d. Numbers below top row (range E5:I12) — Comma style and decimal places 5. Total line a. Cell style — Total b. Numbers — Accounting style 6. Average, Highest, and Lowest rows a. Font style of row titles in range A14:A16 — bold b. Numbers — Currency style with floating dollar sign in the range E14:I16 7. Percentages in column J a. Numbers — Percentage style with two decimal places; if a cell in range J4:J12 is less than zero, then cell appears with background color of light red 8. Column widths a. Column A — 14.11 characters b. Columns B and C — best fit c. Column D — 6.00 characters d. Column E, G, and J — 9.00 characters e. Columns F, H, and I — 12.67 characters 9. Row heights a. Row 3 — 60.00 points b. Row 14 — 26.25 points c. Remaining rows — default
C6180_Excel2_CTP.4c.indd 108
4/4/07 4:00:42 PM
To Change the Workbook Theme The Concourse theme includes fonts and colors that provide the worksheet a professional and subtly colored appearance. The following steps change the workbook theme to the Concourse theme.
1 • Click the Page Layout tab on the
Excel Chapter 2
Formatting the Worksheet EX 109
Page Layout tab
Ribbon.
• Click the Themes button on the Ribbon to display the Theme gallery (Figure 2–31).
Themes button
I Experiment
Current theme
• Point to several themes in the
Q&A
Theme gallery to see a live preview of the themes.
Concourse theme
Why should I change the theme of a workbook?
Theme gallery
A company or department may standardize on a specific theme so that all of their documents have a similar appearance. Similarly, an individual may want to have a theme that sets their work apart from others. Other Office applications, such as Word and PowerPoint, include the same themes included with Excel, meaning that all of your Microsoft Office documents can share a common theme.
Figure 2–31
2 • Click Concourse in the Theme
Home tab
Q&A
gallery to change the workbook theme to Concourse (Figure 2–32). Why did the cells in the worksheet change? The cells in the worksheet originally were formatted with the default font for the default Office theme. The default font for the Concourse theme is different than that of the default font for the Office theme and therefore changed on the worksheet when you changed the theme. If you had modified the font for any of the cells, those cells would not receive the default font for the Concourse theme.
C6180_Excel2_CTP.4c.indd 109
font of worksheet cells reflects theme’s default font
Figure 2–32
4/4/07 4:00:43 PM
Background Colors The most popular background color is blue. Research shows that the color blue is used most often because this color connotes serenity, reflection, and proficiency.
To Format the Worksheet Titles The following steps merge and center the worksheet titles, apply the Title cells style to the worksheet titles, and decrease the font of the worksheet subtitle.
1
Click the Home tab on the Ribbon.
2
Select the range A1:J1 and then click the Merge & Center button on the Ribbon.
3
Select the range A2:J2 and then click the Merge & Center button on the Ribbon.
4
Select the range A1:A2, click the Cell Styles button on the Ribbon, and then click the Title cell style in the Cell Styles gallery.
5
Select cell A2 and then click the Decrease Font Size button on the Ribbon (Figure 2–33).
Q&A
BTW
EX 110 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
What is the effect of clicking the Decrease Font Size button? When you click the Decrease Font Size button Excel assigns the next lowest font size in the Font Size gallery to the selected range. The Increase Font Size button works in a similar manner, but causes Excel to assign the next highest font size in the Font Size gallery to the selected range.
Decrease Font Size button
Increase Font Size button
Merge & Center button
Cell Styles button
font size of worksheet subtitle decreased
Figure 2–33
To Change the Background Color and Apply a Box Border to the Worksheet Title and Subtitle The final formats assigned to the worksheet title and subtitle are the turquoise background color and thick box border (Figure 2–30b on page EX 107). The following steps complete the formatting of the worksheet titles.
1 • Select the range A1:A2
Fill Color button arrow
and then click the Fill Color button arrow on the Ribbon to display the Fill Color palette (Figure 2–34).
desired background color Fill Color palette
range A1:A2 is active range
Figure 2–34
C6180_Excel2_CTP.4c.indd 110
4/4/07 4:00:46 PM
2 • Click Turquoise Accent 1, lighter 60% (column 5, row 3) on the Fill Color palette to change the background color of cells A1 and A2 from white to turquoise (Figure 2–35).
Excel Chapter 2
Formatting the Worksheet EX 111
background of range A1:A2 is turquoise
Figure 2–35
3 • Click the Borders button arrow on the Ribbon to display the Borders gallery (Figure 2–36).
Borders button arrow
Borders gallery
desired border
Figure 2–36
C6180_Excel2_CTP.4c.indd 111
4/4/07 4:00:49 PM
EX 112 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
4 • Click the Thick Box Border command on the Borders gallery to display a thick box border around the range A1:A2.
• Click cell A18 to deselect the range A1:A2 (Figure 2–37). Format Cells: Number Dialog Box Launcher button
Other Ways 1. On Ribbon click Format Cells Dialog Box Launcher, click appropriate tab, click desired format, click OK button
thick box border surrounds worksheet title and subtitle in cells A1:A2
2. Right-click range, click Format Cells on shortcut menu, click appropriate tab, click desired format, click OK button 3. Press CTRL+1, click appropriate tab, click desired format, click OK button
Figure 2–37
To Apply a Cell Style to the Column Headings and Format the Total Rows As shown in Figure 2–30b on page EX 107, the column titles (row 3) have the Heading 3 cell style and the total row (row 13) has the Total cell style. The summary information headings in the range A14:A16 should be bold. The following steps assign these styles to row 3 and row 13 and the range A14:A16.
1
Select the range A3:J3.
2
Apply the Heading 3 cell style to the range A3:J3.
3
Apply the Total cell style to the range A13:J13.
4
Select the range A14:A16 and then click the Bold button on the Ribbon (Figure 2–38).
Bold button
Center button
Format Cells Dialog Box Launcher
column headings formatted with Heading 3 cell style
total row formatted with Total cell style range A14:A16 formatted bold
Figure 2–38
C6180_Excel2_CTP.4c.indd 112
4/4/07 4:00:52 PM
To Center Data in Cells and Format Dates With the column titles and total rows formatted, the next step is to center the stock symbols in column B and format the dates in column C. If a cell entry is short, such as the stock symbols in column B, centering the entries within their respective columns improves the appearance of the worksheet. The following steps center the data in the range B4:B12 and format the dates in the range C4:C12.
1 • Select the range B4:B12 and then
Excel Chapter 2
Formatting the Worksheet EX 113
Format Cells dialog box
click the Center button on the Ribbon to center the data in the range B4:B12.
Number tab
2 • Select the range C4:C12. • Click the Format Cells: Number
Date selected in Category list
3/14/01 style selected in Type list
Dialog Box Launcher on the Ribbon to display the Format Cells dialog box.
• When Excel displays the Format Cells dialog box, if necessary click the Number tab, click Date in the Category list, and then click 3/14/01 in the Type list to choose the format for the range C4:C12 (Figure 2–39). OK button
Figure 2–39
C6180_Excel2_CTP.4c.indd 113
4/4/07 4:00:55 PM
EX 114 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
3 • Click the OK button to format the dates in column C using the date format style, mm/dd/yy.
• Select cell E4 to deselect the Q&A
range C4:C13 (Figure 2–40). Can I format an entire column at once? Yes. Rather than selecting the range B4:B12 in Step 1, you could have clicked the column B heading immediately above cell B1, and then clicked the Center button on the Ribbon. In this case, all cells in column B down to the last cell in the worksheet would have been formatted to use center alignment. This same procedure could have been used to format the dates in column C.
Excel displays dates in range C4:C12 using date style format, mm/dd/yy
Figure 2–40 Other Ways 1. Right-click range, click Format Cells on shortcut menu, click appropriate tab, click desired format, click OK button
BTW
2. Press CTRL+1, click appropriate tab, click desired format, click OK button
Rotating and Shrinking Entries in Cells In addition to aligning entries horizontally and vertically, you also can rotate and shrink entries to fit in a cell. To rotate or shrink entries to fit in a cell, click Format Cells on the shortcut menu, click the Alignment tab in the Format Cells dialog box, and then select the type of control you want.
C6180_Excel2_CTP.4c.indd 114
Formatting Numbers Using the Ribbon As shown in Figure 2–30b on page EX 107, the worksheet is formatted to resemble an accounting report. For example, in columns E through I, the numbers in the first row (row 4), the totals row (row 13), and the rows below the totals (rows 14 through 16) have dollar signs, while the remaining numbers (rows 5 through 12) in columns E through I do not. To append a dollar sign to a number, you should use the Accounting number format. Excel displays numbers using the Accounting number format with a dollar sign to the left of the number, inserts a comma every three positions to the left of the decimal point, and displays numbers to the nearest cent (hundredths place). Clicking the Accounting Number Format button on the Ribbon assigns the desired Accounting number format. When you use the Accounting Number Format button to assign the Accounting number format, Excel displays a fixed dollar sign to the far left in the cell, often with spaces between it and the first digit. To assign a floating dollar sign that appears immediately to the left of the first digit with no spaces, use the Currency style in the Format Cells dialog box. The Comma style format is used to instruct Excel to display numbers with commas and no dollar signs. The Comma style format, which can be assigned to a range of cells by clicking the Comma Style button on the Ribbon, inserts a comma every three positions to the left of the decimal point and causes numbers to be displayed to the nearest hundredths.
4/4/07 4:00:57 PM
To Apply an Accounting Style Format and Comma Style Format Using the Ribbon The following steps show how to assign formats using the Accounting Number Format button and the Comma Style button on the Ribbon.
1 • Select the range E4:I4.
Excel Chapter 2
Formatting the Worksheet EX 115
Accounting Number Format button
• While holding down the CTRL key, select the ranges F13:I13.
• Click the Accounting Number
Q&A
Format button on the Ribbon (Figure 2–41) to apply the Accounting style format with fixed dollar signs to the nonadjacent ranges E4:I4 and F13:I13 (Figure 2–41). What is the effect of applying the Accounting style format? The Accounting Number Format button assigns a fixed dollar sign to the numbers in Excel displays nonadjacent the ranges E4:I4 and ranges E4:I4 and F13:I13 using F13:I13. In each cell in the Accounting style format with fixed dollar signs these ranges, Excel displays the dollar sign to the far left with spaces between it and the first digit in the cell. Figure 2–41
2 • Select the range E5:I12. Comma Style button
• Click the Comma Style button on the Ribbon to assign the Comma style format to the range E5:I12 (Figure 2–42).
width of columns automatically increased due to formatting
range E5:I12 selected
Excel displays range E5:I12 using Comma style format
C6180_Excel2_CTP.4c.indd 115
parentheses indicate number is negative
Figure 2–42
4/4/07 4:00:59 PM
EX 116 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
3 • Click cell E4.
Increase Decimal button
Decrease Decimal button
• While holding down the CTRL key, select cell G4.
• Click the Increase Decimal button on the Ribbon to increase the number of decimal places displayed in cell E4 and G4.
Excel displays numbers to three decimal places
• Select the range E5:E12. While holding down the CTRL key, select the range G5:G12.
• Click the Increase Decimal button on
Q&A
the Ribbon to increase the number of decimal places displayed in selected ranges (Figure 2–43). What is the effect of clicking the Increase Decimal button?
Figure 2–43
The Increase Decimal button instructs Excel to display additional decimal places in a cell. Each time you click the Increase Decimal button, Excel adds a decimal place to the selected cell.
To Apply a Currency Style Format with a Floating Dollar Sign Using the Format Cells Dialog Box The following steps use the Format Cells dialog box to apply the Currency style format with a floating dollar sign to the numbers in the ranges E14:I16.
1 • Select the range E14:I16 and then point to the Format Cells: Number Dialog Box Launcher on the Ribbon (Figure 2–44).
Format Cells: Number Dialog Box Launcher
Enhanced ScreenTip
range E14:I16 selected
Figure 2–44
C6180_Excel2_CTP.4c.indd 116
4/4/07 4:01:02 PM
2 • Click the Format Cells: Number
Format Cells dialog box Number tab
Dialog Box Launcher.
sample of how number in upper-left cell of selected range will appear
• If necessary, click the Number tab in the Format Cells dialog box.
• Click Currency in the Category
Q&A
list and then click the third style ($1,234.10) in the Negative numbers list (Figure 2–45).
Excel Chapter 2
Formatting the Worksheet EX 117
number of decimal places Currency style selected $ symbol selected
How do I select the proper format?
Negative numbers list
You can choose from 12 categories of formats. Once you select a category, you can select the number of decimal places, whether or not a dollar sign should be displayed, and how negative numbers should appear. Selecting the appropriate negative numbers format is important, because doing so adds a space to the right of the number in order to align the numbers in the worksheet on the decimal points. Some of the available negative number formats do not align the numbers in the worksheet on the decimal points.
OK button
Figure 2–45
3 • Click the OK button to assign
Q&A
the Currency style format with a floating dollar sign to the range E14:I16 (Figure 2–46). Should I click the Accounting Number Style button on the Ribbon or use the Format Cells dialog box?
Excel displays range E14:I16 using Currency style format with floating dollar signs
Recall that a floating dollar sign always appears immediately to the left of the first digit, and the fixed dollar sign always appears on the left side of the cell. Cell E4, for example, has a fixed dollar sign, while cell E14 has a floating dollar sign. The Currency style was assigned to cell E14 using the Format Cells dialog box and the result is a floating dollar sign.
parentheses surround negative numbers
Figure 2–46
Other Ways 1. Press CTRL+1, click Number tab, click Currency in Category list, select format, click OK button
C6180_Excel2_CTP.4c.indd 117
2. Press CTRL+SHIFT+ DOLLAR SIGN ($)
4/4/07 4:01:05 PM
EX 118 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
To Apply a Percent Style Format and Use the Increase Decimal Button The next step is to format the percent gain/loss in column J. Currently, Excel displays the numbers in column J as a decimal fraction (for example, 0.284874 in cell J4). The following steps format the range J4:J16 to the Percent style format with two decimal places.
1 • Select the range J4:J16. • Click the Percent Style button on
Percent Style button
Increase Decimal button
Decrease Decimal button
Q&A
the Ribbon to display the numbers in column J as a rounded whole percent. What is the result of clicking the Percent Style button? The Percent Style button instructs Excel to display a value as a percentage, determined by multiplying the cell entry by 100, rounding the result to the nearest percent, and adding a percent sign. For example, when cell J4 is formatted using the Percent Style and Increase Decimal buttons, Excel displays the actual value 0.284874 as 28.49%.
Excel displays range J4:J16 using Percent style format with two decimal places
2 • Click the Increase Decimal button on the Ribbon two times to display the numbers in column J with the Percent style format and two decimal places (Figure 2–47).
Figure 2–47
Other Ways 1. Right-click range, click Format Cells on shortcut menu, click Number tab, click Percentage in Category list, select format, click OK button 2. Press CTRL+1, click Number tab, click Percentage in Category list, select format, click OK button 3. Press CTRL+SHIFT+ PERCENT SIGN (%)
C6180_Excel2_CTP.4c.indd 118
Conditional Formatting The next step is to emphasize the negative percentages in column J by formatting them to appear with a tinted background. The Conditional Formatting button on the Ribbon will be used to complete this task. Excel lets you apply formatting that appears only when the value in a cell meets conditions that you specify. This type of formatting is called conditional formatting. You can apply conditional formatting to a cell, a range of cells, the entire worksheet, or the entire workbook. Usually, you apply conditional formatting to a range of cells that contains values you want to highlight, if conditions warrant. For example, you can instruct Excel to change the color of the background of a cell if the value in the cell meets a condition, such as being less than 0 as shown in Figure 2–48. A condition, which is made up of two values and a relational operator, is true or false for each cell in the range. If the condition is true, then Excel applies the formatting. If the condition is false, then Excel suppresses the formatting. What makes conditional formatting so powerful is that the cell’s appearance can change as you enter new values in the worksheet.
4/4/07 4:01:09 PM
To Apply Conditional Formatting The following steps assign conditional formatting to the range J4:J12, so that any cell value less than zero will cause Excel to display the number in the cell with a light red background.
1 • Select the range J4:J12.
Excel Chapter 2
Formatting the Worksheet EX 119
Conditional Formatting button
• Click the Conditional Formatting button on the Ribbon to display the Conditional Formatting gallery (Figure 2–48).
Conditional Formatting gallery
range J4:J12 selected
New Rule command
Figure 2–48
2 • Click New Rule in the Conditional
New Formatting Rule dialog box Select a Rule Type list
Formatting gallery to display the New Formatting Rule dialog box.
• Click ‘Format only cells that contain‘ in the Select a Rule Type area.
• In the Edit the Rule Description area, click the box arrow in the relational operator box (second text box) and then select less than.
• Type 0 (zero) in the rightmost box in the Edit the Rule Description area (Figure 2–49).
Edit the Rule Description area
relational operator
value 2
Format button value 1
Figure 2–49
C6180_Excel2_CTP.4c.indd 119
4/4/07 4:01:11 PM
EX 120 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
3 • Click the Format button.
• When Excel displays the Format Cells dialog box, click the Fill tab and then click the light red color in column 6, row 2 (Figure 2–50).
desired fill color
Sample area displays fill color
OK button
Figure 2–50
4 • Click the OK button to close the Format Cells dialog box and display the New Formatting Rule dialog box with the desired color displayed in the Preview box (Figure 2–51).
New Formatting Rule dialog box
Preview box displays format assigned to cell in selected range if value in cell is less than 0
OK button
Figure 2–51
C6180_Excel2_CTP.4c.indd 120
4/4/07 4:01:14 PM
5 • Click the OK button to assign the conditional format to the range J4:J12.
Excel Chapter 2
Formatting the Worksheet EX 121
• Click cell A18 to deselect the range J4:J12 (Figure 2–52).
Excel displays negative numbers in range J4:J12 with a light red background
Conditional Formatting Operators As shown in Figure 2–49 on page EX 119, the second text box in the New Formatting Rule dialog box allows you to select a relational operator, such as less than, to use in the condition. The eight different relational operators from which you can choose for conditional formatting in the New Formatting Rule dialog box are summarized in Table 2–5. Table 2–5 Summary of Conditional Formatting Relational Operators Relational Operator
Description
Between
Cell value is between two numbers
Not between
Cell value is not between two numbers
Equal to
Cell value is equal to a number
Not equal to
Cell value is not equal to a number
Greater than
Cell value is greater than a number
Less than
Cell value is less than a number
Greater than or equal to
Cell value is greater than or equal to a number
Less than or equal to
Cell value is less than or equal to a number
C6180_Excel2_CTP.4c.indd 121
BTW
Figure 2–52
Conditional Formatting You can assign any format to a cell, a range of cells, a worksheet, or an entire workbook conditionally. If the value of the cell changes and no longer meets the specified condition, Excel suppresses the conditional formatting.
4/4/07 4:01:18 PM
EX 122 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
BTW
Hidden Columns Trying to unhide a range of columns using the mouse can be frustrating. An alternative is to use the keyboard: select the columns to the right and left of the hidden columns and then press CTRL+SHIFT+) (RIGHT PARENTHESIS). To use the keyboard to hide a range of columns, press CTRL+0 (ZERO).
Changing the Widths of Columns and Heights of Rows When Excel starts and displays a blank worksheet on the screen, all of the columns have a default width of 8.43 characters, or 64 pixels. A character is defined as a letter, number, symbol, or punctuation mark in 11-point Calibri font, the default font used by Excel. An average of 8.43 characters in 11-point Calibri font will fit in a cell. Another measure of the height and width of cells is pixels, which is short for picture element. A pixel is a dot on the screen that contains a color. The size of the dot is based on your screen’s resolution. At a common resolution of 1024 ⫻ 768, 1024 pixels appear across the screen and 768 pixels appear down the screen for a total of 786,432 pixels. It is these 786,432 pixels that form the font and other items you see on the screen. The default row height in a blank worksheet is 15 points (or 20 pixels). Recall from Chapter 1 that a point is equal to 1/72 of an inch. Thus, 15 points is equal to about 1/5 of an inch. You can change the width of the columns or height of the rows at any time to make the worksheet easier to read or to ensure that Excel displays an entry properly in a cell.
To Change the Widths of Columns When changing the column width, you can set the width manually or you can instruct Excel to size the column to best fit. Best fit means that the width of the column will be increased or decreased so the widest entry will fit in the column. Sometimes, you may prefer more or less white space in a column than best fit provides. Excel thus allows you to change column widths manually. When the format you assign to a cell causes the entry to exceed the width of a column, Excel automatically changes the column width to best fit. If you do not assign a format to a cell or cells in a column, the column width will remain 8.43 characters. To set a column width to best fit, double-click the right boundary of the column heading above row 1. The following steps change the column widths: column A to 14.11 characters; columns B and C to best fit; column D to 6.00 characters; columns E, G, and J to 9.00 characters; and columns F, H, and I to 12.67 characters.
1 • Point to the boundary on the right side of the column A heading above row 1. ScreenTip shows proposed column width
• When the mouse pointer changes
Q&A
to a split double arrow, drag until the ScreenTip indicates Width: 14.11 (134 pixels). Do not release the mouse button (Figure 2–53).
mouse pointer
What happens if I change the column width to zero (0)? If you decrease the column width to 0, the column is hidden. Hiding cells is a technique you can use to hide data that might not be relevant to a particular report or sensitive data that you do not want others to see. To instruct Excel to display a hidden column, position the mouse pointer to the right of the column heading boundary where the hidden column is located and then drag to the right.
C6180_Excel2_CTP.4c.indd 122
dotted line shows proposed right border of column A
current right border of column A
Figure 2–53
4/4/07 4:01:20 PM
2 • Release the mouse button. • Drag through column headings B and C above row 1.
columns B and C selected
Excel Chapter 2
Formatting the Worksheet EX 123
mouse pointer pointing to right boundary of column C
• Point to the boundary on the
Q&A
right side of column heading C to cause the mouse pointer to become a split double arrow (Figure 2–54). What if I want to make a large change to the column width? If you want to increase or decrease column width significantly, you can right-click a column heading and then use the Column Width command on the shortcut menu to change the column’s width. To use this command, however, you must select one or more entire columns.
new column A width
Figure 2–54
3 • Double-click the right boundary of column heading C to change the width of columns B and C to best fit.
column widths B and C are set to best fit
columns E, G, and J selected
• Click the column E heading above row 1. mouse pointer
• While holding down the CTRL key,
ScreenTip shows proposed column width
click the column G heading and then the column J heading above row 1 so that columns E, G, and J are selected.
• If necessary, scroll the worksheet to the right so that the right border of column J is visible. Point to the boundary on the right side of the column J heading above row 1.
dotted line shows proposed right border of column G
• Drag until the ScreenTip indicates Width: 9.00 (88 pixels). Do not release the mouse button (Figure 2–55).
Figure 2–55
C6180_Excel2_CTP.4c.indd 123
4/4/07 4:01:22 PM
EX 124 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
4 • Release the mouse button.
ScreenTip shows proposed column width
column widths of E, G, and J set to 9.00 characters
• Click the column F heading above row 1 to select column F.
• While holding down the CTRL key, click the column H heading and then the column I heading above row 1, to select columns F, H, and I.
mouse pointer
• Point to the boundary on the right side of the column I heading above row 1. columns F, H, and I selected
• Drag to the left until the ScreenTip indicates Width: 12.67 (121 pixels). Do not release the mouse button (Figure 2–56).
5 • Release the mouse button.
dotted line shows proposed right border of column I
Figure 2–56
width of column A set to 14.11 characters
width of columns B and C set to best fit
width of column D set to 6.00 characters
widths of columns E, G, and J set to 9.00 characters
• Point to the boundary on the right side of the column D heading above row 1. widths of columns F, H, and I set to 12.67 characters
• Drag to the left until the ScreenTip indicates Width: 6.00 (61 pixels) and then release the mouse button to display the worksheet with the new column widths.
Figure 2–57
• Click cell A18 to deselect columns F, H, and I (Figure 2–57). Other Ways 1. Right-click column heading or drag through multiple column headings and rightclick, click Column Width on shortcut menu, enter desired
C6180_Excel2_CTP.4c.indd 124
column width, click OK button 2. Right-click column heading or drag through multiple column headings and right-
click, click Format button on Ribbon, click Column Width in Format gallery, enter desired column width, click OK button
4/4/07 4:01:26 PM
To Change the Heights of Rows When you increase the font size of a cell entry, such as the title in cell A1, Excel automatically increases the row height to best fit so it can display the characters properly. Recall that Excel did this earlier when multiple lines were entered in a cell in row 3, and when the cell style of the worksheet title and subtitle was changed. You also can increase or decrease the height of a row manually to improve the appearance of the worksheet. The following steps show how to improve the appearance of the worksheet by increasing the height of row 3 to 60.00 points, and increasing the height of row 14 to 26.25 points.
Excel Chapter 2
Formatting the Worksheet EX 125
1 • Point to the boundary below row heading 3.
• Drag down until the ScreenTip indicates Height: 60.00 (80 pixels). Do not release the mouse button (Figure 2–58).
ScreenTip shows proposed height of row 3 current bottom border of row 3
dotted line shows proposed bottom border of row 3 mouse pointer
Figure 2–58
C6180_Excel2_CTP.4c.indd 125
4/4/07 4:01:30 PM
EX 126 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
2 • Release the mouse button. • Point to the boundary below row heading 14.
• Drag down until the ScreenTip
row 3 height is 60.00 points
indicates Height: 26.25 (35 pixels). Do not release the mouse button (Figure 2–59).
dotted line shows proposed bottom border of row 14
ScreenTip shows proposed height of row 14
mouse pointer
current bottom border of row 14
Figure 2–59
3 • Release the mouse button to
formatting of worksheet complete
change the row height of row 14 to 26.25.
• Select cells A3:J3 and then click the Center button on the Ribbon to center the column headings.
Q&A
• Select cell A18 (Figure 2–60). Can I hide a row? Yes. As with column widths, when you decrease the row height to 0, the row is hidden. To instruct Excel to display a hidden row, position the mouse pointer just below the row heading boundary where the row is hidden and then drag down. To set a row height to best fit, double-click the bottom boundary of the row heading.
row 14 height is 26.25 points added white space in row 14 improves appearance of worksheet
Figure 2–60 Other Ways 1. Right-click row heading or drag through multiple row headings and rightclick, click Row Height
C6180_Excel2_CTP.4c.indd 126
on shortcut menu, enter desired row height, click OK button
4/4/07 4:01:32 PM
BTW
Checking Spelling Excel has a spell checker you can use to check the worksheet for spelling errors. The spell checker looks for spelling errors by comparing words on the worksheet against words contained in its standard dictionary. If you often use specialized terms that are not in the standard dictionary, you may want to add them to a custom dictionary using the Spelling dialog box. When the spell checker finds a word that is not in either dictionary, it displays the word in the Spelling dialog box. You then can correct it if it is misspelled.
Hidden Rows You can use the keyboard to unhide a range of rows by selecting the rows immediately above and below the hidden rows and then pressing CTRL+SHIFT+( (LEFT PARENTHESIS). To use the keyboard to hide a range of rows, press CTRL+9.
Excel Chapter 2
Checking Spelling EX 127
To Check Spelling on the Worksheet To illustrate how Excel responds to a misspelled word, the word, Stock, in cell A3 is misspelled purposely as the word, Stcok, as shown in Figure 2–61.
1 • Click cell A3 and then type Stcok to misspell the word Stock.
Spelling dialog box Spelling button
Review tab
• Click cell A1.
Ignore Once button
• Click the Review tab on the Ribbon.
• Click the Spelling
Q&A
button on the Ribbon to run the spell checker and display the misspelled word, Stcok, in the Spelling dialog box (Figure 2–61).
desired word in Suggestions list
Ignore All and Change All buttons impact words throughout document
Add to Dictionary button Change button
AutoCorrect button
misspelled word
indicates language to use in spell check
What happens when the spell checker finds a misspelled word? When the spell checker identifies that a cell contains a word not in its standard or custom dictionary, it selects that cell as the active cell and displays the Spelling dialog box. The Spelling dialog box (Figure 2–61) lists the word not found in the dictionary and a list of suggested corrections.
C6180_Excel2_CTP.4c.indd 127
Figure 2–61
4/4/07 4:01:37 PM
EX 128 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
2 • With the word Stock highlighted in the Suggestions list, click the Change button to change the misspelled word, Stcok, to the correct word, Stock (Figure 2–62).
Save button
• If the Microsoft Office Excel dialog box is displayed, click the OK button.
3 • Select cell A18.
Stcok changed to Stock
• Click the Home tab on the Ribbon. • Click the Save button on the
Q&A
Quick Access Toolbar to save the workbook. What other actions can I take in the Spelling dialog box? If one of the words in the Suggestions list is correct, click it and then click the Change button. If none of the suggestions is correct, type the correct word in the Not in Dictionary text box and then click the Change button. To change the word throughout the worksheet, click the Change All button instead of the Change button. To skip correcting the word, click the Ignore Once button. To have Excel ignore the word for the remainder of the worksheet, click the Ignore All button.
Figure 2–62
Other Ways 1. Press F7
C6180_Excel2_CTP.4c.indd 128
4/4/07 4:01:40 PM
Spell Checking While Excel’s spell checker is a valuable tool, it is not infallible. You should proofread your workbook carefully by pointing to each word and saying it aloud as you point to it. Be mindful of misused words such as its and it’s, through and though, and to and too. Nothing undermines a good impression more than a professional looking report with misspelled words.
Error Checking Always take the time to check the formulas of a worksheet before submitting it to your supervisor. You can check formulas by clicking the Error Checking button on the Formulas tab on the Ribbon. You also should test the formulas by employing data that tests the limits of formulas. Experienced spreadsheet specialists spend as much time testing a workbook as they do creating it, before placing it into production.
• If you select a single cell so that the formula bar is not active and then start the spell checker, Excel checks the remainder of the worksheet, including notes and embedded charts. • If you select a cell other than cell A1 before you start the spell checker, Excel will display a dialog box when the spell checker reaches the end of the worksheet, asking if you want to continue checking at the beginning. • If you select a range of cells before starting the spell checker, Excel checks the spelling of the words only in the selected range. • To check the spelling of all the sheets in a workbook, click Select All Sheets on the sheet tab shortcut menu and then start the spell checker. To instruct Excel to display the sheet tab shortcut menu, right-click any sheet tab. • To add words to the dictionary such as your last name, click the Add to Dictionary button in the Spelling dialog box (Figure 2–61 on page EX 127) when Excel identifies the word as not in the dictionary. • Click the AutoCorrect button (Figure 2–61) to add the misspelled word and the correct version of the word to the AutoCorrect list. For example, suppose you misspell the word, do, as the word, dox. When the spell checker displays the Spelling dialog box with the correct word, do, in the Change to box, click the AutoCorrect button. Then, anytime in the future that you type the word, dox, Excel automatically will change it to the word, do.
Preparing to Print the Worksheet Excel allows for a great deal of customization in how a worksheet appears when printed. For example, the margins on the page can be adjusted. A header or footer can be added to each printed page as well. Excel also has the capability to work on the worksheet in Page Layout View. Page Layout View allows you to create or modify a worksheet while viewing how it will look in printed format. The default view that you have worked in up until this point in the book is called Normal View.
C6180_Excel2_CTP.4c.indd 129
Plan Ahead
BTW
Specify how the printed worksheet should appear. Before printing a worksheet, you should consider how the worksheet will appear when printed. In order to fit as much information on the printed page as possible, the margins of the worksheet should be set to a reasonably small width and height. The current Portfolio Summary worksheet will print on one page. If, however, the club added more data to the worksheet, then it may extend to multiple pages. It is, therefore, a good idea to add a page header to the worksheet that prints in the top margin of each page. In Chapter 1, the worksheet was printed in portrait orientation, which means the printout is printed across the width of the page. Landscape orientation means the printout is printed across the length of the page. Landscape orientation is a good choice for the Silver Dollars Stock Club Portfolio Summary because the printed worksheet’s width is greater than its length.
Excel Chapter 2
Consider these additional guidelines when using the spell checker: • To check the spelling of the text in a single cell, double-click the cell to make the formula bar active and then click the Spelling button on the Review tab on the Ribbon.
BTW
Additional Spell Checker Considerations
BTW
Preparing to Print the Worksheet EX 129
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential – proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
4/4/07 4:01:42 PM
EX 130 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
To Change the Worksheet’s Margins, Header, and Orientation in Page Layout View The following steps change to Page Layout View, narrow the margins of the worksheet, change the header of the worksheet, and set the orientation of the worksheet to landscape.
1 • Click the Page
Page Layout tab
Q&A
Layout View button on the status bar to view the worksheet in Page Layout View (Figure 2–63). What are some key features of Page Layout View? Page Layout View shows the worksheet divided into pages. A blue background separates each page. The white areas surrounding each page indicate the print margins. The top of each page includes a Header area, and the bottom of each page includes a Footer area. Page Layout View also includes a ruler at the top of the page that assists you in placing objects on the page, such as charts and pictures.
Page Layout View shows how worksheet will look in printed format
Page Layout View button
Figure 2–63
2 • Click the Page Layout tab on the Ribbon.
Margins button
• Click the Margins button on the Ribbon to display the Margins gallery (Figure 2–64).
Margins gallery
Narrow margin style worksheet margins set to Normal margin style
Figure 2–64
C6180_Excel2_CTP.4c.indd 130
4/4/07 4:01:43 PM
3 • Click Narrow in the Margins gallery to change the worksheet margins to the Narrow margin style.
Excel Chapter 2
Preparing to Print the Worksheet EX 131
new page header displays in Header area
Header area
• Drag the scroll bar on the right side of the worksheet to the top so that row 1 of the worksheet is displayed.
worksheet margins set to Narrow margin style and column H now is displayed on first page
• Click above the worksheet title in cell A1 in the Header area.
• Type Treasurer: Juan Castillo and then press the ENTER key. Type castillo_ juan37@hotmail. com to complete the worksheet header (Figure 2–65).
Figure 2–65
4 • Select cell B16 to deselect the header. Click the Orientation button on the Ribbon to display the Orientation gallery.
Orientation button
Landscape orientation worksheet set to print in portrait orientation
• Point to Landscape but do not click the mouse button (Figure 2–66).
Figure 2–66
C6180_Excel2_CTP.4c.indd 131
4/4/07 4:01:47 PM
EX 132 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
5 • Click Landscape in
Q&A
the Orientation gallery to change the worksheet’s orientation to landscape (Figure 2–67).
worksheet set to print in landscape orientation
Do I need to change the orientation every time I want to print the worksheet? No. Once you change the orientation and save the workbook, Excel will save the orientation setting Figure 2–67 for that workbook until you change it. When you open a new workbook, Excel sets the orientation to portrait. Other Ways 1. Click Page Layout tab on Ribbon, click Page Setup Dialog Box Launcher, click Page tab, click Portrait or Landscape, click OK button
Previewing and Printing the Worksheet In Chapter 1, the worksheet was printed without first previewing it on the screen. By previewing the worksheet, however, you see exactly how it will look without generating a printout. Previewing a worksheet using the Print Preview command can save time, paper, and the frustration of waiting for a printout only to discover it is not what you want.
To Preview and Print a Worksheet The following steps preview and then print the worksheet.
1 • Click the Office Button and then point to Print on the Office Button menu to display the Print submenu (Figure 2–68).
Office Button
Print Preview command
Print command
Figure 2–68
C6180_Excel2_CTP.4c.indd 132
4/4/07 4:01:50 PM
2 • Click Print Preview
Q&A
on the Print submenu to display a preview of the worksheet in landscape orientation (Figure 2–69).
Preview window
Excel Chapter 2
Previewing and Printing the Worksheet EX 133
Print button
What is the purpose of the buttons in the Print Preview area? The Print button displays the Print dialog box and allows you to print the worksheet. The Page Setup button displays the Page Setup dialog box. The Zoom button allows you to zoom in and out of the page displayed in Figure 2–69 the Preview window. You also can click the previewed page in the Preview window when the mouse pointer shape is a magnifying glass to carry out the function of the Zoom button.
3 • Click the Print
Print dialog box
Q&A
button to display the Print dialog box (Figure 2–70). How can I use the Print dialog box? When you click the Print command on the Print submenu of the Office Button OK button menu or a Print button in a dialog box or Preview window, Excel displays the Print dialog box shown in Figure 2–70. Excel does not display the Print dialog box when you use the Print button on the Quick Access Toolbar, as was the case in Chapter 1. The Print dialog box allows you to select a Figure 2–70 printer, instruct Excel what to print, and indicate how many copies of the printout you want.
C6180_Excel2_CTP.4c.indd 133
4/4/07 4:01:52 PM
EX 134 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
4 • Click the OK
worksheet printed in landscape orientation
button to print the worksheet (Figure 2–71).
Other Ways 1. Click Page Layout tab on Ribbon, click Page Setup Dialog Box Launcher, click appropriate tab, change desired options, click Print, click OK button
Figure 2–71
To Print a Section of the Worksheet You might not always want to print the entire worksheet. You can print portions of the worksheet by selecting the range of cells to print and then clicking the Selection option button in the Print what area in the Print dialog box. The following steps print the range A3:F16.
1 • Select the range A3:F16. • Click the Office Button and then
Print dialog box
click Print on the Office Button menu to display the Print dialog box.
• Click Selection in the Print what area to instruct Excel to print only the selected range (Figure 2–72).
Selection option button selected
OK button
range A3:F16 selected
Figure 2–72
C6180_Excel2_CTP.4c.indd 134
4/4/07 4:01:56 PM
2 • Click the OK button to print the selected range of the worksheet on the printer (Figure 2–73).
header prints
selected range prints
Excel Chapter 2
Displaying and Printing the Formulas Version of the Worksheet EX 135
• Click the Normal View button on the status bar.
• Click cell A18 to
Q&A
deselect the range A3:F13. What are the options in the Print what area? The Print what area of the Print dialog box includes four option buttons (Figure 2–72). As shown in the previous steps, the Selection option button instructs Excel to print the selected range. The Figure 2–73 Active sheet(s) option button instructs Excel to print the active worksheet (the worksheet currently on the screen) or the selected worksheets. Finally, the Entire workbook option button instructs Excel to print all of the worksheets in the workbook. Other Ways 1. Select range, click Page Layout tab on Ribbon, click Print Area button, click Set Print Area, click Quick Print button on Quick Access Toolbar, click Print Area button, click Clear Print Area button
Thus far, you have been working with the values version of the worksheet, which shows the results of the formulas you have entered, rather than the actual formulas. Excel also can display and print the formulas version of the worksheet, which shows the actual formulas you have entered, rather than the resulting values. You can toggle between the values version and formulas version by holding down the CTRL key while pressing the ACCENT MARK (`) key, which is located to the left of the number 1 key on the keyboard. The formulas version is useful for debugging a worksheet. Debugging is the process of finding and correcting errors in the worksheet. Viewing and printing the formulas version instead of the values version makes it easier to see any mistakes in the formulas. When you change from the values version to the formulas version, Excel increases the width of the columns so the formulas and text do not overflow into adjacent cells on the right. The formulas version of the worksheet thus usually is significantly wider than the values version. To fit the wide printout on one page, you can use landscape orientation, which has already been selected for the workbook, and the Fit to option in the Page sheet in the Page Setup dialog box.
C6180_Excel2_CTP.4c.indd 135
BTW
Displaying and Printing the Formulas Version of the Worksheet
Values versus Formulas When completing class assignments, do not enter numbers in cells that require formulas. Most instructors require their students to hand in both the values version and formulas version of the worksheet. The formulas version verifies that you entered formulas, rather than numbers, in formulabased cells.
4/4/07 4:02:01 PM
EX 136 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
To Display the Formulas in the Worksheet and Fit the Printout on One Page The following steps change the view of the worksheet from the values version to the formulas version of the worksheet and then print the formulas version on one page.
1 • Press CTRL+ACCENT MARK (`).
• When Excel displays
numbers displayed using General format
the formulas version of the worksheet, click the right horizontal scroll arrow until column J appears to display the worksheet with formulas (Figure 2–74).
formulas displayed as entered
2 • If necessary, click the Page Layout tab Figure 2–74 on the Ribbon and then click the Page Setup Dialog Box Launcher to display the Page Setup dialog box.
• If necessary, click Landscape to select it and then click Fit to in the Scaling area. 3 • Click the Print button in the Page Setup dialog box to print the formulas in the worksheet on one page in landscape orientation (Figure 2–75).
• When Excel displays the Print dialog box, click the OK button.
font size automatically reduced so worksheet fits on one page
formulas instead of values printed
Figure 2–75
4 • After viewing and printing the formulas version, press CTRL+ACCENT MARK (`) to instruct Excel to display the values version. • Click the left horizontal scroll arrow until column A appears. Other Ways 1. Click Show Formulas button on Formulas tab on Ribbon
C6180_Excel2_CTP.4c.indd 136
4/4/07 4:02:05 PM
To Change the Print Scaling Option Back to 100%
1
If necessary, click the Page Layout tab on the Ribbon and then click the Page Setup Dialog Box Launcher to display the Page Setup dialog box.
2
Click Adjust to in the Scaling area.
3
If necessary, type 100 in the Adjust to box.
4
Click the OK button to set the print scaling to normal.
5
Click the Home tab on the Ribbon.
Q&A
Depending on your printer, you may have to change the Print Scaling option back to 100% after using the Fit to option. The following steps reset the Print Scaling option so future worksheets print at 100%, instead of being resized to print on one page.
What is the purpose of the Adjust to box in the Page Setup dialog box?
Excel Chapter 2
Importing External Data from a Web Source Using a Web Query EX 137
Importing External Data from a Web Source Using a Web Query One of the major features of Excel is its capability of importing external data from Web sites. To import external data from a Web site, you must have access to the Internet. You then can import data stored on a Web site using a Web query. When you run a Web query, Excel imports the external data in the form of a worksheet. As described in Table 2–6, three Web queries are available when you first install Excel. All three Web queries relate to investment and stock market activities. Table 2–6 Excel Web Queries Query
External Data Returned
MSN MoneyCentral Investor Currency Rates
Currency rates
MSN MoneyCentral Investor Major Indices
Major indices
MSN MoneyCentral Investor Stock Quotes
Up to 20 stocks of your choice
Gather information regarding the needed Web query. As shown in Table 2–6, the MSN Money Central Investor Stock Quotes feature that is included with Excel allows you to retrieve information on up to 20 stocks of your choice. The Web query requires that you supply the stock symbols. The stock symbols are located in column B of the Portfolio Summary worksheet.
C6180_Excel2_CTP.4c.indd 137
BTW
The Adjust to box allows you to specify the percentage of reduction or enlargement in the printout of a worksheet. The default percentage is 100%. When you click the Fit to option, this percentage automatically changes to the percentage required to fit the printout on one page.
Web Queries Most Excel specialists that build Web queries use the worksheet returned from the Web query as an engine to supply data to another worksheet in the workbook. With 3-D cell references, you can create a worksheet similar to the Silver Dollars Stock Club worksheet to feed the Web query stock symbols and get refreshed stock prices in return.
Plan Ahead
4/4/07 4:02:08 PM
EX 138 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
To Import Data from a Web Source Using a Web Query Although you can have a Web query return data to a blank workbook, the following steps have the data for the nine stock symbols in column B of the Portfolio Summary worksheet returned to a blank worksheet in the Silver Dollars Stock Club Portfolio Summary workbook. The data returned by the stock-related Web queries is real time in the sense that it is no more than 20 minutes old during the business day.
1 • With the Silver Dollars Stock Club Portfolio Summary workbook open, click the Sheet2 tab at the bottom of the window.
Existing Connections button
Data tab
Existing Connections dialog box
• With cell A1 active, click the Data tab on the Ribbon, and then click the Existing Connections button to display the Existing Connections dialog box (Figure 2–76).
A1 is active cell
MSN MoneyCentral Investor Stock Quotes connection
Sheet2 tab
Figure 2–76
C6180_Excel2_CTP.4c.indd 138
4/4/07 4:02:09 PM
2 • Double-click MSN MoneyCentral Investor Stock Quotes to display the Import Data dialog box (Figure 2–77).
instructs Excel to place external data on current worksheet
Excel Chapter 2
Importing External Data from a Web Source Using a Web Query EX 139
Import Data dialog box
instructs Excel to place upper-left corner of external data in cell A1 OK button
Figure 2–77
3 • Click the OK button. • When Excel displays the Enter Enter Parameter Value dialog box
Parameter Value dialog box, type the nine stock symbols aapl t c cmcsa goog hd ibm mrk s in the text box.
• Click the ‘Use this value/reference
Q&A
for future refreshes’ check box to select it (Figure 2–78). What is the purpose of clicking the check box? Once Excel displays the worksheet, you can refresh the data as often as you want. To refresh the data for all the stocks, click the Refresh All button on the Data tab on the Ribbon. Because the ‘Use this value/reference for future refreshes’ check box was selected, Excel will continue to use the same stock symbols each time it refreshes.
C6180_Excel2_CTP.4c.indd 139
stock symbols separated by a space
keeps symbols entered above for future references
OK button
Figure 2–78
4/4/07 4:02:12 PM
EX 140 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
4 • Click the OK button
Q&A
to retrieve the stock quotes and display a new worksheet with the desired data (Figure 2–79).
Refresh All button
Excel displays external data containing stock information in worksheet
What composes the new worksheet? As shown in Figure 2–79, Excel displays the data returned from the Web query in an organized, formatted worksheet, which has a worksheet title, column titles, and a row of data for each stock symbol entered. Other than the first column, which contains the stock name and stock symbol, you have no control over the remaining columns of data returned. The latest price of each stock appears in column D.
latest stock price
links to MSN MoneyCentral Web site
Figure 2–79 Other Ways 1. Press ALT+A, X, select data source
Changing the Worksheet Names The sheet tabs at the bottom of the window allow you to view any worksheet in the workbook. You click the sheet tab of the worksheet you want to view in the Excel window. By default, Excel presets the names of the worksheets to Sheet1, Sheet2, and so on. The worksheet names become increasingly important as you move towards more sophisticated workbooks, especially workbooks in which you reference cells between worksheets. Plan Ahead
C6180_Excel2_CTP.4c.indd 140
Choose names for the worksheets. Use simple, meaningful names for each worksheet. Name the first worksheet that includes the portfolio summary Portfolio Summary. The second worksheet that includes the stock quotes should be named Real-Time Stock Quotes to reflect its contents.
4/4/07 4:02:15 PM
To Change the Worksheet Names The following steps show how to rename worksheets by double-clicking the sheet tabs.
1 • Double-click the sheet tab labeled
Excel Chapter 2
Changing the Worksheet Names EX 141
Sheet2 in the lower-left corner of the window.
• Type Real-Time Stock Quotes
Q&A
as the worksheet name and then press the ENTER key to display the new worksheet name on the sheet tab (Figure 2–80). What is the maximum length for a worksheet tab? Worksheet names can be up to 31 characters (including spaces) in length. Longer worksheet names, however, mean that fewer sheet tabs will show. To view more sheet tabs, you can drag the tab split box (Figure 2–81) to the right. This will reduce the size of the scroll bar at the bottom of the screen. Double-click the tab split box to reset it to its normal position.
Sheet2 name changed to RealTime Stock Quotes
Figure 2–80
2 • Double-click the sheet tab labeled Sheet1 in the lower-left corner of the window.
• Type Portfolio Summary as
Q&A
the worksheet name and then press the ENTER key to change the name of the worksheet from Sheet 1 to Portfolio Summary (Figure 2–81). How can I quickly move between worksheet tabs? You can use the tab scrolling buttons to the left of the sheet tabs (Figure 2–81) to move between worksheets. The leftmost and rightmost scroll buttons move to the first or last worksheet in the workbook. The two middle scroll buttons move one worksheet to the left or right.
tab scrolling buttons
tab split box Sheet1 name changed to Portfolio Summary
Figure 2–81
3 • Click the Home tab on the Ribbon.
C6180_Excel2_CTP.4c.indd 141
4/4/07 4:02:17 PM
BTW
EX 142 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
Obtaining an E-Mail Account Several Web sites that allow you to sign up for free e-mail are available. Some choices are MSN Hotmail, Yahoo! Mail, and Google Gmail.
E-Mailing a Workbook from within Excel The most popular service on the Internet is electronic mail, or e-mail, which is the electronic transmission of messages and files to and from other computers using the Internet. Using e-mail, you can converse with friends across the room or on another continent. One of the features of e-mail is the capability to attach Office files, such as Word documents or Excel workbooks, to an e-mail message and send it to a coworker. In the past, if you wanted to e-mail a workbook, you saved the workbook, closed the file, started your e-mail program, and then attached the workbook to the e-mail message before sending it. With Excel, you have the capability of e-mailing a worksheet or workbook directly from within Excel. For these steps to work properly, you must have an e-mail address and one of the following as your e-mail program: Microsoft Outlook, Microsoft Outlook Express, Microsoft Exchange Client, or another 32-bit e-mail program compatible with Messaging Application Programming Interface.
To E-Mail a Workbook from within Excel The following steps show how to e-mail the Silver Dollars Stock Club Portfolio Summary workbook from within Excel to Juan Castillo at the e-mail address
[email protected].
1 • With the Silver Dollars Stock Club Portfolio Summary workbook open, click the Office Button and then click Send to display the Send submenu (Figure 2–82).
Office Button
E-mail command
Send submenu
Send command
Figure 2–82
C6180_Excel2_CTP.4c.indd 142
4/4/07 4:02:21 PM
e-mail Message window
2 • Click E-mail on the Send submenu.
• When the e-mail Message window appears, type castillo_ juan37@hotmail. com in the To text box.
Excel Chapter 2
Chapter Summary EX 143
Send button
To text box e-mail address of person receiving e-mail
• Type the message
workbook attached to e-mail
shown in the message area in Figure 2–83.
3 • Click the Send
e-mail message in message area
Q&A
button to send the e-mail with the attached workbook to castillo_juan37@ hotmail.com. How can the recipient use the attached workbook? Because the workbook was sent as an attachment, Figure 2–83 Juan Castillo can double-click the attachment in the e-mail to open it in Excel, or he can save it on disk and then open it later.
With the workbook complete and e-mailed, the following steps save the workbook and quit Excel.
1
Click the Save button on the Quick Access Toolbar.
2
Click the Close button on the upper-right corner of the title bar.
Chapter Summary
BTW
To Save the Workbook and Quit Excel Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
In creating the Silver Dollars Stock Club Portfolio Summary workbook, you learned how to enter formulas, calculate an average, find the highest and lowest numbers in a range, verify formulas using Range Finder, draw borders, align text, format numbers, change column widths and row heights, and add conditional formatting to a range of numbers. In addition, you learned to spell check a worksheet, preview a worksheet, print a section of a worksheet, display and print the formulas version of the worksheet using the Fit to option, complete a Web query, rename sheet tabs,
C6180_Excel2_CTP.4c.indd 143
4/4/07 4:02:23 PM
EX 144 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
and send an e-mail directly from within Excel with the opened workbook as an attachment. The items listed below include all the new Excel skills you have learned in this chapter. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
11. 12.
Enter a Formula Using the Keyboard (EX 91) Enter Formulas Using Point Mode (EX 93) Copy Formulas Using the Fill Handle (EX 95) Determine the Average of a Range of Numbers Using the Keyboard and Mouse (EX 99) Determine the Highest Number in a Range of Numbers Using the Insert Function Box (EX 101) Determine the Lowest Number in a Range of Numbers Using the Sum Menu (EX 102) Copy a Range of Cells across Columns to an Adjacent Range Using the Fill Handle (EX 104) Verify a Formula Using Range Finder (EX 106) Change the Workbook Theme (EX 109) Change the Background Color and Apply a Box Border to the Worksheet Title and Subtitle (EX 110) Center Data in Cells and Format Dates (EX 113) Apply an Accounting Number Format and Comma Style Format Using the Ribbon (EX 115)
13. Apply a Currency Style Format with a Floating Dollar Sign Using the Format Cells Dialog Box (EX 116) 14. Apply a Percent Style Format and Use the Increase Decimal Button (EX 118) 15. Apply Conditional Formatting (EX 119) 16. Change the Widths of Columns (EX 122) 17. Change the Heights of Rows (EX 125) 18. Check Spelling on the Worksheet (EX 127) 19. Change the Worksheet’s Margins, Header, and Orientation in Page Layout View (EX 130) 20. Preview and Print a Worksheet (EX 132) 21. Print a Section of the Worksheet (EX 134) 22. Display the Formulas in the Worksheet and Fit the Printout on One Page (EX 136) 23. Import Data from a Web Source Using a Web Query (EX 138) 24. Change the Worksheet Names (EX 141) 25. E-Mail a Workbook from within Excel (EX 142)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this chapter.
Learn It Online Learn It Online is a series of online student exercises that test your knowledge of chapter content and key terms. Instructions: To complete the Learn It Online exercises, start your browser, click the Address bar, and then enter the Web address scsite.com/ex2007/learn. When the Excel 2007 Learn It Online page is displayed, click the link for the exercise you want to complete and then read the instructions.
C6180_Excel2_CTP.4c.indd 144
Chapter Reinforcement TF, MC, and SA A series of true/false, multiple choice, and short answer questions that test your knowledge of the chapter content.
Who Wants To Be a Computer Genius? An interactive game that challenges your knowledge of chapter content in the style of a television quiz show.
Flash Cards An interactive learning environment where you identify chapter key terms associated with displayed definitions.
Wheel of Terms An interactive game that challenges your knowledge of chapter key terms in the style of the television show Wheel of Fortune.
Practice Test A series of multiple choice questions that test your knowledge of chapter content and key terms.
Crossword Puzzle Challenge A crossword puzzle that challenges your knowledge of key terms presented in the chapter.
4/4/07 4:02:25 PM
Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter.
STUDENT ASSIGNMENTS
Profit Analysis Worksheet Instructions Part 1: Start Excel. Open the workbook Apply 2-1 Car-B-Clean Profit Analysis. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. The purpose of this exercise is to open a partially completed workbook, enter formulas and functions, copy the formulas and functions, and then format the worksheet titles and numbers. As shown in Figure 2–84, the completed worksheet analyzes profits by product.
Excel Chapter 2
Apply Your Knowledge EX 145
Figure 2–84
Perform the following tasks. 1. Use the following formulas in cells E4, F4, and G4: Total Sales (cell E4) = Units Sold * (Unit Cost + Unit Profit) or =D4 * (B4 + C4) Total Profit (cell F4) = Units Sold * Unit Profit or = D4 * C4 % Total Profit (cell G4) = Total Profit / Total Sales or = F4 / E4 Use the fill handle to copy the three formulas in the range E4:G4 to the range E5:G12. 2. Determine totals for the units sold, total sales, and total profit in row 13. Copy cell G12 to G13 to assign the formula in cell G12 to G13 in the total line.
Continued >
C6180_Excel2_CTP.4c.indd 145
4/4/07 4:02:27 PM
EX 146 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
Apply Your Knowledge
continued
3. In the range B14:B16, determine the lowest value, highest value, and average value, respectively, for the values in the range B4:B12. Use the fill handle to copy the three functions to the range C14:G16. Delete the average from cell G16, because an average of percentages of this type is mathematically invalid.
STUDENT ASSIGNMENTS
4. Format the worksheet as follows: a. change the workbook theme to Concourse by using the Themes button on the Page Layout tab on the Ribbon b. cell A1 — change to font size 24 with a green (column 6 of standard colors) background and white font color by using the buttons in the Font group on the Home tab on the Ribbon c. cell A2 — change to a green (column 6 of standard colors) background and white font color d. cells B4:C4, E4:F4, and E13:F13 — Accounting style format with two decimal places and fixed dollar signs (use the Accounting Style button on the Home tab on the Ribbon) e. cells B5:C12 and E5:F12 — Comma style format with two decimal places (use the Comma Style button on the Home tab on the Ribbon) f. cells D4:D16 — Comma style format with no decimal places g. cells G4:G15 — Percent style format with three decimal places h. cells B14:C16 and E14:F16 — Currency style format with floating dollar signs (use the Format Cells: Number Dialog Box Launcher on the Home tab on the Ribbon) 5. Switch to Page Layout View and enter your name, course, laboratory assignment number (Apply 2-1), date, and any other information requested by your instructor in the Header area. Preview and print the worksheet in landscape orientation. Change the document properties, as specified by your instructor. Save the workbook using the file name, Apply 2-1 Car-B-Clean Profit Analysis Complete in the format specified by your instructor. 6. Use Range Finder to verify the formula in cell F4. 7. Print the range A3:E16. Press CTRL+ACCENT MARK ( `) to change the display from the values version of the worksheet to the formulas version. Print the formulas version in landscape orientation on one page (Figure 2–85) by using the Fit to option in the Page sheet in the Page Setup dialog box. Press CTRL+ACCENT MARK ( `) to change the display of the worksheet back to the values version. Do not save the workbook. If requested, submit the three printouts to your instructor. Instructions Part 2: 1. Do not save the workbook in this part. In column C, use the keyboard to add manually $1.00 to the profit of each product with a unit profit less than $7.00 and $3.00 to the profits of all other products. You should end up with $2,765,603.80 in cell F13. 2. Print the worksheet. Do not save the workbook. If requested, submit the revised workbook in the format specified by your instructor.
C6180_Excel2_CTP.4c.indd 146
4/4/07 4:02:29 PM
Excel Chapter 2
EX 147
STUDENT ASSIGNMENTS
Extend Your Knowledge
Figure 2–85
Extend Your Knowledge Extend the skills you learned in this chapter and experiment with new skills. You may need to use Help to complete the assignment.
Applying Conditional Formatting to Cells Instructions: Start Excel. Open the workbook Extend 2-1 Biology 201 Midterm Scores. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required in this book. Perform the following tasks to apply new conditional formatting to the worksheet. 1. Select the range C4:C18. Click the Conditional Formatting button on the Home tab on the Ribbon and then select New Rule in the Conditional Formatting gallery. Select ‘Format only top or bottom ranked values’ in the Select a Rule Type area (Figure 2–86). Enter a value between 20 and 35 of your choosing in the text box in the Edit the Rule Description area and click the ‘% of the selected range’ check box to select it. Click the Format button and choose a format to assign to this conditional format. Click the OK button in each dialog box to close the dialog boxes and view the worksheet. 2. With range C4:C18 selected, apply a conditional format to the range that highlights scores that are below average. 3. With range D4:D18 selected, apply a conditional format to the range that highlights any grade that is a D or an F. 4. With range B4:B18 selected, apply a conditional format to the range that uses a red color to highlight any duplicate student names. 5. Change the document properties, as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Extend 2-1 Biology 201 Midterm Scores Complete, and submit the revised workbook as specified by your instructor.
C6180_Excel2_CTP.4c.indd 147
Figure 2–86
4/4/07 4:02:29 PM
EX 148 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
Make It Right
STUDENT ASSIGNMENTS
Analyze a workbook and correct all errors and/or improve the design.
Correcting Functions and Formulas in a Worksheet Instructions: Start Excel. Open the workbook Make It Right 2-1 El Centro Diner Payroll Report. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required for this book. Correct the following formatting, function, and formula problems (Figure 2–87) in the worksheet.
Figure 2–87
1. Adjust the width of column B to 11.25 pixels so that the word in the column header does not wrap. 2. Spell check the worksheet and correct any spelling mistakes that are found, but ignore any spelling mistakes found with the worksheet title and the employee names. 3. The averages in several columns do not include the employee in row 13. Adjust the functions in these cells so that all employees are included in the calculation. 4. The net pay calculation should be: Net Pay = Gross Pay – (Federal Taxes + State Taxes) Adjust the formulas in the range H4:H13 so that the correct formula is used. 5. The value for the highest value in column C was entered as a number rather than as a function. Replace the value with the appropriate function. 6. The currency values in row 4 should be formatted with the Accounting Number Format button on the Home tab on the Ribbon. They are currently formatted with the Currency format. 7. Delete the function in the cell containing the average of % Taxes because it is mathematically invalid.
C6180_Excel2_CTP.4c.indd 148
4/4/07 4:02:33 PM
8. Change the document properties, as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Make It Right 2-1 El Centro Diner Payroll Report Corrected. Submit the revised workbook as specified by your instructor.
Excel Chapter 2
In the Lab EX 149
Create a workbook using the guidelines, concepts, and skills presented in this chapter. Labs are listed in order of increasing difficulty.
Lab 1: Sales Analysis Worksheet Problem: You have been asked to build a sales analysis worksheet for Facade Importers that determines the sales quota and percentage of quota met for the sales representatives in Table 2–8. The desired worksheet is shown in Figure 2–88.
STUDENT ASSIGNMENTS
In the Lab
Table 2–8 Facade Importers Sales Data Sales Representative
Sales Amount
Sales Return
Sales Quota
Polizzi, Bernard
591518
12638
765130
Li, Grace
895050
12015
776381
Volpe, Pamela
716502
18141
733309
Khan, Anwer
709672
22326
566940
Hudson, Emma
802525
11138
712222
Huerta, Teresa
885156
18721
778060
Figure 2–88 Continued >
C6180_Excel2_CTP.4c.indd 149
4/4/07 4:02:34 PM
EX 150 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
In the Lab
continued
Instructions Part 1: Perform the following tasks to build the worksheet shown in Figure 2–88. 1. Apply the Aspect theme to the worksheet by using the Themes button on the Page Layout tab on the Ribbon.
STUDENT ASSIGNMENTS
2. Increase the width of column A to 19.00 points and the width of columns B through F to 13.50 points. 3. Enter the worksheet title Facade Importers in cell A1 and the worksheet subtitle Sales Analysis in cell A2. Enter the column titles in row 3 as shown in Figure 2–88. In row 3, use ALT+ENTER to start a new line in a cell. 4. Enter the sales data described in Table 2–8 in columns A, B, C, and E in rows 4 through 9. Enter the row titles in the range A10:A14 as shown in Figure 2–88 on the previous page. 5. Obtain the net sales in column D by subtracting the sales returns in column C from the sales amount in column B. Enter the formula in cell D4 and copy it to the range D5:D9. 6. Obtain the above quota amounts in column F by subtracting the sales quota in column E from the net sales in column D. Enter the formula in cell F4 and copy it to the range F5:F9. 7. Obtain the totals in row 10 by adding the column values for each salesperson. In the range B11:B13, use the AVERAGE, MAX, and MIN functions to determine the average, highest value, and lowest value in the range B4:B9. Copy the range B11:B13 to the range C11:F13. 8. Determine the percent of quota sold in cell B14 by dividing the total net sales amount in cell D10 by the total sales quota amount in cell E10. Center this value in the cell. 9. If necessary, click the Home tab on the Ribbon. One at a time, merge and center the worksheet title and subtitle across columns A through F. Select cells A1 and A2 and change the background color to red (column 2 in the Standard Colors area on the Fill Color palette). Apply the Title cell style to cells A1 and B1 by clicking the Cell Styles button on the Home tab on the Ribbon and clicking the Title cell style in the Titles and Headings area in the Cell Styles gallery. Change the worksheet title in cell A1 to 28-point white (column 1, row 1 on the Font Color gallery). Change the worksheet subtitle to the same color. Assign a thick box border from the Borders gallery to the range A1:A2. 10. Center the titles in row 3, columns A through F. Apply the Heading 3 cell style to the range A3:F3. Use the Italic button on the Home tab on the Ribbon to italicize the column titles in row 3 and the row titles in the range A10:A14. 11. Apply the Total cell style to the range A10:F10. Assign a thick box to cell B14. Change the background and font colors for cell B14 to the same colors applied to the worksheet title in Step 9. 12. Change the row heights of row 3 to 33.00 points and rows 11 and 14 to 30.00 points. 13. Select cell B14 and then click the Percent Style button on the Home tab on the Ribbon. Click the Increase Decimal button on the Ribbon twice to display the percent in cell B14 to hundredths. 14. Use the CTRL key to select the ranges B4:F4 and B10:F13. That is, select the range B4:F4 and then while holding down the CTRL key, select the range B10:F13. Use the Format Cells: Number Dialog Box Launcher button on the Home tab on the Ribbon to display the Format Cells dialog box to assign the selected ranges a Floating Dollar Sign style format with two decimal places and parentheses to represent negative numbers. Select the range B5:F9 and click the Comma Style button on the Home tab on the Ribbon. 15. Rename the sheet tab as Sales Analysis. Change the document properties, as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor.
C6180_Excel2_CTP.4c.indd 150
4/4/07 4:02:37 PM
16. Save the workbook using the file name Lab 2-1 Part 1 Facade Importers Sales Analysis. Print the entire worksheet in landscape orientation. Print only the range A3:B10.
STUDENT ASSIGNMENTS
17. Display the formulas version by pressing CTRL+ACCENT MARK ( `). Print the formulas version using the Fit to option button in the Scaling area on the Page tab in the Page Setup dialog box. After printing the worksheet, reset the Scaling option by selecting the Adjust to option button on the Page tab in the Page Setup dialog box and changing the percent value to 100%. Change the display from the formulas version to the values version by pressing CTRL+ACCENT MARK ( `). Do not save the workbook.
Excel Chapter 2
In the Lab EX 151
18. Submit the assignment as specified by your instructor. Instructions Part 2: Open the workbook created in Part 1 and save the workbook as Lab 2-1 Part 2 Facade Importers Sales Analysis. Manually decrement each of the six values in the net sales column by $10,000.00 until the percent of quota sold in cell B14 is below, yet as close as possible to, 100%. All six values in column E must be incremented the same number of times. The percent of quota sold in B14 should equal 99.85%. Update the worksheet header and save the workbook. Print the worksheet. Submit the assignment as specified by your instructor. Instructions Part 3: Open the workbook created in Part 2 and then save the workbook as Lab 2-1 Part 3 Facade Importers Sales Analysis. With the percent of quota sold in cell B14 equal to 99.85% from Part 2, manually decrement each of the six values in the sales return column by $1,000.00 until the percent of quota sold in cell B14 is above, yet as close as possible to, 100%. Decrement all six values in column C the same number of times. Your worksheet is correct when the percent of quota sold in cell B14 is equal to 100.12%. Update the worksheet header and save the workbook. Print the worksheet. Submit the assignment as specified by your instructor.
In the Lab Lab 2: Balance Due Worksheet Problem: You are a spreadsheet intern for Jackson’s Bright Ideas, a popular Denver-based light fixture store with outlets in major cities across the western United States. You have been asked to use Excel to generate a report (Figure 2–89) that summarizes the monthly balance due. A graphic breakdown of the data also is desired. The customer data in Table 2–9 is available for test purposes. Table 2–9 Jackson’s Bright Ideas Monthly Balance Due Data Customer
Beginning Balance
Credits
Payments
Purchases
Costa, Dan
160.68
18.70
99.33
68.28
Hernandez, Abraham
138.11
48.47
75.81
46.72
Mc Cartan, John
820.15
32.11
31.23
29.19
Paoli, Pam
167.35
59.32
52.91
33.90
Ramirez, Alberto
568.34
55.17
18.53
36.34
Vaughn, Noah
449.92
25.90
82.05
99.77
Xiong, James
390.73
48.12
19.35
92.13
Continued >
C6180_Excel2_CTP.4c.indd 151
4/4/07 4:02:37 PM
EX 152 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
In the Lab
continued
STUDENT ASSIGNMENTS
Instructions Part 1: Create a worksheet similar to the one shown in Figure 2–89. Include the five columns of customer data in Table 2–9 in the report, plus two additional columns to compute a service charge and a new balance for each customer. Assume no negative unpaid monthly balances.
Figure 2–89
Perform the following tasks: 1. Enter and format the worksheet title Jackson's Bright Ideas and worksheet subtitle Monthly Balance Due Report in cells A1 and A2. Change the theme of the worksheet to the Technic theme. Apply the Title cell style to cells A1 and A2. Change the font size in cell A1 to 28 points. One at a time, merge and center the worksheet title and subtitle across columns A through G. Change the background color of cells A1 and A2 to yellow (column 4 in the Standard Colors area in the Font Color palette). Draw a thick box border around the range A1:A2. 2. Change the width of column A to 20.00 characters. Change the widths of columns B through G to 12.00. Change the heights of row 3 to 36.00 and row 12 to 30.00 points. 3. Enter the column titles in row 3 and row titles in the range A11:A14 as shown in Figure 2–89. Center the column titles in the range A3:G3. Apply the Heading 3 cell style to the range A3:G3. Bold the titles in the range A11:A14. Apply the Total cell style to the range A11:G11. Change the font size of the cells in the range A3:G14 to 12 points. 4. Enter the data in Table 2–9 in the range A4:E10. 5. Use the following formulas to determine the service charge in column F and the new balance in column G for the first customer. Copy the two formulas down through the remaining customers. a. Service Charge (cell F4) = 2.75% * (Beginning Balance – Payments – Credits) or = 0.0275 * (B4 – D4 – C4) b. New Balance (G4) = Beginning Balance + Purchases – Credits – Payments + Service Charge or =B4 + E4 – C4 – D4 + F4 6. Determine the totals in row 11.
C6180_Excel2_CTP.4c.indd 152
4/4/07 4:02:38 PM
7. Determine the maximum, minimum, and average values in cells B12:B14 for the range B4:B10 and then copy the range B12:B14 to C12:G14. 8. Use the Format Cells command on the shortcut menu to format the numbers as follows: (a) assign the Currency style with a floating dollar sign to the cells containing numeric data in the ranges B4:G4 and B11:G14; and (b) assign the Comma style (currency with no dollar sign) to the range B5:G10.
Excel Chapter 2
In the Lab EX 153
STUDENT ASSIGNMENTS
9. Use conditional formatting to change the formatting to white font on a red background in any cell in the range C4:C10 that contains a value greater than 50. 10. Change the worksheet name from Sheet1 to Balance Due. Change the document properties, as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. 11. Spell check the worksheet. Preview and then print the worksheet in landscape orientation. Save the workbook using the file name, Lab 2-2 Part 1 Jackson’s Bright Ideas Monthly Balance Due Report. 12. Print the range A3:D14. Print the formulas version on one page. Close the workbook without saving the changes. Submit the assignment as specified by your instructor. Instructions Part 2: This part requires that a 3-D Bar chart with a cylindrical shape be inserted on a new worksheet in the workbook. If necessary, use Excel Help to obtain information on inserting a chart on a separate sheet in the workbook. 1. With the Lab 2-2 Part 1 Jackson’s Bright Ideas Monthly Balance Due Report workbook open, save the workbook using the file name, Lab 2-2 Part 2 Jackson’s Bright Ideas Monthly Balance Due Report. Draw the 3-D Bar chart with cylindrical shape showing each customer’s total new balance as shown in Figure 2–90.
Figure 2–90
2. Use the CTRL key and mouse to select the nonadjacent chart ranges A4:A10 and G4:G10. That is, select the range A4:A10 and then while holding down the CTRL key, select the range G4:G10. The customer names in the range A4:A10 will identify the cylindrical bars, while the data series in the range G4:G10 will determine the length of the bars.
C6180_Excel2_CTP.4c.indd 153
Continued >
4/4/07 4:02:40 PM
EX 154 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
In the Lab
continued
STUDENT ASSIGNMENTS
3. Click the Insert tab on the Ribbon. Click the Bar button in the Charts group on the Ribbon and then select Clustered Horizontal Cylinder in the Cylinder area. When the chart is displayed on the worksheet, click the Move Chart button on the Ribbon. When the Move Chart dialog box appears, click New sheet and then type Bar Chart for the sheet name. Click the OK button. 4. When the chart is displayed on the new worksheet, click the chart area, which is a blank area near the edge of the chart, and then click the Format contextual tab. Click the Shape Fill button on the Ribbon and then select Gold, Accent 2, Lighter 80% in the gallery (column 6, row 2). Click the Layout contextual tab. Click the Chart Title button on the Ribbon and then select Above Chart in the Chart Title gallery. If necessary, use the scroll bar on the right side of the worksheet to scroll to the top of the chart. Click the edge of the chart title to select it and then type Balance Due as the chart title. 5. Drag the Balance Due tab at the bottom of the worksheet to the left of the Bar Chart tab to reorder the sheets in the workbook. Preview and print the chart. 6. Click the Balance Due sheet tab. Change the following purchases: customer John Mc Cartan to $406.58, and customer Pam Paoli to $74.99. The company also decided to change the service charge from 2.75% to 3.25% for all customers. After copying the adjusted formula in cell F4 to the range F5:F10, click the Auto Fill Options button and then click Fill without Formatting to maintain the original formatting in the range F5:F10. The total new balance in cell G11 should equal $2,919.01. 7. Select both sheets by holding down the SHIFT key and then clicking the Bar Chart tab. Preview and print the selected sheets. Submit the assignment as requested by your instructor. Save the workbook. 8. Submit the assignment as specified by your instructor. Instructions Part 3: With your instructor’s permission, e-mail the workbook created in this exercise with the changes indicated in Part 2 as an attachment to your instructor. Close the workbook without saving the changes.
In the Lab Lab 3: Equity Web Queries Problem: A friend of your family, Benson Yackley, has learned that Excel can connect to the Web, download real-time stock data into a worksheet, and then refresh the data as often as needed. Because you have had courses in Excel and the Internet, he has hired you as a consultant to develop a stock analysis workbook. His portfolio is shown in Table 2–10.
Table 2–10 Benson Yackley’s Stock Portfolio Company
Stock Symbol
Exxon Mobil
XOM
Dell
DELL
Hewlett-Packard
HPQ
Intel
INTC
Instructions Part 1: Start Excel. If necessary, connect to MetLife MET the Internet. Perform a Web query to obtain multiple PepsiCo PEP stock quotes (Figure 2–91), using the stock symbols in the second column of Table 2–10. Place the results of the Web query in a new worksheet. Rename the worksheet Real-Time Stock Quotes. Change the document properties, as specified by your instructor. Add a header with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Lab 2-3 Part 1 Benson Yackley Equities Online. Preview and then print the worksheet in landscape orientation using the Fit to option.
C6180_Excel2_CTP.4c.indd 154
4/4/07 4:02:42 PM
STUDENT ASSIGNMENTS
Click the following links and print the Web page that appears in the browser window: Click here to visit MSN Money; Dell Inc.; Chart (to the right of MetLife, Inc.); and News (to the right of PepsiCo, Inc.). Submit the assignment as specified by your instructor.
Excel Chapter 2
In the Lab EX 155
Figure 2–91
Instructions Part 2: While connected to the Internet and with the Lab 2-3 Benson Yackley Equities Online workbook open, create a worksheet listing the major indices and their current values on Sheet2 of the workbook (Figure 2–92). After clicking the Sheet2 tab, create the worksheet by double-clicking MSN MoneyCentral Investor Major Indices in the Existing Connections dialog box. The dialog box is displayed when you click the Existing Connections button on the Data tab on the Ribbon. Rename the worksheet Major Indices. Preview and then print the Major Indices worksheet in landscape orientation using the Fit to option. Save the workbook using the same file name as in Part 1. Submit the assignment as specified by your instructor.
Figure 2–92
C6180_Excel2_CTP.4c.indd 155
4/4/07 4:02:43 PM
EX 156 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
Cases and Places Apply your creative thinking and problem solving skills to design and implement a solution.
STUDENT ASSIGNMENTS
• EASIER • • MORE DIFFICULT • 1: Design and Create a Weight-Loss Plan Worksheet As a summer intern working for Choose to Lose, a local weight-loss clinic, you have been asked to create a worksheet that estimates the monthly weight lost for an individual based on recommended average daily activities. You have been given the numbers of calories burned per hour and the average number of hours for each activity (Table 2–11). Use the following formulas: Formula A: Total Calories Burned per Day = Calories burned per Hour ⫻ Average Hours Daily Formula B: Total Pounds Lost per Month (30 days) = 30 ⫻ Total Calories Burned per Day / 3500 Formula C: Average function Formula D: Max function Formula E: Min function Use the concepts and techniques presented in this project to create and format the worksheet. Include an embedded 3-D Pie chart that shows the contribution of each activity to the total calories burned per day. Use Microsoft Excel Help to create a professional looking 3-D Pie chart with title and data labels. Table 2–11 Activities with Corresponding Calories Burned per Hour and Worksheet Layout Calories Burned per Hour
Average Hours Daily
Aerobics class
450
0.50
Brisk walking
350
0.50
House work
150
1.00
Office work/sitting
120
6.00
Sleeping
70
9.00
Standing
105
2.00
Swimming
290
0.50
Tennis
315
0.25
Walking
240
4.25
Activity
Totals
C6180_Excel2_CTP.4c.indd 156
—
Average
Formula C
Highest
Formula D
Lowest
Formula E
Total Calories Burned per Day
Total Pounds Lost per Month (30 Days)
Formula A
Formula B
—
—
4/4/07 4:02:46 PM
You work part-time for Doze-Now, a retailer of sleep-related products. Your manager wants to know the profit potential of their inventory based on the categories of inventory in Table 2–12. Table 2–12 contains the format of the desired report. The required formulas are shown in Table 2–13. Use the concepts and techniques developed in this project to create and format the worksheet. Submit a printout of the values version and formulas version of the worksheet. The company just received a shipment of 175 additional comforters and 273 items of sleepwear. Update the appropriate cells in the Units on Hand column. Table 2–12 Doze-Now Profit Potential Data and Worksheet Layout Item
Units on Hand
Average Unit Cost
Comforters
216
46.52
Night lights
4,283
6.89
Pillows
691
47.64
Sleep sound machines
103
45.06
Sleepwear
489
16.77
Total
—
Average
Formula E
Lowest
Formula F
Highest
Formula G
Total Cost
Average Unit Price
Total Value
Potential Profit
Formula A
Formula B
Formula C
Formula D
—
—
—
—
Excel Chapter 2
• 2: Create a Profit Potential Worksheet
STUDENT ASSIGNMENTS
Cases and Places EX 157
Table 2–13 Doze-Now Profit Potential Formulas Formula A = Units on Hand * Average Unit Cost Formula B = Average Unit Cost * (1 / (1 – .58)) Formula C = Units on Hand * Average Unit Price Formula D = Total Value – Total Cost Formula E = AVERAGE function Formula F = MIN function Formula G = MAX function
Continued >
C6180_Excel2_CTP.4c.indd 157
4/4/07 4:02:47 PM
EX 158 Excel Chapter 2 Formulas, Functions, Formatting, and Web Queries
Cases and Places
continued
STUDENT ASSIGNMENTS
•• 3: Create a Fund-Raising Analysis Worksheet You are the chairperson of the fund-raising committee for a local charity. You want to compare various fund-raising ideas to determine which will give you the best profit. The data obtained from six businesses about their products and the format of the desired report are shown in Table 2–14. The required formulas are shown in Table 2–15. Use the concepts and techniques presented in this project to create and format the worksheet. Table 2–14 Fund-Raising Data and Worksheet Layout
Product
Cost per Unit
Company
$4.75
Margin
Selling Price
Profit per 2000 Sales
Profit per 5000 Sales
40%
Formula A
Formula B
Formula C
Candles
Woodland Farms
Candy
Polkandy
3.00
70%
Coffee
Garcia Coffee
6.50
45%
Cookie dough
Oh, Dough!
2.90
65%
Flower bulbs
Early Bloom
2.40
50%
T-shirts
Zed’s Sports
5.75
42%
Minimum
Formula D
Maximum
Formula E
Table 2–15 Band Fund-Raising Formulas Formula A = Cost per Unit / (1 – Margin) Formula B = 2000 * (Selling Price – Cost per Unit) Formula C = 5000 *110% * (Selling Price – Cost per Unit) Formula D = MIN function Formula E = MAX function
•• 4: Design and Create a Projected Budget Make It Personal
For the next six-month period, forecast your income for each month, your base expenditures for each month, and your special expenditures for each month. Base expenditures include expenses that occur each month, such as food and loan payments. Special expenditures include expenses that are out of the ordinary, such as the purchase of gifts, automobile insurance, and medical expenses. With this data, develop a worksheet calculating the amount of remaining money at the end of each month. You can determine this amount by subtracting both expenses from the anticipated income. Include a total, average value, highest value, and lowest value for income, base expenditures, special expenditures, and remaining money. Use the concepts and techniques presented in this project to create and format the worksheet. Create a 3-D Pie chart on a separate sheet illustrating the portion each month’s special expenditures deducts from the total remaining money after all six months have passed. Use Microsoft Excel Help to create a professional looking 3-D Pie chart with title and data labels.
C6180_Excel2_CTP.4c.indd 158
4/4/07 4:02:48 PM
Working Together
Have each member of your team select six stocks — two bank stocks, two communications stocks, and two Internet stocks. Each member should submit the stock names, stock symbols, and an approximate six-month-old price. Create a worksheet that lists the stock names, symbols, price, and number of shares for each stock (use 350 shares as the number of shares for all stocks). Format the worksheet so that it has a professional appearance and is as informative as possible. Have the group do research on the use of 3-D references, which is a reference to a range that spans two or more worksheets in a workbook (use Microsoft Excel Help). Use what the group learns to create a Web query on the Sheet2 worksheet by referencing the stock symbols on the Sheet1 worksheet. On the Sheet1 worksheet, change the cells that list current price per share numbers on the Sheet1 worksheet so that they use 3-D cell references that refer to the worksheet created by the Web query on the Sheet2 worksheet. Present your workbook and findings to the class.
C6180_Excel2_CTP.4c.indd 159
Excel Chapter 2
•• 5: Design and Create a Stock Analysis Worksheet
STUDENT ASSIGNMENTS
Cases and Places EX 159
4/4/07 4:02:50 PM
This page intentionally left blank
C6394_FM_CTP.4c.indd xvi
8/8/07 3:59:57 PM
Microsoft Office Excel 2007
3
What-If Analysis, Charting, and Working with Large Worksheets
Objectives You will have mastered the material in this chapter when you can: • Rotate text in a cell • Create a series of month names • Copy, paste, insert, and delete cells • Format numbers using format symbols • Freeze and unfreeze titles • Show and format the system date • Use absolute cell references in a formula
• Use the Format Painter button to format cells • Create a 3-D Pie chart on a separate chart sheet • Color and rearrange worksheet tabs • Change the worksheet view • Answer what-if questions • Goal seek to answer what-if questions
• Use the IF function to perform a logical test
C6181_Excel3_CTP.4c.indd 161
4/3/07 1:54:17 PM
Microsoft Office Excel 2007
3
What-If Analysis, Charting, and Working with Large Worksheets Introduction Worksheets normally are much larger than those created in the previous chapters, often extending beyond the size of the window. Because you cannot see the entire worksheet on the screen at one time, working with a large worksheet sometimes can be frustrating. This chapter introduces several Excel commands that allow you to control what displays on the screen so you can view critical parts of a large worksheet at one time. One command lets you freeze the row and column titles so Excel always displays them on the screen. Another command splits the worksheet into separate window panes so you can view different parts of a worksheet on the screen at one time. Hiding the Ribbon will allow a larger portion of the worksheet to be visible. When you set up a worksheet, you should use cell references in formulas whenever possible, rather than constant values. The use of a cell reference allows you to change a value in multiple formulas by changing the value in a single cell. The cell references in a formula are called assumptions. Assumptions are values in cells that you can change to determine new values for formulas. This chapter emphasizes the use of assumptions and shows how to use Excel to answer what-if questions such as, what happens to the semiannual operating income if you decrease the marketing expenses assumption by 2%? Being able to analyze quickly the effect of changing values in a worksheet is an important skill in making business decisions. This chapter also introduces you to techniques that will enhance your ability to create worksheets and draw charts. From your work in Chapter 1, you are aware of how easily you can create charts. This chapter covers additional charting techniques that allow you to convey your message in a dramatic pictorial fashion such as an exploded 3-D Pie chart. This chapter also covers other methods for entering values in cells, such as allowing Excel to enter values for you based on a pattern of values that you create, and formatting these values. In addition, you will learn how to use absolute cell references and how to use the IF function to assign a value to a cell based on a logical test.
Project — Financial Projection Worksheet with What-If Analysis and Chart The project in the chapter follows proper design guidelines and uses Excel to create the worksheet and pie chart shown in Figure 3–1. Campus Clothiers manufactures and sells customized clothing to college students on campuses around the country. Each June and December, the director of finance and accounting submits a plan to the management team to show projected monthly revenues, costs of goods, gross margin, expenses, and operating income for the next six months. The director requires an easy-to-read worksheet that shows financial projections for the next six months. The worksheet should allow for quick analysis if projections for certain numbers change, such as the percentage of expenses allocated to marketing. In addition, a 3-D Pie chart is required that shows the projected operating income contribution for each of the six months. EX 162
C6181_Excel3_CTP.4c.indd 162
4/3/07 1:54:18 PM
Microsoft Office Excel 2007
(a) Worksheet
(b) 3-D Pie Chart Figure 3–1 EX 163
C6181_Excel3_CTP.4c.indd 163
4/3/07 1:54:18 PM
BTW
Correctness Studies have shown that more than 25 percent of all business worksheets have errors. If you are not careful entering data and formulas, then your worksheet is prone to errors. You can ensure correctness in your formulas by carefully checking them using Range Finder. The Formula Auditing group on the Formulas tab on the Ribbon also can be helpful when verifying formulas.
BTW
EX 164 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Excel’s Usefulness Just a few short years ago, a what-if question of any complexity only could be answered using a large, expensive computer programmed by highly paid computer professionals. Generating a result could take days. Excel gives the noncomputer professional the ability to get complex businessrelated questions answered instantaneously and economically.
C6181_Excel3_CTP.4c.indd 164
The requirements document for the Campus Clothiers Semiannual Financial Projection worksheet is shown in Figure 3–2. It includes the needs, source of data, summary of calculations, chart requirements, and other facts about its development.
Figure 3–2
4/3/07 1:54:21 PM
Overview As you read this chapter, you will learn how to create the worksheet shown in Figure 3–1 by performing these general tasks: • Create a series of month names
Excel Chapter 32
Project — Financial Projection Worksheet with What-If Analysis and Chart EX 165
• Use absolute cell references in a formula • Use the IF function to perform a logical test • Use the Format Painter button to format cells • Create a 3-D Pie chart on a separate chart sheet • Answer what-if questions • Manipulate large worksheets General Project Decisions While creating an Excel worksheet, you need to make several decisions that will determine the appearance and characteristics of the finished worksheet. As you create the worksheet required to meet the requirements shown in Figure 3–2, you should follow these general guidelines:
Plan Ahead
1. Plan the layout of the worksheet. The requirements state that six months are necessary in the worksheet. It is therefore sensible to place the months across columns so that the financial headings can be placed in rows. The what-if assumptions should not clutter the worksheet, but they should be placed in an easily located portion of the worksheet. 2. Determine the necessary formulas and functions needed. Except for the monthly sales numbers, the remaining numbers in the main portion of the worksheet are calculated based on the numbers in the what-if portion of the worksheet. The formulas are stated in the requirements document (Figure 3–2). The Bonus expense is included only if a certain condition is met. A function can check for the condition and include the bonus when necessary. 3. Identify how to format various elements of the worksheet. Sales and Expenses are two distinct categories of financial data and should be separated visually. Gross Margin and Total Expenses should stand out because they are subtotals. The Operating Income is the key piece of information being calculated in the worksheet and, therefore, should be formatted in such a manner as to draw the reader’s attention. The what-if assumptions should be formatted in a manner which indicates that they are separate from the main area of the worksheet. 4. Specify how the chart should convey necessary information. The requirements document indicates that the chart should be a 3-D Pie chart and emphasize the month with the greatest operating income. A 3-D Pie chart is a good way to compare visually a small set of numbers. The month, which is emphasized, also should appear closer to the reader in order to draw the reader’s attention. 5. Perform what-if analysis and goal seeking using the best techniques. What-if analysis allows you quickly to answer questions regarding various predictions. In Campus Clothiers Semiannual Financial Projection worksheet, the only cells that you should change when performing what-if analysis are those in the what-if portion of the worksheet. All other values in the worksheet, except for the projected sales, are calculated. Goal seeking allows you automatically to modify values in the what-if area of the worksheet based on a goal that you have for another cell in the worksheet. (continued)
C6181_Excel3_CTP.4c.indd 165
4/3/07 1:54:22 PM
EX 166 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Plan Ahead
(continued) In addition, using a sketch of the worksheet can help you visualize its design. The sketch of the worksheet (Figure 3-3a) consists of titles, column and row headings, location of data values, calculations, and a rough idea of the desired formatting. The sketch of the 3-D Pie chart (Figure 3–3b) shows the expected contribution of each month’s operating income to the semiannual operating income. The projected monthly sales will be entered in row 4 of the worksheet. The assumptions will be entered below the operating income (Figure 3–3a). The projected monthly sales and the assumptions will be used to calculate the remaining numbers in the worksheet. When necessary, more specific details concerning the above guidelines are presented at appropriate points in the chapter. The chapter also will identify the actions you perform and decisions made regarding these guidelines during the creation of the worksheet shown in Figure 3–1 on page EX 163.
(a) Worksheet
(b) 3-D Pie Chart Figure 3–3
C6181_Excel3_CTP.4c.indd 166
4/3/07 1:54:23 PM
With a good understanding of the requirements document, an understanding of the necessary decisions, and a sketch of the worksheet, the next step is to use Excel to create the worksheet. Table 3–1 Campus Clothiers Semiannual Financial Projections Data and What-If Assumptions
Excel Chapter 32
Project — Financial Projection Worksheet with What-If Analysis and Chart EX 167
Projected Monthly Total Net Revenues January
$3,383,909.82
February
6,880,576.15
March
9,742,702.37
April
4,818,493.53
May
4,566,722.63
June
8,527,504.39
What-If Assumptions Bonus
$100,000.00
Commission Margin
3.25% 61.00%
Marketing
9.00%
Research and Development Revenue for Bonus Support, General, and Administrative
5.75% $4,750,000.00 17.00%
To Start Excel If you are using a computer to step through the project in this chapter and you want your screen to match the figures in this book, you should change your computer’s resolution to 1024 ⫻ 768. For information about how to change a computer’s resolution, see page APP 36 in Appendix E. The following steps, which assume Windows Vista is running, start Excel based on a typical installation of Microsoft Office on your computer. You may need to ask your instructor how to start Excel for your computer. Note: If you are using Windows XP, see Appendix F for alternate steps.
1
Click the Start button on the Windows Vista taskbar to display the Start menu.
2
Click All Programs at the bottom of the left pane on the Start menu to display the All Programs list.
3
Click Microsoft Office in the All Programs list to display the Microsoft Office list.
4
Click Microsoft Office Excel 2007 to start Excel and display a blank worksheet in the Excel window.
5
If the Excel window is not maximized, click the Maximize button next to the Close button on its title bar to maximize the window.
6
If the worksheet window in Excel is not maximized, click the Maximize button next to the Close button on its title bar to maximize the worksheet window within Excel.
C6181_Excel3_CTP.4c.indd 167
4/3/07 1:54:28 PM
EX 168 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
To Enter the Worksheet Titles, Change Workbook Properties, Apply a Theme, and Save the Workbook The worksheet contains two titles, one in cell A1 and another in cell A2. In the previous chapters, titles were centered across the worksheet. With large worksheets that extend beyond the size of a window, it is best to enter titles in the upper-left corner as shown in the sketch of the worksheet in Figure 3–3a. The following steps enter the worksheet titles and save the workbook.
BTW
Note: If you are using Windows XP, see Appendix F for alternate steps.
Rotating Text in a Cell In Excel, you use the Alignment sheet of the Format Cells dialog box, as shown in Figure 3–5, to position data in a cell by centering, left-aligning, or right-aligning; indenting; aligning at the top, bottom, or center; and rotating. If you enter 90 in the Degrees box in the Orientation area, the text will appear vertically and read from bottom to top in the cell.
Plan Ahead
1
Click cell A1 and then enter Campus Clothiers as the worksheet title.
2
Click cell A2 and then enter Semiannual Projected Gross Margin, Expenses, and Operating Income as the worksheet subtitle and then press the ENTER key.
3
Click the Office Button, click Prepare on the Office Button menu, and then click Properties.
4
Update the document properties with your name and any other relevant information.
5
Click the Close button in the Document Properties pane.
6
Apply the Trek theme to the worksheet by clicking the Themes button on the Page Layout tab on the Ribbon and then return to the Home tab on the Ribbon.
7
With a USB flash drive connected to one of the computer’s USB ports, click the Save button on the Quick Access Toolbar.
8
When Excel displays the Save As dialog box, type Campus Clothiers Semiannual Financial Projection in the File name text box.
9
If the Folders list is displayed below the Folders button, click the Folders button to remove the Folders list.
10 If Computer is not displayed in the Favorite Links section, drag the top or bottom edge of the Save As dialog box until Computer is displayed.
11 Click Computer in the Favorite Links section. If necessary, scroll until UDISK 2.0 (E:) appears in
the list of available drives. Double-click UDISK 2.0 (E:) (your USB flash drive may have a different name and letter). Click the Save button in the Save As dialog box to save the workbook.
Rotating Text and Using the Fill Handle to Create a Series The data on the worksheet, including month names and the What-If Assumptions section, now can be added to the worksheet. Plan the layout of the worksheet. The design of the worksheet calls specifically for only six months of data. Because there always will be only six months of data in the worksheet, the months should be placed across the top of the worksheet as column headings rather than as row headings. There are more data items regarding each month than there are months, and it is possible that more expense categories could be added in the future. A proper layout, therefore, includes placing the data items for each month as row headings. The What-If Assumptions section should be placed in an area of the worksheet that is easily accessible, yet does not impair the view of the main section of the worksheet. As shown in Figure 3–3a, the What-If Assumptions should be placed below the calculations in the worksheet.
When you first enter text, its angle is zero degrees (0°), and it reads from left to right in a cell. Text in a cell can be rotated counterclockwise by entering a number between 1° and 90° in the Alignment sheet in the Format Cells dialog box.
C6181_Excel3_CTP.4c.indd 168
4/3/07 1:54:28 PM
To Rotate Text and Use the Fill Handle to Create a Series of Month Names Chapters 1 and 2 used the fill handle to copy a cell or a range of cells to adjacent cells. The fill handle also can be used to create a series of numbers, dates, or month names automatically. The following steps enter the month name, January, in cell B3; format cell B3 (including rotating the text); and then use the fill handle to enter the remaining month names in the range C3:G3.
1 • Select cell B3.
Home tab active
Format Cells dialog box
Excel Chapter 32
Rotating Text and Using the Fill Handle to Create a Series EX 169
Alignment tab
• Type January as the
Orientation area
cell entry and then click the Enter box.
• Click the Format Cells: Alignment Dialog Box Launcher on the Ribbon to display the Format Cells dialog box (Figure 3– 4).
cell B3 selected
Figure 3–4
2 • Click the 45° point in the Orientation area to move the Text hand in the Orientation area to the 45° point and to display 45 in the Degrees box (Figure 3–5).
45° point
Text hand
Degrees box
OK button
Figure 3–5
C6181_Excel3_CTP.4c.indd 169
4/3/07 1:54:29 PM
EX 170 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
3 • Click the OK button to rotate the text in cell B3 at a 45° angle and automatically increase the height of row 3 to best fit the rotated text (Figure 3–6).
• Point to the fill handle on the lower-right corner of cell B3.
height of row 3 automatically changed to best fit to display rotated text font in cell B3 rotated 45°
crosshair mouse pointer pointing to fill handle
Figure 3–6
4 • Drag the fill handle to the right to select the range C3:G3. Do not release the mouse button (Figure 3–7).
fill handle dragged to cell G3 ScreenTip indicates proposed value of rightmost cell
Figure 3–7
C6181_Excel3_CTP.4c.indd 170
4/3/07 1:54:32 PM
5 • Release the mouse button to create a month name series January through June in the range B3:G3 and copy the format in cell B3 to the range C3:G3.
Excel Chapter 32
Rotating Text and Using the Fill Handle to Create a Series EX 171
• Click the Auto Fill Options button below the lower-right corner of the fill area to display the Auto Fill Options menu (Figure 3–8). Q&A
What if I do not want to copy the format of cell B3 during the auto fill operation? In addition to creating a series of values, dragging the fill handle instructs Excel to copy the format of cell B3 to the range C3:G3. With some fill operations, you may not want to copy the formats of the source cell or range to the destination cell or range. If this is the case, click the Auto Fill Options button after the range fills (Figure 3–8) and then select the option you desire on the Auto Fill Options menu.
months of year propagated using fill handle Auto Fill Options button format of cell B3 applied to range C3:G3
Auto Fill Options menu
Figure 3–8
6 • Click the Auto Fill Options button to hide the Auto Fill Options menu. Q&A
• Click cell H3, type Total, and then press the RIGHT ARROW key. Why is the word Total automatically formatted with the Heading 3 cell style and 45° rotation? Excel tries to save you time by automatically recognizing the adjacent cell format in cell G3 and applying it to cell H3. The Heading 3 cell style in cell G3 causes this action to occur. Other Ways
Using the Auto Fill Options Menu As shown in Figure 3–8, Fill Series is the default option that Excel uses to fill the area, which means it fills the destination area with a series, using the same formatting as the source area. If you choose another option on the Auto Fill Options menu, then Excel immediately changes the contents of the destination range. Following the use of the fill handle, the Auto Fill Options button remains active until you begin the next Excel operation. Table 3–2 summarizes the options on the Auto Fill Options menu.
C6181_Excel3_CTP.4c.indd 171
1. Enter start month in cell, apply formatting, right-drag fill handle in direction to fill, click Fill Months on shortcut menu 2. Enter start month in cell, apply formatting, select range, click Fill button on Home tab on Ribbon, click Series, click AutoFill
4/3/07 1:54:34 PM
BTW
EX 172 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
The Mighty Fill Handle If you drag the fill handle to the left or up, Excel will decrement the series rather than increment the series. To copy a word, such as January or Monday, which Excel might interpret as the start of a series, hold down the CTRL key while you drag the fill handle to a destination area. If you drag the fill handle back into the middle of a cell, Excel erases the contents.
Table 3–2 Options Available on the Auto Fill Options Menu Auto Fill Option
Description
Copy Cells
Fill destination area with contents using format of source area. Do not create a series.
Fill Series
Fill destination area with series using format of source area. This option is the default.
Fill Formatting Only
Fill destination area using format of source area. No content is copied unless fill is series.
Fill Without Formatting
Fill destination area with contents, without the formatting of source area.
Fill Months
Fill destination area with series of months using format of source area. Same as Fill Series and shows as an option only if source area contains a month.
You can use the fill handle to create a series longer than the one shown in Figure 3–8. If you drag the fill handle past cell G3 in Step 4, Excel continues to increment the months and logically will repeat January, February, and so on, if you extend the range far enough to the right. You can create several different types of series using the fill handle. Table 3–3 illustrates several examples. Notice in examples 4 through 7, 9, and 11 that, if you use the fill handle to create a series of numbers or nonsequential months, you must enter the first item in the series in one cell and the second item in the series in an adjacent cell. Next, select both cells and drag the fill handle through the destination area. Table 3–3 Examples of Series Using the Fill Handle Example
C6181_Excel3_CTP.4c.indd 172
Contents of Cell(s) Copied Using the Fill Handle
Next Three Values of Extended Series
1
2:00
3:00, 4:00, 5:00
2
Qtr3
Qtr4, Qtr1, Qtr2
3
Quarter 1
Quarter 2, Quarter 3, Quarter 4
4
5-Jan, 5-Mar
5-May, 5-Jul, 5-Sep
5
2007, 2008
2009, 2010, 2011
6
1, 2
3, 4, 5
7
430, 410
390, 370, 350
8
Sun
Mon, Tue, Wed
9
Sunday, Tuesday
Thursday, Saturday, Monday
10
4th Section
5th Section, 6th Section, 7th Section
11
⫺205, ⫺208
⫺211, ⫺214, ⫺217
4/3/07 1:54:36 PM
To Increase Column Widths and Enter Row Titles In Chapter 2, the column widths were increased after the values were entered into the worksheet. Sometimes, you may want to increase the column widths before you enter the values and, if necessary, adjust them later. The following steps increase the column widths and then enter the row titles in column A down to What-If Assumptions in cell A18.
Excel Chapter 32
Rotating Text and Using the Fill Handle to Create a Series EX 173
1 • Move the mouse pointer to the boundary between column heading A and column heading B so that the mouse pointer changes to a split double arrow.
split double arrow mouse pointer
• Drag the mouse pointer to the right until the ScreenTip displays, Width: 35.00 (322 pixels). Do not release the mouse button (Figure 3–9).
proposed width of column A
Figure 3–9
2 • Release the mouse button to change the width of column A.
• Click column heading B and then drag through column heading G to select columns B through G.
split double arrow mouse pointer
Columns B through G selected
• Move the mouse pointer to the boundary between column headings B and C and then drag the mouse to the right until the ScreenTip displays, Width: 14.00 (133 pixels). Do not release the mouse button (Figure 3–10).
Figure 3–10
C6181_Excel3_CTP.4c.indd 173
4/3/07 1:54:37 PM
EX 174 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
3 • Release the mouse button to change the width of columns B through G.
Decrease Indent button
Increase Indent button
• Use the technique described in Step 1 to increase the width of column H to 15.00.
• Enter the row titles in the range A4:A18 as shown in Figure 3–11, but without the indents.
• Click cell A5 and then click the Increase Indent button on the Ribbon.
• Select the range A9:A13 and then click the Increase Indent button on the Ribbon.
indented row titles
• Click cell A19 to finish entering
row titles
Q&A
the row titles (Figure 3–11). What happens when I click the Increase Indent button? The Increase Indent button indents the contents of a cell to the right by three spaces each time you click it. The Decrease Indent button decreases the indent by three spaces each time you click it. Figure 3–11 Other Ways
BTW
1. To indent, right-click range, click Format Cells on shortcut menu, click Alignment tab, click Left (Indent) in Horizontal list, type number of spaces to indent in Indent text box, click OK button
Fitting Entries in a Cell An alternative to increasing the column widths or row heights is to shrink the characters in the cell to fit the current width of the column. To shrink to fit, click Format Cells: Alignment Dialog Box Launcher on the Ribbon, and click Shrink to fit in the Text control area. After shrinking entries to fit in a cell, consider using the Zoom slider on the status bar to make the entries more readable.
C6181_Excel3_CTP.4c.indd 174
Copying a Range of Cells to a Nonadjacent Destination Area As shown in the sketch of the worksheet (Figure 3–3a on page EX 166), the row titles in the Expenses area are the same as the row titles in the What-If Assumptions table, with the exception of the two additional entries in cells A21 (Margin) and A24 (Revenue for Bonus). Hence, the What-If Assumptions table row titles can be created by copying the range A9:A13 to the range A19:A23 and then inserting two rows for the additional entries in cells A21 and A24. The source area (range A9:A13) is not adjacent to the destination area (range A19:A23). The first two chapters used the fill handle to copy a source area to an adjacent destination area. To copy a source area to a nonadjacent destination area, however, you cannot use the fill handle. A more versatile method of copying a source area is to use the Copy button and Paste button on the Home tab on the Ribbon. You can use these two buttons to copy a source area to an adjacent or nonadjacent destination area. The Copy button copies the contents and format of the source area to the Office Clipboard, a reserved place in the computer’s memory that allows you to collect text and graphic items from an Office document and then paste them into any Office document. The Copy command on the Edit menu or shortcut menu works the same as the Copy button. The Paste button copies the item from the Office Clipboard to the destination area.
4/3/07 1:54:39 PM
To Copy a Range of Cells to a Nonadjacent Destination Area The following steps use the Copy and Paste buttons to copy the range A9:A13 to the nonadjacent range A19:A23.
1 • Select the range A9:A13 and then click the Copy button on the Home tab on the Ribbon to copy the values and formats of the range A9:A13 to the Office Clipboard.
• Click cell A19, the top cell in the Q&A
destination area (Figure 3–12).
Paste button
Excel Chapter 32
Copying a Range of Cells to a Nonadjacent Destination Area EX 175
Cut button
Copy button
Why do I not need to select the entire destination area? You are not required to select the entire destination area (range A19:A23) before clicking the Paste button. Excel needs to know only the upper-left cell of the destination area. In the case of a single column range, such as A19:A23, the top cell of the destination area (cell A19) also is the upper-left cell of the destination area.
source area surrounded by marquee
top cell of destination area
Figure 3–12
C6181_Excel3_CTP.4c.indd 175
4/3/07 1:54:41 PM
EX 176 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
2 • Click the Paste button on the Ribbon to copy the values and formats of the last item placed on the Office Clipboard (range A9:A13) to the destination area A19:A23.
• Scroll down so row 5 appears at the Q&A
top of the window (Figure 3–13).
Paste button
Paste button arrow
What if data already existed in the destination area? When you complete a copy, the values and formats in the destination area are replaced with the values and formats of the source area. Any data contained in the destination area prior to the copy and paste is lost. If you accidentally delete valuable data, immediately click the Undo button on the Quick Access Toolbar.
source area range A9:A13
destination area range A19:A23
3 • Press the ESC key to remove the marquee from the source area and disable the Paste button on the Ribbon.
Paste Options button
Figure 3–13 Other Ways 1. Right-click source area, click Copy on shortcut menu, right-click destination area, click Paste on shortcut menu 2. Select source area and point on border of range; while holding down CTRL key, drag source area to destination area 3. Select source area, press CTRL+C, select destination area, press CTRL+V
C6181_Excel3_CTP.4c.indd 176
Using the Paste Options Menu After the Paste button is clicked, Excel immediately displays the Paste Options button, as shown in Figure 3–13. If you click the Paste Options button arrow and select an option on the Paste Options menu, Excel modifies the most recent paste operation based on your selection. Table 3–4 summarizes the options available on the Paste Options menu. Table 3–4 Options Available on the Paste Options Menu Paste Option
Description
Keep Source Formatting
Copy contents and format of source area. This option is the default.
Match Destination Formatting
Copy contents of source area, but not the format.
Values and Number Formatting
Copy contents and format of source area for numbers or formulas, but use format of destination area for text.
Keep Source Column Widths
Copy contents and format of source area. Change destination column widths to source column widths.
Formatting Only
Copy format of source area, but not the contents.
Link Cells
Copy contents and format and link cells so that a change to the cells in source area updates the corresponding cells in destination area.
4/3/07 1:54:42 PM
Cutting When you cut a cell or range of cells using the Cut command or Cut button, Excel copies the cells to the Office Clipboard, but does not remove the cells from the source area until you paste the cells in the destination area by clicking the Paste button or pressing the ENTER key. When you complete the paste, Excel clears the cell entry and its formats from the source area. Inserting Multiple Rows If you want to insert multiple rows, you have two choices. First, you can insert a single row by using the Insert command on the shortcut menu and then repeatedly press F4 to keep inserting rows. Alternatively, you can select any number of existing rows before inserting new rows. For instance, if you want to insert five rows, select five existing rows in the worksheet, right-click the rows, and then click Insert on the shortcut menu.
Using Drag and Drop to Move or Copy Cells You also can use the mouse to move or copy cells. First, you select the source area and point to the border of the cell or range. You know you are pointing to the border of the cell or range when the mouse pointer changes to a block arrow. To move the selected cell or cells, drag the selection to the destination area. To copy a selection, hold down the ctrl key while dragging the selection to the destination area. You know Excel is in copy mode when a small plus sign appears next to the block arrow mouse pointer. Be sure to release the mouse button before you release the ctrl key. Using the mouse to move or copy cells is called drag and drop.
Using Cut and Paste to Move Cells Another way to move cells is to select them, click the Cut button on the Ribbon (Figure 3–12 on page EX 175) to remove them from the worksheet and copy them to the Office Clipboard, select the destination area, and then click the Paste button on the Ribbon or press the enter key. You also can use the Cut command on the shortcut menu, instead of the Cut button.
Inserting and Deleting Cells in a Worksheet At any time while the worksheet is on the screen, you can insert cells to enter new data or delete cells to remove unwanted data. You can insert or delete individual cells; a range of cells, rows, columns; or entire worksheets.
To Insert a Row The Insert command on the shortcut menu allows you to insert rows between rows that already contain data. According to the sketch of the worksheet in Figure 3–3a on page EX 166, two rows must be inserted in the What-If Assumptions table, one between Commission and Marketing for the Margin assumption and another between Research and Development and Support, General, and Administrative for the Revenue for Bonus assumption. The following steps accomplish the task of inserting the new rows into the worksheet.
C6181_Excel3_CTP.4c.indd 177
Excel Chapter 32
BTW
Move It or Copy It You may hear someone say, “Move it or copy it, it’s all the same.” No, it is not the same! When you move a cell, the data in the original location is cleared and the format is reset to the default. When you copy a cell, the data and format of the copy area remain intact. In short, you should copy cells to duplicate entries and move cells to rearrange entries.
BTW
The Paste button on the Ribbon (Figure 3–13) includes an arrow, which displays a list of advanced paste options (Paste, Paste Special, and Paste as Hyperlink). These options will be discussed when they are used. An alternative to clicking the Paste button is to press the enter key. The enter key completes the paste operation, removes the marquee from the source area, and disables the Paste button so that you cannot paste the copied source area to other destination areas. The enter key was not used in the previous set of steps so that the capabilities of the Paste Options button could be discussed. The Paste Options button does not appear on the screen when you use the enter key to complete the paste operation.
BTW
Inserting and Deleting Cells in a Worksheet EX 177
4/3/07 1:54:44 PM
EX 178 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
1 • Right-click row heading 21, the row below where you want to insert a row, to display the shortcut menu and the Mini toolbar (Figure 3–14).
shortcut menu
Insert command
row heading 21
Mini toolbar
Figure 3–14
2 • Click Insert on the shortcut menu to insert a new row in the worksheet by shifting the selected row 21 and all rows below it down one row.
• Click cell A21 in the new row and
Q&A
then enter Margin as the row title (Figure 3–15). What is the resulting format of the new row? The cells in the new row inherit the formats of the cells in the row above them. You can change this by clicking the Insert Options button that appears immediately above the inserted row. Following the insertion of a row, the Insert Options button lets you select from the following options: (1) Format Same As Above; (2) Format Same As Below; and (3) Clear Formatting. The Format Same as Above option is the default. The Insert Options button remains active until you begin the next Excel operation.
C6181_Excel3_CTP.4c.indd 178
row title Margin entered in new row Excel inserts new row original row 21 shifted down one row
Figure 3–15
4/3/07 1:54:45 PM
3 • Right-click row heading 24 and then click Insert on the shortcut menu to insert a new row in the worksheet.
Excel Chapter 32
Inserting and Deleting Cells in a Worksheet EX 179
• Click cell A24 in the new row and
Q&A
then enter Revenue for Bonus as the row title (Figure 3–16). row title Revenue for Bonus entered in new row
What would happen if cells in the shifted rows are included in formulas? If the rows that are shifted down include cell references in formulas located in the worksheet, Excel automatically adjusts the cell references in the formulas to their new locations. Thus, in Step 2, if a formula in the worksheet references a cell in row 21 before the insert, then the cell reference in the formula is adjusted to row 22 after the insert.
Excel inserts new row
original row 24 shifted down one row
Figure 3–16
Other Ways
Inserting Single Cells or a Range of Cells The Insert command on the shortcut menu or the Cells command on the Insert gallery of the Insert button on the Ribbon allows you to insert a single cell or a range of cells. You should be aware that if you shift a single cell or a range of cells, however, it no longer may be lined up with its associated cells. To ensure that the values in the worksheet do not get out of order, it is recommended that you insert only entire rows or entire columns. When you insert a single cell or a range of cells, Excel displays the Insert Options button so that you can change the format of the inserted cell, using options similar to those for inserting rows and columns.
C6181_Excel3_CTP.4c.indd 179
BTW
You insert columns into a worksheet in the same way you insert rows. To insert columns, select one or more columns immediately to the right of where you want Excel to insert the new column or columns. Select the number of columns you want to insert. Next, click the Insert tab on the Ribbon and then click Insert Sheet Rows in the Insert gallery or click Insert on the shortcut menu. The Insert command on the shortcut menu requires that you select an entire column (or columns) to insert a column (or columns). Following the insertion of a column, Excel displays the Insert Options button, which allows you to modify the insertion in a fashion similar to that discussed earlier when inserting rows.
2. Press CTRL+SHIFT+PLUS SIGN, click Entire Row, click OK button
Dragging Ranges You can move and insert a selected cell or range between existing cells by holding down the SHIFT key while you drag the selection to the gridline where you want to insert. You also can copy and insert by holding down the CTRL+SHIFT keys while you drag the selection to the desired gridline.
BTW
Inserting Columns
1. On Home tab on Ribbon, click Insert, click Insert Sheet Rows
The Insert Options Button When you insert columns or rows, Excel only displays the Insert Options button if formats are assigned to the leftmost column or top row of the selection.
4/3/07 1:54:48 PM
EX 180 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
BTW
Deleting Columns and Rows Ranges and Undo Copying, deleting, inserting, and moving ranges of cells have the potential to render a worksheet useless. Carefully review these actions before continuing on to the next task. If you are not sure the action is correct, click the Undo button on the Quick Access Toolbar.
The Delete button on the Ribbon or the Delete command on the shortcut menu removes cells (including the data and format) from the worksheet. Deleting cells is not the same as clearing cells. The Clear command, which was described earlier in Chapter 1 on page EX 66, clears the data from the cells, but the cells remain in the worksheet. The Delete command removes the cells from the worksheet and shifts the remaining rows up (when you delete rows) or shifts the remaining columns to the left (when you delete columns). If formulas located in other cells reference cells in the deleted row or column, Excel does not adjust these cell references. Excel displays the error message #REF! in those cells to indicate a cell reference error. For example, if cell A7 contains the formula =A4+A5 and you delete row 5, Excel assigns the formula =A4+#REF! to cell A6 (originally cell A7) and displays the error message #REF! in cell A6. It also displays an Error Options button when you select the cell containing the error message #REF!, which allows you to select options to determine the nature of the problem.
Deleting Individual Cells or a Range of Cells Although Excel allows you to delete an individual cell or range of cells, you should be aware that if you shift a cell or range of cells on the worksheet, it no longer may be lined up with its associated cells. For this reason, it is recommended that you delete only entire rows or entire columns.
Entering Numbers with Format Symbols The next step in creating the Semiannual Financial Projection worksheet is to enter the what-if assumptions values in the range B19:B25. The numbers in the table can be entered and then formatted as in Chapters 1 and 2, or each one can be entered with format symbols. When a number is entered with a format symbol, Excel immediately displays it with the assigned format. Valid format symbols include the dollar sign ($), comma (,), and percent sign (%). If you enter a whole number, it appears without any decimal places. If you enter a number with one or more decimal places and a format symbol, Excel displays the number with two decimal places. Table 3–5 illustrates several examples of numbers entered with format symbols. The number in parentheses in column 4 indicates the number of decimal places. Table 3–5 Numbers Entered with Format Symbols Format Symbol , $
%
C6181_Excel3_CTP.4c.indd 180
Typed in Formula Bar
Displays in Cell
Comparable Format
83,341
83,341
Comma (0)
1,675.8
1,675.80
Comma (2)
$278
$278
Currency (0)
$3818.54
$3,818.54
Currency (2)
$45,612.3
$45,612.30
Currency (2)
23%
23%
Percent (0)
97.50%
97.50%
Percent (2)
39.833%
39.83%
Percent (2)
4/3/07 1:54:49 PM
To Enter Numbers with Format Symbols The following step enters the numbers in the What-If Assumptions table with format symbols.
1 • Enter 100,000.00 in cell B19, 3.25% in cell B20, 61.00% in cell B21, 9.00% in cell B22, 5.75% in cell B23, 4,750,000.00 in cell B24, and 17.00% in cell B25 to display the entries using a format based on the format symbols entered with the numbers (Figure 3–17).
comma and decimal entered with number instructs Excel to format cell to Comma style with two decimal places
Excel Chapter 32
Freezing Worksheet Titles EX 181
decimal and percent sign entered with number instructs Excel to format cell to Percent style with two decimal places
Figure 3–17 Other Ways 1. Right-click range, click Format Cells on shortcut menu, click Number tab, click category in Category list, [select desired format], click OK button
2. Press CTRL+1, click Number tab, click category in Category list, [select desired format], click OK button
Freezing worksheet titles is a useful technique for viewing large worksheets that extend beyond the window. Normally, when you scroll down or to the right, the column titles in row 3 and the row titles in column A that define the numbers no longer appear on the screen. This makes it difficult to remember what the numbers in these rows and columns represent. To alleviate this problem, Excel allows you to freeze the titles, so that Excel displays the titles on the screen, no matter how far down or to the right you scroll.
C6181_Excel3_CTP.4c.indd 181
BTW
Freezing Worksheet Titles Freezing Titles If you want to freeze only column headings, select the appropriate cell in column A before you click the Freeze Panes button on the View tab on the Ribbon. If you only want to freeze row titles, then select the appropriate cell in row 1. To freeze both column headings and row titles, select the cell that is the intersection of the column and row titles before you click the Freeze Panes button on the View tab on the Ribbon.
4/3/07 1:54:49 PM
EX 182 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
To Freeze Column and Row Titles The following steps use the Freeze Panes button on the View tab on the Ribbon to freeze the worksheet title and column titles in rows 1, 2, and 3, and the row titles in column A.
1 • Press CTRL+HOME to
View tab Freeze Panes button
select cell A1 and ensure that Excel displays row 1 and column A on the screen.
Freeze Panes command
• Select cell B4. • Click the View tab
Q&A
on the Ribbon and then click the Freeze Panes button on the Ribbon to display the Freeze Panes gallery (Figure 3–18).
cell below column titles and to the right of row titles to freeze
Freeze Panes gallery
Figure 3–18
Why is cell A1 selected first? Before freezing the titles, it is important that Excel displays cell A1 in the upper-left corner of the screen. For example, if cell B4 was selected without first selecting cell A1 to ensure Excel displays the upper-left corner of the screen, then Excel would freeze the titles and also hide rows 1 and 2. Excel thus would not be able to display rows 1 and 2 until they are unfrozen.
2 • Click Freeze Panes in the Freeze
Q&A
Panes gallery to freeze column A and rows 1 through 3 (Figure 3–19). What happens after I click the Freeze Panes command?
row titles in column A will remain on the screen when scrolling right
column titles in
first three rows will Excel displays remain on the screen a thin black when scrolling down line on the right side of column A, indicating the split between the frozen row titles in column A and the rest of the worksheet. It also displays a thin black line below row 3, indicating the split between the frozen column titles in rows 1 through 3 and the rest of the worksheet (Figure 3–19).
thin black lines indicate border of frozen rows and columns
Figure 3–19 Other Ways 1. Press ALT+W, F
C6181_Excel3_CTP.4c.indd 182
4/3/07 1:54:51 PM
To Enter the Projected Monthly Sales
If necessary, click the Home tab on the Ribbon.
2
Enter 3383909.82 in cell B4, 6880576.15 in cell C4, 9742702.37 in cell D4, 4818493.53 in cell E4, 4566722.63 in cell F4, and 8527504.39 in cell G4.
3
Click cell H4 and then click the Sum button on the Ribbon twice to total the semiannual sales in cell H4 (Figure 3–20).
BTW
1
Your Age in Days How many days have you been alive? Enter today’s date (e.g., 12/5/2008) in cell A1. Next, enter your birth date (e.g., 6/22/1986) in cell A2. Select cell A3 and enter the formula =A1 - A2. Format cell A3 to the General style using the Number Dialog Box Launcher. Cell A3 will display your age in days.
BTW
The following steps enter the projected monthly sales, listed earlier in Table 3–1 on page EX 167, in row 4 and compute the projected semiannual sales in cell H4.
Updating the System Date and Time If the system date and time appear in an active worksheet, Excel will not update the date and time in the cell until you enter data in another cell or complete some other activity, such as undoing a previous activity or pressing function key F9.
Sum button
columns B, C, and D not displayed when active cell is in column H
projected monthly sales for last three months
Excel Chapter 32
Displaying a System Date EX 183
projected semiannual sales
row titles frozen on screen
Figure 3–20
Displaying a System Date The sketch of the worksheet in Figure 3–3a on page EX 166 includes a date stamp on the right side of the heading section. A date stamp shows the date a workbook, report, or other document was created or the period it represents. In business, a report often is meaningless without a date stamp. For example, if a printout of the worksheet in this chapter were distributed to the company’s analysts, the date stamp would show when the six-month projections were made, as well as what period the report represents. A simple way to create a date stamp is to use the NOW function to enter the system date tracked by your computer in a cell in the worksheet. The NOW function is one of 14 date and time functions available in Excel. When assigned to a cell, the NOW function returns a number that corresponds to the system date and time beginning with December 31, 1899. For example, January 1, 1900 equals 1, January 2, 1900 equals 2, and so on. Noon equals .5. Thus, noon on January 1, 1900 equals 1.5 and 6 P.M. on January 1, 1900 equals 1.75. If the computer’s system date is set to the current date, which normally it is, then the date stamp is equivalent to the current date. Excel automatically formats this number as a date, using the date and time format, mm/dd/yyyy hh:mm, where the first mm is the month, dd is the day of the month, yyyy is the year, hh is the hour of the day, and mm is the minutes past the hour.
C6181_Excel3_CTP.4c.indd 183
4/3/07 1:54:53 PM
EX 184 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
To Enter and Format the System Date The following steps enter the NOW function and change the format from mm/dd/yyyy hh:mm to mm/dd/yyyy.
1 • Click cell H2 and then click the Insert Function box in the formula bar.
Insert Function dialog box Or select a category box arrow Insert Function box inserts equal sign in active cell and in formula bar
• When Excel displays the Insert Function dialog box, click the ‘Or select a category’ box arrow, and then select Date & Time in the list.
Date & Time category
NOW function selected description of selected function
• Scroll down in the Select a function list and then click NOW (Figure 3–21). OK button
Figure 3–21
2 • Click the OK button. • When Excel displays the Function Arguments dialog box, click the OK button to display the system date and time in cell H2, using the default date and time format mm/dd/yyyy hh:mm.
cell H2 assigned NOW function
system date
system time
shortcut menu
• Right-click cell H2 to display the shortcut menu (Figure 3–22).
Format Cells command
Figure 3–22
C6181_Excel3_CTP.4c.indd 184
4/3/07 1:54:55 PM
3 • Click Format Cells on the shortcut
Format Cells dialog box
menu.
• When Excel displays the Format Cells dialog box, if necessary, click the Number tab.
Number tab
sample of date in cell H2 using selected format
• Click Date in the Category list. Scroll down in the Type list and then click 3/14/2001 to display a sample of the data in the active cell (H2) using the selected format in the Sample area (Figure 3–23).
Excel Chapter 32
Displaying a System Date EX 185
Date category
desired format type
Figure 3–23
4 • Click the OK button in the Format
Q&A
Cells dialog box to display the system date in the form mm/dd/yyyy (Figure 3–24). How does Excel format a date?
Excel displays
system date with In Figure 3–24, the date is mm/dd/yyyy format displayed right-aligned in the cell because Excel treats a date as a number formatted to display as a date. If you assign the General format (Excel’s default format for numbers) to a date in a cell, the date is displayed as a number with two decimal places. For example, if the system time and date is 6:00 Figure 3–24 PM on December 28, 2007 and the cell containing the NOW function is assigned the General format, then Excel displays the following number in the cell:
39444.75 Number of days since December 31, 1899
time of day is 6:00 PM (portion of day complete)
The whole number portion of the number (39444) represents the number of days since December 31, 1899. The decimal portion of the number (.75) represents 6:00 PM as the time of day, at which point 3/4 of the day is complete. To assign the General format to a cell, click General in the Category list in the Format Cells dialog box (Figure 3–23).
C6181_Excel3_CTP.4c.indd 185
Other Ways 1. On Formulas tab on Ribbon, click Date & Time, click NOW 2. Press CTRL+SEMICOLON (not a volatile date) 3. Press CTRL+SHIFT+# to format date to day-month-year
4/3/07 1:54:58 PM
EX 186 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Absolute versus Relative Addressing The next sections describe the formulas and functions needed to complete the calculations in the worksheet. Plan Ahead
Determine necessary formulas and functions needed. The next step is to enter the formulas that calculate the following values for January: cost of goods sold (cell B5), gross margin (cell B6), expenses (range B9:B13), total expenses (cell B14), and the operating income (cell B16). The formulas are based on the projected monthly sales in cell B4 and the assumptions in the range B19:B25. The formulas for each column (month) are the same, except for the reference to the projected monthly sales in row 4, which varies according to the month (B4 for January, C4 for February, and so on). Thus, the formulas for January can be entered in column B and then copied to columns C through G. Table 3–6 shows the formulas for determining the January costs of goods, gross margin, expenses, total expenses, and operating income in column B. If the formulas are entered as shown in Table 3–6 in column B for January and then copied to columns C through G (February through June) in the worksheet, Excel will adjust the cell references for each column automatically. Thus, after the copy, the February Commission expense in cell C10 would be =C4 * C20. While the cell reference C4 (February Sales) is correct, the cell reference C20 references an empty cell. The formula for cell C7 should read =C4 * B20, rather than =C4 * C20, because B20 references the Commission % value in the What-If Assumptions table. In this instance, a way is needed to keep a cell reference in a formula the same, or constant, when it is copied.
BTW
Table 3–6 Formulas for Determining Cost of Goods, Margin, Expenses, Total Expenses, and Operating Income for January
Absolute Referencing Absolute referencing is one of the more difficult worksheet concepts to understand. One point to keep in mind is that the paste operation is the only operation affected by an absolute cell reference. An absolute cell reference instructs the paste operation to keep the same cell reference as it copies a formula from one cell to another.
C6181_Excel3_CTP.4c.indd 186
Cell
Row Title
Formula
Comment
B5
Cost of Goods Sold
=B4 * (1 ⫺ B21)
Sales times (1 minus Margin %)
B6
Gross Margin
= B4 ⫺ B5
Sales minus Cost of Goods
B9
Bonus
=IF(B4 >= B24, B19, 0)
Bonus equals value in B19 or 0
B10
Commission
=B4 * B20
Sales times Commission %
B11
Marketing
=B4 * B22
Sales times Marketing %
B12
Research and Development
=B4 * B23
Sales times Research and Development %
B13
Support, General, and Administrative
=B4 * B25
Sales times Support, General, and Administrative %
B14
Total Expenses
=SUM(B9:B13)
Sum of January Expenses
B16
Operating Income
=B6 ⫺ B14
Gross Margin minus Total Expense
To keep a cell reference constant when copying a formula or function, Excel uses a technique called absolute cell referencing. To specify an absolute cell reference in a formula, enter a dollar sign ($) before any column letters or row numbers you want to keep constant in formulas you plan to copy. For example, $B$20 is an absolute cell reference, while B20 is a relative cell reference. Both reference the same cell. The difference becomes apparent when they are copied to a destination area. A formula using the absolute cell reference $B$20 instructs Excel to keep the cell reference B20 constant (absolute) in the formula as it copies it to the destination area. A formula using the relative cell reference B20 instructs Excel to adjust the cell reference as it copies it to the destination area. A cell reference with only one dollar sign before either the column or the row is called a mixed cell reference. Table 3–7 gives some additional examples of absolute, relative, and mixed cell references.
4/3/07 1:55:02 PM
Table 3–7 Examples of Absolute, Relative, and Mixed Cell References Cell Reference
Type of Reference
Meaning
$B$20
Absolute cell reference
Both column and row references remain the same when you copy this cell, because the cell references are absolute.
B$20
Mixed reference
This cell reference is mixed. The column reference changes when you copy this cell to another column because it is relative. The row reference does not change because it is absolute.
$B20
Mixed reference
This cell reference is mixed. The column reference does not change because it is absolute. The row reference changes when you copy this cell reference to another row because it is relative.
B20
Relative cell reference
Both column and row references are relative. When copied to another cell, both the column and row in the cell reference are adjusted to reflect the new location.
Excel Chapter 32
Absolute versus Relative Addressing EX 187
To Enter a Formula Containing Absolute Cell References The following steps enter the cost of goods formula = B4*(1 ⫺ $B$21) in cell B5 using Point mode. To enter an absolute cell reference, you can type the dollar sign ($) as part of the cell reference or enter it by pressing f4 with the insertion point in or to the right of the cell reference to change to absolute.
1 • Press CTRL+HOME and then click cell B5. formula appears in formula bar
• Type = (equal sign), click cell B4, type *(1-b21 and then press F4 to change b21 from a relative cell reference to an absolute cell reference.
Enter box
• Type ) to complete the formula Q&A
(Figure 3–25). Is an absolute reference required in this formula? No, because a mixed cell reference could have been used. The formula in cell B4 will be copied across columns, rather than down rows. So, the formula entered in cell B4 in Step 1 could have been entered as =B4*(1-$B21), rather than =B4*(1-$B$21). That is, the formula could have included the mixed cell reference $B21, rather than the absolute cell reference $B$21. When you copy a formula across columns, the row does not change anyway. The key is to ensure that column B remains constant as you copy the formula across rows. To change the absolute cell reference to a mixed cell reference, continue to press the F4 key until you get the desired cell reference.
C6181_Excel3_CTP.4c.indd 187
cell B4 is relative
cell $B$21 is absolute
Excel colors border of cells used in formula
Figure 3–25
4/3/07 1:55:03 PM
EX 188 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
2 • Click the Enter box in the formula bar to display the result, 1319724.83, in cell B5, instead of the formula (Figure 3–26).
formula assigned to cell B5 appears in formula bar
projected January cost of goods sold
Figure 3–26
3 • Click cell B6, type = (equal sign), click cell B4, type — (minus sign), and then click cell B5.
• Click the Enter box in the formula bar to display the gross margin for January, 2064184.99, in cell B6 (Figure 3-27).
formula appears in formula bar
active cell shows result of formula
Figure 3–27
C6181_Excel3_CTP.4c.indd 188
4/3/07 1:55:06 PM
Making Decisions — The IF Function According to the Request for New Workbook in Figure 3–2 on page EX 164, if the projected January sales in cell B4 is greater than or equal to the revenue for bonus in cell B24 (4,750,000.00), then the January bonus value in cell B9 is equal to the bonus value in cell B19 (100,000.00); otherwise, cell B9 is equal to 0. One way to assign the January bonus value in cell B9 is to check to see if the sales in cell B4 equal or exceed the revenue for bonus amount in cell B24 and, if so, then to enter 100,000.00 in cell B9. You can use this manual process for all six months by checking the values for the corresponding month. Because the data in the worksheet changes each time a report is prepared or the figures are adjusted, however, it is preferable to have Excel assign the monthly bonus to the entries in the appropriate cells automatically. To do so, cell B9 must include a formula or function that displays 100,000.00 or 0.00 (zero), depending on whether the projected January sales in cell B4 is greater than, equal to, or less than the revenue for bonus value in cell B24. The IF function is useful when you want to assign a value to a cell based on a logical test. For example, using the IF function, cell B9 can be assigned the following IF function:
Excel Chapter 32
Making Decisions — The IF Function EX 189
=IF(B4>=$B$24, $B$19, 0)
logical_test
value_if_true
value_if_false
=IF(logical_test, value_if_true, value_if_false) The argument, logical_test, is made up of two expressions and a comparison operator. Each expression can be a cell reference, a number, text, a function, or a formula. Valid comparison operators, their meaning, and examples of their use in IF functions are shown in Table 3–8. The argument, value_if_true, is the value you want Excel to display in the cell when the logical test is true. The argument, value_if_false, is the value you want Excel to display in the cell when the logical test is false. Table 3–8 Comparison Operators Comparison Operator
Meaning
Example
=
Equal to
=IF(H7 = 0, J6 ^ H4, L9 + D3)
<
Less than
=IF(C34 * W3 < K7, $K$6, L33 - 5)
>
Greater than
=IF(MIN(K8:K12) > 75, 1, 0)
>=
Greater than or equal to
=IF(P8 >= $H$6, J7 / V4, 7.5)
<=
Less than or equal to
=IF(G7 - G2 <= 23, L$9, 35 / Q2)
<>
Not equal to
=IF(B1 <> 0, ‘’No’’,’’Yes’’)
C6181_Excel3_CTP.4c.indd 189
BTW
The IF function instructs Excel that, if the projected January sales in cell B4 is greater than or equal to the revenue for bonus value in cell B24, then Excel should display the value 100000 in cell B19, in cell B9. If the projected January sales in cell B4 is less than the revenue for bonus value in cell B24, then Excel displays a 0 (zero) in cell B9. The general form of the IF function is:
Logical Operators in IF Functions IF functions can use logical operators, such as AND, OR, and NOT. For example, the three IF functions =IF(AND(B3>C3, D3
G5, D2<X3), “OK”, “Not OK”) and =IF(NOT(A6
4/3/07 1:55:08 PM
EX 190 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
To Enter an IF Function The following steps assign the IF function =IF(B4>=$B$24,$B$19,0) to cell B9. This IF function determines whether or not the worksheet assigns a bonus for January.
1 • Click cell B9. Type =if(b4>=$b$24, $b$19,0) in the cell (Figure 3–28).
Excel colors border of cells used in formula if value in cell B4 is greater than or equal to 4,750,000, then bonus equals 100,000; otherwise, bonus equals 0
IF function typed in active cell
Excel colors border of cells used in formula
Figure 3–28
2 • Click the Enter box
Q&A
in the formula bar to display 0 in cell B9 (Figure 3–29), because the value in cell B4 (3383909.82) is less than the value in cell B24 (4,750,000) (Figure 3–29).
IF function assigned to cell B9
Why does the value 0 display in cell B9? The value that Excel displays in cell B9 depends on the values assigned to Figure 3–29 cells B4, B19, and B24. For example, if the value for January sales in cell B4 is reduced below 4,750,000.00, then the IF function in cell B9 will cause Excel to display a 0. If you change the bonus in cell B19 from 100,000.00 to another number and the value in cell B4 is greater than or equal to the value in cell B24, it will change the results in cell B9 as well. Finally, increasing the revenue for bonus in cell B24 so that it is greater than the value in cell B4 will change the result in cell B9.
value of 0 assigned to cell B9 because value in cell B4 (3383909.82) is less than value in cell B24 (4,750,000.00)
Other Ways 1. On Formulas tab on Ribbon, click Logical button, click IF 2. Click Insert Function box in formula bar, click Logical in ‘Or select a category list’, click IF in drop-down list, click OK button
C6181_Excel3_CTP.4c.indd 190
4/3/07 1:55:09 PM
1
Click cell B10. Type =b4*$b$20 and then press the DOWN ARROW key. Type =b4*$b$22 and then press the DOWN ARROW key. Type =b4*$b$23 and then press the DOWN ARROW key. Type =b4*$b$25 and then press the DOWN ARROW key.
2
With cell B14 selected, click the Sum button on the Home tab on the Ribbon twice. Click cell B16. Type =b6-b14 and then press the ENTER key (Figure 3–30a).
3
Press CTRL+ACCENT MARK (`) to instruct Excel to display the formulas version of the worksheet (Figure 3–30b).
4
When you are finished viewing the formulas version, press CTRL+ACCENT MARK (`) to instruct Excel to display the values version of the worksheet.
Q&A
The January commission expense in cell B10 is equal to the sales in cell B4 times the commission assumption in cell B20 (3.25%). The January marketing expense in cell B11 is equal to the projected January sales in cell B4 times the marketing assumption in cell B22 (9.00%). Similar formulas determine the remaining January expenses in cells B12 and B13. The total expenses value in cell B14 is equal to the sum of the expenses in the range B9:B13. The operating income in cell B16 is equal to the gross margin in cell B6 minus the total expenses in cell B14. The formulas are short, and therefore, they are typed in the following steps, rather than entered using Point mode.
Why should I view the formulas version of the worksheet?
BTW
To Enter the Remaining January Formulas Replacing a Formula with a Constant You can replace a formula with its result so it remains constant. Do the following: (1) Click the cell with the formula; (2) press F2 or click in the formula bar; (3) press F9 to display the value in the formula bar; and (4) press the ENTER key.
Excel Chapter 32
Making Decisions — The IF Function EX 191
Viewing the formulas version (Figure 3–30b) of the worksheet allows you to check the formulas assigned to the range B5:B16. Recall that formulas were entered in lowercase. You can see that Excel converts all the formulas from lowercase to uppercase.
Excel displays values for January in formulas version, Excel displays formulas for January
(a) Values Version (b) Formulas Version Figure 3–30
C6181_Excel3_CTP.4c.indd 191
4/3/07 1:55:12 PM
EX 192 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
To Copy Formulas with Absolute Cell References Using the Fill Handle The following steps show how to use the fill handle to copy the January formulas in column B to the other five months in columns C through G.
1 • Select the range B5:B16 and then point to the fill handle in the lower-right corner of cell B16 (Figure 3–31).
source area is B5:B16
mouse pointer changes to cross hair
Figure 3–31
C6181_Excel3_CTP.4c.indd 192
4/3/07 1:55:14 PM
2 • Drag the fill handle
Q&A
to the right to select the destination area C5:G16 to copy the formulas from the source area (B5:B16) to the destination area (C5:G16) and display the calculated amounts and Auto Fill Options button (Figure 3–32).
columns B (January), C (February), and D (March) do not appear
What happens to the formulas after the copy is made? Because the formulas in the range B5:B16 use absolute cell references, the formulas still refer to the current values in the Assumptions table when the formulas are copied to the range C5:G16.
Q&A
Excel Chapter 32
Making Decisions — The IF Function EX 193
What happened to columns B, C, and D?
source area B5:B16 copied to destination area C5:G16
projected June expenses based on projected June sales (cell G4) and assumptions in range B19:B25
Auto Fill Options button
As shown in Figure 3–32, as the fill handle is dragged to the Figure 3–32 right, columns B, C, and D no longer appear on the screen. Column A, however, remains on the screen, because the row titles were frozen earlier in this chapter.
C6181_Excel3_CTP.4c.indd 193
4/3/07 1:55:16 PM
BTW
EX 194 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Error Messages When Excel cannot calculate a formula, it displays an error message in a cell. These error messages always begin with a number sign (#). The more commonly occurring error messages are: #DIV/0! (tries to divide by zero); #NAME? (uses a name Excel does not recognize); #N/A (refers to a value not available); #NULL! (specifies an invalid intersection of two areas); #NUM! (uses a number incorrectly); #REF (refers to a cell that is not valid); #VALUE! (uses an incorrect argument or operand); and ##### (cell not wide enough to display entire entry).
To Determine Row Totals in Nonadjacent Cells The following steps determine the row totals in column H. To determine the row totals using the Sum button, select only the cells in column H containing numbers in adjacent cells to the left. If, for example, you select the range H5:H16, Excel will display 0s as the sum of empty rows in cells H7, H8, and H15.
1
Select the range H5:H6. Hold down the CTRL key and select the range H9:H14 and cell H16 as shown in Figure 3–33.
2
Click the Sum button on the Ribbon to display the row totals in column H (Figure 3–33).
Sum button
projected semiannual cost of goods, gross margin, expenses by category, and operating income
BTW
Figure 3–33 Toggle Commands Many of the commands on the Ribbon, in the galleries, and the shortcut keys function as a toggle. For example, if you click the Freeze Panes command on the Freeze Panes gallery, the command changes to Unfreeze Panes the next time you view the gallery. These types of commands work like an on-off switch, or toggle.
C6181_Excel3_CTP.4c.indd 194
To Unfreeze the Worksheet Titles and Save the Workbook All the text, data, and formulas have been entered into the worksheet. The following steps unfreeze the titles and save the workbook using its current file name, Campus Clothiers Semiannual Financial Projection.
1
Press CTRL+HOME to select cell B4 and view the upper-left corner of the screen.
2
Click the View tab on the Ribbon and then click the Freeze Panes button on the Ribbon to display the Freeze Panes gallery (Figure 3–34).
3
Click Unfreeze Panes in the Freeze Panes gallery to unfreeze the titles.
4/3/07 1:55:18 PM
Why does pressing CTRL+HOME select cell B4? When the titles are frozen and you press CTRL+HOME, Excel selects the upper-left cell of the unfrozen section of the worksheet. For example, in Step 1 of the previous steps, Excel selected cell B4. When the titles are unfrozen, then pressing CTRL+HOME selects cell A1.
Home tab
View tab Freeze Panes button
Save button Unfreeze Panes command
Work Days Assume that you have two dates: one in cell F3 and the other in cell F4. The date in cell F3 is your starting date and the date in cell F4 is the ending date. To calculate the work days between the two dates (excludes weekends), use the following formula: =NETWORKDAYS(F3, F4). For this function to work, make sure the Analysis ToolPak add-in is installed. You can install it on the Add-Ins page of the Excel Options dialog box.
Excel Chapter 32
Click the Home tab on the Ribbon and then click the Save button on the Quick Access Toolbar.
BTW
4 Q&A
Formatting the Worksheet EX 195
Freeze Panes gallery
Figure 3–34
Nested Forms of the IF Function A nested IF function is one in which the action to be taken for the true or false case includes yet another IF function. The second IF function is considered to be nested, or layered, within the first. Study the nested IF function below, which determines the eligibility of a person to vote. Assume the following in this example: (1) the nested IF function is assigned to cell K12, which instructs Excel to display one of three messages in the cell; (2) cell H12 contains a person’s age; and (3) cell I12 contains a Y or N, based on whether the person is registered to vote. =IF(H12>=18, IF(I12="Y","Registered","Eligible and Not Registered"),"Not Eligible to Register")
The nested IF function instructs Excel to display one, and only one, of the following three messages in cell K12: (1) Registered; or (2) Eligible and Not Registered; or (3) Not Eligible to Register. You can nest IF functions as deep as you want, but after you get beyond a nest of three IF functions, the logic becomes difficult to follow and alternative solutions, such as the use of multiple cells and simple IF functions, should be considered.
Formatting the Worksheet The worksheet created thus far shows the financial projections for the six-month period, from January to June. Its appearance is uninteresting, however, even though some minimal formatting (formatting assumptions numbers, changing the column widths, and formatting the date) was performed earlier. This section will complete the formatting of the worksheet to make the numbers easier to read and to emphasize the titles, assumptions, categories, and totals.
C6181_Excel3_CTP.4c.indd 195
4/3/07 1:55:19 PM
EX 196 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
BTW
Plan Ahead
Selecting Nonadjacent Ranges One of the more difficult tasks to learn is selecting nonadjacent ranges. To complete this task, do not hold down the CTRL key when you select the first range because Excel will consider the current active cell to be the first selection. Once the first range is selected, hold down the CTRL key and drag through the nonadjacent ranges. If a desired range is not visible in the window, use the scroll arrows to view the range. It is not necessary to hold down the CTRL key while you scroll.
Identify how to format various elements of the worksheet. The worksheet will be formatted in the following manner so it appears as shown in Figure 3–35: (1) format the numbers; (2) format the worksheet title, column titles, row titles, and operating income row; and (3) format the assumptions table. Numbers in heading rows and total rows should be formatted with a currency symbol. Other dollar amounts should be formatted with a Comma style. The assumptions table should be diminished in its formatting so it does not distract from the main calculations and data in the worksheet. Assigning the data in the assumptions table a font size of 8 point would set it apart from other data formatted with a font size of 11 point.
range A1:H2 has orange background
36-point font height of rows 1 through 3 are best fit
Comma style 14-point italic underlined font
font in range A19:B25 is 8
Currency style with floating dollar sign
Figure 3–35
To Assign Formats to Nonadjacent Ranges The numbers in the range B4:H16 are to be formatted as follows: 1. Assign the Currency style with a floating dollar sign to rows 4, 6, 9, 14, and 16. 2. Assign a Comma style to rows 5 and 10 through 13. To assign a Currency style with a floating dollar sign, use the Format Cells dialog box rather than the Accounting Style button on the Ribbon, which assigns a fixed dollar sign. Also use the Format Cells dialog box to assign the Comma style, because the Comma Style button on the Ribbon assigns a format that displays a dash (-) when a cell has a value of 0. The specifications for this worksheet call for displaying a value of 0 as 0.00 (see cell B9 in Figure 3–35), rather than as a dash. To create a Comma style using the Format Cells dialog box, you can assign a Currency style with no dollar sign. The following steps assign formats to the numbers in rows 4 through 16.
C6181_Excel3_CTP.4c.indd 196
4/3/07 1:55:21 PM
1 • Select the range B4:H4.
• While holding down
Format Cells dialog box
the CTRL key, select the nonadjacent ranges B6:H6, B9:H9, B14:H14, and B16:H16, and then release the CTRL key.
• Click the Format Cells: Number Dialog Box Launcher on the Ribbon to display the Format Cells dialog box (Figure 3–36).
Excel Chapter 32
Formatting the Worksheet EX 197
Format Cells: Number Dialog Box Launcher
Currency category nonadjacent ranges B4:H4, B6:H6, B9:H9, B14:H14, and B16:H16 selected
Figure 3–36
2 • Click Currency in the
Q&A
Category list, select 2 in the Decimal places box, click $ in the Symbol list to ensure a dollar sign shows, and click the black font color ($1,234.10) in the Negative numbers list (Figure 3–37). Why was the particular style chosen for the negative numbers?
sample of format
Currency style to appear with two decimal places, dollar sign, and negative numbers in parentheses
In accounting, negative numbers OK button often are shown with parentheses surrounding the value rather than with a negative sign preceding the value. Figure 3–37 Thus, the format (1,234.10) in the Negative numbers list was clicked. The data being used in this chapter contains no negative numbers. However, you must select a format for negative numbers, and you must be consistent if you are choosing different formats in a column, otherwise the decimal points may not line up.
C6181_Excel3_CTP.4c.indd 197
4/3/07 1:55:23 PM
EX 198 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
3 • Click the OK button. • Select the range B5:H5. Comma style format is same as previous Currency style, but without dollar sign symbol
• While holding down the CTRL key, select the range B10:H13, and then release the CTRL key.
• Click the Format Cells: Number Dialog Box Launcher on the Ribbon to display the Format Cells dialog box.
nonadjacent ranges B5:H5, and B10:H13 selected
• When Excel displays the Format Cells dialog box, click Currency in the Category list, select 2 in the Decimal places box, click None in the Symbol Figure 3–38 list so a dollar sign does not show, and click the black font color (1,234.10) in the Negative numbers list (Figure 3–38).
OK button
4 • Click the OK button. • Press CTRL+HOME to select cell A1 to display the formatted numbers as shown in Figure 3–39.
Currency style with floating dollar sign Comma style
Other Ways 1. Right-click range, click Format Cells on shortcut menu, click Number tab, click category in Category list, select format, click OK button 2. Press CTRL+1, click Number tab, click category in Category list, select format, click OK button
C6181_Excel3_CTP.4c.indd 198
Figure 3–39
4/3/07 1:55:26 PM
To Format the Worksheet Titles The following steps emphasize the worksheet titles in cells A1 and A2 by changing the font type, size, and color. The steps also format all of the row headers in column A with a Bold font style.
1 • Click the column A heading to
Excel Chapter 32
Formatting the Worksheet EX 199
select column A.
• Click the Bold button on the Ribbon to bold all of the data in column A (Figure 3–40).
Bold button
column A selected
Figure 3–40
2 • Click cell A1 to select it. Click the Font Size box arrow on the Ribbon, and then click 36 in the Font Size list.
• Click cell A2, click the Font Size box arrow, and then click 18 in the Font Size list (Figure 3–41).
font size of cell A1 changed to 36 and font size of cell A2 changed to 18
Figure 3–41
C6181_Excel3_CTP.4c.indd 199
4/3/07 1:55:29 PM
EX 200 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
3 • Select the range A1:H2 and then click the Fill Color button arrow on the Ribbon.
Font Color button arrow
• Click Orange, Accent 1 (column 5, row 1) on the Fill Color palette.
• Click the Font Color button arrow on the Ribbon and then select White, Background 1 (column 1, row 1) on the Font Color palette (Figure 3–42).
Fill Color button arrow
Figure 3–42
fill color and font color of range A1:H2 changed
Other Ways 1. Right-click range, click Format Cells on shortcut menu, click Fill tab to color background (or click Font tab to color font), click OK button
BTW
2. Press CTRL+1, click Fill tab to color background (or click Font tab to color font), click OK button
The Fill and Font Color Button You may have noticed that the color bar at the bottom of the Fill Color and Font Color buttons on the Home tab on the Ribbon (Figure 3-42) changes to the most recently selected color. To apply this same color to a cell background or text, select a cell and then click the Fill Color button to use the color as a background or click the Font Color button to use the color as a font color.
To Assign Cell Styles to Nonadjacent Rows and Colors to a Cell The next step to improving the appearance of the worksheet is to format the heading in row 3 and the totals in rows 4, 14, and 16. The following steps format the heading in row 3 with the Heading 3 cell style and the totals in rows 4, 14, and 16 with the Total cell style. Cell A4 also is formatted.
1
Select the range A3:H3 and apply the Heading 3 cell style.
2
Select the range A6:H6 and while holding down the CTRL key, select the ranges A14:H14 and A16:H16.
3
Apply the Total cell style.
4
Click cell A4, click the Fill Color button arrow on the Ribbon, and then click the Orange, Accent 1 color (column 5, row 1) on the Fill Color palette.
5
Click the Font Color button arrow on the Ribbon, and then click the White, Background 1 color (column 1, row 1) on the Font Color palette (Figure 3–43).
Heading 3 cell style applied
font color and fill color changed Total cell style applied
Figure 3–43
C6181_Excel3_CTP.4c.indd 200
4/3/07 1:55:32 PM
Copying a Cell’s Format Using the Format Painter Button Using the Format Painter button on the Ribbon, you can format a cell quickly by copying a cell’s format to another cell or a range of cells.
Excel Chapter 32
Copying a Cell’s Format Using the Format Painter Button EX 201
To Copy a Cell’s Format Using the Format Painter Button The following steps format cells A6, A14, and the range A16:H16 using the Format Painter button.
1 • Select cell A4. • Click the Format Painter button on the Ribbon and then move the mouse pointer onto the worksheet to cause the mouse pointer to change to a block plus sign with a paintbrush (Figure 3–44).
Format Painter button
block plus sign with paintbrush mouse pointer cell A4 selected
marquee is displayed around cell A4
Figure 3–44
C6181_Excel3_CTP.4c.indd 201
4/3/07 1:55:35 PM
EX 202 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
2 • Click cell A6 to assign the format of cell A4 to cell A6 (Figure 3–45).
format of cell A4 copied to cell A6
Figure 3–45
3 • With cell A6 selected, click the Format Painter button on the Ribbon and then click cell A16.
• Select the range B16:H16, click the Fill Color button on the Ribbon, and then click the Orange, Accent 1 color (column 5, row 1) on the Fill Color palette.
• Click the Font Color button on the Ribbon, and then click the Background 1 color (column 1, row 1) on the Font Color palette (Figure 3–46).
• Apply the Currency style to the range B16:G16. format copied to cell A14 and range A16:H16
Figure 3–46 Other Ways 1. Click Copy button, select cell, click Paste button, click Paste Special command on Paste menu, click Formats, click OK button
C6181_Excel3_CTP.4c.indd 202
2. Double-click Format Painter button
4/3/07 1:55:37 PM
1
Scroll down to view rows 18 through 25 and then click cell A18.
2
Click the Font Size box arrow on the Ribbon and then click 14 in the Font Size list. Click the Italic button and then click the Underline button on the Ribbon.
3
Select the range A19:B25, click the Font Size button on the Ribbon, and then click 8 in the Font Size list.
4
Click cell D25 to deselect the range A19:B25 and display the What-If Assumptions table as shown in Figure 3–47.
5
Click the Save button on the Quick Access Toolbar.
Q&A
The last step to improving the appearance of the worksheet is to format the What-If Assumptions table in the range A18:B25. The specifications in Figure 3–35 on page EX 196 require a 14-point italic underlined font for the title in cell A18 and 8-point font in the range A19:B25. The following steps format the What-If Assumptions table.
BTW
To Format the What-If Assumptions Table and Save the Workbook
What happens when I click the Italic and Underline buttons?
Painting a Format to Nonadjacent Ranges Double-click the Format Painter button on the Home tab on the Ribbon and then drag through the nonadjacent ranges to paint the formats to the ranges. Click the Format Painter button to deactivate it.
Excel Chapter 32
Copying a Cell’s Format Using the Format Painter Button EX 203
Recall that when you assign the italic font style to a cell, Excel slants the characters slightly to the right as shown in cell A18 in Figure 3–47. The underline format underlines only the characters in the cell, rather than the entire cell, as is the case when you assign a cell a bottom border.
Underline button
Italic button
14-point italic underlined font
8-point font
Figure 3–47
C6181_Excel3_CTP.4c.indd 203
4/3/07 1:55:40 PM
EX 204 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Adding a 3-D Pie Chart to the Workbook The next step in the chapter is to draw the 3-D Pie chart on a separate sheet in the workbook, as shown in Figure 3–48. Use a Pie chart to show the relationship or proportion of parts to a whole. Each slice (or wedge) of the pie shows what percent that slice contributes to the total (100%).
BTW
Plan Ahead
Charts You are aware that, when you change a value on which a chart is dependent, Excel immediately redraws the chart based on the new value. Did you know that, with bar charts, you can drag the bar in the chart in one direction or another to change the corresponding value in the worksheet, as well?
Specify how the chart should convey necessary information. The 3-D Pie chart in Figure 3–48 shows the contribution of each month’s projected operating income to the six-month projected operating income. The 3-D Pie chart makes it easy to evaluate the contribution of one month in comparison to the other months. Unlike the 3-D Column chart created in Chapter 1, the 3-D Pie chart shown in Figure 3–48 is not embedded in the worksheet. Instead, the Pie chart resides on a separate sheet, called a chart sheet, which contains only the chart. In this worksheet, the ranges to chart are the nonadjacent ranges B3:G3 (month names) and B16:G16 (monthly operating incomes). The month names in the range B3:G3 will identify the slices of the Pie chart; these entries are called category names. The range B16:G16 contains the data that determines the size of the slices in the pie; these entries are called the data series. Because six months are being charted, the 3-D Pie chart contains six slices. The sketch of the 3-D Pie chart in Figure 3–3b on page EX 166 also calls for emphasizing the month of June by offsetting its slice from the main portion. A Pie chart with one or more slices offset is called an exploded Pie chart.
chart title underlined and font size changed
BTW
3-D Pie chart
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential – proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
default color of slices changed
data labels changed to month and percentage
BTW
exploded slice
Chart Items When you rest the mouse pointer over a chart item, such as a legend, bar, or axis, Excel displays a chart tip containing the name of the item.
Figure 3–48
As shown in Figure 3–48, the default 3-D Pie chart also has been enhanced by rotating it, changing the colors of the slices, adding a bevel, and modifying the chart title and labels that identify the slices.
C6181_Excel3_CTP.4c.indd 204
4/3/07 1:55:42 PM
To Draw a 3-D Pie Chart on a Separate Chart Sheet The following steps draw the 3-D Pie chart on a separate chart sheet.
1 • Select the range B3:G3.
Insert tab
Excel Chapter 32
Adding a 3-D Pie Chart to the Workbook EX 205
Pie button
• While holding down the CTRL key, select the range B16:G16.
• Click the Insert tab on the Ribbon. • Click the Pie button on the Ribbon to display the Pie gallery (Figure 3–49). Pie gallery
Pie in 3-D chart
Figure 3–49
2 Move Chart button
• Click Pie in 3-D chart in the Pie gallery.
• When Excel draws the chart, click the Move Chart button on the Ribbon to display the Move Chart dialog box (Figure 3–50).
Move Chart dialog box
New sheet name text box
New sheet option button
OK button
Figure 3–50
C6181_Excel3_CTP.4c.indd 205
4/3/07 1:55:44 PM
EX 206 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
3 • Click the New sheet option button and then type 3-D Pie Chart in the New sheet name text box.
• Click the OK button to move the chart to a new chart sheet with the name 3-D Pie Chart (Figure 3–51).
new sheet created with new name
Figure 3–51 Other Ways 1. Select range to chart, press F11
To Insert a Chart Title and Data Labels The next step is to insert a chart title and labels that identify the slices. Before you can format a chart item, such as the chart title or data labels, you must select it. You can format a selected chart item using the Ribbon or shortcut menu. The following steps insert a chart title, remove the legend, and add data labels.
1 • Click anywhere in the chart area
Layout tab
outside the chart.
• Click the Layout tab on the Ribbon and then click the Chart Title button.
• Click the Centered Overlay Title command in the Chart Title gallery.
chart title
• Select the text in the chart title and then type Semiannual Financial Projection as the new chart title (Figure 3–52).
Figure 3–52
C6181_Excel3_CTP.4c.indd 206
4/3/07 1:55:46 PM
2 • Select the text in the new title and
Home tab
then click the Home tab on the Ribbon.
Excel Chapter 32
Adding a 3-D Pie Chart to the Workbook EX 207
• Click the Underline button to assign an underline font style to the chart title (Figure 3–53). chart title underlined
Underline button
Figure 3–53
3 • Click the Layout tab on the
Layout tab
Ribbon and then click the Legend button to display the Legend gallery.
• Point to None in the Legend
None legend option
gallery (Figure 3–54).
Legend gallery
legend
Figure 3–54
C6181_Excel3_CTP.4c.indd 207
4/3/07 1:55:49 PM
EX 208 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
4 • Click None to turn
Data Labels button
off the legend on the chart.
• Click the Data Labels button on the Ribbon and then click Outside End in the Data Labels gallery to display data labels outside the chart at the end of each slice (Figure 3–55).
data labels selected
legend no longer is displayed
Figure 3–55
5 • If necessary, rightclick any data label to select all of the data labels on the chart and to display the shortcut menu.
Format Data Labels dialog box
Series Name check box
• Click the Format Data Labels command on the shortcut menu to display the Format Data Labels dialog box.
Category Name check box Value check box Percentage check box Show Leader Lines check box
• If necessary, click the Series Name, Value, and Show Leader Lines check boxes to deselect them and then click the Category Name and Percentage check boxes to select them (Figure 3–56). Close button
Figure 3–56
C6181_Excel3_CTP.4c.indd 208
4/3/07 1:55:52 PM
6 • Click the Close button to close the Format Data Labels dialog box and display the chart as shown in Figure 3–57.
Excel Chapter 32
Adding a 3-D Pie Chart to the Workbook EX 209
chart selected data labels include category name and percentage
Figure 3–57
To Rotate the 3-D Pie Chart With a three-dimensional chart, you can change the view to better show the section of the chart you are trying to emphasize. Excel allows you to control the rotation angle, elevation, perspective, height, and angle of the axes by using the Format Chart Area dialog box. When Excel initially draws a Pie chart, it always positions the chart so that one of the dividing lines between two slices is a straight line pointing to 12 o’clock (or 0°). As shown in Figure 3–57, the line that divides the January and June slices currently is set to 0°. This line defines the rotation angle of the 3-D Pie chart. To obtain a better view of the offset June slice, the 3-D Pie chart can be rotated 250° to the right. The following steps show how to rotate the 3-D Pie chart.
C6181_Excel3_CTP.4c.indd 209
4/3/07 1:55:55 PM
EX 210 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
1 • Click the 3-D Rotation button on the Ribbon to display the Format Chart Area dialog box.
Format Chart Area dialog box
3-D Rotation button
• Click the Increase
Q&A
X Rotation button in the Rotation area of the Format Chart Area dialog box until the X rotation is at 250° (Figure 3–58). What happens as I click the Increase X Rotation button?
Rotation area
3-D Rotation category
Increase X Rotation button chart rotated
Excel rotates the chart 10° in a clockwise direction each time you click the Increase X Rotation button. The Y box in the Rotation area allows you to control the tilt, or elevation, of the chart. You can tilt the chart towards or away from your view in order to enhance the view of the chart.
Close button
Figure 3–58
2 • Click the Close button in the Format Chart Area dialog box to display the rotated chart (Figure 3–59).
chart rotated to show June slice
Figure 3–59
C6181_Excel3_CTP.4c.indd 210
4/3/07 1:55:57 PM
To Apply a 3-D Format to the Pie Chart Excel allows you to apply dramatic 3-D visual effects to charts. The chart shown in Figure 3–59 could be enhanced with a bevel along the top edge. A bevel is a curve that is applied to soften the appearance of a straight edge. Excel also allows you to change the appearance of the material from which the surface of the chart appears to be constructed. The following steps apply a bevel to the chart and change the surface of the chart to a softer-looking material.
Excel Chapter 32
Adding a 3-D Pie Chart to the Workbook EX 211
1 • Right-click the chart to display the shortcut menu (Figure 3–60).
shortcut menu
Format Data Series command
Figure 3–60
2 • Click the Format Data Series
Format Data Series dialog box
command on the shortcut menu to display the Format Data Series dialog box and then click the 3-D Format category on the left side of the dialog box.
Top bevel button
• Click the Top button in the Bevel area to display the Bevel gallery (Figure 3–61).
Circle bevel button 3-D Format category Bevel gallery
Figure 3–61
C6181_Excel3_CTP.4c.indd 211
4/3/07 1:56:00 PM
EX 212 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
3 • Click the Circle bevel button (column 1, row 1) in the Bevel gallery to add a bevel to the chart. bevel width and height set to 50 pt
• Type 50 pt in the top Width box in the Bevel area of the dialog box and then type 50 pt in the uppermost Height box in the Bevel area of the dialog box to increase the width and height of the bevel on the chart (Figure 3–62).
Bevel added to chart
Close button
Figure 3–62
4 • Click the Material button in the Surface area of the Format Data Series dialog box and then point to the Soft Edge button (column 2, row 2) in the Material gallery (Figure 3–63).
Surface area Material button
Soft Edge gallery selection
Material gallery
Figure 3–63
C6181_Excel3_CTP.4c.indd 212
4/3/07 1:56:04 PM
5 • Click the Soft Edge button and then click the Close button in the Format Data Series dialog box (Figure 3-64).
Excel Chapter 32
Adding a 3-D Pie Chart to the Workbook EX 213
soft edge is displayed on chart
Figure 3–64
To Explode the 3-D Pie Chart and Change the Color of a Slice The next step is to emphasize the slice representing June by offsetting, or exploding, it from the rest of the slices so that it stands out. The following steps explode a slice of the 3-D Pie chart and then change its color.
1 • Click the slice labeled June twice (do not double-click) to select only the June slice.
• Right-click the slice
June slice selected
labeled June to display the shortcut menu and then point to Format Data Point (Figure 3–65).
• Click Format
shortcut menu
Data Point.
Format Data Point command
Figure 3–65
C6181_Excel3_CTP.4c.indd 213
4/3/07 1:56:07 PM
EX 214 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
2 • When Excel
Format Data Point dialog box
Q&A
displays the Format Data Point dialog box, drag the Point Explosion slider to the right until the Point Explosion box reads 28% (Figure 3–66). Should I offset more slices? You can offset as many slices as you want, but remember that the reason for offsetting a slice is to emphasize it. Offsetting multiple slices tends to reduce the impact on the reader and reduces the overall size of the Pie chart.
Point Explosion slider Point Explosion box reads 28% June slice exploded 28%
Figure 3–66
3 • Click the Fill category
Solid fill option button
on the left side of the dialog box.
Color button
• Click the Solid fill
Fill category
option button and then click the Color button to display the color palette.
• Point to the Orange color in the Standard Colors area (Figure 3–67).
Theme Colors palette
4 • Click the Orange color on the color palette and then click the Close button on the Format Data Point dialog box to change the color of the slice labeled June to orange.
Orange standard color
Close button
Figure 3–67
C6181_Excel3_CTP.4c.indd 214
4/3/07 1:56:09 PM
The colors of the remaining slices also can be changed to enhance the appeal of the chart. The following steps change the color of the remaining five chart slices.
1
Click the slice labeled January twice (do not double-click) to select only the January slice.
2
Right-click the slice labeled January to display the shortcut menu and then click Format Data Point.
3
Click the Fill category on the left side of the dialog box.
4
Click the Solid fill option button and then click the Color button to display the color palette.
5
Click the Green color on the color palette and then click the Close button in the Format Data Point dialog box to change the color of the slice labeled January to green.
6
Repeat steps 1 through 5 for the remaining four slices. Assign the following colors in the Standard Colors area of the color palette to each slice: February – Yellow; March – Light Blue; April – Red; May – Blue. The completed chart appears as shown in Figure 3–68.
Exploding a 3-D Pie Chart If you click the 3-D Pie chart so that all of the slices are selected, you can drag one of the slices to explode all of the slices.
Excel Chapter 32
To Change the Colors of the Remaining Slices
BTW
Adding a 3-D Pie Chart to the Workbook EX 215
slice colors changed
Figure 3–68
C6181_Excel3_CTP.4c.indd 215
4/3/07 1:56:13 PM
EX 216 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Renaming and Reordering the Sheets and Coloring Their Tabs The final step in creating the workbook is to reorder the sheets and modify the tabs at the bottom of the screen.
To Rename and Reorder the Sheets and Color Their Tabs The following steps rename the sheets, color the tabs, and reorder the sheets so the worksheet precedes the chart sheet in the workbook.
1 • Right-click the tab labeled 3-D Pie Chart at the bottom of the screen to display the shortcut menu.
• Point to the Tab Color command to display the color palette (Figure 3–69).
shortcut menu
desired color
Tab Color command 3-D Pie Chart tab
Figure 3–69
C6181_Excel3_CTP.4c.indd 216
4/3/07 1:56:14 PM
2 • Click Brown, Accent 2 (column 6, row 1) in the Theme Colors area to change the color of the tab to brown.
• Double-click the tab labeled
Excel Chapter 32
Renaming and Reordering the Sheets and Coloring Their Tabs EX 217
shortcut menu
Sheet1 at the bottom of the screen.
desired color
• Type Semiannual Financial Projection as the new sheet name and then press the ENTER key.
• Right-click the tab and then click Tab Color on the shortcut menu.
Tab Color command sheet renamed
• Point to the Orange, Accent 1 (column 5, row 1) color in the Theme Colors area of the palette (Figure 3–70).
Figure 3–70
3 • Click Orange, Accent 1 (column 5, row 1) in the Theme Colors area to change the color of the tab to orange.
• Drag the Semiannual Financial Projection tab to the left in front of the 3-D Pie Chart tab to rearrange the sequence of the sheets and then click cell E18 (Figure 3–71).
tab color shows as orange underline when sheet is active
Sheet 1 renamed and moved to left of 3-D Pie Chart tab 3-D Pie Chart tab colored brown
Figure 3–71 Other Ways 1. To rename sheet, right-click sheet tab, click Rename on shortcut menu 2. To move sheet, right-click sheet tab, click Move or Copy on shortcut menu
C6181_Excel3_CTP.4c.indd 217
4/3/07 1:56:16 PM
BTW
EX 218 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Checking Spelling Unless you first select a range of cells or an object before starting the spell checker, Excel checks the selected worksheet, including all cell values, cell comments, embedded charts, text boxes, buttons, and headers and footers.
Checking Spelling, Saving, Previewing, and Printing the Workbook With the workbook complete, this section checks spelling, saves, previews, and then prints the workbook. Each set of steps concludes with saving the workbook to ensure that the latest changes are saved.
BTW
BTW
To Check Spelling in Multiple Sheets
Printing in Black and White You can speed up the printing process and save ink if you print worksheets with color in black and white. To print a worksheet in black and white on a color printer, do the following: (1) Click the Page Setup Dialog Box Launcher on the Page Layout tab on the Ribbon, click the Sheet tab, and then click ‘Black and white’ in the Print area. (2) Click the Preview button to see that Excel has removed the colored backgrounds, click the Close button, and then click the OK button. You are now ready to print economically, in black and white.
Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
C6181_Excel3_CTP.4c.indd 218
By default, the spell checker checks the spelling only in the selected sheets. It will check all the cells in the selected sheets, unless you select a range of two or more cells. Before checking the spelling, the following steps select the 3-D Pie Chart sheet so that the entire workbook is checked for spelling errors.
1
With the Semiannual Financial Projection sheet active, press CTRL+HOME to select cell A1. Hold down the CTRL key and then click the 3-D Pie Chart tab.
2
Click the Review tab on the Ribbon and then click the Spelling button on the Ribbon.
3
Correct any errors and then click the OK button when the spell check is complete.
4
Click the Save button on the Quick Access Toolbar.
To Preview and Print the Workbook After checking the spelling, the next step is to preview and print the sheets. As with spelling, Excel previews and prints only the selected sheets. In addition, because the worksheet is too wide to print in portrait orientation, the orientation must be changed to landscape. The following steps adjust the orientation and scale, preview the workbook, and then print the workbook.
1
Ready the printer. If both sheets are not selected, hold down the CTRL key and then click the tab of the inactive sheet.
2
Click the Page Layout tab on the Ribbon and then click the Page Setup Dialog Box Launcher. Click the Page tab and then click Landscape. Click Fit to in the Scaling area.
3
Click the Print Preview button in the Page Setup dialog box. When the preview of the first of the selected sheets appears, click the Next Page button at the top of the Print Preview window to view the next sheet. Click the Previous Page button to redisplay the first sheet.
4
Click the Print button at the top of the Print Preview window. When Excel displays the Print dialog box, click the OK button to print the worksheet and chart (Figure 3–72).
5
Right-click the Semiannual Financial Projection tab. Click Ungroup Sheets on the shortcut menu to deselect the 3-D Pie Chart tab.
6
Click the Save button on the Quick Access Toolbar.
4/3/07 1:56:19 PM
Excel Chapter 32
Checking Spelling, Saving, Previewing, and Printing the Workbook EX 219
(a) Worksheet
(b) 3-D Pie Chart Figure 3–72
C6181_Excel3_CTP.4c.indd 219
4/3/07 1:56:20 PM
BTW
EX 220 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Zooming You can use the Zoom In and Zoom Out buttons on the status bar to zoom from 10% to 400% to reduce or enlarge the display of the worksheet.
Changing the View of the Worksheet With Excel, you easily can change the view of the worksheet. For example, you can magnify or shrink the worksheet on the screen. You also can view different parts of the worksheet through window panes.
To Shrink and Magnify the View of a Worksheet or Chart You can magnify (zoom in) or shrink (zoom out) the appearance of a worksheet or chart by using the Zoom button on the View tab on the Ribbon. When you magnify a worksheet, Excel enlarges the view of the characters on the screen, but displays fewer columns and rows. Alternatively, when you shrink a worksheet, Excel is able to display more columns and rows. Magnifying or shrinking a worksheet affects only the view; it does not change the window size or printout of the worksheet or chart. The following steps shrink and magnify the view of the worksheet.
1 • If cell A1 is not active, press
View tab
CTRL+HOME.
• Click the View tab on the Ribbon and then click the Zoom button on the Ribbon to display a list of Magnifications in the Zoom dialog box (Figure 3–73).
Zoom button
Zoom dialog box
Fit selection option zooms window to selected range
75% option button
OK button
Figure 3–73
C6181_Excel3_CTP.4c.indd 220
4/3/07 1:56:25 PM
2 • Click 75% and then click the OK button to shrink the display of the worksheet to 75% of its normal display (Figure 3–74).
Excel Chapter 32
Changing the View of the Worksheet EX 221
worksheet displays at 75%
Figure 3–74
3 • Click the Zoom In button on the status bar until the worksheet displays at 100% (Figure 3–75).
worksheet displays at 100% Zoom In button
Figure 3–75
C6181_Excel3_CTP.4c.indd 221
4/3/07 1:56:27 PM
EX 222 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
To Split a Window into Panes When working with a large worksheet, you can split the window into two or four panes to view different parts of the worksheet at the same time. Splitting the Excel window into four panes at cell D7 allows you to view all four corners of the worksheet easily. The following steps split the Excel window into four panes.
1 • Select cell D7, the intersection of
Split button
the four proposed panes.
• If necessary, click the View tab on the Ribbon and then point to the Split button on the Ribbon (Figure 3–76).
panes will be divided above and to the left of active cell
Figure 3–76
C6181_Excel3_CTP.4c.indd 222
4/3/07 1:56:30 PM
2 • Click the Split button to divide the window into four panes.
• Use the scroll arrows to show the
Excel Chapter 32
What-If Analysis EX 223
four corners of the worksheet at the same time (Figure 3–77). Q&A
What is shown in the four panes?
vertical split bar
The four panes in Figure 3–77 are used to show the following: horizontal (1) range A1:C6 in the split bar upper-left pane; upper panes (2) range G1:I6 move in vertical synchronization in the upperright pane; lower panes in vertical (3) range A14:C26 move synchronization in the lower-left pane; and (4) range G14:I26 in the lower-right pane. The vertical split bar is the vertical bar going up and down the middle of the window. The horizontal split bar is the horizontal bar going across the middle of the window. If you use the scroll bars below the window and to the right of left panes move the window to scroll the window, in horizontal Figure 3–77 synchronization you will see that the panes split by the horizontal split bar scroll together vertically. The panes split by the vertical split bar scroll together horizontally. To resize the panes, drag either split bar to the desired location in the window.
scroll bars for top and bottom panes
scroll bars for left and right panes
right panes move in horizontal synchronization
Other Ways 1. Drag horizontal split box and vertical split box to desired locations
1
Position the mouse pointer at the intersection of the horizontal and vertical split bars.
2
When the mouse pointer changes to a four-headed arrow, double-click to remove the four panes from the window.
What-If Analysis
BTW
To Remove the Panes from the Window
The automatic recalculation feature of Excel is a powerful tool that can be used to analyze worksheet data. Using Excel to scrutinize the impact of changing values in cells that are referenced by a formula in another cell is called what-if analysis or sensitivity analysis. When new data is entered, Excel not only recalculates all formulas in a worksheet, but also redraws any associated charts.
C6181_Excel3_CTP.4c.indd 223
Window Panes If you want to split the window into two panes, rather than four, drag the vertical split box to the far left of the window or horizontal split box to the top of the window (Figure 3–78 on the next page). You also can drag the center of the four panes in any direction to change the size of the panes.
4/3/07 1:56:31 PM
EX 224 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
In the workbook created in this chapter, many of the formulas are dependent on the assumptions in the range B19:B25. Thus, if you change any of the assumption values, Excel immediately recalculates all formulas. Excel redraws the 3-D Pie chart as well, because it is based on these numbers.
To Analyze Data in a Worksheet by Changing Values A what-if question for the worksheet in Chapter 3 might be what would happen to the semiannual operating income in cell H16 if the Bonus, Commission, Support, General, and Administrative assumptions in the What-If Assumptions table are changed as follows: Bonus $100,000.00 to $75,000.00; Commission 3.25% to 2.25%; Support, General, and Administrative 17.00% to 14.50%? To answer a question like this, you need to change only the first, second, and seventh values in the What-If Assumptions table as shown in the following steps. The steps also divide the window into two vertical panes. Excel instantaneously recalculates the formulas in the worksheet and redraws the 3-D Pie chart to answer the question.
1 • Use the vertical scroll bar to move
horizontal split box
the window so cell A6 is in the upper-left corner of the screen.
• Drag the vertical split box from the lower-right corner of the screen to the left so that the vertical split bar is positioned as shown in Figure 3–78.
• Use the right scroll arrow to view the totals in column H in the right pane.
• Enter 75000 in cell B19, 2.25 in cell B20, and 14.50 in cell B25 (Figure 3–78), which causes the semiannual operating income in cell H16 to increase from $9,459,176.31 to $10,886,373.12.
current location of vertical split box
changes to assumptions affect projected monthly expenses and operating incomes, which in turn affect projected semiannual operating income
new projected semiannual operating income
vertical split bar
original location of vertical split box
Figure 3–78
C6181_Excel3_CTP.4c.indd 224
4/3/07 1:56:34 PM
To Goal Seek If you know the result you want a formula to produce, you can use goal seeking to determine the value of a cell on which the formula depends. The following steps close and reopen the Campus Clothiers Semiannual Financial Projection workbook. They then show how to use the Goal Seek command on the Data tab on the Ribbon to determine the Support, General, and Administrative percentage in cell B25 that will yield a semiannual operating income of $10,500,000 in cell H16, rather than the original $9,459,176.31.
1 • Close the workbook
Excel Chapter 32
What-If Analysis EX 225
Data tab What-If Analysis button
without saving changes and then reopen it.
• Drag the vertical split box so that the vertical split bar is positioned as shown in Figure 3–79.
Goal Seek command
What-If Analysis menu
• Show column H in the right pane.
• Click cell H16, the cell that contains the semiannual operating income.
• Click the Data tab on
vertical split bar
the Ribbon and then click the What-If Analysis button on the Ribbon to display the What-If Analysis menu (Figure 3–79).
cell on which to seek goal
vertical split bar dragged to this location
Figure 3–79
C6181_Excel3_CTP.4c.indd 225
4/3/07 1:56:36 PM
EX 226 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
2 • Click Goal Seek to display the Goal Seek dialog box with the Set cell box set to the selected cell, H16. cell on which to seek goal is set based on active cell
• When Excel displays the Goal Seek dialog box, click the To value text box, type 10,500,000 and then click the By changing cell box.
Goal Seek dialog box
• Scroll down so row 4 is at the top of the screen.
goal
• Click cell B25 on the worksheet to assign cell B25 to the By changing cell box (Figure 3–80).
OK button
cell to change to reach goal active cell
Figure 3–80
C6181_Excel3_CTP.4c.indd 226
4/3/07 1:56:38 PM
EX 227
3 • Click the OK
Q&A
button to goal seek for the value $10,500,000.00 in cell H16 (Figure 3–81).
Excel Chapter 32
What-If Analysis
What happens when I click the OK button? Excel immediately changes cell H16 from $9,459,176.31 to the desired value of $10,500,000.00. More importantly, Excel changes the Support, General, and Administrative assumption in cell B25 from 17.00% to 14.26% (Figure 3–81). Excel also displays the Goal Seek Status dialog box. If you click the OK button, Excel keeps the new values in the worksheet. If you click the Cancel button, Excel redisplays the original values.
Goal Seek Status dialog box
OK button
Cancel button
semiannual projected operating income changes from $9,459,176.31 to $10,500,000.00 Support, General, and Administrative expenses changes from 17.00% to 14.26%
Figure 3–81
4 • Click the Cancel button in the Goal Seek Status dialog box. Other Ways 1. Press ALT+T, G
BTW
Goal Seeking Undoing What You Did The Undo button is ideal for returning the worksheet to its original state after you have changed the values in a worksheet to answer a what-if question. To view the original worksheet after answering a what-if question, click the Undo button on the Quick Access Toolbar for each value you changed.
C6181_Excel3_CTP.4c.indd 227
Goal seeking assumes you can change the value of only one cell referenced directly or indirectly to reach a specific goal for a value in another cell. In this example, to change the semiannual operating income in cell H16 to $10,500,000.00, the Support, General, and Administrative percentage in cell B25 must decrease by 2.74% from 17.00% to 14.26%. You can see from this goal seeking example that the cell to change (cell B25) does not have to be referenced directly in the formula or function. For example, the semiannual operating income in cell H16 is calculated by the function =SUM(B16:G16). Cell B25 is not referenced in this function. Instead, cell B25 is referenced in the formulas in rows 9 through 13, on which the monthly operating incomes in row 16 are based. Excel thus is capable of goal seeking on the semiannual operating income by varying the value for the Support, General, and Administrative assumption.
4/3/07 1:56:40 PM
EX 228 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
To Quit Excel To quit Excel, complete the following steps.
1
Click the Close button on the title bar.
2
If the Microsoft Excel dialog box is displayed, click the No button.
Chapter Summary In this chapter you learned how to work with large worksheets that extend beyond the window, how to use the fill handle to create a series, new formatting techniques, about the difference between absolute cell references and relative cell references, how to use the IF function, how to rotate text in a cell, freeze titles, change the magnification of the worksheet, show different parts of the worksheet at the same time through multiple panes, create a 3-D Pie chart, and improve the appearance of a 3-D Pie chart. This chapter also introduced you to using Excel to do what-if analysis by changing values in cells and goal seeking. The items listed below include all the new Excel skills you have learned in this chapter. 1. Rotate Text and Use the Fill Handle to Create a Series of Month Names (EX 169) 2. Increase Column Widths and Enter Row Titles (EX 173) 3. Copy a Range of Cells to a Nonadjacent Destination Area (EX 175) 4. Insert a Row (EX 177) 5. Enter Numbers with Format Symbols (EX 181) 6. Freeze Column and Row Titles (EX 182) 7. Enter and Format the System Date (EX 184) 8. Enter a Formula Containing Absolute Cell References (EX 187) 9. Enter an IF Function (EX 190) 10. Copy Formulas with Absolute Cell References Using the Fill Handle (EX 192) 11. Unfreeze the Worksheet Titles and Save the Workbook (EX 194) 12. Assign Formats to Nonadjacent Ranges (EX 196) 13. Format the Worksheet Titles (EX 199)
14. Copy a Cell’s Format Using the Format Painter Button (EX 201) 15. Draw a 3-D Pie Chart on a Separate Chart Sheet (EX 205) 16. Insert a Chart Title and Data Labels (EX 206) 17. Rotate the 3-D Pie Chart (EX 209) 18. Apply a 3-D Format to the Pie Chart (EX 211) 19. Explode the 3-D Pie Chart and Change the Color of a Slice (EX 213) 20. Rename and Reorder the Sheets and Color Their Tabs (EX 216) 21. Check Spelling in Multiple Sheets (EX 218) 22. Shrink and Magnify the View of a Worksheet or Chart (EX 220) 23. Split a Window into Panes (EX 222) 24. Analyze Data in a Worksheet by Changing Values (EX 224) 25. Goal Seek (EX 225)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this chapter.
C6181_Excel3_CTP.4c.indd 228
4/3/07 1:56:42 PM
Learn It Online is a series of online student exercises that test your knowledge of chapter content and key terms. Instructions: To complete the Learn It Online exercises, start your browser, click the Address bar, and then enter the Web address scsite.com/off2007/learn. When the Office 2007 Learn It Online page is displayed, click the link for the exercise you want to complete and then read the instructions.
Chapter Reinforcement TF, MC, and SA A series of true/false, multiple choice, and short answer questions that test your knowledge of the chapter content.
Who Wants To Be a Computer Genius? An interactive game that challenges your knowledge of chapter content in the style of a television quiz show.
Flash Cards An interactive learning environment where you identify chapter key terms associated with displayed definitions.
Wheel of Terms An interactive game that challenges your knowledge of chapter key terms in the style of the television show Wheel of Fortune.
Practice Test A series of multiple choice questions that test your knowledge of chapter content and key terms.
Crossword Puzzle Challenge A crossword puzzle that challenges your knowledge of key terms presented in the chapter.
Excel Chapter 3
Learn It Online
STUDENT ASSIGNMENTS
Apply Your Knowledge EX 229
Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter.
Understanding Logical Tests and Absolute Cell Referencing Instructions Part 1: Determine the truth value (true or false) of the following logical tests, given the following cell values: X4 = 25; Y3 = 28; K7 = 110; Z2 = 15; and Q9 = 35. Enter true or false. a. Y3 < X4 Truth value: b. Q9 = K7 Truth value: c. X4 + 15 * Z2 / 5 <> K7 Truth value: d. K7 / Z2 > X4 ⫺ Y3 Truth value: e. Q9 * 2 ⫺ 42 < (X4 + Y3 ⫺ 8) / 9 Truth value: f. K7 + 300 <= X4 * Z2 + 10 Truth value: g. Q9 + K7 > 2 * (Q9 + 25) Truth value: h. Y3 = 4 * (Q9 / 5) Truth value: Instructions Part 2: Write cell K23 as a relative reference, absolute reference, mixed reference with the row varying, and mixed reference with the column varying.
Instructions Part 3: Start Excel. Open the workbook Apply 3-1 Absolute Cell References. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required in this book. You will recreate the numerical grid pictured in Figure 3–82 on the next page. Continued >
C6181_Excel3_CTP.4c.indd 229
4/3/07 1:56:43 PM
EX 230 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Apply Your Knowledge
continued
STUDENT ASSIGNMENTS
Perform the following tasks: 1. Enter a formula in cell C7 that multiplies cell C2 times the sum of cells C3 through C6. Write the formula so that when you copy it to cells D7 and E7, cell C2 remains absolute. Verify your formula by checking it with the values found in cells C7, D7, and E7 in Figure 3–82. 2. Enter a formula in cell F3 that multiplies cell B3 times the sum of cells C3 through E3. Write the formula so that when you copy the formula to cells F4, F5, and F6, cell B3 remains absolute. Verify your formula by checking it with the values found in cells F3, F4, F5, and F6 in Figure 3–82. 3. Enter a formula in cell C8 that multiplies cell C2 times the sum of cells C3 through C6. Write the formula so that when you copy the formula to cells D8 and E8, Excel adjusts all the cell references according to the destination cells. Verify your formula by checking it with the values found in cells C8, D8, and E8 in Figure 3–82. 4. Enter a formula in cell G3 that multiplies cell B3 times the sum of cells C3, D3, and E3. Write the formula so that when you copy the formula to cells G4, G5, and G6, Excel adjusts all the cell references according to the destination cells. Verify your formula by checking it with the values found in cells G3, G4, G5, and G6 in Figure 3–82.
Figure 3–82
5. Change the document properties, as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Apply 3-1 Absolute Cell References Complete, and submit the revised workbook as requested by your instructor.
Extend Your Knowledge Extend the skills you learned in this chapter and experiment with new skills. You may need to use Help to complete the assignment.
Nested IF Functions and More About the Fill Handle Instructions Part 1: Start Excel. You will use nested IF functions to determine values for sets of data. Perform the following tasks: 1. Enter the following IF function in cell C1: =IF(B1=“CA”,“West”, IF(B1=“NJ”,“East”, IF(B1=“IL”,“Midwest”,“State Error”)))
C6181_Excel3_CTP.4c.indd 230
4/3/07 1:56:44 PM
2. Use the fill handle to copy the nested IF function down through cell C7. Enter the following data in the cells in the range B1:B7 and then write down the results that display in cells C1 through C7 for each set. Set 1: B1 = CA; B2 = NY; B3 = NJ; B4 = MI; B5 = IL; B6 = CA; B7 = IL. Set 2: B1= WI; B2 = NJ; B3 = IL; B4 = CA; B5 = NJ; B6 = NY; B7 = CA.
Excel Chapter 3
Extend Your Knowledge EX 231
Set 1 Results: Instructions Part 2: Start Excel. Open the workbook Extend 3-1 Create Series. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required in this book. Perform the following tasks: 1. Use the fill handle on one column at a time to propagate the fourteen series through row 16 as shown in Figure 3–83. For example, in column A, select cell A2 and drag the fill handle down to cell A16. In column C, hold down the CTRL key to repeat Monday through cell C16. In column D, select the range D2:D3 and drag the fill handle down to cell D16. Likewise, in columns F and I through K, select the two adjacent cells in rows 2 and 3 before dragging the fill handle down to the corresponding cell in row 16.
STUDENT ASSIGNMENTS
Set 2 Results:
2. Select cell D21. While holding down the CTRL key, one at a time drag the fill handle three cells to the right, to the left, up, and down to generate four series of numbers beginning with zero and incremented by one. 3. Select cell I21. Point to the cell border so that the mouse pointer changes to a plus sign with four arrows. Drag the mouse pointer down to cell I22 to move the contents of cell I21 to cell I22. 4. Select cell I22. Point to the cell border so that the mouse pointer changes to a plus sign with four arrows. While holding down the CTRL key, drag the mouse pointer to cell M22 to copy the contents of cell I22 to cell M22. 5. Select cell M21. Drag the fill handle in to the center of cell M21 so that the cell is shaded in order to delete the cell contents. 6. Change the document properties, as specified by your instructor. Change the worksheet header Figure 3–83 with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Extend 3-1 Create Series Complete, and submit the revised workbook as requested by your instructor.
C6181_Excel3_CTP.4c.indd 231
4/3/07 1:56:46 PM
EX 232 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Make It Right Analyze a workbook and correct all errors and/or improve the design.
STUDENT ASSIGNMENTS
Inserting Rows, Moving a Range, and Correcting Formulas in a Worksheet Instructions: Start Excel. Open the workbook Make It Right 3-1 e-MusicPro.com Annual Projected Net Income. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required for this book. Correct the following design and formula problems (Figure 3–84a) in the worksheet.
(a) Before
(b) After Figure 3–84
1. The Royalty in cell C3 is computed using the formula =B9*B3 (Royalties % ⫻ Sales). Similar formulas are used in cells C4 and C5. The formula in cell C3 was entered and copied to cells C4 and C5. Although the result in cell C3 is correct, the results in cells C4 and C5 are incorrect. Edit the formula in cell C3 by changing cell B9 to an absolute cell reference. Copy the corrected formula in cell C3 to cells C4 and C5. After completing the copy, click the Auto Fill Options button arrow that displays below and to the right of cell C5 and choose Fill Without Formatting. 2. The Royalty Bonus amounts in cells D3, D4, and D5 are computed using the IF function. The Royalty Bonus should equal the amount in cell B10 ($50,000) if the corresponding Sales in column B is greater than or equal to $2,750,000. If the corresponding Sales in column B is less than $2,750,000, then the Royalty Bonus is zero ($0). The IF function in cell D3 was entered and
C6181_Excel3_CTP.4c.indd 232
4/3/07 1:56:47 PM
3. The Manufacturing Costs in cell E3 is computed using the formula =B11*B3 (Manu. Costs % x Sales). The formula in cell E3 was entered and copied to cells E4 and E5. Although the result in cell E3 is correct, the results in cells E4 and E5 are incorrect. Edit and correct the formula in cell E3 by changing cell B11 to an absolute cell reference. Copy the corrected formula in cell E3 to cells E4 and E5. After completing the copy, click the Auto Fill Options button arrow that displays below and to the right of cell E5 and choose Fill Without Formatting. 4. Change the design of the worksheet by moving the Assumptions table in the range A8:B11 to the range A1:B4 as shown in Figure 3–84b. To complete the move, insert five rows above row 1 and then drag the Assumptions table to the range A1:B4. Use Figure 3–84b to verify that Excel automatically adjusted the cell references based on the move. Use the Undo button and Redo button on the Quick Access Toolbar to move the Assumptions table back and forth while the results of the formulas remain the same.
Excel Chapter 3
copied to cells D4 and D5. The current IF functions in cells D3, D4, and D5 are incorrect. Edit and correct the IF function in cell D3. Copy the corrected formula in cell D3 to cells D4 and D5. After completing the copy, click the Auto Fill Options button arrow that displays below and to the right of cell D5 and choose Fill Without Formatting.
STUDENT ASSIGNMENTS
In the Lab EX 233
5. Change the document properties, as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Make It Right 3-1 e-MusicPro.com Annual Projected Net Income Complete, and submit the revised workbook as requested by your instructor.
In the Lab Create a workbook using the guidelines, concepts, and skills presented in this chapter. Labs are listed in order of increasing difficulty.
Lab 1: Eight-Year Financial Projection Problem: Your supervisor in the Finance department at Salioto Auto Parts has asked you to create a worksheet that will project the annual gross margin, expenses, total expenses, operating income, income taxes, and net income for the next ten years based on the assumptions in Table 3–9. The desired worksheet is shown in Figure 3–85 on the next page. In Part 1 you will create the worksheet. In Part 2 you will create a chart to present the data, shown in Figure 3–86 on page 236. In Part 3 you will use Goal Seek to analyze three different sales scenarios. Table 3–9 Salioto Auto Parts Financial Projection Assumptions Units Sold in Prior Year Unit Cost
11,459,713 $13.40
Annual Sales Growth
4.50%
Annual Price Decrease
4.25%
Margin
39.25%
Continued >
C6181_Excel3_CTP.4c.indd 233
4/3/07 1:56:50 PM
EX 234 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
continued
STUDENT ASSIGNMENTS
In the Lab
Figure 3–85
Instructions Part 1: 1. Start Excel. Apply the Apex theme to the worksheet by using the Themes button on the Page Layout tab on the Ribbon. Bold the entire worksheet by selecting the entire worksheet and using the Bold button on the Home tab on the Ribbon. 2. Enter the worksheet title Salioto Auto Parts in cell A8 and the subtitle Eight-Year Financial Projection in cell A9. Format the worksheet title in cell A8 to 36-point Algerian (or a similar font). Format the worksheet subtitle in cell A9 to 20-point Rockwell (or a similar font). Enter the system date in cell I9 using the NOW function. Format the date to the 14-Mar-01 style. 3. Change the following column widths: A = 25.00 characters; B through I = 15.00 characters. Change the heights of rows 7, 10, and 21 to 42.00 points. 4. Enter the eight column titles Year 1 through Year 8 in the range B10:I10 by entering Year 1 in cell B10 and then dragging cell B10’s fill handle through the range C10:I10. Format cell B10 as follows: (a) increase the font size to 14; (b) center and italicize; and (c) rotate its contents 45°. Use the Format Painter button to copy the format assigned to cell B10 to the range C10:I10. 5. Enter the row titles in the range A11:A24. Change the font in cells A14, A20, A22, and A24 to 14-point Rockwell (or a similar font). Add thick bottom borders to the ranges B10:I10 and B12:I12. 6. Enter the table title Assumptions in cell A1. Enter the assumptions in Table 3-9 in the range A2:B6. Use format symbols when entering the numbers. Change the font size of the table title to 14-point Rockwell and underline it. 7. Select the range B11:I24 and then click the Format Cells: Number Dialog Box Launcher on the Home tab on the Ribbon to display the Format Cells dialog box. Use the Number category in the Format Cells dialog box to assign the Comma style with no decimal places and negative numbers enclosed in parentheses to the range B11:I24.
C6181_Excel3_CTP.4c.indd 234
4/3/07 1:56:50 PM
a. Year 1 Sales (cell B11) = Units Sold in Prior Year * (Unit Cost / (1 ⫺ Margin)) or =B2 * (B3 / (1 ⫺ B6)) b. Year 2 Sales (cell C11) = Year 1 Sales * (1 + Annual Sales Growth) * (1 ⫺ Annual Price Decrease) or =B11 * (1 + $B$4) * (1 ⫺ $B$5) c. Copy cell C11 to the range D11:I11. d. Year 1 Cost of Goods (cell B12) = Year 1 Sales ⫺ (Year 1 Sales * Margin) or =B11 * (1 ⫺ $B$6) e. Copy cell B12 to the range C12:I12. f. Gross Margin (cell B13) = Year 1 Sales ⫺ Year 1 Cost of Goods or =B11 ⫺ B12 g. Copy cell B13 to the range C13:I13. h. Year 1 Advertising (cell B15) = 500 + 13% * Year 1 Sales or =500 + 13% * B11 i. Copy cell B15 to the range C15:I15. j. Maintenance (row 16): Year 1 = 1,905,000; Year 2 = 5,550,000; Year 3 = 4,250,000; Year 4 = 5,050,000; Year 5 = 2,500,000; Year 6 = 3,150,000; Year 7 = 2,945,000; and Year 8 = 3,560.000. k. Year 1 Rent (cell B17) = 1,700,000 l. Year 2 Rent (cell C17) = Year 1 Rent + 10% * Year 1 Rent or =B17 * (1 + 10%) m. Copy cell C17 to the range D17:I17. n. Year 1 Salaries (cell B18) = 22.25% * Year 1 Sales or =22.25% * B11 o. Copy cell B18 to the range C18:I18. p. Year 1 Supplies (cell B19) = 1.5% * Year 1 Sales or =1.5% * B11 q. Copy cell B19 to the range C19:I19. r. Year 1 Total Expenses (cell B20) or =SUM(B15:B19) s. Copy cell B20 to the range C20:I20. t. Year 1 Operating Income (cell B22) = Year 1 Gross Margin ⫺ Year 1 Total Expenses or =B13 ⫺ B20 u. Copy cell B22 to the range C22:I22. v. Year 1 Income Taxes (cell B23): If Year 1 Operating Income is less than 0, then Year 1 Income Taxes equal 0; otherwise Year 1 Income Taxes equal 40% * Year 1 Operating Income or =IF(B22 < 0, 0, 40% * B22) w. Copy cell B23 to the range C23:I23. x. Year 1 Net Income (cell B24) = Year 1 Operating Income ⫺ Year 1 Income Taxes or =B22 ⫺ B23 y. Copy cell B24 to the range C24:I24.
Excel Chapter 3
8. Complete the following entries:
STUDENT ASSIGNMENTS
In the Lab EX 235
9. Change the background colors as shown in Figure 3-85. Use Orange (column 3 under Standard Colors) for the background colors. 10. Zoom to: (a) 200%; (b) 75%; (c) 25%; and (d) 100%. 11. Change the document properties, as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Lab 3-1 Salioto Auto Parts Eight-Year Financial Projection. 12. Preview the worksheet. Use the Page Setup button to fit the printout on one page in landscape orientation. Preview the formulas version (ctrl+`) of the worksheet in landscape orientation using the Fit to option. Press ctrl+` to instruct Excel to display the values version of the worksheet. Save the workbook again and close the workbook. 13. Submit the workbook as requested by your instructor. Instructions Part 2: 1. Start Excel. Open the workbook Lab 3-1 Salioto Auto Parts Eight-Year Financial Projection. 2. Use the nonadjacent ranges B10:I10 and B24:I24 to create a 3-D Cylinder chart. Draw the chart by clicking the Column button on the Insert tab on the Ribbon. When the Column gallery is displayed, click the Clustered Cylinder chart type (column 1, row 2). When the chart is displayed, click the Move Chart button on the Ribbon to move the chart to a new sheet. Continued >
C6181_Excel3_CTP.4c.indd 235
4/3/07 1:56:52 PM
EX 236 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
In the Lab
continued
STUDENT ASSIGNMENTS
3. Select the legend on the right side of the chart and delete it. Add the chart title by clicking the Layout tab on the Ribbon, then clicking the Chart Title button. Click Above Chart in the Chart Title gallery. Format the chart title as shown in Figure 3–86. 4. To change the color of the cylinders, click one of the cylinders and use the Shape Fill button on the Format tab on the Ribbon. To change the color of the wall, click the wall behind the cylinders and use the Shape Fill button on the Format tab on the Ribbon. Use the same procedure to change the color of the base of the wall. 5. Rename the sheet tabs Eight-Year Financial Projection and 3-D Cylinder Chart. Rearrange the sheets so that the worksheet is leftmost, and color their tabs as shown in Figure 3–86. 6. Click the Eight-Year Financial Projection tab to display the worksheet. Save the workbook using the same file name (Lab 3-1 Salioto Auto Parts Eight-Year Financial Projection) as defined in Part 1. Submit the workbook as requested by your instructor.
Figure 3–86
C6181_Excel3_CTP.4c.indd 236
4/3/07 1:56:52 PM
Table 3–10 Salioto Auto Parts Data to Analyze and Results Case
Annual Sales Growth
Annual Price Decrease
Year 8 Resulting Net Income in Cell I24
1
7.45%
5.25%
174,568
2
12.75%
⫺3.00%
6,677,903
3
⫺7.25%
1.65%
(3,552,156)
Excel Chapter 3
Instructions Part 3: 1. Start Excel. Open the workbook Lab 3-1 Salioto Auto Parts Eight-Year Financial Projection. Do not save the workbook in this part. Divide the window into two panes by dragging the horizontal split box between rows 6 and 7. Use the scroll bars to show both the top and bottom of the worksheet. Using the numbers in columns 2 and 3 of Table 3-10, analyze the effect of changing the annual sales growth (cell B4) and annual price decrease (cell B5) on the net incomes in row 24. The resulting answers are in column 4 of Table 3–10. Submit the workbook or results of the what-if analysis for each case as requested by your instructor.
STUDENT ASSIGNMENTS
In the Lab EX 237
2. Close the workbook without saving it, and then reopen it. Use the What-If Analysis button on the Data tab on the Ribbon to goal seek. Determine a margin (cell B6) that would result in a Year 8 net income of $2,000,000 (cell I24). You should end up with a margin of 40.68% in cell B6. Submit the workbook with the new values or the results of the goal seek as requested by your instructor. Do not save the workbook with the latest changes.
In the Lab Lab 2: Modifying a Weekly Payroll Worksheet Problem: As a summer intern at Britney’s Music Emporium, you have been asked to modify the weekly payroll report shown in Figure 3–87a on the next page. The workbook, Lab 3-2 Britney’s Music Emporium Weekly Payroll Report, is included with the Data Files for Students. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required for this book. The major modifications to the payroll report to be made in this exercise include: (1) reformatting the worksheet; (2) adding computations of time-and-a-half for hours worked greater than 40; (3) adding calculations to charge no federal tax in certain situations; (4) adding Social Security and Medicare deductions; (5) adding and deleting employees; and (6) changing employee information. The final payroll report is shown in Figure 3–87b on the next page.
C6181_Excel3_CTP.4c.indd 237
4/3/07 1:56:55 PM
STUDENT ASSIGNMENTS
EX 238 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
(a) Before
(b) After Figure 3–87
Instructions Part 1: 1. Start Excel. Open the workbook, Lab 3-2 Britney’s Music Emporium Weekly Payroll Report and then save the workbook using the file name Lab 3-2 Britney’s Music Emporium Weekly Payroll Report Complete. 2. Select the worksheet by clicking the Select All button. Click the Clear button on the Home tab on the Ribbon and then click Clear Formats on the Clear menu to clear the formatting. Bold the entire worksheet. 3. Delete rows 11 through 13 to remove the statistics below the Totals row. Change all the row heights back to the default height (12.75). 4. Insert four rows above row 1 by selecting rows 1 through 4, right-clicking the selection, and clicking Insert on the shortcut menu. 5. Change the row heights as follows: row 5 = 48.00; rows 6 and 7 = 25.50. One at a time, select cells D7, E7, and G7. For each cell, press the f2 key and then the enter key to display the column headings on multiple rows. Center the range B7:J7.
C6181_Excel3_CTP.4c.indd 238
4/3/07 1:56:55 PM
6. Delete column B by right-clicking the column heading and clicking Delete on the shortcut menu. 7. Insert a new column between columns C and D. Change the column widths as follows: A = 25.00; D = 13.00; and E through K = 9.71. Enter the new column D title YTD Soc. Sec. in cell D7. 8. Insert two new columns between columns F and G. Enter the new column G title Soc. Sec. in cell G7. Enter the new column H title Medicare in cell H7.
Excel Chapter 3
In the Lab EX 239
10. Assign the NOW function to cell B6 and format it to the 3/14/2001 style. 11. Delete employee James, Delmar (row 12). Change Raul Aquire’s (row 8) hours worked to 2.5. Change Casimir Kwasny’s (row 9) number of dependents to 7 and rate per hour to $8.25. Change Tepin Ruiz’s (row 11) hours worked to 49.5 and Fred Holkavich’s (row 12) hours worked to 57. 12. Freeze column A and rows 1 through 7 by selecting cell B8, clicking the Freeze Panes button on the View tab on the Ribbon, and then clicking Freeze Panes on the Freeze Panes menu. 13. In column D, enter the YTD Soc. Sec. values listed in Table 3–11. 14. Insert two new rows immediately above the Totals row. Add the new employee data as listed in Table 3–12.
Table 3–11 The Britney Music Emporium’s YTD Social Security Values Employee
STUDENT ASSIGNMENTS
9. Enhance the worksheet title in cell A5 by using a 36-point light blue Arial Rounded MT Bold (or a similar font) font style as shown in Figure 3–87b.
YTD Soc. Sec.
Aquire, Raul
767.00
Kwasny, Casimir
1307.75
Mohammed, Aadil
930.25
Ruiz, Tepin
7458.75
Holkavich, Fred
7457.75
Table 3–12 The Britney Music Emporium’s New Employee Data Employee
Dependents
Rate per Hour
YTD Soc. Sec.
Hours Worked
Jordan, Leon
4
13.50
2952.78
37.25
Wright, Louis
5
23.25
7430.00
46.75
15. Center the range B6:B14. Use the Currency category in the Format Cells dialog box to assign a Comma style (no dollar signs) with two decimal places and negative numbers within parentheses to the range C8:K15. Assign a Percent style and two decimal places to the range L8:L15. Draw a thick bottom border in the ranges A7:L7 and A14:L14. 16. As shown in Figure 3–87b, enter and format the Social Security (7.65% with a maximum of $7,458.75) and Medicare tax (1.45%) information in the range A1:B3. Use format symbols where applicable. 17. Change the formulas to determine the gross pay in column F and the federal tax in column I as follows: a.
In cell F8, enter an IF function that applies the following logic and then copy it to the range F9:F14. If Hours Worked <= 40, then Rate per Hour * Hours Worked, otherwise Rate per Hour * Hours Worked + 0.5 * Rate per Hour * (Hours Worked ⫺ 40) or =IF(E8 <= 40, C8 * E8, C8 * E8 + 0.5 * C8 *(E8 ⫺ 40))
b. In cell I8, enter the IF function that applies the following logic and then copy it to the range I9:I14. If (Gross Pay – Dependents * 22.09 > 0, then 20% * (Gross Pay – Dependents * 22.09), otherwise 0 or =IF(F8 – B8 * 22.09 > 0, 20% * (F8 – B8 * 22.09), 0)
Continued >
C6181_Excel3_CTP.4c.indd 239
4/3/07 1:56:58 PM
EX 240 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
In the Lab
continued
STUDENT ASSIGNMENTS
18. An employee pays Social Security tax only if his or her YTD Soc. Sec. in column D is less than the Maximum Social Security value in cell B3. Use the following logic to determine the Social Security tax for Raul Aquire in cell G8 and then copy it to the range G9:G14. Soc. Sec. (cell G8): If Social Security Tax * Gross Pay + YTD Soc. Sec. > Maximum Social Security, then Maximum Social Security ⫺ YTD Soc. Sec., otherwise Social Security Tax * Gross Pay or =IF($B$1 * F8 + D8 >= $B$3, $B$3 ⫺ D8, $B$1 * F8) 19. In cell H8, enter the following formula and then copy it to the range H9:H14: Medicare (cell H8) = Medicare Tax * Gross Pay or =$B$2 * F8 20. In cell K8, enter the following formula and copy it to the range K9:K14: Net Pay (K8) = Gross Pay ⫺ (Soc. Sec. + Medicare + Federal Tax + State Tax) or =F8 ⫺ (G8 + H8 + I8 + J8) 21. In cell L8, enter the following formula and copy it to the range L9:L14: % Taxes (cell L8) = (Soc. Sec. + Medicare + Federal Tax + State Tax) / Gross Pay or =(G8 + H8 + I8 + J8) / F8 22. Use the Range Finder (double-click cell) to verify the new totals as shown in row 15 in Figure 3–87b. Unfreeze the worksheet by clicking the Freeze Panes button on the View tab on the Ribbon, and then clicking Unfreeze Panes on the Freeze Panes menu. 23. Preview the worksheet. Use the Page Setup button to change the orientation to landscape and fit the report on one page. 24. Change the document properties, as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook. 25. Use the Zoom button on the View tab on the Ribbon to change the view of the worksheet. One by one, select all the percents on the Zoom dialog box. When you are done, return the worksheet to 100% magnification. 26. Preview the formulas version (ctrl+`) in landscape orientation. Close the worksheet without saving the latest changes. 27. Submit the workbook as requested by your instructor. Instructions Part 2: Start Excel. Open Lab 3-2 Britney’s Music Emporium Weekly Payroll Report Complete. Do not save the workbook in this part. Using the numbers in Table 3–13, analyze the effect of changing the Medicare tax in cell B2. The first case should result in a total Medicare tax in cell H15 of $106.78. The second case should result Table 3–13 The Britney Music Emporium’s Medicare Tax Cases in a total Medicare tax of $166.73. Close the workbook without saving Case Medicare Tax changes. Submit the results of the 1 2.85% what-if analysis as requested by your 2 4.45% instructor. Instructions Part 3: Submit results for this part as requested by your instructor. 1. Start Excel. Open Lab 3-2 Britney’s Music Emporium Weekly Payroll Report Complete. Select cell F8. Write down the formula that Excel displays in the formula bar. Select the range C8:C14. Point to the border surrounding the range and drag the selection to the range D17:D23. Click cell F8, and write down the formula that Excel displays in the formula bar below the one you wrote down earlier. Compare the two formulas. What can you conclude about how Excel responds when you move cells involved in a formula? Click the Undo button on the Quick Access Toolbar.
C6181_Excel3_CTP.4c.indd 240
4/3/07 1:56:58 PM
3. Right-click the range C8:C14 and then click Insert on the shortcut menu. When Excel displays the Insert dialog box, click Shift cells right and then click the OK button. What does Excel display in the formula bar when you click cell F8? What does Excel display in the formula bar when you click cell G8? What can you conclude about how Excel responds when you insert cells next to cells involved in a formula? Close the workbook without saving the changes.
In the Lab Lab 3: Analysis of Indirect Expense Allocations Problem: Your classmate works part time as a consultant for RockieView Resort and Spa. She has asked you to assist her in creating an indirect expense allocation worksheet (Figure 3–88) that will help the resort and spa administration better evaluate the profit centers described in Table 3–14 on the next page.
Excel Chapter 3
2. Right-click the range C8:C14 and then click Delete on the shortcut menu. When Excel displays the Delete dialog box, click Shift cells left and then click the OK button. What does Excel display in cell F8? Click cell F8 and then point to the Trace Error button that is displayed to the left of the cell. Write down the ScreenTip that is displayed. Click the Undo button on the Quick Access Toolbar.
STUDENT ASSIGNMENTS
In the Lab EX 241
Figure 3–88
Continued >
C6181_Excel3_CTP.4c.indd 241
4/3/07 1:56:59 PM
EX 242 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
In the Lab
continued
Table 3–14 RockieView Resort and Spa Worksheet Data Banquet Room
STUDENT ASSIGNMENTS
Total Net Revenue Cost of Sales
Business Children’s Center Game Room
Conference Rooms
Gift Shop
Lounge
Restaurant
Spa
345819
192190
52750
212300
112100
622350
615350
92900
19750
16235
12900
55250
42100
115400
175000
42150
Direct Expenses
9245
9245
7250
19300
37400
101000
115600
24800
Square Footage
10500
875
1425
6250
1325
7500
6700
2750
Instructions Part 1: Do the following to create the worksheet shown in Figure 3–88. 1. Apply the Solstice theme to the worksheet. Bold the entire worksheet by selecting the entire worksheet and using the Bold button on the Ribbon. 2. Change the following column widths: A = 28.00; B through I = 13.00; J = 14.00. 3. Enter the worksheet titles in cells A1 and A2 and the system date in cell J2. Format the date to the 14-Mar-01 style. 4. Enter the column titles, row titles, and the first three rows of numbers in Table 3–14 in rows 3 through 6. Center and italicize the column headings in the range B3:J3. Add a thick bottom border to the range B3:J3. Sum the individual rows 4, 5, and 6 in the range J4:J6. 5. Enter the Square Footage row in Table 3–14 with the comma format symbol in row 16. Sum row 16 in cell J16. Use the Format Painter button to format cell J16. Change the height of row 16 to 39.00. Vertically center the range A16:J16 through the use of the Format Cells dialog box. 6. Enter the remaining row titles in the range A7:A17 as shown in Figure 3–88. Increase the font size in cells A7, A14, and A15 to 16 point. 7. Copy the row titles in range A8:A13 to the range A18:A23. Enter the numbers shown in the range B18:B23 of Figure 3–88 with format symbols. 8. The planned indirect expenses in the range B18:B23 are to be prorated across the profit center as follows: Administrative (row 8), Energy (row 10), and Marketing (row 13) on the basis of Total Net Revenue (row 4); Depreciation (row 9), Insurance (row 11), and Maintenance (row 12) on the basis of Square Footage (row 16). Use the following formulas to accomplish the prorating: a.
Banquet Room Administrative (cell B8) = Administrative Expenses * Banquet Room Total Net Revenue / Resort Total Net Revenue or =$B$18 * B4 / $J$4
b. Banquet Room Depreciation (cell B9) = Depreciation Expenses * Banquet Room Square Footage / Total Square Footage or =$B$19 * B16 / $J$16 c.
Banquet Room Energy (cell B10) = Energy Expenses * Banquet Room Total Net Revenue / Resort Total Net Revenue or =$B$20 * B4 / $J$4
d. Banquet Room Insurance (cell B11) = Insurance Expenses * Banquet Room Square Feet / Total Square Footage or =$B$21 * B16 / $J$16 e. Banquet Room Maintenance (cell B12) = Maintenance Expenses * Banquet Room Square Footage / Total Square Footage or =$B$22 * B16 / $J$16 f.
Banquet Room Marketing (cell B13) = Marketing Expenses * Banquet Room Total Net Revenue / Resort Total Net Revenue or =$B$23 * B4 / $J$4
g. Banquet Room Total Indirect Expenses (cell B14) = SUM(B8:B13) h. Banquet Room Net Income (cell B15) = Total Net Revenue ⫺ (Cost of Sales + Direct Expenses + Total Indirect Expenses) or =B4 ⫺ (B5 + B6 + B14)
C6181_Excel3_CTP.4c.indd 242
i.
Copy the range B8:B15 to the range C8:I15.
j.
Sum the individual rows 8 through 15 in the range J8:J15.
4/3/07 1:57:01 PM
9. Add a thick bottom border to the range B13:J13. Assign the Currency style with two decimal places and show negative numbers in parentheses to the following ranges: B4:J4; B8:J8; and B14:J15. Assign the Comma style with two decimal places and show negative numbers in parentheses to the following ranges: B5:J6 and B9:J13.
Excel Chapter 3
In the Lab EX 243
11. Use the background color blue and the font color white for the ranges A1:J2; A7; A15:J15; and A17:B23 as shown in Figure 3–88. 12. Rename the Sheet1 sheet, Analysis of Indirect Expenses, and color its tab blue. 13. Update the document properties with your name, course number, and name for the workbook. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Lab 3-3 RockieView Resort and Spa Indirect Expenses Allocations. 14. Preview the worksheet. Use the Page Setup button to change the orientation to landscape and fit the report on one page. Preview the formulas version (ctrl+`) of the worksheet in landscape orientation using the Fit to option button in the Page Setup dialog box. Press ctrl+` to show the values version of the worksheet. Save the workbook again.
STUDENT ASSIGNMENTS
10. Change the font in cell A1 to 48-point Britannic Bold (or a similar font). Change the font in cell A2 to 22-point Britannic Bold (or a similar font). Change the font in cell A17 to 18-point italic Britannic Bold.
15. Divide the window into four panes and show the four corners of the worksheet. Remove the four panes. Close the workbook but do not save the workbook. Instructions Part 2: Start Excel. Open Lab 3-3 RockieView Resort and Spa Indirect Expenses Allocations. Draw a 3-D Pie chart (Figure 3–89) on a separate sheet that shows the contribution of each category of indirect expense to the total indirect expenses. That is, chart the nonadjacent ranges A8:A13 (category names) and J8:J13 (data series). Show labels that include category names and percentages. Do not show the legend or leader lines. Format the 3-D Pie chart as shown in Figure 3–89. Rename the chart sheet 3-D Pie Chart and color the tab red. Move the chart tab to the right of the worksheet tab. Save the workbook using the file name, Lab 3-3 RockieView Resort and Spa Indirect Expenses Allocations. Submit the workbook as requested by your instructor.
Figure 3–89
C6181_Excel3_CTP.4c.indd 243
Continued >
4/3/07 1:57:01 PM
EX 244 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
STUDENT ASSIGNMENTS
In the Lab
C6181_Excel3_CTP.4c.indd 244
continued
Instructions Part 3: Start Excel. Open Lab 3-3 RockieView Resort and Spa Indirect Expenses Allocations. 1. Using the numbers in Table 3–15, analyze the effect of changing the planned indirect expenses in the range B18:B23 on the net incomes for each profit center. You should end with the following totals in cell J15: Case 1 = $892,684.00 and Case 2 = $869,634.00. Submit the workbook or results for each case Table 3–15 RockieView Resort and Spa Indirect Expense Allocations What-If Data as requested by your instructor. Case 1 Case 2 2. Use the What-If Administrative 234000 210000 Analysis button Depreciation 123500 152000 on the Data tab Energy 67750 48000 on the Ribbon Insurance 26200 53000 to goal seek. Maintenance 42000 38000 Determine a Marketing 57000 72500 planned indirect Administrative expense (cell B18) that would result in a total net income of $1,200,000 (cell J15). You should end up with a planned indirect Administrative expense of $50,159 in cell B18. Submit the workbook with the new values or the results of the goal seek as requested by your instructor.
4/3/07 1:57:03 PM
Cases and Places Apply your creative thinking and problem solving skills to design and implement a solution.
Excel Chapter 3
Cases and Places EX 245
• 1: Five-Year Sales Projections You have been asked to develop a worksheet for Millennium Steel that shows annual growth for the next five years based on the prior year’s sales and growth data. Include an embedded exploded 3-D Pie chart that shows the contribution of each year to the total gross margin. The data and general layout of the worksheet, including the totals, are shown in Table 3–16. Table 3–16 Millennium Steel Sales Data and General Layout Year 1
Year 2
Year 3
Year 4
Year 5
Total
Sales
Formula A
—
Cost of Goods
Formula B
—
Gross Margin
Formula C
—
STUDENT ASSIGNMENTS
• EASIER •• MORE DIFFICULT
Assumptions Prior Year’s Sales
35234500
Annual Growth Rate
⫺1.75%
12.35%
5.00%
⫺1.25%
8.75%
Annual Cost Rate
41.25%
44.00%
33.00%
43.75%
34.25%
2.90%
3.10%
4.95%
2.50%
4.50%
Premium
Enter the formulas shown in Table 3–17 in the locations shown in Table 3–16. Copy formulas A, B, and C to the remaining years. The gross margin for the five years should equal $118,986,982. Table 3–17 Millennium Steel Sales Projection Formulas Formula A = Prior Year’s Sales * (1 + Annual Growth Rate) Formula B = IF(Annual Growth Rate < 0, Sales * (Annual Cost Rate + Premium), Sales * Annual Cost Rate) Formula C = Sales ⫺ Cost of Goods
Use the concepts and techniques developed in the first three projects to create and format the worksheet and embedded 3-D Pie chart. Use the Goal Seek command to determine the Year 1 annual growth rate that will generate a total gross margin of $125,000,000. You should end up with a Year 1 annual growth rate of 2.35%. Submit the workbook and results of the goal seek as requested by your instructor.
• 2: Bimonthly Projected Earnings and Expenditures The Chesterton Trib is a small newspaper that publishes stories of local interest. Revenues are earned from subscriptions and the sale of advertising space. A fixed percentage of the Net Revenue is spent on marketing, payroll, commissions (advertising sales only), production costs, and reportorial expenses. The editor has summarized the paper’s expenditures over the past year and the anticipated income from subscriptions and advertising on a bimonthly basis as shown in Table 3–18. With the data, you have been asked to prepare a worksheet for the next shareholder’s meeting showing total revenues, total expenditures, and operating incomes for each bimonthly period. Include a 3-D Cylinder chart on a separate sheet that compares the six bimonthly operating incomes. Use the concepts and techniques presented in this project to create and format the worksheet and chart.
C6181_Excel3_CTP.4c.indd 245
4/3/07 1:57:03 PM
EX 246 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Table 3–18 Chesterton Trib Bimonthly Projected Earnings and Expenditures Revenue Subscriptions Advertising
February
April
June
August
October
December
12178.30
8391.50
15714.50
16340.10
12567.25
12800.15
4130.20
6425.00
4123.15
5023.30
7015.75
9273.20
STUDENT ASSIGNMENTS
Assumptions Marketing
15.60%
Payroll
21.50%
Commissions on Advertising
3.25%
Production Costs
12.50%
Reportorial Expenses
5.00%
One shareholder lobbied to reduce marketing expenditures by 3% and payroll costs by 5%. Perform a what-if-analysis reflecting the proposed changes in expenditure assumptions. The reduction in expenditures should result in a total operating income of $59,696.91 or an increase of $9,118.59. Submit the workbook and results of the what-if analysis as requested by your instructor.
• • 3: Projected Used-Truck Savings Cousin Abe and Aunt Esther own a paint company. Their good friend Billie Bob is retiring after 35 years of delivering the morning newspaper. Billie Bob has offered them the opportunity to take his place next year. The job requires, however, that they own a truck. They need to save enough money over the next six months to buy a $10,000 used truck. They have job orders at their paint company for the next six months: $22,150 in July, $22,480 in August, $32,900 in September, $31,200 in October, $45,301 in November, and $32,190 in December. Each month, they spend 34.55% of the job order income on material, 3.00% on rollers and brushes, 4.75% on their retirement account, and 39.5% on food and clothing. The remaining profits (orders ⫺ total expenses) will be put aside for the used truck. Aunt Esther’s retired parents have agreed to provide a bonus of $250 whenever the monthly profit exceeds $2,000. Use the concepts and techniques presented in this project to create and format the worksheet. Cousin Abe has asked you to create a worksheet that shows orders, expenses, profits, bonuses, and savings for the next six months, and totals for each category. Aunt Esther would like to save for another used truck for $17,000. She has asked you to (a) perform a what-if analysis to determine the effect on the savings by reducing the percentage spent on material to 25% (answer total savings = $16,084.49), and (b) with the original assumptions, goal seek to determine what percentage of profits to spend on food and clothing if $15,000 is needed for the used truck (answer = 29.165%). Submit the workbook and results of the what-if analysis as requested by your instructor.
• • 4: College Expense and Resource Projections Make It Personal
Attending college with limited resources can be a trying experience. One way to alleviate some of the financial stress is to plan ahead. Develop a worksheet following the general layout in Table 3–19 that shows the projected expenses and resources for four years of college. Use the formulas listed in Table 3–20 and the concepts and techniques presented in this project to create the worksheet.
C6181_Excel3_CTP.4c.indd 246
4/3/07 1:57:04 PM
Expenses
Freshman
Sophomore
Junior
Senior
Total
Room & Board
$6,125.00
Formula A
—
Tuition & Books
8,750.00
Formula A
—
Clothes
750.00
Formula A
—
1,025.00
Formula A
—
Miscellaneous
675.00
Formula A
Total Expenses
—
—
—
—
—
Resources
Freshman
Sophomore
Junior
Senior
Total
Entertainment
—
Savings
Formula B
—
Parents
Formula B
—
Job
Formula B
—
Loans
Formula B
—
Scholarships
Formula B
—
Total Resources
—
—
—
—
Excel Chapter 3
Table 3–19 College Expense and Resource Projections
STUDENT ASSIGNMENTS
Cases and Places EX 247
—
Assumptions Savings
10.00%
Parents
20.00%
Job
10.00%
Loans
30.00%
Scholarships
30.00%
Annual Rate Increase
7.50%
Table 3–20 College Expense and Resource Projections Formulas After creating the worksheet: (a) perform what-if analysis by Formula A = Prior Year’s Expense * (1 + Annual Rate Increase) changing the percents of the resource Formula B = Total Expenses for Year * Corresponding Assumption assumptions; (b) perform a what-if analysis to determine the effect on the resources by increasing the Annual Rate Increase to 9%; and (c) with the original assumptions, goal seek to determine what the Annual Rate Increase would be for the total expenses to be $100,000. Submit the workbook and results of the what-if analysis as requested by your instructor.
•• 5: Cost of Storing Radio Isotopes Working Together
A government agency plans to conduct experiments that will result in some radioactive waste. Although the isotopes will break apart into atoms of other elements over time, agency watchdogs are concerned about containment costs while the material still is radioactive. The agency director has asked your group to prepare a worksheet showing the amount of radioactive material remaining, containment costs, estimated agency appropriations, and the percentage of appropriations that will be spent on containment every year for the next decade. The director has outlined the desired worksheet as shown in Table 3–21 on the next page.
Continued >
C6181_Excel3_CTP.4c.indd 247
4/3/07 1:57:04 PM
EX 248 Excel Chapter 3 What-If Analysis, Charting, and Working with Large Worksheets
Cases and Places
continued
These formulas have been supplied: Formula A: Amount Remaining = Original Amount ⫻ 0.5 (Number of Years Stored / Half-Life) Formula B: Containment Costs = Containment Cost Per Kilogram ⫻ Total Amount Remaining
STUDENT ASSIGNMENTS
Formula C: Estimated Appropriations = Appropriations ⫻ (1 + Estimated Yearly Increase) (Number of Years Stored / Half-Life) Formula D: Percentage Spent on Containment = Containment Costs / Estimated Appropriations The director has asked your group to include a function that prints “Acceptable” below the percentage spent on containment whenever the percentage is less than 1%, otherwise print “Not Acceptable.” Have each member of your team submit a sketch of the proposed worksheet and then implement the best one. Use the concepts and techniques presented in this project to create and format the worksheet. Submit the sketches and workbook as requested by your instructor. Table 3–21 Cost of Storing Radioactive Isotopes Number of Years Stored Number of Years Stored
1
Amount of Isotope X Remaining (in kg)
Formula A
Amount of Isotope Y Remaining (in kg)
Formula A
Total Remaining (in kg)
—
Containment Costs
Formula B
Estimated Appropriations
Formula C
Percentage Spent on Containment
Formula D
2
3
.................................................
10
—
—
.................................................
—
Message
Assumptions
C6181_Excel3_CTP.4c.indd 248
Original Amount of Isotope X Remaining (in kg)
650
Half-Life of Isotope X (in years)
1
Containment Cost per Kilogram
1000
Estimated Yearly Increase
10.00%
Original Amount of Isotope Y Remaining (in kg)
3000
Half-Life of Isotope Y (in years)
0.45
Appropriations
6000000
4/3/07 1:57:05 PM
Microsoft Office Excel 2007
Web Feature
Creating Web Pages Using Excel
Objectives You will have mastered the material in this Web feature when you can: • Customize the Quick Access Toolbar • Publish a worksheet and chart as a Web page
• Display Web pages published in Excel in a browser • Complete file management tasks within Excel
EX 250 Excel Web Feature Creating Web Pages Using Excel
Web Feature Introduction
Excel is active
Excel provides fast, easy methods for saving workbooks as Web pages that can be stored on the World Wide Web, a company’s intranet, or a local hard disk. A user then can display the workbook using a browser, rather than Excel.
save workbook as static Web page
(a) Workbook Viewed in Excel Figure 1
Project — Workbook with Chart Saved as a Web Page Figure 1a shows the workbook for Stonegate Plumbing’s 1st quarter sales by month. The chief financial officer for the company requests that the information in the worksheet, including the chart, be made available on the company’s intranet for others in the company to view. In order to accomplish this task, you must save the workbook as a Web page. You can save a workbook, or a portion of a workbook, as a Web page. The saved Web page is a snapshot of the workbook. It is similar to a printed report in that you can view it, but you cannot modify it. In the browser window, the workbook appears as it would in Microsoft Excel, including sheet tabs that you can click to switch between worksheets. As illustrated in Figure 1, this Web feature shows you how to save a workbook (Figure 1a) as a Web page (Figure 1b) and view it using your browser. When you use the Save As command on the Office Button menu and choose to save a workbook as a Web page, Excel allows you to publish workbooks, which is the process of making a workbook available to others; for example, on the World Wide Web or on a
browser is active
(b) Static Web Page Viewed in Browser
Excel Chapter Excel Web Feature2
Project – Workbook with Chart Saved as a Web Page EX 251
BTW
EX 252 Excel Web Feature Creating Web Pages Using Excel
Web Folders and FTP Locations You can save any type of file to a Web folder or on an FTP location, just as you would save to a folder on your hard disk. Web folders and FTP locations are particularly useful because they appear as standard folders in Windows Explorer or in the Address bar list. For additional information, see Appendix D.
company’s intranet. If you have access to a Web server, you can publish Web pages by saving them on a Web server or on an FTP location. To learn more about publishing Web pages on a Web server or on an FTP location using Microsoft Office applications, refer to Appendix D. This Web feature illustrates how to create and save the Web pages on a USB flash drive, rather than on a Web server. This feature also demonstrates how to preview a workbook as a Web page and create a new folder using the Save As dialog box.
Overview As you read through this Web feature, you will learn how to create the worksheet shown in Figure 1 on pages EX 250 and 251 by performing these general tasks: • Save a Workbook as a Web page • Preview the Workbook in a Web browser • Complete file management tasks within Excel
Using Web Page Preview and Saving an Excel Workbook as a Web Page At any time during the construction of a workbook, you can preview it as a Web page by using the Web Page Preview command. The Web Page Preview command is not available on the Ribbon, but you can add the command to the Quick Access Toolbar. When you invoke the Web Page Preview command, it starts your browser and displays the active sheet in the workbook as a Web page. If the preview is acceptable, then you can save the workbook as a Web page.
To Add a Button to the Quick Access Toolbar Many commands available in Excel are not included on any of the tabs on the Ribbon. You can, however, add such commands to the Quick Access Toolbar. One such command allows you to preview a document in a Web browser. This command, Web Page Preview, needs to be added to the Quick Access Toolbar so that the Web page can be previewed. The following steps add the Web Page Preview command to the Quick Access Toolbar.
1 • Connect a USB flash drive with the Data Files for Students on it to one of the computer’s USB ports.
• Start Excel and then open the workbook, Stonegate Plumbing 1st Quarter Sales, from the Data Files for Students.
Customize Quick Access Toolbar button
COMP: Make sure arrows are pointing precisely where the Art MS indicates - they cannot even be slightly off Customize Quick Access Toolbar menu
2 • Click the Customize Quick Access Toolbar button to display the Customize Quick Access Toolbar menu (Figure 2).
More Commands command
Figure 2
3 • Click the More Commands command on the Customize Quick Access Toolbar menu.
• When the Excel
Bubble height One line bubbles - 1p1 Two-line bubbles - 1p8 Three-line bubbles - 2p3 Four-line bubbles - 2p10 Commands Not in the Ribbon
Options dialog box is displayed, click the ‘Choose commands from’ box arrow to display the ‘Choose commands from’ list (Figure 3).
Choose commands from list
Figure 3
4 • Click Commands Not in the Ribbon in the ‘Choose commands from’ list to display a list of commands not in the Ribbon (Figure 4). Commands Not in the Ribbon selected
list of commands not in the Ribbon
Figure 4
Choose commands from box arrow
Excel Chapter Excel Web Feature2
Using Web Page Preview and Saving an Excel Workbook as a Web Page EX 253
EX 254 Excel Web Feature Creating Web Pages Using Excel
5 • Scroll to the bottom of the list, click Web Page Preview, and then click the Add button to add the button to the Quick Access Toolbar (Figure 5).
Web Page Preview command added to Quick Access Toolbar list
Add button
OK button
Figure 5
6 • Click the OK button to close the
Q&A
Excel Options dialog box and display the Quick Access Toolbar with the Web Page Preview button added to it (Figure 6). Will the Web Page Preview command be on the Quick Access Toolbar the next time that I start Excel? Yes. When you change the Quick Access Toolbar, the changes remain even after you restart Excel. If you share a computer with somebody else or if the Quick Access Toolbar becomes cluttered, Excel allows you to remove commands from the Quick Access Toolbar. The Web Page Preview button is removed from the Quick Access Toolbar later in this Web feature.
Web Page Preview button added to Quick Access Toolbar
Figure 6
To Preview the Web Page The following steps preview the Web page version of the workbook in a browser.
1 • Click the Web Page Preview
browser is active
button on the Quick Access Toolbar to display the Web page in your browser. If the security warning appears in the Information bar at the top of the Web page, click its Close button.
COMP: Make sure arrows are pointing precisely where the Art MS indicates - they cannot even be slightly off
Excel creates Web page in temporary folder
• If necessary, click the Maximize
Q&A
button on your browser’s title bar (Figure 7). What happens when I click the Web Page Preview button?
3-D Pie Chart tab
1st Quarter Sales tab
Microsoft Excel button is not highlighted indicating it is not active
Excel starts your browser. The browser button browser displays a preview of how is highlighted indicating it is active the 1st Quarter Sales sheet will appear as a Web page (Figure 7). The Web page preview in the browser is nearly identical to the Figure 7 display of the worksheet in Excel. A highlighted browser button appears on the Windows Vista taskbar indicating it is active. The Excel button on the Windows Vista taskbar no longer is highlighted.
1st Quarter Sales sheet appears as Web page
2 • Click the 3-D Pie Chart tab at the bottom of the Web page to display the 3-D Pie chart in the browser (Figure 8).
Close button 3-D Pie Chart sheet appears as Web page
3 • After viewing the Web page preview of the Stonegate Plumbing 1st Quarter Sales workbook, click the Close button on the right side of the browser title bar to close the browser and make Excel active again.
3-D Pie Chart tab
browser is active
Figure 8
Excel Chapter Excel Web Feature2
Using Web Page Preview and Saving an Excel Workbook as a Web Page EX 255
EX 256 Excel Web Feature Creating Web Pages Using Excel
To Save an Excel Workbook as a Web Page in a Newly Created Folder Once the preview of the workbook as a Web page is acceptable, you can save the workbook as a Web page so that others can view it using a Web browser, such as Internet Explorer or Mozilla Firefox. Two Web page formats exist in which you can save workbooks. Both formats convert the contents of the workbook into HTML (HyperText Markup Language), which is a language browsers can interpret. One format is called Single File Web Page format, which saves all of the components of the Web page in a single file with an .mht extension. This format is useful particularly for e-mailing workbooks in HTML format. The second format, called Web Page format, saves the Web page in a file and some of its components in a folder. This format is useful if you need access to the components, such as images, that make up the Web page. Experienced users organize the files saved on a storage medium, such as a USB flash drive or hard disk, by creating folders. They then save related files in a common folder. Excel allows you to create folders before saving a file using the Save As dialog box. The following steps create a new folder on the USB flash drive and save the workbook as a Web page in the new folder.
1 • With the Stonegate Plumbing
Save As dialog box
1st Quarter Sales workbook open, click the Office Button.
• Click Save As on the Office Button menu to display the Save As dialog box (Figure 9).
Figure 9
2 • Type Stonegate Plumbing 1st Quarter Sales Web Page in the File name box.
New Folder button new folder
• Click the ‘Save as type’ box arrow
new folder name in text box
and then click Single File Web Page.
• Click the Address bar arrow, select UDISK 2.0 (E:) (your USB flash drive name and letter may be different), and then click the New Folder button to create a new folder.
Web page file name
• When Excel displays the new folder with the name New Folder, type Web Feature in the text box (Figure 10).
Save as type box arrow file type results in extension of .mht
Figure 10
3 • Press the ENTER key. If the
Q&A
Microsoft Office Excel dialog box appears, click the Yes button. What does Excel do when I press the ENTER key? Excel automatically selects the new folder named Web Feature in the Address bar (Figure 11). The Entire Workbook option button in the Save area instructs Excel to save all sheets in the workbook as Web pages.
4 • Click the Save button in the
new Web Feature folder on USB flash drive selected in Address bar and Navigation pane
saves all sheets in workbook as Web page Save area
Save As dialog box to save the workbook in a single file in HTML format in the Web Feature folder on the USB flash drive.
• If the Microsoft Office Excel
Save button
dialog box is displayed, click the Yes button. Figure 11
Excel Chapter Excel Web Feature2
Using Web Page Preview and Saving an Excel Workbook as a Web Page EX 257
Creating Links You can add hyperlinks to an Excel workbook before you save it as a Web page. The hyperlinks in the Excel workbook can link to a Web page, a location in a Web page, or an e-mail address that automatically starts the viewer’s e-mail program.
Viewing Source Code To view the HTML source code for a Web page created in Excel, use your browser to display the Web page, click the Page button and then click View Source.
Saving Workbooks as Web Pages The Save As dialog box changes when you select Single File Web Page, which is in MHTML format, in the ‘Save as type’ box. When you use the Single File Web Page format, a Save area appears in the dialog box. Within the Save area are two option buttons and a Publish button (Figure 11). You can select only one of the option buttons. The Entire Workbook option button is selected by default. This indicates Excel will save all the active sheets (1st Quarter Sales and 3-D Pie Chart) in the workbook as a Web page. The alternative is the Selection: Sheet option button. If you select this option, Excel will save only the active sheet (the one that currently is displaying in the Excel window) in the workbook. The Publish button in the Save As dialog box in Figure 11 is an alternative to the Save button. It allows you to customize the Web page further. If you have access to a Web server and it allows you to save files in a Web folder, then you can save the Web page directly on the Web server by clicking the Network icon in the Folders list in the Save As dialog box (Figure 11). If you have access to a Web server that allows you to save on an FTP site, then you can select the FTP site below FTP locations in the Address bar just as you select any folder in which to save a file. To learn more about publishing Web pages in a Web folder or on an FTP location using Office applications, refer to Appendix D. After Excel saves the workbook in Step 4, it displays the MHTML file in the Excel window. Excel can continue to display the workbook in HTML format, because, within the MHTML file that it created, it also saved the Excel formats that allow it to display the MHTML file in Excel.
To Reset the Quick Access Toolbar and Quit Excel The necessary work with the Excel workbook is complete. The following steps remove the Web Page Preview button from the Quick Access Toolbar and quit Excel.
1
Click the Customize the Quick Access Toolbar button on the Ribbon.
2
Click the More Commands command.
3
When the Excel Options dialog box is displayed, click the Reset button. If the Reset Customizations dialog box is displayed, click the Yes button.
4
Click the OK button in the Excel Options dialog box to close it.
5
Click the Close button on the Microsoft Excel title bar.
Q&A
BTW
BTW
EX 258 Excel Web Feature Creating Web Pages Using Excel
Do I need to remove the button from the Quick Access Toolbar? No. For consistency, in this book the Quick Access Toolbar is reset after the added buttons no longer are needed. If you share a computer with others, you should reset the Quick Access Toolbar when you are finished using the computer.
invoked commands will affect selected folder
often used file management commands available in Excel on shortcut menu
Figure 12
Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential – proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
Excel Chapter Excel Web Feature2
In the previous set of steps, Excel automatically navigates to the new folder name in the Save in box when you press the ENTER key after typing the new folder name (Figure 11 on page EX 257). It actually was not necessary to create a new folder earlier in this Web feature; the Web page could have been saved on the USB flash drive in the same manner files were saved on the USB flash drive in the previous projects. Creating a new folder, however, allows you to organize your work. Finally, once you create a folder, you can right-click it while the Save As dialog box is active and perform many file management tasks directly in Excel (Figure 12). For example, once the shortcut menu appears, you can rename the selected folder, delete it, copy it, display its properties, and perform other file management functions.
BTW
File Management Tools in Excel
BTW
Using Web Page Preview and Saving an Excel Workbook as a Web Page EX 259
EX 260 Excel Web Feature Creating Web Pages Using Excel
To View and Manipulate the Web Page Using a Browser With the Web page saved in the Web Feature folder on the USB flash drive, you can now view it using a browser, as shown in the following steps.
1 • If necessary, connect the USB flash drive with the Data Files for Students to one of the computer’s USB ports.
file name in address box
• Click the Start button on the Windows Vista taskbar, click All Programs on the Start menu, and then click Internet Explorer in the All Programs list.
• When the Internet Explorer window opens, type e:\web feature\ stonegate plumbing 1st quarter sales web page.mht in the Address box and then press the ENTER key to display the Web page in your browser (Figure 13). (Your USB flash drive may have a different name and letter.)
worksheet appears as Web page
3-D Pie Chart tab
1st Quarter Sales tab
browser is active
• If the Internet Explorer dialog box Figure 13 appears, click the OK button, right-click the first Internet Explorer button on the Windows Vista taskbar, and then click Close on the shortcut menu. If a security warning appears in the Information bar at the top of the Web page, click its Close button.
2 • Click the 3-D Pie Chart sheet tab at the bottom of the window to display the 3-D Pie chart in your browser (Figure 14). If the security warning appears in the Information bar at the top of the Web page, click its Close button.
3-D Pie chart appears on Web page
• Use the scroll arrows
Q&A
to display the lower portion of the chart. What are the benefits of using a browser to view a workbook? You can see from Figures 13 and 14 3-D Pie Chart sheet tab that a Web page is an ideal way to distribute information to a large browser group of people. is active For example, the Web page could be Figure 14 published on a Web server connected to the Internet and made available to anyone with a computer, browser, and the address of the Web page. It also can be e-mailed easily, because the Web page resides in a single file, rather than in a file and folder. Publishing a workbook as a Web page, therefore, is an excellent alternative to distributing printed copies of the workbook.
3 • Click the Close button on the right side of the browser title bar to close the browser.
Feature Summary This Web feature introduced you to customizing the Quick Access Toolbar, previewing a workbook as a Web page, creating a new folder on a USB flash drive, and publishing and viewing a Web page. The items listed below include all the new Office 2007 skills you have learned in this Web feature. 1. Add a Button to the Quick Access Toolbar (EX 252) 2. Preview the Web Page (EX 255)
3. Save an Excel Workbook as a Web Page in a Newly Created Folder (EX 256) 4. View and Manipulate the Web Page Using a Browser (EX 260)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this feature.
Excel Chapter Excel Web Feature2
Web Feature Summary EX 261
EX 262 Excel Web Feature Creating Web Pages Using Excel
In the Lab
STUDENT ASSIGNMENTS
Create a Web page using the guidelines, concepts, and skills presented in this Web feature. Labs are listed in order of increasing difficulty.
1 Creating a Web Page I Problem: You are a spreadsheet specialist for Aunt Leona’s Pizza, a national chain of pizzerias. Your manager has asked you to create a Web page from the company’s annual sales workbook. Instructions Part 1: Start Excel and open the Lab WF-1 Aunt Leonas Pizza Annual Sales workbook from the Data Files for Students. Perform the following tasks: 1. Add the Web Page Preview command to the Quick Access Toolbar. 2. Review the worksheet and chart so you have an idea of what the workbook contains. Preview the workbook as a Web page. Close the browser. 3. Save the workbook as a single file Web page in a new folder titled Web Feature Exercises using the file name, Lab WF-1 Aunt Leonas Pizza Annual Sales Web Page. Make sure you select Entire Workbook in the Save area before you click the Save button. Reset the Quick Access Toolbar and then quit Excel. 4. Start your browser. With the Web page located on the USB flash drive, type e:\web feature exercises\ lab wf-1 aunt leonas pizza annual sales web page.mht in the Address box (your USB flash drive may have a different name and letter). When the browser displays the Web page, click the tabs at the bottom of the window to view the sheets. Close the browser. Submit the assignment as requested by your instructor.
In the Lab 2 Creating a Web Page II Problem: You work part-time as a spreadsheet analyst for What-a-Racket Tennis Club. You have been asked to create a Web page from the workbook that the company uses to project membership dues and payroll expenses. Instructions Part 1: Start Excel and open the Lab WF-2 What-a-Racket Tennis Club Projections workbook from the Data Files for Students. Perform the following tasks: 1. Add the Web Page Preview command to the Quick Access Toolbar. 2. Review the 3-D Bar Chart sheet and the Projected Expenses sheet in Excel. Preview the workbook as a Web page. Close the browser. 3. Save the workbook as a Web page (select Web Page in the Save as type box) in the Web Feature Exercises folder using the file name, Lab WF-2 What-a-Racket Tennis Club Projections Web Page. Make sure you select Entire Workbook in the Save area before you click the Save button. Reset the Quick Access Toolbar and then quit Excel. Saving the workbook as a Web page, rather than a single file Web page, will result in an additional folder being added to the Web Feature Exercises folder. 4. Start your browser. Type e:\web feature exercises\lab wf-2 what-a-racket tennis club projections web page.htm in the Address box (your USB flash drive may have a different name and letter). When the browser displays the Web page, click the tabs at the bottom of the window to view the sheets. Close the browser. Submit the assignment as requested by your instructor.
3 File Management within Excel Problem: Your manager at What-a-Racket Tennis Club has asked you to teach her to complete basic file management tasks from within Excel. Instructions: Start Excel and click the Open command on the Office Button menu. When Excel displays the Open dialog box, create a new folder called In the Lab 3. Click the Back to button to reselect the drive in the Address bar. Use the shortcut menu to complete the following tasks: (1) rename the In the Lab 3 folder to In the Lab 3A; (2) show the properties of the In the Lab 3A folder; and (3) delete the In the Lab 3A folder.
Excel Web Feature
In the Lab
STUDENT ASSIGNMENTS
In the Lab EX 263
This page intentionally left blank
C6394_FM_CTP.4c.indd xvi
8/8/07 3:59:57 PM
Microsoft Office Excel 2007
4
Financial Functions, Data Tables, and Amortization Schedules
Objectives You will have mastered the material in this chapter when you can: • Control the color and thickness of outlines and borders
• Analyze worksheet data by changing values
• Assign a name to a cell and refer to the cell in a formula using the assigned name
• Use names and the Set Print Area command to print sections of a worksheet
• Determine the monthly payment of a loan using the financial function PMT
• Set print options
• Use the financial functions PV (present value) and FV (future value) • Create a data table to analyze data in a worksheet • Add a pointer to a data table
• Protect and unprotect cells in a worksheet • Use the formula checking features of Excel • Hide and unhide cell gridlines, rows, columns, sheets, and workbooks
• Create an amortization schedule
C6426_04_CTP.4c.indd 265
6/12/07 8:41:24 AM
Microsoft Office Excel 2007
4
Financial Functions, Data Tables, and Amortization Schedules Introduction Two of the more powerful aspects of Excel are its wide array of functions and its capability of organizing answers to what-if questions. In this chapter, you will learn about financial functions such as the PMT function, which allows you to determine a monthly payment for a loan, and the PV function, which allows you to determine the present value of an investment. In earlier chapters, you learned how to analyze data by using Excel’s recalculation feature and goal seeking. This chapter introduces an additional what-if analysis tool, called data tables. You use a data table to automate data analyses and organize the answers returned by Excel. Another important loan analysis tool is the Amortization Schedule section. An amortization schedule shows the beginning and ending balances and the amount of payment that applies to the principal and interest over a period. In previous chapters, you learned how to print in a variety of ways. This chapter continues with a discussion about additional methods of printing using names and the Set Print Area command. Finally, this chapter introduces you to cell protection; hiding and unhiding rows, columns, sheets, and workbooks; and formula checking. Cell protection ensures that users do not change values inadvertently that are critical to the worksheet. Hiding portions of a workbook lets you show only the parts of the workbook that the user needs to see. The formula checker checks the formulas in a workbook in a manner similar to the way the spell checker checks for misspelled words.
Project — Loan Payment Calculator with Data Table and Amortization Schedule The project in the chapter follows proper design guidelines and uses Excel to create the worksheet shown in Figure 4–1. Braden Mortgage operates as a small home loan institution. The company’s Chief Financial Officer has asked for a workbook that calculates loan payment information, displays an amortization schedule, and displays a table that shows loan payments for varying interest rates. To ensure that the loan officers do not delete the formulas in the worksheet, she has asked that cells in the worksheet be protected so they cannot be changed accidently.
EX 266
C6426_04_CTP.4c.indd 266
6/12/07 8:41:27 AM
Microsoft Office Excel 2007
Loan Payment Calculator calculates monthly payment, total interest, and total cost on basis of loan data entered
all cells in worksheet except those in ranges C3:C5 and E2:E3 are protected so user cannot change cells accidently
Amortization Schedule summarizes loan information over life of loan
Interest Rate Schedule lists monthly payment, total interest, and total cost for interest rates between 4.50% and 7.75% in increments of 0.25%
green background and white font in cell highlights row in data table that corresponds to rate in cell E2
Figure 4–1
The requirements document for the Braden Mortgage Loan Payment Calculator worksheet is shown in Figure 4–2 on the next page. It includes the needs, source of data, summary of calculations, special requirements, and other facts about its development.
Overview As you read this chapter, you will learn how to create the worksheet shown in Figure 4–1 by performing these general tasks: • Create and format the Loan Payment Calculator section and use the payment function • Create and format a data table that includes the interest rate schedule • Create and format the amortization schedule and use the present value and future value functions • Create and test print areas in the worksheet • Protect cells in the worksheet • Check the formulas in the worksheet
EX 267
C6426_04_CTP.4c.indd 267
6/12/07 8:41:27 AM
EX 268 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
Figure 4–2
C6426_04_CTP.4c.indd 268
6/12/07 8:41:29 AM
General Project Decisions While creating an Excel worksheet, you need to make several decisions that will determine the appearance and characteristics of the finished worksheet. As you create the worksheet required to meet the requirements shown in Figure 4–2, you should follow these general guidelines:
Plan Ahead
Excel Chapter 42
Project — Loan Payment Calculator with Data Table and Amortization Schedule EX 269
1. Create and format the Loan Payment Calculator section of the worksheet. The Loan Payment Calculator section requires a compact and understandable interface where both loan officers and customers can view the results of possible loan situations quickly. This section requires complex financial calculations such as present value and future value of a loan. Excel’s financial functions can be used to solve these problems. As with the other two sections of the worksheet, this section of the worksheet should be formatted to make it distinct from the other two sections of the worksheet. 2. Create and format the Interest Rate Schedule section of the worksheet. The Interest Rate Schedule depends on values in the Loan Payment Calculator section of the worksheet. If those values are placed in the top row of the Interest Rate Schedule, then payment, interest, and cost values for various interest rates can be computed in the columns in this section. 3. Create and format the Amortization Schedule section of the worksheet. The amortization schedule relies on formulas specified in the requirements document (Figure 4–2). This section of the worksheet also should include subtotals and a total to provide additional insight to the users of the worksheet. 4. Specify and name print areas of the worksheet. As specified in the requirements document, users of the worksheet require the option to print the individual sections of the worksheet. Excel allows you to name these sections and then print the sections by name. 5. Determine which cells to protect and unprotect in the worksheet. When creating a workbook that will be used by others, the spreadsheet designer should consider which cells another user should be able to manipulate. For the Loan Payment Calculator, the user needs to modify only the item, price, down payment, rate, and number of years of the loan. All other cells in the worksheet should be protected from input by the user of the worksheet. In addition, using a sketch of the worksheet can help you visualize its design. The sketch of the worksheet (Figure 4–3) consists of titles, column and cell headings, location of data values, and a general idea of the desired formatting. As shown in the worksheet sketch shown in Figure 4–3, the three basic sections of the worksheet are (1) the Loan Payment Calculator on the upper–left side, (2) the Interest Rate Schedule data table on the lower–left side, and (3) the Amortization Schedule on the right side. The worksheet will be created in this order. (continued)
Figure 4–3
C6426_04_CTP.4c.indd 269
6/12/07 8:41:30 AM
EX 270 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
BTW
BTW
Plan Ahead
Good Worksheet Design Do not create worksheets as if you are going to use them only once. Carefully design worksheets as if they will be on display and evaluated by your fellow workers. Smart worksheet design starts with visualizing the results you need. A well-designed worksheet often is used for many years.
Multiple Worksheets You can have more than one instance of Excel running. Besides opening multiple workbooks in Excel, you can run multiple instances of Excel. Each instance of Excel will show as a button on the Windows Vista taskbar. When you first install Excel, Excel shows all open workbooks in the taskbar. To change this behavior, click the Excel Options button on the Office Button menu, click Advanced, remove the checkmark from the ‘Show all windows in the Taskbar’ check box, and then click the OK button.
C6426_04_CTP.4c.indd 270
(continued) When necessary, more specific details concerning the above guidelines are presented at appropriate points in the chapter. The chapter also will identify the actions you perform and decisions made regarding these guidelines during the creation of the worksheet shown in Figure 4–1 on page EX 267.
With a good understanding of the requirements document, an understanding of the necessary decisions, and a sketch of the worksheet, the next step is to use Excel to create the worksheet.
To Start and Customize Excel If you are using a computer to step through the project in this chapter and you want your screen to match the figures in this book, you should change your computer’s resolution to 1024 ⫻ 768. For information about how to change a computer’s resolution, see page APP 21 in Appendix E. The following steps, which assume Windows is running, start Excel based on a typical installation of Microsoft Office on your computer. You may need to ask your instructor how to start Excel for your computer.
1
Click the Start button on the Windows Vista taskbar to display the Start menu.
2
Click All Programs at the bottom of the left pane on the Start menu to display the All Programs list.
3
Click Microsoft Office in the All Programs list to display the Microsoft Office list.
4
Click Microsoft Office Excel 2007 to start Excel and display a blank worksheet in the Excel window.
5
If the Excel window is not maximized, click the Maximize button next to the Close button on its title bar to maximize the window.
6
If the worksheet window in Excel is not maximized, click the Maximize button next to the Close button on its title bar to maximize the worksheet window within Excel.
To Bold the Entire Worksheet The following steps assign a bold format to the entire worksheet so that all entries will be emphasized.
1
Click the Select All button immediately above row heading 1 and to the left of column heading A.
2
Click the Bold button on the Home tab on the Ribbon.
6/12/07 8:41:32 AM
1
Select cell B1. Enter Loan Payment Calculator as the section title. Select the range B1:E1. Click the Merge & Center button on the Ribbon.
2
With cell B1 active, click the Cell Styles button on the Ribbon and then select the Title cell style in the Cell Styles gallery.
3
Position the mouse pointer on the bottom boundary of row heading 1. Drag down until the ScreenTip indicates Height: 23.25 (31 pixels). Position the mouse pointer on the bottom boundary of row heading 2. Drag down until the ScreenTip indicates Height: 30.00 (40 pixels).
4
Select cell B2 and then enter Date as the row title and then press the TAB key.
5
With cell C2 selected, enter =now() to display the system date.
6
Right–click cell C2 and then click Format Cells on the shortcut menu. When Excel displays the Format Cells dialog box, click the Number tab, click Date in the Category list, scroll down in the Type list, and then click 14–Mar–2001. Click the OK button.
7
Enter the following row titles: Cell
Entry
Cell
Entry
B3
Item
D2
Rate
B4
Price
D3
Years
B5
Down Payment
D4
Monthly Payment
B6
Loan Amount
D5
Total Interest
D6
Total Cost
8
Position the mouse pointer on the right boundary of column heading A and then drag to the left until the ScreenTip indicates Width: 1.57 (16 pixels).
9
Position the mouse pointer on the right boundary of column heading B and then drag to the right until the ScreenTip indicates Width: 13.86 (102 pixels).
BTW
The next step is to enter the Loan Payment Calculator section title, row titles, system date, document properties, and then save the workbook. To make the worksheet easier to read, the width of column A will be decreased to 1.57 characters and used as a separator between the Loan Payment Calculator section and the row headings on the left. Using a column as a separator between sections on a worksheet is a common technique employed by spreadsheet specialists. The width of columns B through E will be increased so the intended values fit. The height of row 1, which contains the title, will be increased so it stands out. The worksheet title also will be changed to the Title cell style. The following steps enter the section title, row titles, system date, document properties, and then save the workbook.
Global Formatting To assign formats to all the cells in all the worksheets in a workbook, click the Select All button, rightclick a tab, and click Select All Sheets on the shortcut menu. Next, assign the formats. To deselect the sheets, hold down the SHIFT key and click the Sheet1 tab. You also can select a cell or a range of cells and then select all sheets to assign formats to that cell or a range of cells on all sheets in a workbook.
BTW
To Enter the Section Title, Row Titles, System Date, Document Properties, and Save the Workbook
Concatenation You can concatenate text, numbers, or text and numbers from two or more cells into a single cell. The ampersand (&) is the concatenation operator. For example, if cell A1 = AB, cell A2 = CD, cell A3 = 25, and you assign cell A4 the formula =A1&A2&A3, then ABCD25 displays in cell A4.
Excel Chapter 42
Project — Loan Payment Calculator with Data Table and Amortization Schedule EX 271
10 Click column heading C to select it and then drag through column headings D and E. Position the mouse pointer on the right boundary of column heading C and then drag until the ScreenTip indicates Width: 16.29 (119 pixels).
11 Double–click the Sheet1 tab and then enter Braden Mortgage as the sheet name. Right– click the tab and then click Tab Color. Click Light Green (column 5, row 1) in the Standard Colors area and then select cell D6 (Figure 4–4 on the next page).
C6426_04_CTP.4c.indd 271
6/12/07 8:41:33 AM
EX 272 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
12 Update the document properties with your name and any other relevant information. 13 With a USB flash drive connected to one of the computer’s USB ports, click the Save button
BTW
on the Quick Access Toolbar. Save the workbook using the file name Braden Mortgage Loan Payment Calculator on the USB flash drive.
Shortcut Menus Excel requires that you point to the object (cell, range, toolbar) on the screen when you right-click to display the corresponding shortcut menu. For example, if you select the range G6:J14 and right-click with the mouse pointer on cell A1, then the shortcut menu pertains to cell A1 and not the selected range G6:J14.
Merge & Center button Bold button width of column A changed to 1.57 characters
width of column B changed to 13.86 characters
width of columns C, D, and E changed to 16.29 characters
Select All button Loan Payment Calculator section title is Title cell style
system date formatted to day-month-year style with four digits for year
height of rows 1 and 2 changed to 23.25 points and 30 points
Figure 4–4
Adding Custom Borders and a Background Color to a Range In previous projects, you were introduced to outlining a range using the Borders button on the Home tab on the Ribbon. The Borders button, however, offers only a limited selection of border thicknesses. To control the color and thickness, Excel requires that you use the Border sheet in the Format Cells dialog box.
To Add Custom Borders and a Background Color to a Range The following steps add a thick black border and a light blue background color to the Loan Payment Calculator section. Rather than using the Fill Color button to color the background of a range as was done in previous projects, the steps use the Fill sheet in the Format Cells dialog box. To subdivide the row titles and numbers further, light borders also are added within the section as shown in Figure 4–1 on page EX 267.
C6426_04_CTP.4c.indd 272
6/12/07 8:41:35 AM
1 • Select the range B2:E6 and then right–click to display the shortcut menu (Figure 4–5).
2 • Click Format Cells on the shortcut menu.
Excel Chapter 42
Adding Custom Borders and a Background Color to a Range EX 273
range B2:E6 selected
• When Excel displays the Format Cells dialog box, click the Border tab.
• Click the medium line style in the Style area (column 2, row 5).
shortcut menu
Format Cells command
Figure 4–5
3 • Click the Outline button in the Presets area to display a preview of the outline border in the Border area (Figure 4–6).
Format Cells dialog box Border tab Outline button
preview of border medium border selected
Figure 4–6
C6426_04_CTP.4c.indd 273
6/12/07 8:41:37 AM
EX 274 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
4 • Click the light border in the Style
Q&A
area (column 1, row 7) and then click the Vertical Line button in the Border area to preview the black vertical border in the Border area (Figure 4–7). How should I create my desired border?
light border selected
As shown in Figure 4–7, you can add a variety of borders with different colors to a cell or range of cells to improve its appearance. It is important that you select border characteristics in the order specified in the steps; that is, (1) choose the border color; (2) choose the border line style; and (3) choose the border type. If you attempt to do these steps in any other order, you may not end up with the desired borders.
border preview
vertical lines will be added to the inside cell borders Vertical Line button
OK button
Figure 4–7
5 • Click the Fill tab and then click light blue (column 9, row 3) in the Background Color area.
• Click the OK button and then select cell B8 to deselect the range B2:E6, add a black outline with vertical borders to the right side of each column in the range B2: E6, and add a light blue fill color to the range (Figure 4–8).
medium border and light blue background applied to range B2:E6
Other Ways 1. Select range, click Fill Color button arrow on Home tab on Ribbon, click color, click Borders button arrow on Ribbon, click border 2. Click Format Cells: Font Dialog Box Launcher on Ribbon, click Fill tab, click color, click Borders tab, click border
C6426_04_CTP.4c.indd 274
light vertical border applied to right side of each column in selected range
Figure 4–8
6/12/07 8:41:40 AM
Select the range C4:C6. While holding down the CTRL key, select the nonadjacent range E4:E6.
2
Right–click one of the selected ranges and then click Format Cells on the shortcut menu.
3
When Excel displays the Format Cells dialog box, click the Number tab. Click Currency in the Category list and then click the second format, $1,234.10, in the Negative numbers list. Click the OK button to assign the Currency style format with a floating dollar sign to the ranges C4:C6 and E4:E6. What will happen when I enter values in those cells?
BTW
1
Q&A
While usually you format cells after you enter values in cells, Excel also allows you to format cells before you enter the values. For example, at the beginning of this project, bold was applied to all the cells in the blank worksheet. The steps on the next page assign the Currency style format with a floating dollar sign to the ranges C4:C6 and E4:E6 before the values are entered.
When to Format Excel lets you format (1) before you enter data; (2) when you enter data, through the use of format symbols; (3) incrementally after entering sections of data; and (4) after you enter all the data. Spreadsheet specialists usually format a worksheet in increments as they build the worksheet, but occasions do exist where it makes sense to format cells before you enter any data.
BTW
To Format Cells before Entering Values
Entering Percents When you format a cell to display percentages, Excel assumes that whatever you enter into that cell in the future will be a percentage. Thus, if you enter the number .5, Excel translates the value as 50%. A potential problem arises, however, when you start to enter numbers greater than or equal to one. For instance, if you enter the number 25, do you mean 25% or 2500%? If you want Excel to treat the number 25 as 25% instead of 2500% and Excel interprets the number 25 as 2500%, click the Excel Options button on the Office Button menu. When the Excel Options dialog box is displayed, click the Advanced button and make sure the ‘Enable automatic percent entry’ check box is selected.
Excel Chapter 42
Adding Custom Borders and a Background Color to a Range EX 275
As you enter numbers into these cells, Excel will display the numbers using the Currency style format. You also could have selected the range B4:E6 rather than the nonadjacent ranges and assigned the Currency style format to this range, which includes text. The Currency style format has no impact on text in a cell.
To Enter the Loan Data
1
Select cell C3. Type Home and then click the Enter box in the formula bar. With cell C3 still active, click the Align Text Right button on the Ribbon. Select cell C4 and then enter 265000 for the price of the house. Select cell C5 and then enter 30000 for the down payment.
2
Select cell E2. Enter 5.75% for the interest rate. Select cell E3 and then enter 18 for the number of years to complete the entry of loan data in the worksheet (Figure 4–9 on the next page).
Q&A
As shown in the Source of Data section of the Request for New Workbook document in Figure 4–2 on page EX 268, five items make up the loan data in the worksheet: the item to be purchased, the price of the item, the down payment, the interest rate, and the number of years until the loan is paid back (also called the term of the loan). These items are entered into cells C3 through C5 and cells E2 and E3. The steps below describe how to enter the following loan data: Item — Home; Price — $265,000.00; Down Payment — $30,000.00; Interest Rate — 5.75%; and Years — 18.
Why are the entered values already formatted? The values in cells C4 and C5 in Figure 4–9 are formatted using the Currency style with two decimal places, because this format was assigned to the cells prior to entering the values. Excel also automatically formats the interest rate in cell E2 to the Percent style with two decimal places, because the percent sign (%) was appended to 5.75 when it was entered.
C6426_04_CTP.4c.indd 275
6/12/07 8:41:43 AM
EX 276 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
Align Text Right button
rate formatted to Percent style by entering a % format symbol with number
values displayed using Currency style with two decimal places
BTW
Figure 4–9 Cell References in Formulas Are you tired of writing formulas that make no sense when you read them because of cell references? The Name Manager can help add clarity to your formulas by allowing you to assign names to cells. You then can use the names, such as Amount, rather than the cell reference, such as H10, in the formulas you create. To access the Name Manager, click the Formulas tab on the Ribbon and then click the Name Manager button.
Creating Cell Names Based on Row Titles Worksheets often have column titles at the top of each column and row titles to the left of each row that describe the data within the worksheet. You can use these titles within formulas when you want to refer to the related data by name. A cell name is created from column and row titles through the use of the Name command on the Insert menu. You also can use the same command to define descriptive names that are not column titles or row titles to represent cells, ranges of cells, formulas, or constants. Naming a cell that you plan to reference in a formula helps make the formula easier to read and remember. For example, the loan amount in cell C6 is equal to the price in cell C4 minus the down payment in cell C5. Therefore, according to what you learned in earlier projects, you can enter the loan amount formula in cell C6 as =C4 – C5. By naming cells C4 and C5 using the corresponding row titles in cells B4 and B5, however, you can enter the loan amount formula as =Price – Down Payment, which is clearer and easier to understand than =C4 – C5.
To Create Names Based on Row Titles The following steps assign the row titles in the range B4:B6 to their adjacent cell in column C and assigns the row titles in the range D2:D6 to their adjacent cell in column E.
C6426_04_CTP.4c.indd 276
6/12/07 8:41:45 AM
1 • Select the
Formulas tab Define Name button
range B4:C6.
• Click the Formulas
Excel Chapter 42
Creating Cell Names Based on Row Titles EX 277
tab on the Ribbon (Figure 4–10). Create from Selection button
range B4:C6 selected
Figure 4–10
2 • Click the Create
Q&A
from Selection button on the Ribbon to display the Create Names from Selection dialog box (Figure 4–11).
Create Names from Selection dialog box
How does Excel determine which option to automatically select in the the Create Names from Selection dialog box? Excel automatically selects the Left column check box in the ‘Create names from values in the’ area because the left column of the cells selected in Step 1 contains text.
3 • Click the OK button.
Left column check box selected
names in column B to left will reference cells in column C OK button
Figure 4–11
• Select the range D2:E6 and then click the Create from Selection button on the Ribbon. • Click the OK button on the Create Names from Selection dialog box to assign names to the range E2:E6.
C6426_04_CTP.4c.indd 277
6/12/07 8:41:47 AM
EX 278 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
4 • Select cell B8 to
Q&A
deselect the range D2:E6 and then click the Name box arrow in the formula bar to view the names created (Figure 4–12a).
Name Manager button
Name box arrow
Name Manager dialog box
How can the cell names be used? You now can use the assigned names in formulas to reference cells in names created the ranges C4:C6 or displayed in Name list E2:E6. Excel is not case–sensitive with respect to names of cells. Hence, you can enter the names (a) of cells in formulas in uppercase or lowercase letters. To use a name that is made up of two or more words in a formula, you should replace any space with the underscore character (_). For example, the name, Down Payment, is written as down_payment or Down_Payment when you want to reference the adjacent cell C5. Figure 4–12b shows the Name Manager dialog box that displays when you click the Name Manager button.
list of names
Excel automatically inserts underscore in names with two words Close button
(b) Figure 4–12
Other Ways 1. Select cell or range, type name in Name box, press ENTER key 2. Select cell or range, on Formulas tab on Ribbon click Define Name button, [type name], click OK button 3. Select cell or range, on Formulas tab on Ribbon click Name Manager button, click New, [type name], click OK button, click Close button
More About Cell Names If you enter a formula using Point mode and click a cell that has an assigned name, then Excel will insert the name of the cell rather than the cell reference. Consider these additional points regarding the assignment of names to cells: 1. A name can be a minimum of 1 character to a maximum of 255 characters. 2. If you want to assign a name that is not a text item in an adjacent cell, use the Define Name button on the Formulas tab on the Ribbon (Figure 4–10 on the previous page) or select the cell or range and then type the name in the Name box in the formula bar. 3. Names are absolute cell references. This is important to remember if you plan to copy formulas that contain names, rather than cell references. 4. Excel displays the names in alphabetical order in the Name list when you click the Name box arrow and in the Name Manager dialog box when you click the Name Manager button on the Formulas tab on the Ribbon (Figures 4–12a and 4–12b).
C6426_04_CTP.4c.indd 278
6/12/07 8:41:50 AM
Spreadsheet specialists often assign names to a cell or range of cells so they can select them quickly. If you want to select a cell or range of cells using the assigned name, you can click the Name box arrow (Figure 4–12a) and then click the name of the cell you want to select. This method is similar to using the F5 key to select a cell, but it is much quicker. When you select a name that references a range in the Name list, Excel highlights the range on the worksheet.
Entering Interest Rates An alternative to requiring the user to enter an interest rate in percent form, such as 7.75%, is to allow the user to enter the interest rate as a number without an appended percent sign (7.75) and then divide the interest rate by 1200, rather than 12.
Excel Chapter 42
5. Names are global to the workbook. That is, a name assigned to a cell or cell range on one worksheet in a workbook can be used on other sheets in the same workbook to reference the named cell or range.
BTW
Creating Cell Names Based on Row Titles EX 279
To Enter the Loan Amount Formula Using Names To determine the loan amount in cell C6, subtract the down payment in cell C5 from the price in cell C4. As indicated earlier, this can be done by entering the formula =C4 – C5 or by entering the formula =price – down_payment in cell C6. You also can use Point mode to enter the formula, as shown in the following steps.
1 • Select cell C6. • Type = (equal sign), click cell C4, type – (minus sign), and then click cell C5 to display the formula in cell C6 and in the formula bar using the names of the cells rather then the cell references (Figure 4–13).
Enter box formula appears in formula bar
formula created using Point mode
Figure 4–13
2 • Click the Enter box to assign the formula =Price – Down_Payment to cell C6 (Figure 4–14). name of active cell appears in Name box formula assigned to active cell appears in formula bar
Excel displays result of formula in cell
Figure 4–14
C6426_04_CTP.4c.indd 279
6/12/07 8:41:53 AM
EX 280 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
To Enter the PMT Function The next step is to determine the monthly payment for the loan in cell E4. You can use Excel’s PMT function to determine the monthly payment. The PMT function has three arguments — rate, payment, and loan amount. Its general form is: =PMT(rate, periods, loan amount) where rate is the interest rate per payment period, periods is the number of payments, and loan amount is the amount of the loan. In the worksheet shown in Figure 4–14 on the previous page, Excel displays the annual interest rate in cell E2. Financial institutions, however, calculate interest on a monthly basis. Therefore, the rate value in the PMT function is rate / 12 (cell E2 divided by 12), rather than just rate (cell E2). The periods (or number of payments) in the PMT function is 12 * years (12 times cell E3) because there are 12 months, or 12 payments, per year. Excel considers the value returned by the PMT function to be a debit and, therefore, returns a negative number as the monthly payment. To display the monthly payment as a positive number, begin the function with a negative sign instead of an equal sign. The PMT function for cell E4 is: –PMT(rate / 12, 12 * years, loan_amount) monthly interest rate
number of payments
loan amount
The following steps use the keyboard, rather than Point mode, to enter the PMT function to determine the monthly payment in cell E4.
1 • Select cell E4. Type –pmt(rate /
Save button
Q&A
12, 12*years, loan_amount as the function to display the PMT function in cell E4 and in the formula bar (Figure 4–15).
Enter box
What happens as I enter the function? The ScreenTip shows the general form of the PMT function. The arguments in brackets in the ScreenTip are optional and not required for the computation described here. The Formula AutoComplete list shows functions and cell names that match the letters that you type on the keyboard. You can type the complete cell name, such as Loan_Amount, or select the cell name from the list. Excel will add the closing parenthesis to the function automatically. Excel also may scroll the worksheet to the right in order to accommodate the display of the ScreenTip.
C6426_04_CTP.4c.indd 280
PMT function preceded by negative sign causes payment to appear as a positive number
ScreenTip shows function and arguments
Formula AutoComplete list shows alphabetical list of functions and names
Figure 4–15
6/12/07 8:41:56 AM
2 • If necessary, scroll the worksheet to the left using the horizontal scrollbar.
• Click the Enter box in the formula
Q&A
bar to complete the function (Figure 4–16).
PMT function assigned to active cell E4
Excel Chapter 42
Creating Cell Names Based on Row Titles EX 281
What does Excel display after I click the Enter box? Excel displays the monthly payment $1,748.80 in cell E4, based on a loan amount of $235,000.00 (cell C6) with an annual interest rate of 5.75% (cell E2) for a term of 18 years (cell E3), as shown in Figure 4–16.
monthly payment
Figure 4–16 Other Ways 1. Click Formulas tab on Ribbon, click Financial button on Ribbon, select PMT function, enter arguments, click OK button
Other Financial Functions In addition to the PMT function, Excel provides more than 50 additional financial functions to help you solve the most complex finance problems. These functions save you from entering long, complicated formulas to obtain needed results. Table 4–1 summarizes three of the more frequently used financial functions.
2. Click Insert Function button in formula bar, select Financial category, select PMT function, click OK button, enter arguments, click OK button
Table 4–1 Financial Functions Description
FV (rate, periods, payment)
Returns the future value of an investment based on periodic, constant payments, and a constant interest rate.
PMT (rate, periods, loan amount)
Calculates the payment for a loan based on the loan amount, constant payments, and a constant interest rate.
PV (rate, periods, payment)
Returns the present value of an investment. The present value is the total amount that a series of future payments is worth now.
BTW
Function
To Determine the Total Interest and Total Cost The next step is to determine the total interest the borrower will pay on the loan (the lending institution’s gross profit on the loan) and the total cost the borrower will pay for the item being purchased. The total interest (cell E5) is equal to the number of payments times the monthly payment, less the loan amount: =12 * years * monthly_payment – loan_amount The total cost of the item to be purchased (cell E6) is equal to the price plus the total interest: =price + total_interest The steps on the next page enter formulas to determine the total interest and total cost using names.
C6426_04_CTP.4c.indd 281
Range Finder Remember to check all formulas carefully. You can double-click a cell with a formula and Excel will use Range Finder to highlight the cells that provide data to the formula. While Range Finder is active, you can drag the outlines from one cell to another to change the cells referenced in the formula, provided the cells have not been named.
6/12/07 8:41:58 AM
1
Select cell E5. Use Point mode and the keyboard to enter the formula =12 * years * monthly_payment – loan_amount to determine the total interest.
2
Select cell E6. Use Point mode and the keyboard to enter the formula =price + total_ interest to determine the total cost.
3
Select cell B8 to deselect cell E6 (Figure 4–17).
4
Click the Save button on the Quick Access Toolbar to save the workbook using the file name Braden Mortgage Loan Payment Calculator.
Q&A
EX 282 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
What are the new values displayed by Excel? Excel displays a total interest (the lending institution’s gross profit) of $142,740.46 in cell E5 and a total cost of $407,740.46 in cell E6, which is the total cost of the home to the borrower (Figure 4–17).
Save button
12 * years * monthly_payment – loan_amount =price + total_interest $265,000 home will cost a total of $407,740.46
Figure 4–17
To Enter New Loan Data Assume you want to purchase a Prius for $25,500.00. You have $5,280.00 for a down payment and you want the loan for a term of five years. Braden Mortgage currently is charging 10.25% interest for a five–year auto loan. The following steps show how to enter the new loan data.
C6426_04_CTP.4c.indd 282
1
Select cell C3. Type Prius and then press the DOWN ARROW key.
2
In cell C4, type 25500 and then press the DOWN ARROW key.
3
In cell C5, type 5280 and then select cell E2.
4
In cell E2, type 10.25% and then press the DOWN ARROW key.
6/12/07 8:41:59 AM
In cell E3, type 5 and then select cell B8 to recalculate the loan information in cells C6, E4, E5, and E6 (Figure 4–18). What do the results of the new calculation mean? As you can see from Figure 4–18, the monthly payment for the Prius is $432.11. By paying for the car over a five–year period at an interest rate of 10.25%, you will pay total interest of $5,706.40 on the loan and pay a total cost of $31,206.40 for a $25,500.00 Prius.
Excel Chapter 42
5 Q&A
Creating Cell Names Based on Row Titles EX 283
with down payment of $5,280.00, monthly payment for $25,500.00 Prius is $432.11 for 5 years
total cost of Prius
total interest paid on loan (lending institution’s gross profit)
Figure 4–18
1
Select cell C3. Type Home and then press the DOWN ARROW key.
2
In cell C4, type 265000 and then press the DOWN ARROW key.
3
In cell C5, type 30000 and then select cell E2.
4
In cell E2, type 5.75 and then press the DOWN ARROW key.
5
In cell E3, type 18 and then select cell B8.
Q&A
What is happening on the worksheet as I enter the original data?
Q&A
The following steps re–enter the original loan data.
Can the Undo button on the Quick Access Toolbar be used to change back to the original data?
Excel instantaneously recalculates all formulas in the worksheet each time you enter a value. Excel displays the original loan information as shown in Figure 4–17.
BTW
To Enter the Original Loan Data Testing a Worksheet It is good practice to test the formulas in a worksheet over and over again until you are confident they are correct. Use data that tests the limits of the formulas. For example, you should enter negative numbers, zero, and large positive numbers to test the formulas.
Yes, but the Undo button must be clicked five times, once for each data item.
C6426_04_CTP.4c.indd 283
6/12/07 8:42:01 AM
EX 284 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
BTW
Using a Data Table to Analyze Worksheet Data Data Tables Data tables have one purpose: to organize the answers to what-if questions. You can create two kinds of data tables. The first type involves changing one input value to see the resulting effect on one or more formulas. The second type involves changing two input values to see the resulting effect on one formula.
You already have seen that if you change a value in a cell, Excel immediately recalculates and displays the new results of any formulas that reference the cell directly or indirectly. But what if you want to compare the results of the formula for several different values? Writing down or trying to remember all the answers to the what–if questions would be unwieldy. If you use a data table, however, Excel will organize the answers in the worksheet for you automatically. A data table is a range of cells that shows the answers generated by formulas in which different values have been substituted. Data tables are built in an unused area of the worksheet (in this case, the range B7:E23). Figure 4–19 illustrates the makeup of a one–input data table. With a one–input data table, you vary the value in one cell (in this worksheet, cell E2, the interest rate). Excel then calculates the results of one or more formulas and fills the data table with the results. An alternative to a one–input table is a two–input data table. A two–input data table allows you to vary the values in two cells, but you can apply it to only one formula. A two–input data table example is illustrated in the Extend Your Knowledge exercise on page EX 325. The interest rates that will be used to analyze the loan formulas in this project range from 4.50% to 7.75%, increasing in increments of 0.25%. The one–input data table shown in Figure 4–20 illustrates the impact of varying the interest rate on three formulas: the monthly payment (cell E4), total interest paid (cell E5), and the total cost of the item to be purchased (cell E6). The series of interest rates in column B are called input values.
Data Table command uses formulas in these cells to display resulting Monthly Payment, Total Interest, and Total Cost values based on different interest rates interest rate values used to calculate results in table
data table automatically filled with results based on varying interest rates in column B
same interest rate generates same results Excel displays results of calculations based on varying interest rates in column B
Figure 4–19
C6426_04_CTP.4c.indd 284
Figure 4–20
6/12/07 8:42:04 AM
1
Click the Home tab on the Ribbon. Select cell B7. Enter Interest Rate Schedule as the data table section title.
2
Select cell B1. Click the Format Painter button on the Ribbon. Select cell B7 to copy the format of cell B1.
3
Enter the column titles in the range B8:E8 as shown in Figure 4–21. Select the range B8:E8 and then click the Align Text Right button on the Ribbon to right–align the column titles.
4
Position the mouse pointer on the bottom boundary of row heading 7. Drag down until the ScreenTip indicates Height: 23.25 (31 pixels). Position the mouse pointer on the bottom boundary of row heading 8. Drag down until the ScreenTip indicates Height: 18.00 (24 pixels). Click cell B10 to deselect the range B8:E8 (Figure 4–21).
BTW
The first step in constructing the data table shown in Figure 4–20 is to enter the data table section title and column titles in the range B7:E8 and adjust the heights of rows 7 and 8.
Selecting Cells If you double-click the top of the heavy black border surrounding an active cell, Excel will make the first nonblank cell in the column active. If you double-click the left side of the heavy black border surrounding the active cell, Excel will make the first nonblank cell in the row the active cell. This procedure works in the same fashion for the right border and the bottom border of the active cell.
BTW
To Enter the Data Table Title and Column Titles
Expanding Tables The data table you see in Figure 4–22 on the next page is relatively small. You can continue the series of percents to the bottom of the worksheet and insert additional formulas in columns to create as large a data table as you want.
Excel Chapter 42
Using a Data Table to Analyze Worksheet Data EX 285
Format Painter button
data table section title formatted same as cell B1
row heights increased to 23.25 and 18.00
bottom boundary of row heading 7
column titles right-aligned in row 8
Figure 4–21
C6426_04_CTP.4c.indd 285
6/12/07 8:42:06 AM
EX 286 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
To Create a Percent Series Using the Fill Handle The next step is to create the percent series in column B using the fill handle. These percent figures will serve as the input data for the data table.
1 • With cell B10 selected, enter 4.50% as the first number in the series.
upper-left cell of one-input data table should not contain an input value
• Select cell B11 and then enter 4.75% as the second number in the series.
first two numbers of series
• Select the range B10:B11. • Drag the fill handle through cell B23 to create the border of the fill area as indicated by the shaded border (Figure 4–22). Do not release the mouse button.
fill handle dragged through cell B23
ScreenTip indicates last value in series
Figure 4–22
2 • Release the mouse button to
Q&A
generate the percent series from 4.50 to 7.75% and display the Auto Fill Options button. Click cell C9 to deselect the range B10:B23 (Figure 4–23).
cell C9 is active
What is the purpose of the percent figures in column B? Excel will use the percent figures in column B to calculate the formulas to be evaluated and entered at the top of the data table in row 9. This series begins in cell B10, not cell B9, because the cell immediately to the left of the formulas in a one–input data table should not include an input value.
Excel extends percent series to cell B23
Auto Fill Options button
Figure 4–23 Other Ways 1. Right–drag fill handle in direction to fill, click Fill Series on shortcut menu 2. Select range, click Fill button on Home tab on Ribbon, click Down
C6426_04_CTP.4c.indd 286
6/12/07 8:42:09 AM
1
With cell C9 active, type =e4 and then press the RIGHT ARROW key.
2
Type =e5 in cell D9 and then press the RIGHT ARROW key.
3
Type =e6 in cell E9 and then click the Enter box to complete the assignment of the formulas and Currency style format in the range C9:E9 (Figure 4–24).
Q&A
The next step in creating the data table is to enter the three formulas at the top of the table in cells C9, D9, and E9. The three formulas are the same as the monthly payment formula in cell E4, the total interest formula in cell E5, and the total cost formula in cell E6. The number of formulas you place at the top of a one–input data table depends on the application. Some one–input data tables will have only one formula, while others might have several. In this case, three formulas are affected when the interest rate changes. Excel provides four ways to enter these formulas in the data table: (1) retype the formulas in cells C9, D9, and E9; (2) copy cells E4, E5, and E6 to cells C9, D9, and E9, respectively; (3) enter the formulas =monthly_payment in cell C9, =total_interest in cell D9, and =total_cost in cell E9; or (4) enter the formulas =e4 in cell C9, =e5 in cell D9, and =e6 in cell E9. The best alternative to define the formulas in the data table is the fourth one, which involves using the cell references preceded by an equal sign. This is the best method because: (1) it is easier to enter the cell references; (2) if you change any of the formulas in the range E4:E6, the formulas at the top of the data table are updated automatically; and (3) Excel automatically assigns the format of the cell reference (Currency style format) to the cell. Using the names of the cells in formulas is nearly as good an alternative, but if you use cell names, Excel will not assign the format to the cells. The following steps enter the formulas of the data table in row 9.
Why are these cells assigned the values of cells in the Loan Payment Calculator area of the worksheet?
BTW
To Enter the Formulas in the Data Table Formulas in Data Tables Any experienced Excel user will tell you that to enter the formulas at the top of the data table, you should enter the cell reference or name of the cell preceded by an equal sign (Figure 4–24). This ensures that if you change the original formula in the worksheet, Excel automatically will change the corresponding formula in the data table. If you use a cell reference, Excel also copies the format to the cell. If you use a name, Excel does not copy the format to the cell.
Excel Chapter 42
Using a Data Table to Analyze Worksheet Data EX 287
It is important to understand that the entries in the top row of the data table (row 9) refer to the formulas that the loan department wants to evaluate using the series of percentages in column B. Furthermore, recall that when you assign a formula to a cell, Excel applies the format of the first cell reference in the formula to the cell. Thus, Excel applies the Currency style format to cells C9, D9, and E9 because that is the format of cells E4, E5, and E6.
formulas are placed in top row of data table
varying interest rates are input values to be substituted in cell E2
Figure 4–24
C6426_04_CTP.4c.indd 287
6/12/07 8:42:12 AM
EX 288 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
To Define a Range as a Data Table After creating the interest rate series in column B and entering the formulas in row 9, the next step is to define the range B9:E23 as a data table. The Data Table command on the What–If Analysis button on the Data tab on the Ribbon is used to define the range B9:E23 as a data table. Cell E2 is the input cell, which means it is the cell in which values from column B in the data table are substituted in the formulas in row 9.
1 • Select the
Data tab What-If Analysis button
range B9:E23.
• Click the Data tab on the Ribbon and then click the What–If Analysis button on the Ribbon to display the What–If Analysis menu (Figure 4–25).
What-If Analysis menu
Data Table command
table range B9:E23 to be defined as data table
Figure 4–25
C6426_04_CTP.4c.indd 288
6/12/07 8:42:14 AM
2 • Click Data Table
input cell E2 selected as Column input cell because varying percents in data table are in a column Data Table dialog box
on the What–If Analysis menu.
Excel Chapter 42
Using a Data Table to Analyze Worksheet Data EX 289
• When Excel displays
Q&A
the Data Table dialog box, click the ‘Column input cell’ box, and then click cell E2 in the Loan Payment Calculator section (Figure 4–26).
OK Button
What is the purpose of clicking cell E2? The purpose of varying clicking cell E2 is percents are in column to select it for the Column input cell. A marquee surrounds the selected cell E2, indicating it will be the input cell in which values from column B in the data Figure 4–26 table are substituted in the formulas in row 9. $E$2 now appears in the Column input cell box in the Data Table dialog box.
3 • Click the OK button to
Q&A
create the data table (Figure 4–27). How does Excel create the data table? Excel calculates the results of the three formulas in row 9 for each interest rate in column B and immediately fills columns C, D, and E of the data table. The resulting values for each interest rate are displayed in the corresponding rows.
Excel automatically fills one-input data table
monthly payment for loan amount in cell C6 if interest rate is 6.00% total cost of house if interest rate is 7.00%
Figure 4–27
C6426_04_CTP.4c.indd 289
6/12/07 8:42:16 AM
EX 290 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
More About Data Tables In Figure 4–27, the data table shows the monthly payment, total interest, and total cost for the interest rates in the range B10:B23. For example, if the interest rate is 5.75% (cell E2), the monthly payment is $1,748.80 (cell E4). If the interest rate is 7.75% (cell B23), however, the monthly payment is $2,020.77 rounded to the nearest cent (cell C23). If the interest rate is 7.00% (cell B20), then the total cost of the house is $443,948.90 rounded to the nearest cent (cell E20), rather than $407,740.46 (cell E6). Thus, a 1.25% increase from the interest rate of 5.75% to 7.00% results in a $36,208.44 increase in the total cost of the house. The following list details important points you should know about data tables: 1. The formula(s) you are analyzing must include a cell reference to the input cell. 2. You can have as many active data tables in a worksheet as you want. 3. While only one value can vary in a one–input data table, the data table can analyze as many formulas as you want. 4. To include additional formulas in a one–input data table, enter them in adjacent cells in the same row as the current formulas (row 9 in Figure 4–27 on the previous page) and then define the entire new range as a data table by using the Table command on the Data menu. 5. You delete a data table as you would delete any other item on a worksheet. That is, select the data table and then press the DELETE key.
BTW
To Format the Data Table Undoing Formats If you start to assign formats to a range and then realize you made a mistake and want to start over, select the range, click the Cell Style button on the Home tab on the Ribbon, and then click Normal in the Cell Style gallery.
C6426_04_CTP.4c.indd 290
The following steps format the data table to improve its readability.
1
Select the range B8:E23. Right–click the selected range and then click Format Cells on the shortcut menu. When Excel displays the Format Cells dialog box, click the Border tab, and then click the medium line style in the Style area (column 2, row 5). Click the Outline button in the Presets area. Click the light border in the Style area (column 1, row 7) and then click the Vertical Line button in the Border area to preview the black vertical border in the Border area.
2
Click the Fill tab and then click the light red color box (column 6, row 2). Click the OK button.
3
Select the range B8:E8. Click the Home tab on the Ribbon and then click the Borders button to assign a light bottom border.
4
Select the range C10:E23 and right–click. Click Format Cells on the shortcut menu. When Excel displays the Format Cells dialog box, click the Number tab. Click Currency in the Category list, click the Symbol box arrow, click None, and then click the second format, 1,234.10, in the Negative numbers list. Click the OK button to display the worksheet as shown in Figure 4–28.
5
Click the Save button on the Quick Access Toolbar to save the workbook using the file name Braden Mortgage Loan Payment Calculator.
6/12/07 8:42:20 AM
Excel Chapter 42
Adding a Pointer to the Data Table Using Conditional Formatting EX 291 Save button
range B8:E23 has light border on right side of each column range B8:E8 has light bottom border
entries in data table formatted to Currency style with two decimal places
light red background
Figure 4–28
If the interest rate in cell E2 is between 4.50% and 7.75% and its decimal portion is a multiple of 0.25 (such as 6.25%), then one of the rows in the data table agrees exactly with the monthly payment, interest paid, and total cost in the range E4:E6. For example, in Figure 4–28, row 15 (5.75%) in the data table agrees with the results in the range E4: E6, because the interest rate in cell B15 is the same as the interest rate in cell E2. Analysts often look for the row in the data table that agrees with the input cell results.
C6426_04_CTP.4c.indd 291
BTW
Adding a Pointer to the Data Table Using Conditional Formatting Conditional Formatting You can add as many conditional formats to a range as you like. After adding the first condition, click the Conditional Formatting button on the Home tab on the Ribbon and then click New Rule to add more conditions. If more than one condition is true for a cell, then Excel applies the formats of each condition, beginning with the first.
6/12/07 8:42:21 AM
EX 292 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
To Add a Pointer to the Data Table To make the row stand out, you can add formatting that serves as a pointer to a row. To add a pointer, you can use conditional formatting to make the cell in column B that agrees with the input cell (cell E2) stand out, as shown in the following steps.
1 • Select the
Home tab
Conditional Formatting button
range B10:B23.
• Click the Conditional Formatting button on the Home tab on the Ribbon to display the Conditional Formatting menu (Figure 4–29).
Conditional Formatting menu
New Rule command
range B10:B23 selected
Figure 4–29
C6426_04_CTP.4c.indd 292
6/12/07 8:42:23 AM
New Formatting Rule dialog box
2 • Click New Rule on the Conditional Formatting menu.
Excel Chapter 42
Adding a Pointer to the Data Table Using Conditional Formatting EX 293
• When Excel displays the New Formatting Rule dialog box, click ‘Format only cells that contain’ in the Select a Rule Type box. Select Cell Value in the left list in the ‘Format only cells with’ area and then select equal to in the middle list.
• Type =$E$2 in the
relational operator
interest rate in cell E2
represents each cell in selected range B10:B23 Format button
white font on green background assigned to any cell if its value equals interest rate in cell E2
OK button
right box.
• Click the Format button, click the Fill tab, and then click Green (column 5, row 7) on the Background color palette.
Figure 4–30
• Click the Font tab, click the Color box arrow, and then click White (column 1, row 1) on the Color palette in the Theme area.
• Click the OK button in the Format Cells dialog box to display the New Formatting Rule dialog box as shown in Figure 4–30.
3 • Click the OK
Q&A
button in the New Formatting Rule dialog box. Click cell G23 to deselect the range B10:B23 (Figure 4–31). How does Excel apply the conditional formatting?
cell entry is white font on green background because value in cell B15 equals value in cell E2
Cell B15 in the data table, which contains the value, 5.75%, appears with white font on a green background, because the value 5.75% is the same as the interest rate value in cell E2. Figure 4–31
C6426_04_CTP.4c.indd 293
6/12/07 8:42:25 AM
EX 294 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
4 • Select cell E2 and then enter 7.25 as the interest rate (Figure 4–32).
5 • Enter 5.75 in cell E2 to return the
Q&A
Loan Payment Calculator section and Interest Rate Schedule section to their original states as shown in Figure 4–31. What happens when the interest rate is changed from 5.75?
cell contents displayed as black font on light red background because value in cell B15 no longer equals value in cell E2
Excel immediately displays the cell containing the new rate with a white font on a green background and displays cell B15 with black bold font on a light red background (Figure 4–32). Thus, the white font on a green background serves as a pointer in the data table to indicate the row that agrees with the input cell (cell E2). When the loan officer using this worksheet enters a different percent in cell E2, the Figure 4–32 pointer will move or disappear. It will disappear whenever the interest rate in cell E2 is outside the range of the data table or its decimal portion is not a multiple of 0.25, such as when the interest rate is 8.25% or 5.80%.
cell entry is white font on green background because value in cell B21 equals value in cell E2
Other Ways
,
1. Press ALT+O D
BTW
Creating an Amortization Schedule Amortization Schedules Hundreds of Web sites offer amortization schedules. To find these Web sites, use a search engine, such as Google at google.com, and search using the keywords, amortization schedule.
C6426_04_CTP.4c.indd 294
The next step in this project is to create the Amortization Schedule section on the right side of Figure 4–33. An amortization schedule shows the beginning and ending balances of a loan, and the amount of payment that applies to the principal and interest for each year over the life of the loan. For example, if a customer wanted to pay off the loan after six years, the Amortization Schedule section tells the loan officer what the payoff would be (cell I8 in Figure 4–33). The Amortization Schedule section shown in Figure 4–33 will work only for loans of up to 18 years. You could, however, extend the table to any number of years. The Amortization Schedule section also contains summaries in rows 21, 22, and 23. These summaries should agree exactly with the corresponding amounts in the Loan Payment Calculator section in the range B1:E6.
6/12/07 8:42:29 AM
column shows amount paid on principal each year column shows amount owed on loan at beginning of year
column shows amount owed on loan at end of year
column shows interest paid (lending institution’s gross profit) each year
Excel Chapter 42
Creating an Amortization Schedule EX 295
borrower owes 181,606.20 after sixth year
total interest paid in cell K21 equals total interest paid in cell E5 amount paid on principal in cell J21 equals loan amount in cell C6 total cost in cell K23 equals total cost in cell E6
Figure 4–33
The first step in creating the Amortization Schedule section is to adjust the column widths and enter the Amortization Schedule section title and column titles, as shown in the following steps.
1
Position the mouse pointer on the right boundary of column heading F and then drag to the left until the ScreenTip shows Width: 1.57 (16 pixels).
2
Position the mouse pointer on the right boundary of column heading G and then drag to the left until the ScreenTip shows Width: 8.43 (64 pixels).
3
Drag through column headings H through K to select them. Position the mouse pointer on the right boundary of column heading K and then drag to the right until the ScreenTip shows Width: 14.00 (103 pixels).
4
Select cell G1. Type Amortization Schedule as the section title. Press the ENTER key.
C6426_04_CTP.4c.indd 295
BTW
To Change Column Widths and Enter Titles Column Borders In this chapter, columns A and F are used as column borders to divide sections of the worksheet from one another, as well as from the row headings. A column border is an unused column with a significantly reduced width. You also can use row borders to separate sections of a worksheet.
6/12/07 8:42:32 AM
EX 296 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
5
Select cell B1. Click the Format Painter button on the Ribbon. Click cell G1 to copy the format of cell B1. Click the Merge & Center button on the Ribbon to split cell G1. Select the range G1:K1 and then click the Merge & Center button on the Ribbon.
6
Enter the column titles in the range G2:K2 as shown in Figure 4–34. Where appropriate, press ALT+ENTER to enter the titles on two lines. Select the range G2:K2 and then click the Align Text Right button on the Ribbon. Select cell G3 to display the section title and column headings as shown in Figure 4–34.
width of column F changed to 1.57 characters
width of column G changed to 8.43 characters
width of columns H through K changed to 14.00 characters
column titles are on two lines and right-aligned
Figure 4–34
To Create a Series of Integers Using the Fill Handle The next step is to create a series of numbers, using the fill handle, that represent the years during the life of the loan. The series begins with 1 (year 1) and ends with 18 (year 18).
C6426_04_CTP.4c.indd 296
1
With cell G3 active, enter 1 as the initial year. Select cell G4 and then enter 2 to represent the next year.
2
Select the range G3:G4 and then point to the fill handle. Drag the fill handle through cell G20 to create the series of integers 1 through 18 in the range G3:G20 (Figure 4–35).
6/12/07 8:42:54 AM
Excel Chapter 42
Creating an Amortization Schedule EX 297
Excel extends series to cell G20
Auto Fill Options button
Figure 4–35
To Enter the Formulas in the Amortization Schedule The next step is to enter the four formulas that form the basis of the amortization schedule in row 3. Later, these formulas will be copied through row 20. The formulas are summarized in Table 4–2. Table 4–2 Formulas for the Amortization Schedule Tab Stop
Tab Marker
Result of Pressing Tab Key
Example
H3
Beginning Balance
=C6
The beginning balance (the balance at the end of a year) is the initial loan amount in cell C6.
I3
Ending Balance
=IF(G3 <= $E$3, PV($E$2 /12, 12 * ($E$3 – G3), –$E$4), 0)
The ending balance (the balance at the end of a year) is equal to the present value of the payments paid over the remaining life of the loan.
J3
Paid On Principal
=H3 – I3
The amount paid on the principal at the end of the year is equal to the beginning balance (cell H3) less the ending balance (cell I3).
K3
Interest Paid
=IF(H3 > 0, 12 * $E$4 – J3, 0)
The interest paid during the year is equal to 12 times the monthly payment (cell E4) less the amount paid on the principal (cell J3).
C6426_04_CTP.4c.indd 297
6/12/07 8:42:58 AM
EX 298 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
Of the four formulas in Table 4–2, the most difficult to understand is the PV function that will be assigned to cell I3. The PV function returns the present value of an annuity. An annuity is a series of fixed payments (such as the monthly payment in cell E4) made at the end of each of a fixed number of periods (months) at a fixed interest rate. You can use the PV function to determine how much the borrower of the loan still owes at the end of each year. The PV function can determine the ending balance after the first year (cell I3) by using a term equal to the number of months for which the borrower still must make payments. For example, if the loan is for 18 years (216 months), then the borrower still owes 204 payments after the first year (216 months – 12 months). The number of payments outstanding can be determined from the formula 12 * (E3 – G3) or 12 * (18 – 1), which equals 204. Recall that column G contains integers that represent the years of the loan. After the second year, the number of payments remaining is 192, and so on. If you assign the PV function as shown in Table 4–2 to cell I3 and then copy it to the range I4:I20, the ending balances for each year will display properly. If the loan is for less than 18 years, however, then the ending balances displayed for the years beyond the time the loan is due are invalid. For example, if a loan is taken out for 5 years, then the rows representing years 6 through 18 in the amortization schedule should be 0. The PV function, however, will display negative numbers even though the loan already has been paid off. To avoid this, the worksheet should include a formula that assigns the PV function to the range I3:I20 as long as the corresponding year in column G is less than or equal to the number of years in cell E3. If the corresponding year in column G is greater than the number of years in cell E3, then the ending balance for that year and the remaining years should be 0. The following IF function causes the value of the PV function or 0 to display in cell I3 depending on whether the corresponding value in column G is less than or equal to the number of years in cell E3. Recall that the dollar signs within the cell references indicate the cell reference is absolute and, therefore, will not change as you copy the function downward. =IF(G3 <= $E$3, PV($E$2 /12, 12 * ($E$3 – G3), –$E$4), 0) logical test
value if true
value if false
In the above formula, the logical test determines if the year in column G is less than or equal to the term of the loan in cell E3. If the logical test is true, then the IF function assigns the PV function to the cell. If the logical test is false, then the IF function assigns zero (0) to the cell. The PV function in the IF function includes absolute cell references (cell references with dollar signs) to ensure that the references to cells in column E do not change when the IF function later is copied down the column. The following steps enter the four formulas shown in Table 4–2 into row 3. Row 3 represents year 1 of the loan.
1 • Select cell H3 and
Enter box
then enter =c6 as the beginning balance of the loan.
IF function typed in active cell appears in formula bar =c6
• Select cell I3 and then type =if(g3 <= $e$3, pv($e$2 / 12, 12 * ($e$3 – g3), –$e$4), 0) as the entry (Figure 4-36).
Excel automatically assigns format of cell C6 to cell H3
IF function assigns PV function or 0
Figure 4–36
C6426_04_CTP.4c.indd 298
6/12/07 8:43:01 AM
2 • Click the Enter box
Q&A
in the formula bar to insert the formula (Figure 4–37).
Excel automatically capitalizes all cell references after function is entered
Excel Chapter 42
Creating an Amortization Schedule EX 299
What happens when the Enter box is clicked? Excel evaluates the IF function in cell I3 and displays the result of the PV function (227326.7922) because the value in cell G3 (1) is less than or equal to the term of the loan in cell E3 (18). With cell I3 active, Excel also displays the formula in the formula bar. If the borrower wanted to pay off the loan after one year, the cost would be $227,326.79.
cell I3 assigned ending balance (present value) of loan after year 1
Figure 4–37
3 • Select cell J3. Type =h3 – i3 and then press the RIGHT ARROW key.
• Type =if(h3 > 0, 12 * $e$4 – j3, 0) in cell K3 to display the amount paid on the principal after 1 year ($7,673.21) in cell J3, using the same format as in cell H3 (Figure 4–38).
if beginning value is greater than 0, show interest paid for year; else show 0
beginning balance minus ending balance, or H3 – I3
Excel automatically assigns format of cell H3 to cell J3
Figure 4–38
C6426_04_CTP.4c.indd 299
6/12/07 8:43:03 AM
EX 300 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
4 • Click the Enter box in the
Q&A
formula bar to complete the entry (Figure 4–39). What happens when the Enter box is clicked?
Q&A
Excel displays the interest paid after 1 year (13312.37332) in cell K3. Thus, the lending institution’s gross profit for the first year of the loan is $13,312.37.
values displayed using General style format
Why are some of the cells in the range H3:K3 formatted? When you enter a formula in a cell, Excel assigns the cell the same format as the first cell reference in the formula. For example, when you enter =c6 in cell H3, Excel assigns the format in cell C6 to cell H3. The same applies to cell J3. Although this method of formatting also works for most functions, it does not work for the IF function. Thus, the results of the IF functions in cells I3 and K3 are displayed using the General style format, which is the format of all cells when you open a new workbook.
amount paid on principal after one year
lending institution’s gross profit for first year
Figure 4–39
C6426_04_CTP.4c.indd 300
6/12/07 8:43:07 AM
To Copy the Formulas to Fill the Amortization Schedule With the formulas entered into the first row, the next step is to copy them to the remaining rows in the amortization schedule. The required copying is straightforward, except for the beginning balance column. To obtain the next year’s beginning balance (cell H4), last year’s ending balance (cell I3) must be used. After cell I3 is copied to cell H4, then H4 can be copied to the range H5:H20.
Excel Chapter 42
Creating an Amortization Schedule EX 301
1 • Select the range I3:K3 and then
Q&A
drag the fill handle down through row 20 to copy the formulas in cells I3, J3, and K3 to the range I4: K20 (Figure 4–40). Why do some of the numbers seem incorrect? Many of the numbers displayed are incorrect because most of the cells in column H do not contain beginning balances.
range I3:K3 copied to range I4:K20
0s in column K are result of empty cells in column H
Auto Fill Options button
Figure 4–40
2 • Select cell H4, type =i3 as the cell entry, and then click the Enter box in the formula bar to display the ending balance (227326.7922) for year 1 as the beginning balance for year 2 (Figure 4–41).
beginning balance for each year is equal to previous year’s ending balance
Figure 4–41
C6426_04_CTP.4c.indd 301
6/12/07 8:43:10 AM
EX 302 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
3 • With cell H4 active, drag the fill
Q&A
handle down through row 20 to copy the formula in cell H4 (=I3) to the range H5:H20 (Figure 4–42). What happens after the fill operation is complete? Because the cell reference I3 is relative, Excel adjusts the row portion of the cell reference as it is copied downward. Thus, each new beginning balance in column H is equal to the ending balance of the previous year.
with beginning balances for each year calculated, remaining values in amortization schedule now are correct
cell H4 copied to range H5:H20
Auto Fill Options button
ending balance for year 18 is 0
Figure 4–42
To Enter the Total Formulas in the Amortization Schedule The next step is to determine the amortization schedule totals in rows 21 through 23. These totals should agree with the corresponding totals in the Loan Payment Calculator section (range B1:E6). The following steps show how to enter the total formulas in the amortization schedule.
C6426_04_CTP.4c.indd 302
6/12/07 8:43:13 AM
Select cell I21. Enter Subtotal as the row title. Select the range J21:K21. Click the Sum button on the Ribbon.
2
Select cell I22. Type Down Pymt as the row title. Select cell K22 and then enter =c5 as the down payment.
3
Select cell I23. Type Total Cost as the row title. Select cell K23, type =j21 + k21 + k22 as the total cost, and then click the Enter box in the formula bar to complete the amortization schedule totals (Figure 4–43). What was accomplished in the previous steps? The formula assigned to cell K23 (=j21 + k21 + k22) sums the total amount paid on the principal (cell J21), the total interest paid (cell K21), and the down payment (cell K22). Excel assigns total amount paid on cell J21 the same format as cell principal over life of loan J3, because cell J3 is the first cell reference in =SUM(J3:J20). Furthermore, because cell J21 was selected first when the range J21:K21 was selected to determine the sum, Excel assigned cell K21 the same format it assigned to cell J21. Figure 4–43 Finally, cell K22 was assigned the Currency style format, because cell K22 was assigned the formula =c5, and cell C5 has a Currency style format. For the same reason, the value in cell K23 appears in Currency style format.
Sum button
down payment assigned format of cell C5
Excel Chapter 42
1
Q&A
Creating an Amortization Schedule EX 303
lending institution’s total gross profit
total cost assigned format of cell J21
To Format the Numbers in the Amortization Schedule The final step in creating the amortization schedule is to format it so it is easier to read. The formatting is divided into two parts: (1) formatting the numbers and (2) adding borders and background. When the beginning balance formula (=c6) was entered earlier into cell H3, Excel automatically copied the Currency style format along with the value from cell C6 to cell H3. The steps on the next page use the Format Painter button to copy the Currency style format from cell H3 to the range I3:K3. Then the Comma style will be assigned to the range H4:K20.
C6426_04_CTP.4c.indd 303
6/12/07 8:43:15 AM
BTW
BTW
EX 304 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
The Magical Fill Handle If there is a column with entries adjacent to the range you plan to drag the fill handle down through, then you can double-click the fill handle instead of dragging. For example, in Step 3 on page EX 302, you could have double-clicked the fill handle instead of dragging the fill handle down through column 20 to copy the formula in cell H4 to the range H5:H20, because of the numbers in column G. This feature also applies to copying a range using the fill handle.
Round-Off Errors If you manually add the numbers in column K (range K3:K20) and compare it to the sum in cell K21, you will notice that the total interest paid is $0.01 off. This round-off error is due to the fact that some of the numbers involved in the computations have additional decimal places that do not appear in the cells. You can use the ROUND function on the formula entered into cell K3 to ensure that the total is exactly correct. For information on the ROUND function, click the Insert Function button in the formula bar, click Math & Trig in the ‘Or select a category’ list, scroll down in the ‘Select a function’ list, and then click ROUND.
1
Select cell H3. Click the Format Painter button on the Home tab on the Ribbon. Drag through the range I3:K3 to assign the Currency style format to the cells.
2
Select the range H4:K20 and then right–click. Click Format Cells on the shortcut menu. When Excel displays the Format Cells dialog box, click the Number tab. Click Currency in the Category list, click the Symbol box arrow, click None, and then click the second format, 1,234.10, in the Negative numbers list. Click the OK button.
3
Select cell H21 to deselect the range H4:K20 to display the numbers in the amortization schedule as shown in Figure 4–44.
values displayed using Currency style with two decimal places
values displayed using Comma style with two decimal places
values displayed using Currency style with two decimal places
Figure 4–44
To Add Borders and a Background to the Amortization Schedule The following steps add the borders and a background to the amortization schedule.
C6426_04_CTP.4c.indd 304
1
Select the range G2:K23. Right–click the selected range and then click Format Cells on the shortcut menu. When Excel displays the Format Cells dialog box, click the Border tab.
2
Click the medium line style in the Style area (column 2, row 5). Click the Outline button in the Presets area.
3
Click the light line style in the Style area (column 1, row 7). Click the vertical line button in the Border area.
4
Click the Fill tab and then click light blue (column 5, row 2). Click the OK button.
6/12/07 8:43:18 AM
5
Select the range G2:K2. Click the Borders button on the Home tab on the Ribbon to assign the range a light bottom border.
6
Select the range G20:K20 and then click the Borders button on the Home tab on the Ribbon to assign the range a light bottom border. Select cell H22 to display the worksheet as shown in Figure 4–45.
7
Click the Save button on the Quick Access Toolbar to save the workbook using the file name, Braden Mortgage Loan Payment Calculator.
Excel Chapter 42
Creating an Amortization Schedule EX 305
Borders button
range G2:K2 has light black bottom border
range G2:K23 has medium border and light blue background
each column in Amortization Schedule has light right border
range G20:K20 has light black bottom border
Figure 4–45
To Enter New Loan Data With the Loan Payment Calculator, Interest Rate Schedule, and Amortization Schedule sections of the worksheet complete, you can use them to generate new loan information. For example, assume you want to purchase a pontoon boat for $41,550.00. You have $6,000.00 for a down payment and want the loan for 5 years. Braden Mortgage currently is charging 7.25% interest for a 5–year loan. The steps on the next page enter the new loan data.
C6426_04_CTP.4c.indd 305
6/12/07 8:43:21 AM
1
Select cell C3. Type Pontoon Boat and then press the DOWN ARROW key.
2
In cell C4, type 41550 and then press the DOWN ARROW key.
3
In cell C5, type 6000 as the down payment.
4
Select cell E2, type 7.25 and then press the DOWN ARROW key.
5
In cell E3, type 5 and then press the DOWN ARROW key. Select cell H22 to display the worksheet as shown in Figure 4–46.
Q&A
EX 306 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
What happens on the worksheet when the new data is entered? As shown in Figure 4–46, the monthly payment for the pontoon boat is $708.13 (cell E4). The total interest is $6,938.00 (cell E5) and the total cost for the boat is $48,488.00 (cell E6). Because the term of the loan is for 5 years, the rows for years 6 through 18 in the Amortization Schedule section display 0.00.
amortization schedule stops at 5 years because loan is for 5 years
Excel automatically recalculates data table each time entry is made in worksheet
new loan data
new loan information calculated
total cost of Pontoon Boat is $48,488.00 if down payment is $6,000.00, term is 5 years, and interest rate is 7.25%
cells assigned 0s because loan is only 5 years
Figure 4–46
To Enter the Original Loan Data The following steps enter the original loan data.
C6426_04_CTP.4c.indd 306
1
Select cell C3. Type Home and then press the DOWN ARROW key.
2
In cell C4, type 265000 and then press the DOWN ARROW key.
3
In cell C5, type 30000 as the down payment.
6/12/07 8:43:24 AM
4
Select cell E2, type 5.75 and then press the DOWN ARROW key.
5
In cell E3, type 18 and then click the Enter box in the formula bar or press the ENTER key to complete the entry of the original load data. Select cell H22.
Excel Chapter 42
Printing Sections of the Worksheet EX 307
Printing Sections of the Worksheet In Chapter 2, you learned to print a section of a worksheet by selecting it and using the Selection option in the Print dialog box (see page EX 134). If you find yourself continually selecting the same range in a worksheet to print, you can set a specific range to print each time you print the worksheet by using the Set Print Area command. When you set a range to print using the Set Print Area command, Excel will continue to print only that range until you clear it using the Clear Print Area command.
To Set Up a Worksheet to Print This section describes print options available in the Sheet sheet in the Page Setup dialog box (Figure 4–47). These print options pertain to the way the worksheet will appear in the printed copy or when previewed. One of the more important print options is the capability of printing in black and white. Printing in black and white not only speeds up the printing process, but also saves ink. This is especially true if you have a color printer and need only a black and white printed copy of the worksheet. The following steps ensure any printed copy fits on one page and prints in black and white.
1 • Click the Page Layout tab on the Ribbon and then click the Page Setup Dialog Box Launcher on the Ribbon.
Page Setup Dialog Box Launcher Page tab
Page Setup dialog box orientation set to Portrait
• When Excel displays the Page Setup dialog box, click the Page tab and then click Fit to in the Scaling area to set the worksheet to print on one page (Figure 4–47).
Fit to option button selected
Figure 4–47
C6426_04_CTP.4c.indd 307
6/12/07 8:43:27 AM
EX 308 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
2 • Click the Sheet tab and then click ‘Black and white’ in the Print area to select the check box (Figure 4–48). enter name or range to print
3 • Click the OK button.
Sheet tab
set row or column headings to repeat on each new printed page
print gridlines control print quality and color
black and white check box selected
print row heading numbers and column heading letters
control page order when printing large worksheets
OK button
Figure 4–48
More About Print Options Table 4–3 summarizes the print options available on the Sheet sheet in the Page Setup dialog box. Table 4–3 Print Options Available Using the Sheet Sheet in the Page Setup Dialog Box
C6426_04_CTP.4c.indd 308
Print Option
Description
Print area box
Excel prints from cell A1 to the last occupied cell in a worksheet unless you instruct it to print a selected area. You can select a range to print with the mouse, or you can enter a range or name of a range in the Print area box. Nonadjacent ranges will print on a separate page.
6/12/07 8:43:29 AM
Table 4–3 Print Options Available Using the Sheet Tab in the Page Setup Dialog Box (continued) Print Option
Description
Print titles area
This area is used to instruct Excel to print row titles and column titles on each printed page of a worksheet. You must specify a range, even if you are designating one column (e.g., 1:4 means the first four rows).
Gridlines check box
A check mark in this check box instructs Excel to print gridlines.
Black and white check box
A check mark in this check box speeds up printing and saves colored ink if you have colors in a worksheet and a color printer.
Draft quality check box
A check mark in this check box speeds up printing by ignoring formatting and not printing most graphics.
Row and column headings check box
A check mark in this check box instructs Excel to include the column heading letters (A, B, C, etc.) and row heading numbers (1, 2, 3, etc.) in the printout.
Comments box
Indicates where comments are to be displayed on the printout.
Cell errors as box
Indicates how errors in cells should be displayed on the printout.
Page order area
Determines the order in which multipage worksheets will print.
Excel Chapter 42
Printing Sections of the Worksheet EX 309
To Set the Print Area The following steps print only the Loan Payment Calculator section by setting the print area to the range B1:E6.
1 • Select the range B1:E6 and then
Print Area button
click the Print Area button on the Ribbon to display the Print Area menu (Figure 4–49).
Set Print Area command
Print Area menu
range B1:E6 selected
Figure 4–49
C6426_04_CTP.4c.indd 309
6/12/07 8:43:31 AM
EX 310 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
2 • Click Set Print Area on the Print Area menu. range B1:E6 prints
• Click the Office Button and then click Print on the Office Button menu. When Excel displays the Print dialog box, click the OK button to print the selected area (Figure 4–50).
3 • Click the Print Area button on the
Q&A
Ribbon and then click the Clear Print Area command on the Print Area menu to reset the print area to the entire worksheet. What happens when I set a print area? Once you set a print area, Excel will continue to print the specified range, rather than the entire worksheet. If you save the workbook with the print area set, then Excel will remember the settings the next time you open the workbook and print only the specified range. To remove the print area so that the entire worksheet prints, click Clear Print Area on the Print Area menu as described in Step 3.
Figure 4–50
Other Ways 1. Press ALT+F, T, S
To Name and Print Sections of a Worksheet With some spreadsheet applications, you will want to print several different areas of a worksheet, depending on the request. Rather than using the Set Print Area command or manually selecting the range each time you want to print, you can name the ranges using the Name box in the formula bar. You then can use one of the names to select an area before using the Set Print Area command or Selection option button. The following steps name the Loan Payment Calculator section, the Interest Rate Schedule section, the Amortization Schedule section, and the entire worksheet, and then print each section using the Selection option button in the Print dialog box.
C6426_04_CTP.4c.indd 310
6/12/07 8:43:33 AM
1 • If necessary, select the range B1: E6, click the Name box, and then type Loan_Payment as the name of the range (Figure 4–51).
name Loan_Payment appears in Name box
Excel Chapter 42
Printing Sections of the Worksheet EX 311
range B1:E6 selected
Figure 4–51
2 • Press the ENTER key. • Select the range B7:E23, click the Name box, type Interest_ Schedule as the name of the range, and then range B1:K23 press the ENTER key.
• Select the range G1:K23, click the Name box, type Amortization_ Schedule as the name of the range, and then press the ENTER key.
Name box arrow
range G1:K23 range B7:E23
range B1:E6
• Select the range B1:K23, click the Name box, type All_Sections as the name of the range, and then press the ENTER key.
• Select cell H22 and then click the Name box arrow in the formula bar to display the Name list with the new range names (Figure 4–52). Figure 4–52
C6426_04_CTP.4c.indd 311
6/12/07 8:43:37 AM
EX 312 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
Loan_Payment range selected
3 • Click Loan_Payment in the
Print dialog box
Name list to select the range B1:E6.
• Click the Office Button and then click Print on the Office Button menu to display the Print dialog box.
• When Excel displays the Print dialog box, click Selection in the Print what area (Figure 4–53). Selection option button selected
Figure 4–53
4 • Click the OK button to print the Loan_ Payment range.
Loan Payment (B1:E6)
• One at a time, use the Name box to select the names Interest_Schedule, Amortization_Schedule, and All_Sections, and then print them following the instructions in Step 3 (Figure 4–54). 5 • Click the Save button on
Interest Schedule (B7:E23)
Amortization Schedule (G1:K23)
All Sections (B1:K23)
Q&A
the Quick Access Toolbar to save the workbook using the file name, Braden Mortgage Loan Payment Calculator. Why does the All_Sections range print on one page? Recall that the Fit to option was selected earlier (Figure 4–47 on page EX 307). This selection ensures that each of the printouts fits across the page in portrait orientation.
Figure 4–54
Other Ways 1. Select cell or range, on Formulas tab on Ribbon, click Define Name button, [type name], click OK button
C6426_04_CTP.4c.indd 312
2. Select cell or range, on Formulas tab on Ribbon, click Name Manager button, click New, [type name], click OK button, click Close button
6/12/07 8:43:42 AM
When building a worksheet for novice users, you should protect the cells in the worksheet that you do not want changed, such as cells that contain text or formulas. When you create a new worksheet, all the cells are assigned a locked status, but the lock is not engaged, which leaves cells unprotected. Unprotected cells are cells whose values you can change at any time. Protected cells are cells that you cannot change. You should protect cells only after the worksheet has been tested fully and the correct results appear. Protecting a worksheet is a two–step process: 1. Select the cells you want to leave unprotected and then change their cell protection settings to an unlocked status.
BTW
Protecting the Worksheet Naming Ranges A name can be assigned to two or more nonadjacent ranges. After selecting the first range, hold down the CTRL key and drag through the additional ranges of cells to select them before entering the name in the Name box.
Excel Chapter 42
Protecting the Worksheet EX 313
2. Protect the entire worksheet. At first glance, these steps may appear to be backwards. Once you protect the entire worksheet, however, you cannot change anything, including the locked status of individual cells.
To Protect a Worksheet In the Loan Payment Calculator worksheet (Figure 4–55), the user should be able to make changes to only five cells: the item in cell C3; the price in cell C4; the down payment in cell C5; the interest rate in cell E2; and the years in cell E3. These cells must remain unprotected so that users can enter the correct data. The remaining cells in the worksheet should be protected so that the user cannot change them. The following steps show how to protect the Loan Payment Calculator worksheet.
1 • Select the range C3:C5. • Hold down the CTRL key and
nonadjacent ranges C3:C5 and E2:E3 selected
then select the nonadjacent range E2:E3.
• Right–click one of the selected ranges to display the shortcut menu (Figure 4–55). shortcut menu
Format Cells command
Figure 4–55
C6426_04_CTP.4c.indd 313
6/12/07 8:43:48 AM
EX 314 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
2 • Click Format Cells on the shortcut menu.
• When Excel displays the Custom
Q&A
Lists dialog box, click the Protection tab, and then click Locked to remove the check mark (Figure 4–56).
Custom Lists dialog box
check mark removed from Locked check box
Protection tab
What is the meaning of the Locked check box ? Excel displays the Protection sheet in the Custom Lists dialog box with the check mark removed from the Locked check box (Figure 4–56). This means the selected cells (C3:C5 and E2:E3) will not be protected when the Protect command is invoked later.
OK button
Figure 4–56
3 • Click the OK button and then
Review tab
select cell H22 to deselect the ranges C3:C5 and E2:E3.
Protect Sheet button
• Click the Review tab on the Ribbon (Figure 4–57). Protect Workbook button
Figure 4–57
C6426_04_CTP.4c.indd 314
6/12/07 8:43:50 AM
4 • Click the Protect Sheet button on
Save button
the Ribbon to display the Protect Sheet dialog box.
Excel Chapter 42
Protecting the Worksheet EX 315
• When Excel displays the Protect
Q&A
Sheet dialog box, make sure the Protect worksheet and contents of locked cells check box at the top of the dialog box and the first two check boxes in the list contain check marks (Figure 4–58). What do the three checked check boxes mean? With all three check boxes selected, the worksheet is protected from changes to contents (except the cells left unlocked). The two check boxes in the list allow the user to select any cell on the worksheet, but the user can change only unlocked cells.
5 • Click the OK button in the Protect
Protect Sheet dialog box
Password to unprotect sheet text box
check marks indicate what users can do
Figure 4–58
Sheet dialog box.
• Click the Save button on the Quick Access Toolbar. Other Ways 1. Click Format Cells Dialog Box Launcher, click Protection tab, remove check mark from Locked check box, click OK button
All the cells in the worksheet are protected, except for the ranges C3:C5 and E2:E3. The Protect Sheet dialog box in Figure 4–58 lets you enter a password that can be used to unprotect the sheet. You should create a password when you want to keep others from changing the worksheet from protected to unprotected. The check boxes in the list in the Protect Sheet dialog box also give you the option to modify the protection so that the user can make certain changes, such as formatting cells or inserting hyperlinks. If you want to protect more than one sheet in a workbook, select each sheet before you begin the protection process or click the Protect Workbook button on the Review tab on the Ribbon, instead of clicking the Protect Sheet button (Figure 4–57). If you want to unlock cells for specific users, you can use the Allow Users to Edit Ranges button on the Review tab on the Ribbon. When this workbook is put into production, users will be able to enter data in only the unprotected cells. If they try to change any protected cell, such as the monthly payment in cell E4, Excel displays a dialog box with an error message as shown in Figure 4–59 on the next page. An alternative to displaying this dialog box is to remove the check mark from the ‘Select unlocked cells’ check box in the Protect Sheet dialog box (Figure 4–58). With the check mark removed, the user cannot select a locked cell. To unprotect the worksheet so that you can change all cells in the worksheet, unprotect the document by clicking the Unprotect Sheet button on the Review tab on the Ribbon.
C6426_04_CTP.4c.indd 315
BTW
More About Worksheet Protection
Using Protected Worksheets You can move from one unprotected cell to another unprotected cell in a worksheet by using the tab and SHIFT+TAB keys. This is especially useful when the cells are not adjacent to one another.
6/12/07 8:43:53 AM
EX 316 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
unsuccessful attempt to change monthly payment in cell E4, which is protected
Microsoft Office Excel dialog box with error message appears when user attempts to change protected cells
Figure 4–59
To Hide and Unhide a Sheet You can hide rows, columns, and sheets that contain sensitive data. Sheets are hidden by first selecting one or more of them and then using the Hide command on the sheet tab’s shortcut menu (Figure 4–60). Later, you can use the Unhide command on the same shortcut menu to unhide sheets. You also learned earlier in Chapter 2 (page EX 126) that you can use the mouse and keyboard to hide and unhide rows and columns. The following steps show how to hide and then unhide a sheet.
1 • If the Braden Mortgage sheet is not active, click its sheet tab.
• Right–click the sheet tab to display the shortcut menu (Figure 4–60).
shortcut menu
Braden Mortgage sheet tab
Hide command Unhide command
Figure 4–60
C6426_04_CTP.4c.indd 316
6/12/07 8:43:55 AM
2 • Click Hide on the shortcut menu to hide the Braden Mortgage sheet.
Unhide dialog box
Excel Chapter 42
Protecting the Worksheet EX 317
hidden sheets in this workbook
3 • Right–click any sheet tab to display the shortcut menu.
4 • Click Unhide on the shortcut menu to open the Unhide dialog box.
Braden Mortgage sheet hidden
OK button
5 • When Excel displays the
Q&A
Unhide dialog box, if necessary, click Braden Mortgage in the Unhide sheet list (Figure 4–61).
Figure 4–61
When should I hide a sheet? Hiding sheets in a workbook is not uncommon when working with complex workbooks that have one sheet with the results the user needs to see and one or more sheets with essential data that is unimportant to the user, and thus hidden from view. The fact that a sheet is hidden does not mean the data and formulas on the hidden sheets are unavailable for use on other sheets in the workbook. This same logic applies to hidden rows and columns.
6 • Click the OK button to unhide the Braden Mortgage sheet as it was shown in Figure 4–60.
To Hide and Unhide a Workbook You hide an entire workbook by using the Hide button on the View tab on the Ribbon. Some users employ this command when they leave a workbook up on an unattended computer and do not want others to be able to see the workbook. The Hide command is also useful when you have several workbooks opened simultaneously and want the user to be able to view only one of them. The following steps show how to hide and unhide a workbook.
1 • Click the View tab on the
View tab Hide button
Ribbon (Figure 4–62). Full Screen button
Hide Window ScreenTip
Figure 4–62
C6426_04_CTP.4c.indd 317
6/12/07 8:43:58 AM
EX 318 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
2 • Click the Hide button on the Ribbon to hide the Braden Mortgage workbook.
3 • Click the Unhide
Unhide button
workbook hidden
button on the Ribbon.
Unhide dialog box
• When Excel displays
Q&A
the Unhide dialog box, if necessary, click Braden Mortgage Loan Payment Calculator in the Unhide workbook list (Figure 4–63).
name of hidden workbook
OK button
What else can I hide? You can hide most window elements in order to display more rows of worksheet data. These window elements include the Ribbon, formula bar, and status bar. The Excel window elements can be hidden by using the Full Screen button on the View tab on Figure 4–63 the Ribbon (Figure 4–62 on the previous page). These elements remain hidden only as long as the workbook is open. They redisplay when you close the workbook and open it again.
4 • Click the OK button to unhide the Braden Mortgage Loan Payment Calculator workbook as it was shown in Figure 4–62 on the previous page.
Formula Checking Similar to the spell checker, Excel has a formula checker that checks formulas in a worksheet for rule violations. You invoke the formula checker by clicking the Error Checking command on the Tools menu. Each time Excel encounters a cell with a formula that violates one of its rules, it displays a dialog box containing information about the formula and a suggestion on how to fix the formula. Table 4–4 lists Excel’s error checking rules. You can choose which rules you want Excel to use by enabling and disabling them in the Formulas area in the Excel Options dialog box shown in Figure 4–64 on page EX 320.
C6426_04_CTP.4c.indd 318
6/12/07 8:44:01 AM
Table 4–4 Error Checking Rules Rule
Name of Rule
Description
1
Cells containing formulas that result in an error
The cell contains a formula that does not use the expected syntax, arguments, or data types.
2
Inconsistent calculated column formula in tables
The cell contains formulas or values that are inconsistent with the column formula or tables.
3
Cells containing years represented as 2 digits
The cell contains a text date with a two–digit year that can be misinterpreted as the wrong century.
4
Numbers formatted as text or preceded by an apostrophe
The cell contains numbers stored as text.
5
Formulas inconsistent with other formulas in the region
The cell contains a formula that does not match the pattern of the formulas around it.
6
Formula that omits cells in a region
The cell contains a formula that does not include a correct cell or range reference.
7
Unlocked cells containing formulas
The cell with a formula is unlocked in a protected worksheet.
8
Formulas referring to empty cell
The cells referred to in a formula are empty.
9
Data entered in a table is invalid
The cell has a data validation error.
Excel Chapter 42
Formula Checking EX 319
To Enable Background Formula Checking
Click the Office Button on the Ribbon, click the Excel Options button, and then click the Formulas button.
2
If necessary, click ‘Enable background error checking’ in the Error Checking area to select it.
3
Click any check box in the ‘Error checking rules’ area that does not contain a check mark (Figure 4–64 on the next page).
4
Click the OK button.
Q&A
1
How can I decide which rules to have the background formula checker check? You can decide which rules you want the background formula checker to highlight by adding and removing check marks from the check boxes in the ‘Error checking rules’ area (Figure 4–64). If you add or remove check marks, then you should click the Reset Ignored Errors button to reset error checking.
C6426_04_CTP.4c.indd 319
BTW
Through the Excel Options dialog box, you can enable background formula checking. Background formula checking means that Excel continually will review the workbook for errors in formulas as you create or manipulate it. The following steps enable background formula checking.
Excel Help The best way to become familiar with Excel Help is to use it. Appendix C includes detailed information about Excel Help and exercises that will help you gain confidence in using it.
6/12/07 8:44:03 AM
EX 320 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
Excel Options dialog box Formulas button
Indicate errors using this color button
Reset Ignored Errors button
Enable background error checking check box
Error checking rules
OK button
Figure 4–64
BTW
More About Background Formula Checking Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
C6426_04_CTP.4c.indd 320
When a formula fails to pass one of the rules and background formula checking is enabled, then Excel displays a small green triangle in the upper–left corner of the cell assigned the formula in question. Assume, for example, that background formula checking is enabled and that cell E4, which contains the PMT function in the Braden Mortgage workbook, is unlocked. Because rule 7 in Table 4–4 stipulates that a cell containing a formula must be locked, Excel displays a green triangle in the upper–left corner of cell E4. When you select the cell with the green triangle, a Trace Error button appears next to the cell. If you click the Trace Error button, Excel displays the Trace Error menu (Figure 4–65). The first item in the menu identifies the error (Unprotected Formula). The remainder of the menu lists commands from which you can choose. The first command locks the cell. Invoking the Lock Cell command fixes the problem so that the formula no longer violates the rule. The Error Checking Options command instructs Excel to display the Excel Options dialog box with the Formulas area active, as shown in Figure 4–64.
6/12/07 8:44:04 AM
Trace Error button
green triangle is error indicator
Excel Chapter 42
Formula Checking EX 321
cell E4 contains a formula and it is unlocked
type of error appears at top of Trace Error menu
Lock Cell command locks cell
Trace Error menu
displays Error Checking area in Excel Options dialog box
The background formula checker can become annoying when you are creating certain types of worksheets that may violate the formula rules until referenced cells contain data. It is not unusual to end up with green triangles in cells throughout your worksheet. If this is the case, then disable background formula checking by removing the check mark from the ‘Enable background error checking’ check box (Figure 4–64) and use the Error Checking button on the Formulas tab on the Ribbon to check your worksheet once you have finished creating it. It is strongly recommended that you use background formula checking or the Error Checking button on the Formulas tab on the Ribbon during the testing phase to ensure the formulas in your workbook do not violate the rules listed in Table 4–4.
To Quit Excel The following steps quit Excel.
1
Click the Close button on the right side of the title bar.
2
If Excel displays a Microsoft Office Excel dialog box, click the No button.
C6426_04_CTP.4c.indd 321
BTW
Figure 4–65
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential – proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
6/12/07 8:44:06 AM
EX 322 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
Chapter Summary In this chapter, you learned how to use names, rather than cell references, to enter formulas, use financial functions, such as the PMT and PV functions, analyze data by creating a data table and amortization schedule, set print options and print sections of a worksheet using names and the Set Print Area command, protect a worksheet or workbook, and hide and unhide rows, columns, sheets, and workbooks. The items listed below include all the new Excel skills you have learned in this chapter. 1. Add Custom Borders and a Background Color to a Range (EX 272) 2. Create Names Based on Row Titles (EX 276) 3. Enter the Loan Amount Formula Using Names (EX 279) 4. Enter the PMT Function (EX 280) 5. Create a Percent Series Using the Fill Handle (EX 286) 6. Define a Range as a Data Table (EX 288) 7. Add a Pointer to the Data Table (EX 292) 8. Enter the Formulas in the Amortization Schedule (EX 297)
9. Copy the Formulas to Fill the Amortization Schedule (EX 301) 10. Set Up a Worksheet to Print (EX 307) 11. Set the Print Area (EX 309) 12. Name and Print Sections of a Worksheet (EX 310) 13. Protect a Worksheet (EX 313) 14. Hide and Unhide a Sheet (EX 316) 15. Hide and Unhide a Workbook (EX 317) 16. Enable Background Formula Checking (EX 319)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this chapter.
C6426_04_CTP.4c.indd 322
6/12/07 8:44:09 AM
Learn It Online is a series of online student exercises that test your knowledge of chapter content and key terms. Instructions: To complete the Learn It Online exercises, start your browser, click the Address bar, and then enter the Web address scsite.com/ex2007/learn. When the Excel 2007 Learn It Online page is displayed, click the link for the exercise you want to complete and then read the instructions.
Chapter Reinforcement TF, MC, and SA A series of true/false, multiple choice, and short answer questions that test your knowledge of the chapter content.
Who Wants To Be a Computer Genius? An interactive game that challenges your knowledge of chapter content in the style of a television quiz show.
Flash Cards An interactive learning environment where you identify chapter key terms associated with displayed definitions.
Wheel of Terms An interactive game that challenges your knowledge of chapter key terms in the style of the television show Wheel of Fortune.
Practice Test A series of multiple choice questions that test your knowledge of chapter content and key terms.
Crossword Puzzle Challenge A crossword puzzle that challenges your knowledge of key terms presented in the chapter.
Excel Chapter 4
Learn It Online
STUDENT ASSIGNMENTS
Apply Your Knowledge EX 323
Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter.
Determining the Monthly Loan Payment Instructions: Start Excel. Open the workbook Apply 4–1 Monthly Loan Payment from the Data Files for Students. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Perform the following tasks. 1. Use the Create from Selection button in the Defined Names group on the Formulas tab to create names for cells in the range C4:C9 using the row titles in the range B4:B9. 2. Enter the formulas shown in Table 4–5. Table 4–5 Data Table Formulas Cell
Formula
C8
=Price – Down_Payment
C9
=– PMT(Interest_Rate/12, 12 * Years, Loan_Amount)
F4
=C9
G4
+12 * C7 * C9 + C
H4
=G4 – C4
Continued >
C6426_04_CTP.4c.indd 323
6/12/07 8:44:09 AM
EX 324 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
Apply Your Knowledge
continued
STUDENT ASSIGNMENTS
3. Use the Data Table button in the What–If Analysis gallery on the Data tab to define the range E4: H19 as a one–input data table. Use cell C6 (interest rate) as the column input cell. Format the data table so that it appears as shown in Figure 4–66.
Figure 4–66
4. Use the Page Setup dialog box to select the Fit to and Black and white options. Use the Set Print Area command to select the range B2:C9 and then use the Print command on the Office Button menu to print. Use the Clear Print Area command to clear the print area. Name the following ranges: B2:C9 – Calculator; E2:H19 – Rate_Schedule; and B1:H19 – All_Sections. Print each range by selecting the name in the Name box and using the Selection option in the Print dialog box. 5. Unlock the range C3:C7. Protect the worksheet so that the user can select only unlocked cells. 6. Press CTRL+` and print the formulas version in landscape orientation. Press CTRL+` to display the values version. 7. Hide and then unhide the Monthly Loan Payment sheet. Hide and then unhide the workbook. Unprotect the worksheet and then hide columns E through H. Print the worksheet. Select columns D and I and unhide the hidden columns. Hide rows 11 through 19. Print the worksheet. Select rows 10 and 20 and unhide rows 11 through 19. Protect the worksheet.
C6426_04_CTP.4c.indd 324
6/12/07 8:44:10 AM
9. Determine the monthly payment and print the worksheet for each data set: (a) Item = Home; Price = $310,000.00; Down Payment = $62,000.00; Interest Rate = 6.75%; Years = 20; (b) Item = Jacuzzi; Price = $19,000.00; Down Payment = $0.00; Interest Rate = 8.80%; Years = 5. You should get the following monthly payment results: (a) $1,885.70; (b) $392.57. 10. Submit the assignment as specified by your instructor.
Extend Your Knowledge Extend the skills you learned in this chapter and experiment with new skills. You may need to use Help to complete the assignment.
Excel Chapter 4
8. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Apply 4–1 Monthly Loan Payment Complete.
STUDENT ASSIGNMENTS
Extend Your Knowledge EX 325
Two–Input Data Table Instructions: Start Excel. Open the workbook Extend 4–1 401(k) Planning Sheet from the Data Files for Students. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. You have been asked to include a two–input data table (Figure 4–67) on the existing 401(k) Planning Sheet worksheet that shows the future value that results from varying the expected annual return (cell C8) and employee percent invested (cell C5). Complete the following tasks to create the two–input data table.
future value formula
row of different employee investment percentages
column of different annual return percentages
Figure 4–67
Continued >
C6426_04_CTP.4c.indd 325
6/12/07 8:44:12 AM
EX 326 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
Extend Your Knowledge
continued
STUDENT ASSIGNMENTS
1. Enter the data table title and subtitle as shown in cells I1 and I3 in Figure 4–67. Change the width of column H to 0.50 characters. Merge and center the titles over columns I through S. Format the titles as shown using the Title cell style for both the title and subtitle, a font size of 22 for the title, and a font size of 16 for the subtitle. Change the column widths of columns I through S to 11.00 characters. 2. For a two–input data table, the formula you are analyzing must be assigned to the upper–left cell in the range of the data table. Cell C14 contains the future value formula to be analyzed. Therefore, enter =C14 in cell I4. 3. Use the fill handle to create two lists of percents (a) 3.00% through 12.00%, in increments of 0.50% in the range I5:I23; and (b) 3.00% through 7.50% in increments of 0.50% in the range J4:S4. 4. Select the range I4:S23. Click the Data tab on the Ribbon and then click the What–If Analysis button on the Ribbon. Click the Data Table command on the What–If Analysis gallery. When Excel displays the Table dialog box, enter c5 (employee percent invested) in the Row input cell box and c8 (expected annual return) in the Column input cell box. Click the OK button to populate the table. 5. Format the two–input data table as shown in Figure 4–67. 6. Use conditional formatting to change the format of the cell in the two–input data table that is equal to the future value in cell C14 to white bold font on a red background. 7. Protect the worksheet so that the user can select only unlocked cells (C3:C6 and C8:C9). 8. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Change the print orientation to landscape. Print the worksheet using the Fit to option. Print the formulas version of the worksheet. 9. Save the workbook using the file name Extend 4–1 401(k) Planning Sheet Complete.
Make It Right Analyze a workbook and correct all errors and/or improve the design.
Functions, Custom Borders, Cell Names, What–If Analysis, and Protection Instructions: Start Excel. Open the workbook Make It Right 4–1 Financial Calculator. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required for this book. Correct the following design and formula problems so that the worksheet appears as shown in Figure 4–68. 1. The worksheet is protected with no unprotected cells. Unprotect the worksheet so that the worksheet can be edited. 2. Correct the Monthly Payment formula in cell C7 and the Total Interest formula in cell C8. The monthly payment should equal $2,078.97 and the total interest should equal $419,214.32. 3. Change the thick box border to a dark red thick box border. Change the thick border separating columns B and C to a dark red light border. 4. Use Goal Seek to change the down payment in cell C3 so that the monthly payment is $1,850.00 as shown in Figure 4–68. 5. Name the range B1:C9, Loan_Calculator. 6. Assign the names in column E to the adjacent cells in column F. Edit the formulas in cells F5 and F6 and change the cell references to their corresponding names.
C6426_04_CTP.4c.indd 326
6/12/07 8:44:14 AM
Excel Chapter 4 STUDENT ASSIGNMENTS
In the Lab EX 327
Figure 4–68
7. Correct the second and third arguments in the Future Value function in cell C14. Display the future value as a positive number. 8. Change the Present Value function in cell F14 so that the present value displays as a positive number. 9. Complete the one–input data table in the range B17:I19 that determines the depreciation and rate of depreciation for varying years of life (cell F4). Format the numbers in the data table so that they appear as shown in Figure 4–68. 10. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. 11. Unlock the cells containing data (C2:C3, C5:C6, F2:F4, C11:C13, F11:F13). Protect the worksheet so that the user can select only cells with data. 12. Save the workbook using the file name, Make It Right 4–1 Financial Calculator Complete, and submit the revised workbook as requested by your instructor.
In the Lab Create a workbook using the guidelines, concepts, and skills presented in this chapter. Labs are listed in order of increasing difficulty.
Lab 1: 401(k) Retirement Savings Model Problem: You have been asked by the human resources department to develop a retirement planning worksheet that will allow each current and prospective employee to see the effect (dollar accumulation) of investing a percent of his or her monthly salary over a period of years (Figure 4–69 on the next page). The plan calls for the company to match an employee’s investment, dollar for dollar, up to 3%. Thus, if an employee invests 6% of his or her annual salary, then the company matches the first 3%. If an employee invests only 2% of his or her annual salary, then the company matches the entire 2%. The human resources department wants a one–input data table to show the future value of the investment for different periods. Continued >
C6426_04_CTP.4c.indd 327
6/12/07 8:44:15 AM
EX 328 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
continued
STUDENT ASSIGNMENTS
In the Lab
Figure 4–69
Instructions: With a blank worksheet on the screen, perform the following tasks. 1. Change the font of the entire worksheet to bold and apply the Trek theme to the worksheet. Change the column widths to the following: A and D = 0.50; B = 20.00; C, F, and G = 13.00. Change the row heights to the following: 2 = 16.50; and 3 = 32.25. The height of row 1 will be adjusted automatically when a cell style is applied to the worksheet title. 2. In cell B1, enter Retirement Planning Sheet as the worksheet title. Merge and center cell B1 across columns B through G. Apply the Title cell style to cell B1, change the font size to 24 point, and change the font color to Orange, Accent 6 (column 10, row 1 in the Theme colors area on the Font Color palette). Draw a medium black border around cell B1. 3. Enter the row titles in column B, beginning in cell B3 as shown in Figure 4–69. Add the data in Table 4–6 to column C. Use the dollar and percent signs format symbols to format the numbers in the range C4:C7.
Table 4–6 401(k) Planning Sheet Employee Data Row Title
Item
Employee Name
Paul Morimoto
Annual Salary
$82,000.00
Percent Invested
6.00%
Company Match
3.00%
4. Use the Create from Selection button Annual Return 6.50% on the Formulas tab on the Ribbon Years 30 to assign the row titles in column B (range B3:B13) to the adjacent cells in column C. Use these names to enter the following formulas in the range C10:C13. Step 4e formats the displayed results of the formulas. a.
Employee Monthly Contribution (cell C10) = Annual_Salary * Percent_Invested / 12
b. Employer Monthly Contribution (cell C11) = IF(Percent_Invested < Company_Match, Percent_Invested * Annual_Salary / 12, Company_Match * Annual_Salary / 12) c.
Total Monthly Contribution (cell C12) = SUM(C10:C11)
d. Future Value (cell C13) = –FV(Annual_Return/12, 12 * Years, Total) e. If necessary, use the Format Painter button on the Home tab on the Ribbon to assign the Currency style format in cell C4 to the range C10:C13.
C6426_04_CTP.4c.indd 328
6/12/07 8:44:17 AM
The Future Value function (FV) in Step 4d returns to the cell the future value of the investment. The future value of an investment is its value at some point in the future based on a series of payments of equal amounts made over a number of periods earning a constant rate of return. 5. Add borders to the range B3:C13 as shown in Figure 4–69.
Excel Chapter 4
In the Lab EX 329
6. Use the concepts and techniques developed in this project to add the data table in Figure 4–69 to the range E3:G14 as follows. Enter and format the table column titles in row 3.
b. Use the fill handle to create the series of years beginning with 5 and ending with 50 in increments of 5 in column E, beginning in cell E5. c.
In cell F4, enter =C13 as the formula. In cell G4, enter =12 * C10 * C8 as the formula (using cell references in the formulas means Excel will copy the formats).
d. Use the Data Table command on the What–If Analysis gallery on the Data tab on the Ribbon to define the range E4:G14 as a one–input data table. Use cell C8 as the column input cell. e. Format the numbers in the range F5:G14 to the Comma style format. Underline rows 3 and 4 as shown in Figure 4–69. Add borders to the range E3:G14 as shown in Figure 4–69.
STUDENT ASSIGNMENTS
a.
7. Use the Conditional Formatting button on the Home tab on the Ribbon to add a red pointer that shows the row that equates the years in cell C8 to the Years column in the data table. Use a white font color for the pointer. Add the background color Light Yellow, Background 2 (column 3, row 1 in the Theme colors area on the Fill Color palette) as shown in Figure 4–69. 8. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. 9. Spell check and formula check the worksheet. Use Range Finder (double–click cell) to check all formulas. 10. Print the worksheet. 11. Print the formulas version of the worksheet. 12. Unlock the cells in the range C3:C8. Protect the worksheet. Allow users to select only unlocked cells. 13. Save the workbook using the file name Lab 4–1 Retirement Planning Sheet. 14. Hide and then unhide the Retirement Planning Sheet sheet. Hide and then unhide the Workbook. Unprotect the worksheet and then hide columns D through G. Print the worksheet. Select columns C and H and unhide the hidden columns. Hide rows 1 and 2. Print the worksheet. Click the Select All button and unhide rows 1 and 2. 15. Close the workbook without saving changes. Open the workbook Lab 4–1 Retirement Planning Sheet. Determine the future value for the data in Table 4–7. Print the worksheet for each data set. The following Future Value results should display in cell C13: Data Set 1 = $165,108.38; Data Set 2 = $549,735.86; and Data Set 3 = $1,241,885.59. Quit Excel without saving the workbook.
Table 4–7 Future Value Data Data Set 1
Data Set 2
Data Set 3
Employee Name
Paula Rios
Sam Vinci
Gupta Ghandi
Annual Salary
$101,000.00
$78,000.00
$41,000.00
Percent Invested
2.00%
4.5%
6%
Company Match
2.00%
3%
3%
Annual Return
6.50%
7.00%
8.5%
Years
20
30
40
16. Submit the assignment as requested by your instructor.
C6426_04_CTP.4c.indd 329
6/12/07 8:44:18 AM
EX 330 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
STUDENT ASSIGNMENTS
In the Lab Lab 2: Quarterly Income Statement and Break–Even Analysis Problem: You are a consultant to The Bean Bag Game Company. Your area of expertise is cost–volume–profit or CVP (also called break–even analysis), which investigates the relationship among a product’s expenses (cost), its volume (units sold), and the operating income (gross profit). Any money a company earns above the break–even point is called operating income, or gross profit (row 21 in the Break–Even Analysis table in Figure 4–70). You have been asked to prepare a quarterly income statement and a data table that shows revenue, expenses, and income for units sold between 40,000 and 120,000 in increments of 5,000.
Figure 4–70
Instructions: With a blank worksheet on the screen, perform the following tasks. 1. Apply the Concourse theme to the worksheet. Change the font of the entire worksheet to bold. Change the column widths to the following: A = 21.00; B= 26.00; C = 12.78; D = 0.50; E= 7.44; and F through H = 11.22. Change the heights of rows 1 and 2 to 30.00 and 19.50 respectively. Name the sheet tab Break–Even Analysis and color the tab Orange, Accent 3 (column 7, row 1 on the Tab Color palette).
C6426_04_CTP.4c.indd 330
6/12/07 8:44:19 AM
2. Enter the worksheet titles: The Bean Bag Game Company in cell A1, and Quarterly Income Statement in cell A2. Apply the Title cell style to both cells. Change the font sizes in cells A1 and A2 to 24 and 16 respectively. One at a time, merge and center cells A1 and A2 across columns A through C. Change the background color of cells A1 and A2 to Orange, Accent 3 (column 7, row 1 on the Fill Color palette). Change the font color to White, Background 1 (column 1, row 1 on the Font Color palette). Add a thick border to the range A1:A2. Table 4–8 Annual Income Data Title
Cell
Item
Units Sold
C4
55,000
Price per Unit
C5
$24.00
Administrative
C8
$131,394
Rent
C9
$52,000
Marketing
C10
$55,000
Salary and Benefits
C11
$247,000
C14
$8.00
C16
$7.00
Material Cost per Unit 4. Use the Create from Selection button on the Formulas tab on the Ribbon to Manufacturing Cost per Unit assign the row titles in column B in the range B4:B21 to the adjacent cells in column C. Use these names to enter the following formulas in column C:
a.
STUDENT ASSIGNMENTS
3. Enter the row titles in columns A and B as shown in Figure 4–70. Change the font size of the row titles in column A to 12–point and change the font color to Orange, Accent 3. Add the data shown in Table 4–8 in column C. Use the dollar sign ($) and comma (,) format symbols to format the numbers in column C as you enter them.
Excel Chapter 4
In the Lab EX 331
Total Revenue (cell C6) = Units Sold * Price per Unit (or =C4 * C5)
b. Total Fixed Expenses (cell C12) = SUM(C8:C11) c.
Total Material Cost (cell C15) = Units Sold * Material Cost per Unit (or =C4 * C14)
d. Total Manufacturing Cost (cell C17) = Units Sold * Manufacturing Cost per Unit (or =C4 * C16) e. Total Variable Expenses (cell C18) = Total Material Cost + Total Manufacturing Cost (or =C15 + C17) f.
Total Expenses (cell C20) = Total Fixed Expenses + Total Variable Expense (or =C12 + C18)
g. Operating Income (cell C21) = Total Revenue – Total Expenses (or =C6 – C20) 5. If necessary, use the Format Painter button on the Home tab on the Ribbon to assign the Currency style format in cell C8 to the unformatted dollar amounts in column C. 6. Add a thick orange bottom border to the ranges B5:C5, B11:C11, and B17:C17 as shown in Figure 4–70. 7. Use the concepts and techniques presented in this project to add the data table to the range E1:H21 as follows: a.
Add the data table titles and format them as shown in Figure 4–70.
b. Create the series in column E from 40,000 to 120,000 in increments of 5,000, beginning in cell E5. c.
Enter the formula =c6 in cell F4. Enter the formula =c20 in cell G4. Enter the formula =c21 in cell H4. If necessary, adjust the column widths.
d. Use the Data Table command in the What–If Analysis gallery on the Data tab on the Ribbon to define the range E4:H21 as a one–input data table. Use cell C4 (Units Sold) as the column input cell. e. Use the Format Cells command on the shortcut menu to format the range F5:H21 to the Comma style format with no decimal places and negative numbers in red with parentheses. Add a medium outline border and light vertical borders to the range E1:H21. Continued >
C6426_04_CTP.4c.indd 331
6/12/07 8:44:21 AM
EX 332 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
In the Lab
continued
8. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor.
STUDENT ASSIGNMENTS
9. Spell check and formula check the worksheet. Use Range Finder (double–click cell) to check all formulas. 10. Use the Page Setup Dialog Box Launcher on the Page Layout tab on the Ribbon to select the Fit to and ‘Black and white’ options. 11. Unlock the following cells: C4, C5, C14, and C16. Protect the workbook so the user can select only unlocked cells. 12. Save the workbook using the file name, Lab 4–2 The Bean Bag Game Company Quarterly Income. 13. Print the worksheet. Print the formulas version of the worksheet. 14. Determine the operating income for the data sets in Table 4–9. Print the worksheet for each data set. You should get the following Operating Income results in cell C21: Data Set 1 = $333,606; Data Set 2 = ($453,894); and Data Set 3 = $50,106. 15. Hide and then unhide the Break–Even Analysis sheet. Hide and then unhide the workbook. Unprotect the worksheet and then hide columns D through H. Print the worksheet. Select columns C and I and unhide the hidden columns. Hide rows 7 through 21. Print the worksheet. Select rows 6 and 22 and unhide rows 7 through 21. Do not save the workbook. Table 4–9 Operating Income Data Title
Cell
Data Set 1
Data Set 2
Data Set 3
Units Sold
C4
84,000
42,000
119,000
Price per Unit
C5
$19.00
$15.00
$21.00
Material Cost per Unit
C14
$4.00
$4.75
$10.00
Manufacturing Cost per Unit
C16
$5.25
$9.50
$6.50
16. Submit the assignment as specified by your instructor.
In the Lab Lab 3: Loan Analysis and Amortization Schedule Problem: The manager of eLoans Unlimited, Inc., an Internet–based lending institution, has asked you to create the loan analysis worksheet shown in Figure 4–71. She also wants you to demonstrate the goal seeking capabilities of Excel. Instructions: 1. Apply the Aspect theme to a new worksheet. Bold the entire worksheet and change all the columns to a width of 17.00. Change column A to a width of 0.41. 2. Enter the worksheet title in cell B1, apply the Title cell style, and change its font size to 24-point. Enter the worksheet subtitle in cell B2, apply the Title cell style, and change its font size to 16-point. One at a time, merge and center cells B1 and B2 across columns B through F. 3. Enter the row titles for the ranges B3:B5 and E3:E5 as shown in Figure 4–71. Use the Create from Selection button on the Formulas tab on the Ribbon to assign the row titles in the ranges B3:B5 and E3:E5 to the adjacent cells in ranges C3:C5 and F3:F5, respectively.
C6426_04_CTP.4c.indd 332
6/12/07 8:44:22 AM
Excel Chapter 4 STUDENT ASSIGNMENTS
In the Lab EX 333
Figure 4–71
4. Enter 350000 (price) in cell C3, 75000 (down payment) in cell C4, 6.50% (interest rate) in cell F3, and 30 (years) in cell F4. Determine the loan amount by entering the formula =Price — Down_Payment in cell C5. Determine the monthly payment by entering the PMT function —PMT(Rate / 12, 12 * Years, Loan_Amount) in cell F5. 5. Create the amortization schedule in the range B6:F36 by assigning the formulas and functions to the cells indicated in Table 4–10 on the next page. Use names when appropriate. The years in column B starting at cell B7 should extend from 1 to 30 years. 6. Enter the total titles in the range D37:D39 as shown in Figure 4–71. 7. Change the sheet tab name and color as shown in Figure 4–71. 8. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Continued >
C6426_04_CTP.4c.indd 333
6/12/07 8:44:22 AM
EX 334 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
In the Lab
continued
9. Spell check and formula check the worksheet. Use Range Finder (double–click cell) to check all formulas listed in Table 4–10. Table 4–10 Cell Assignments
STUDENT ASSIGNMENTS
Cell
Formula or Function
C7
=C5
D7
=IF(B7 <= $F$4, PV($F$3 / 12, 12 * ($F$4 – B7), –$F$5),0)
E7
=C7 – D7
F7
=IF(C7 > 0, 12 * $F$5 – E7, 0)
C8
=D7
E37
=SUM(E7:E36)
F37
=SUM(F7:F36)
F38
=C4
F39
=E37 + F37 + F38
10. Use the Page Setup command to select the Fit to and ‘Black and white’ options. 11. Unlock the cells in the ranges C3:C4 and F3:F4. Protect the worksheet so that users can select any cell in the worksheet, but can change only the unlocked cells. 12. Save the workbook using the file name Lab 4–3 eLoans Unlimited Loan Calculator. 13. Print the worksheet. Print the formulas version of the worksheet. 14. Use Excel’s goal seeking capabilities to determine the down payment required for the loan data in Figure 4–71 if the monthly payment is set to $1,000.00. The down payment that results for a monthly payment of $1,000.00 is $191,789.18. Print the worksheet with the new monthly payment of $1,000.00. Close the workbook without saving changes. 15. Hide and then unhide the Loan Payment Calculator sheet. Hide and then unhide the workbook. Unprotect the worksheet and then hide columns D through F. Print the worksheet. Select columns C and G and unhide the hidden columns. Hide rows 6 through 39. Print the worksheet. Select rows 5 and 40 and unhide rows 6 through 39. Do not save the workbook.
C6426_04_CTP.4c.indd 334
6/12/07 8:44:25 AM
Cases and Places Apply your creative thinking and problem solving skills to design and implement a solution.
Excel Chapter 4
Cases and Places EX 335
• EASIER •• MORE DIFFICULT You can calculate the number of units you must sell to break even (break–even point) if you know the fixed expenses, the price per unit, and the expense (cost) per unit. You have been hired by Fairview Clothing to create a data table that analyzes the break–even point for prices between $8.00 and $14.25 in increments of $0.25. The following formula determines the break–even point: Break–Even Point = Fixed Expenses / (Price per Unit – Expense per Unit) Assume Fixed Expenses = $800,000; Price per Unit = $8.50; and Expense per Unit = $4.10. Enter the data and formula into a worksheet and then create the data table. Use the Price per Unit as the input cell and the break–even value as the result. For a price per unit of $10.50, the data table should show a break–even point of 125,000 units. Protect the worksheet.
STUDENT ASSIGNMENTS
• 1: Break–Even Analysis
• 2: Salvage Value of an Asset Jack Hollinsworth, owner of Hollinsworth Bakery, recently purchased a new commercial–sized oven for his business. Jack wants a worksheet that uses the financial function SLN to show the oven’s straight–line depreciation and a formula to determine the annual rate of depreciation. Straight–line depreciation is based on an asset’s initial cost, how long it can be used (called useful life), and the price at which it eventually can be sold (called salvage value). Jack has supplied the following information: Cost = $124,857; Salvage = $30,000; Life = 8 years; and Annual Rate of Depreciation = SLN / Cost Jack is not sure what selling price the oven will bring in 8 years. Create a data table that shows straight–line depreciation and annual rate of depreciation for salvage from $25,000 to $35,000 in $500 increments. Use Excel Help to learn more about the SLN function. Protect the worksheet.
• 3: Saving for College Your friends’ dream for their one–year–old son is that one day he will attend their alma mater, Tesla University. For the next 15 years, they plan to make monthly payment deposits to a 529 College Savings plan at a local bank. The account pays 4.5% annual interest, compounded monthly. Create a worksheet for your friends that uses a financial function to show the future value (FV) of their investment and a formula to determine the percentage of the college’s tuition saved. They have supplied the following information: Out of State Annual Tuition = $40,000; Rate (per month) = 4. 5% / 12; Nper (number of monthly payments) = 15 * 12; Pmt (payment per period) = $375; and percentage of Tuition Saved = FV / Tuition for four years Your friends are not sure how much they will be able to save each month. Create a data table that shows the future value and percentage of tuition saved for monthly payments from $250 to $850, in $50 increments. Protect the worksheet.
Continued >
C6426_04_CTP.4c.indd 335
6/12/07 8:44:26 AM
EX 336 Excel Chapter 4 Financial Functions, Data Tables, and Amortization Schedules
Cases and Places
continued
• • 4 Saving for a Dream Home
STUDENT ASSIGNMENTS
Make It Personal
C6426_04_CTP.4c.indd 336
Find a home in your area that you would like to someday purchase. Based on the estimated current price of the home, determine how much money you need to save each month so that in seven years, you have enough to make a down payment of 10% of the current estimated value. Assume that you can save the money in an account that is getting a 5.75% return. Create a worksheet that determines how much you have to save each month so that in seven years the value of the account is 10% of the current estimated value. Hint: Use the FV function with a monthly savings of $400. Then use the Goal Seek command to determine the monthly savings amount. Protect the worksheet.
• • 5 Paying Off a Car Loan Working Together
Jackie Waltrip is retiring from her teaching job, but before leaving her job, she wants to settle her account with her union’s credit union. Jackie has seven years remaining on a ten–year car loan, with an interest rate of 10.25% and a monthly payment of $450.00. The credit union is willing to accept the present value (PV) of the loan as a payoff. Develop an amortization schedule that shows how much Jackie must pay at the end of each of the ten years. As a team, use Excel Help to learn more about present value. Then, design and create a worksheet that includes the beginning and ending balance, the amount paid on the principal, and the interest paid for years four through ten. Because she has paid for the three years already, determine only the ending balance (present value) for year three. Submit the worksheet and a one–page paper on one of the following topics: (1) error checking; (2) elements you can protect in a workbook; or (3) present value.
6/12/07 8:44:26 AM
Microsoft Office Excel 2007
5
Creating, Sorting, and Querying a Table
Objectives You will have mastered the material in this chapter when you can: • Create and manipulate a table • Delete sheets in a workbook • Validate data
• Sort a table on one field or multiple fields • Display automatic subtotals
• Add calculated columns to a table
• Use Group and Outline features to hide and unhide data
• Use icon sets with conditional formatting
• Query a table
• Use the VLOOKUP function to look up a value in a table • Print a table
• Apply database functions, the SUMIF function, and the COUNTIF function • Save a workbook in different file formats
• Add and delete records and change field values in a table
C6427_05_CTP.4c.indd 337
6/12/07 8:22:54 AM
Microsoft 2003 Microsoft Offi Office ce Word Excel 2007
5
Creating, Sorting, and Querying a Table Introduction A table, also called a database, is an organized collection of data. For example, a list of friends, a list of students registered for a class, a club membership roster, and an instructor’s grade book can be arranged as tables in a worksheet. In these cases, the data related to a person is called a record, and the data items that make up a record are called fields. For example, in a table of sales reps, each sales rep would have a separate record; each record might include several fields, such as name, age, hire date, state, and sales quota. A record in a table also can include fields (columns) that contain formulas and functions. A field, or column, that contains formulas or functions is called a calculated column. A calculated column displays results based on other columns in the table. A worksheet’s row-and-column structure can be used to organize and store a table. Each row of a worksheet can store a record, and each column can store a field. Additionally, a row of column headings at the top of the worksheet can store field names that identify each field. Excel’s built-in data validation features help ensure data integrity of the data entered in the table. After you enter a table onto a worksheet, you can use Excel to (1) add and delete records; (2) change the values of fields in records; (3) sort the records so Excel displays them in a different order; (4) determine subtotals for numeric fields; (5) display records that meet comparison criteria; and (6) analyze data using database functions. This chapter illustrates all six of these table capabilities.
Project — Silver Photography Accessories Sales Rep Table The project in the chapter follows proper design guidelines and uses Excel to create the worksheet shown in Figure 5–1. Silver Photography Accessories sells equipment to photography stores throughout the western United States. The company’s sales director has asked for a workbook that summarizes key information about sales reps and their performance. The data in the workbook should be easy to summarize, sort, edit, and query.
EX 338
C6427_05_CTP.4c.indd 338
6/12/07 8:23:01 AM
Microsoft Office Excel 2007
one field appears in each column
Age is one of ten fields in table
conditional formatting adds icon based on rules
column headings are field names (A8:J8)
one record appears in each row
table, also called a database
value in % of Quota field determined from formula
(a)
value in Grade field determined by VLOOOKUP function
database functions use these criteria to determine gender averages and count of reps with grade of A
database functions determine averages and count
VLOOKUP function uses table to determine entries in Grade field in column J based on % of Quota field
SUMIF and COUNTIF functions sum and count selected values
(b) Figure 5–1
EX 339
C6427_05_CTP.4c.indd 339
6/12/07 8:23:02 AM
EX 340 Excel Chapter 5 Creating, Sorting, and Querying a Table
BTW
The requirements document for the Silver Photography Accessories Sales Rep table is shown in Figure 5–2. It includes the needs, source of data, calculations, special requirements, and other facts about its development.
Excel as a Database Tool Even though Excel is not a true database management system, such as Access or Oracle, it does give you many of the same basic capabilities. For example, in Excel you can create a list; add, change, and delete data in the list; use computational fields; sort data in the list; query the list; and create forms and reports.
C6427_05_CTP.4c.indd 340
Figure 5–2
The VLOOKUP function will be used to determine the grades in column J in Figure 5–1a, based on the grade table in columns L and M in Figure 5–1b. The DAVERAGE function will be used to find the average age of female and male sales reps in the table (range O4:R5 in Figure 5–1b). The DCOUNT function will be used to count the number of sales reps that received a grade of A (range O6:R6 in Figure 5–1b). These
6/12/07 8:23:05 AM
two functions require that a criteria area (range O1:Q3) be set up to tell Excel what items to average and count. Icon sets will be used to provide a visual means of identifying grades based on a conditional formatting rule. Finally, the SUMIF and COUNTIF functions will be used to sum selectively the sales of sales reps that received a grade of A and count the number of male sales reps in the table (range O8:R9 in Figure 5–1b). Table 5–1 on the next page describes the field names, columns, types of data, and column widths to use when creating the table.
Excel Chapter 5
Project — Silver Photography Accessories Sales Rep Table EX 341
Overview As you read this chapter, you will learn how to create the worksheet shown in Figure 5–1 by performing these general tasks: • Create and format the sales rep table • Sort the sales rep table • Display subtotals by grouping the sales reps • Obtain answers to questions about the sales reps using a variety of methods to query the sales rep table • Extract records from the table based on given criteria • Save the worksheet in different file formats General Project Decisions While creating an Excel worksheet, you need to make several decisions that will determine the appearance and characteristics of the finished worksheet. As you create the worksheet required to meet the requirements shown in Figure 5–2, you should follow these general guidelines:
Plan Ahead
1. Create and format the sales rep table. The sales rep table should include the data provided in Table 5–1. The table should be formatted so that the records are easily distinguised. The data in the worksheet should start several rows from the top in order to leave room for the criteria area. Using banded rows to format the table provides greater readability. The last two columns require calculations for the % of Quota and Grade. The Grade can be obtained using Excel’s VLOOKUP function. Totals also should be added to the table for the sales reps’ average age, the sum of the sales reps’ quotas, and the sum of the sales reps’ year-to-date sales. 2. Sort the sales rep table. The user of the worksheet should be able to sort the table in a variety of manners and sort using multiple fields at the same time. Excel includes simple and advanced methods for sorting tables. 3. Display subtotals by grouping the sales reps. The user of the worksheet should be able to create subtotals of groups of sales reps after sorting the table. Excel’s grouping features provide for subtotaling. 4. Obtain answers to questions (queries) about the sales reps using a variety of methods to query the sales rep table. A query can include filters, the use of which results in the table displaying only those records that meet certain criteria. Or, a query can include a calculation based on data in the table that then is displayed in the worksheet outside of the table. 5. Extract records from the table based on given criteria. A criteria area and extract area can be created on the worksheet. The criteria area can be used to enter rules regarding which records to extract, such as all female representatives with a grade of A. The extract area can be used to store the records that meet the criteria. The column headings from the table should be used as column headings in both the criteria and extract areas of the worksheet. (continued)
C6427_05_CTP.4c.indd 341
6/12/07 8:23:07 AM
EX 342 Excel Chapter 5 Creating, Sorting, and Querying a Table
Plan Ahead
(continued) 6. Save the worksheet in different file formats. A variety of circumstances may require a worksheet to be saved in a different file format. For example, the data in a worksheet may need to be used in another program that is not capable of reading the Excel file format. The CSV (comma delimited) file format is a file format that is one of the most commonly used. In addition, using a sketch of the worksheet can help you visualize its design. The sketch of the table (Figure 5–3a) consists of the title, column headings, location of data values, and an idea of the desired formatting. The sketch does not show the criteria area above the table and the extract area below the table, which are included as requirements in the requirements document (Figure 5–2). The general layout of the grade table, criteria area, and required statistics are shown in Figure 5–3b. When necessary, more specific details concerning the above guidelines are presented at appropriate points in the chapter. The chapter also will identify the actions you perform and decisions made regarding these guidelines during the creation of the worksheet shown in Figure 5–1 on page EX 339.
(a) Table
(b) Grade Table, Criteria, and Statistics Figure 5–3
C6427_05_CTP.4c.indd 342
6/12/07 8:23:08 AM
With a good understanding of the requirements document, an understanding of the necessary decisions, and a sketch of the worksheet, the next step is to use Excel to create the worksheet.
Excel Chapter 5
Project — Silver Photography Accessories Sales Rep Table EX 343
Table 5–1 Column Information for Silver Photography Accessories Sales Rep Table Column Headings (Field Names)
Column in Worksheet
Name
A
Type of Data
Column Width
Text
16.43 11.57
Description as It Pertains to a Sales Rep
Last name and first name
Gender
B
Text
Age
C
Numeric
Hire Date
D
Date
13.14
State
E
Text
9.43
Sales Area
F
Text
14.00
Inside or outside sales
Quota
G
Numeric
13.29
Annual sales quota
YTD Sales
H
Numeric
13.29
Year-to-date sales
% of Quota
I
YTD Sales / Quota
14.57
Percent of annual quota met
Grade
J
VLOOKUP function
10.29
Grade indicates how much of quota has been met
8.29
Male or female Age in years Date hired Sales territory
If you are using a computer to step through the project in this chapter and you want your screen to match the figures in this book, you should change your computer’s resolution to 1024 ⫻ 768. For information about how to change a computer’s resolution, see page APP 21 in Appendix E. The following steps, which assume Windows is running, start Excel based on a typical installation of Microsoft Office on your computer. You may need to ask your instructor how to start Excel for your computer.
BTW
To Start Excel Starting Excel If you plan to open an existing workbook, you can start Excel and open the workbook at the same time by doubleclicking the workbook file name in Windows Explorer.
Note: If you are using Windows XP, see Appendix F for alternate steps.
1
Click the Start button on the Windows Vista taskbar to display the Start menu.
2
Click All Programs at the bottom of the left pane on the Start menu to display the All Programs list.
3
Click Microsoft Office in the All Programs list to display the Microsoft Office list.
4
Click Microsoft Office Excel 2007 to start Excel and display a blank worksheet in the Excel window.
5
If the Excel window is not maximized, click the Maximize button next to the Close button on its title bar to maximize the window.
6
If the worksheet window in Excel is not maximized, click the Maximize button next to the Close button on its title bar to maximize the worksheet window within Excel.
C6427_05_CTP.4c.indd 343
6/12/07 8:23:10 AM
EX 344 Excel Chapter 5 Creating, Sorting, and Querying a Table
To Enter the Column Headings for a Table
BTW
BTW
Plan Ahead
Setting Up a List When creating a list, leave several rows empty above the list on the worksheet to set up a criteria area for querying the list. Some spreadsheet specialists also leave several columns empty to the left of the list, beginning with column A, for additional worksheet activities. A range of blank rows or columns on the side of a list is called a moat of cells.
Merging and Centering Across a Selection You merge and center when you want to treat the range of cells over which you center as a single cell. You center across a selection when you want the selected range of cells to be independent of one another. With most workbooks, it makes little difference whether you center using one technique or the other. Thus, most spreadsheet specialists use the merge and center technique because the procedure is available as a button on the Home tab on the Ribbon.
C6427_05_CTP.4c.indd 344
Create and format the sales rep table. One way to create a table in Excel is to follow these five steps: (1) enter the column headings (field names); (2) define a range as a table using the Format as Table command; (3) format the insert row immediately below the column headings; (4) set up data validation using the Data Validation command; and (5) enter records into the table. The following pages illustrate the process of creating the Silver Photography Accessories Sales Rep table using these five steps.
The following steps change the column widths to those specified in Table 5–1, enter the table title, and enter and format the column headings. These steps also change the name of Sheet1 to Sales Rep Table, delete the unused sheets in the workbook, and save the workbook using the file name, Silver Photography Accessories Rep Table. Although Excel does not require a table title to be entered, it is a good practice to include one on the worksheet to show where the table begins. With Excel, you usually enter the table several rows below the first row in the worksheet. These blank rows later will be used as a criteria area to store criteria for use in a query. Note: The majority of tasks involved in entering and formatting the table title and column headings of a list are similar to what you have done in previous chapters. Thus, if you plan to complete this chapter on your computer and want to skip the set of steps below, open the workbook Silver Photography Accessories Sales Rep Table from the Data Files for Students.
1
Use the mouse to change the column widths as follows: A = 16.43, B = 11.57, C = 8.29, D = 13.14, E = 9.43, F = 14.00, G = 13.29, H = 13.29, I = 14.57, and J = 10.29.
2
Enter Silver Photography Accessories Sales Rep Table as the table title in cell A7.
3
Apply the Title cell style to cell A7. Click the Font Color button on the Home tab on the Ribbon and then click Red, Accent 2 (column 6, row 1) on the Font Color palette.
4
Select the range A7:H7. Right-click the selected range and then click Format Cells on the shortcut menu. When Excel displays the Format Cells dialog box, if necessary, click the Alignment tab, click the Horizontal box arrow in the Text alignment area, click Center Across Selection in the Horizontal list, and then click the OK button.
5
Enter the column headings in row 8 as shown in Figure 5–4. Center the column headings in the range B8:H8.
6
Apply the Heading 3 cell style to the range A8:H8.
7
Double-click the Sheet1 tab at the bottom of the screen. Type Sales Rep Table as the sheet name. Press the ENTER key. Right-click the tab, point to Tab Color on the shortcut menu, and then click Red, Accent 2 (column 6, row 1).
8
Click the Sheet2 tab, hold down the CTRL key, and then click the Sheet3 tab. Right-click the selected sheet tabs and then click Delete on the shortcut menu to delete the selected sheets from the workbook.
9
Update the document properties with your name and any other relevant information.
6/12/07 8:23:10 AM
10 With a USB flash drive connected to one of the computer’s USB ports, click the Save button
Q&A
on the Quick Access Toolbar. Save the workbook using the file name, Silver Photography Accessories Sales Rep Table on the USB flash drive. (Figure 5–4). When should the Center Across Selection alignment be used instead of the Merge & Center button on the Ribbon?
Excel Chapter 5
Project — Silver Photography Accessories Sales Rep Table EX 345
In Step 4, the Center Across Selection horizontal alignment was used to center the table title in row 7 horizontally across the range A7:H7. In earlier chapters, the Merge & Center button on the Home tab on the Ribbon was used to center text across a range. The major difference between the Center Across Selection horizontal alignment and the Merge & Center button is that, unlike the Merge & Center button, the Center Across Selection horizontal alignment does not merge the selected cell range into one cell.
Save button Cell Styles button
Center button
list title and column headings entered and formatted
blank rows at top of worksheet will be used to store criteria for use in a query
worksheet title centered across selection A7:H7
Figure 5–4
C6427_05_CTP.4c.indd 345
6/12/07 8:23:12 AM
EX 346 Excel Chapter 5 Creating, Sorting, and Querying a Table
To Format a Range as a Table The following steps define the range A8:H8 as a table by applying a table quick style to the range. Excel allows you to enter data in a range either before defining it as a table or after defining it as a table. This chapter uses the latter procedure because it offers additional tools that help ensure data integrity, such as data validation.
1 • Select the
Format as Table button
range A8:H8.
• Click the Format as Table button on the Home tab on the Ribbon to display the Table Style gallery (Figure 5–5).
I Experiment • Point to a number of table quick styles in the Table Style gallery to preview them on the worksheet. column headings in range A8:H8 selected
2 • Click the Table Style Medium 2 quick table style in the Table Style gallery.
Table Style Medium 2 quick table style
Table Style gallery
• When Excel displays
Q&A
the Format As Table dialog box, click the ‘My table has headers’ check box to select it (Figure 5–6).
Figure 5–5
Format As Table dialog box
Why is the range A8:H8 already selected in the Format As Table dialog box? Because the range A8:H8 was selected before clicking the Format As Table button, Excel automatically selects this range for the ‘Where is the data for your table?’ box.
C6427_05_CTP.4c.indd 346
Excel automatically selects highlighted range
My table has headers check box selected
OK button
Figure 5–6
6/12/07 8:23:14 AM
3 • Click the OK button to create a table from the selected column headings and corresponding cells in the row below it.
Table Tools contextual tab visible when table is active
Excel Chapter 5
Project — Silver Photography Accessories Sales Rep Table EX 347
arrows appear next to each column heading when table is active
• Scroll down until row 7 is at the top of the worksheet window (Figure 5–7). Q&A
Why does Excel indicate that the cells in row 9 are in the table?
dark outline surrounds table when table is active
first row in table
Excel automatically creates an empty row in the table so that you are ready to enter the first record in the table.
Figure 5–7 Other Ways 1. Select range, on Insert tab on Ribbon click Table, click OK button
To Format the First Row in an Empty Table
1
Select the range B9:H9 and then click the Center button on the Home tab on the Ribbon.
2
Right-click cell D9. Click Format Cells on the shortcut menu. When Excel displays the Format Cells dialog box, click the Number tab, click Date in the Category list, click 03/14/01 in the Type list, and then click the OK button.
3
Select the range G9:H9 and then click the Comma Style button on the Ribbon. Click the Decrease Decimal button on the Ribbon twice so columns G and H will display whole numbers.
Q&A
If the table contains no data, as in Figure 5–7, then Excel sets the format of the cells in the first row to the default associated with the table quick style chosen when the table was created. That is, if you assigned any formats to the first row before it became part of a table, then those formats are lost when the table is created. For this reason, if you create an empty table and want the records to be formatted in a different manner associated with the selected quick style, you must format the first row after you create the table, as shown in the following steps.
Why are no changes apparent on the worksheet?
2. Select range, press ALT+H+T, select quick style 3. Select range, press ALT+D, I, C
No visible changes appear on the worksheet, because the table contains no records. As records are entered into the table, the assigned formats will apply, even as more rows are added to the table.
C6427_05_CTP.4c.indd 347
6/12/07 8:23:17 AM
EX 348 Excel Chapter 5 Creating, Sorting, and Querying a Table
To Validate Data Excel has built-in data validation features to ensure that the data you enter into a cell or range of cells is within limits. For example, the cells in the Gender column in Figure 5–8 should be either an F for female or an M for male. Any entry other than M or F is invalid and should not be allowed. The following steps show how to use the Data Validation button on the Data tab on the Ribbon to ensure that Excel will accept only an entry of F or M in the Gender column.
1 • Select cell B9, the
Data Validation button
Data tab
cell in the insert row below the Gender column heading in cell B8.
• Click the Data tab on the Ribbon and then point to the Data Validation button on the Ribbon (Figure 5–8).
cell in first row below Gender column heading is active
Figure 5–8
2 • Click the Data Validation button on the Ribbon to display the Data Validation dialog box.
• When Excel displays the Data Validation dialog box, if necessary, click the Settings tab, click the Allow box arrow, and then click List in the Allow list.
• Type F,M in the Source box.
Data Validation dialog box Settings tab
Allow box with List selected
In-cell dropdown check box
• Click the In-cell dropdown check box to clear it (Figure 5–9).
Source box
Figure 5–9
C6427_05_CTP.4c.indd 348
6/12/07 8:23:18 AM
3 • Click the Error Alert tab. • If necessary, click ‘Show error alert after invalid data is entered’ to select it.
Excel Chapter 5
Project — Silver Photography Accessories Sales Rep Table EX 349
• If necessary, click the Style box arrow and then click Stop in the Style list.
• Type Gender Invalid in the
Input Message tab
Title text box.
• Type Gender code must be an F or M. in the Error message box (Figure 5–10).
Q&A
4 • Click the OK button. Why are no changes evident on the worksheet?
Error Alert tab
Show error alert after invalid data is entered check box selected
Style box indicates level of error
entry will appear as title of dialog box
error message will appear in dialog box
No immediate changes appear on the worksheet. If, however, you try to enter any value other than F or M in cell B9, Excel rejects the data and displays the Gender Invalid dialog box created in Step 3.
OK button
Figure 5–10 Other Ways
BTW
1. Press ALT+A, V, V
C6427_05_CTP.4c.indd 349
Lists To change an active list back to a normal range of cells, right-click the range, point to Table on the shortcut menu, and then click Convert to Range on the Table submenu.
6/12/07 8:23:21 AM
BTW
EX 350 Excel Chapter 5 Creating, Sorting, and Querying a Table
Validation Data validation rules can be mandatory or cautionary. If the rule is mandatory (a Stop), then Excel rejects the cell entry via a dialog box (Figure 5–11) and gives you a chance to correct it. If the rule is cautionary (a Warning), Excel displays a dialog box to warn you of the invalid entry and then gives you a chance to redo the cell entry or leave it as entered.
Data Validation Errors and Criteria The Style box in the Error Alert sheet shown in Figure 5–10 sets the level of error. Valid entries include Stop, Warning, and Information. Figure 5–11 shows the Gender Invalid dialog box that Excel displays when a user enters a value other than F or M into a cell in the Gender column in the table. The Retry button leaves the invalid value in the cell for you to change. The Cancel button removes the invalid value. Gender Invalid dialog box
error message
Cancel button removes invalid value from cell
Retry button leaves invalid value in cell
BTW
BTW
Figure 5–11 Garbage In Garbage Out (GIGO) In information processing, the phrase “garbage in, garbage out“, or GIGO (pronounced gee-go), is used to describe the output of inaccurate information that results from the input of invalid data.
Bypassing Validation Excel ignores data validation when you paste data from the Office Clipboard or use the mouse to copy by dragging.
C6427_05_CTP.4c.indd 350
Excel’s built-in data validation features are powerful and easy to use. The different data validation criteria allowed by Excel and summarized in Table 5–2 can be selected in the Allow list in the Settings sheet in the Data Validation dialog box (Figure 5–9 on page EX 348). Table 5–2 Types of Data Validation Criteria Allowed Allows
Description
Any value
Allows the user to enter anything in the cell. Any value is the default for all cells in a worksheet.
Whole number
Allows whole numbers in a specific range.
Decimal number
Allows decimal numbers in a specific range.
List
Allows the user to enter only an item from a list. Useful when working with codes, such as M for male and F for female.
Date
Allows a range of dates.
Time
Allows a range of times.
Text length
Allows a certain length of text.
Custom
Allows you to specify a formula that will validate the data entered by the user. For example, the formula <3 would require the cell entry to be less than 3.
Although this chapter validates only the values entered into the Gender column, Table 5–2 shows that you can validate, in one way or another, all of the columns in the Silver Photography Accessories Sales Rep Table. For example, you can validate the data entered in the Age column by establishing limits for a whole number between 18 and 65. Or, you can validate the data entered in the Hire Date column to ensure the user enters a date between 1960 and 2008.
6/12/07 8:23:23 AM
To Modify a Table Quick Style Before entering records in the table, the quick style that was used to create the table should be modified to make the table more readable. A bold font style with a black font color for the table’s entries makes them more readable. The following steps create a new table quick style by copying the Table Style Medium 2 quick style and then modify the new quick style to apply a bold font style and black font color to the entire table.
1 • If necessary, select cell A9 to
Excel Chapter 5
Project — Silver Photography Accessories Sales Rep Table EX 351
Format as Table button
activate the table.
• Click the Format as Table button on the Home tab on the Ribbon and then right-click the Table Style Medium 2 quick table style to display the shortcut menu (Figure 5–12). Table Style Medium 2 quick table style
Duplicate command
shortcut menu
Figure 5–12
C6427_05_CTP.4c.indd 351
6/12/07 8:23:24 AM
EX 352 Excel Chapter 5 Creating, Sorting, and Querying a Table
2 • Click Duplicate on the shortcut
Modify Table Quick Style dialog box
menu to display the Modify Table Quick Style dialog box.
• When Excel displays the Modify
Q&A
Table Quick Style dialog box, type TableStyleMedium2 – Custom in the Name text box (Figure 5–13). What elements of a table can I customize?
Whole Table table element
The Table Element list in the Modify Table Quick Style dialog box allows you to choose almost any aspect of a table to modify. You can change the formatting for each element listed in the Table Element list by clicking the element and then clicking the Format button to display the Format Cells dialog box with which you are familiar.
Format button
Figure 5–13
3 • With Whole Table selected in the Table Element list, click the Format button to display the Format Cells dialog box.
Quick Style name changed
Format Cells dialog box
• Select Bold in the Font style list. • Click the Color box arrow and then click the Black, Text 1 color (column 2, row 1) (Figure 5–14).
Bold font style selected
4 • Click the OK button to close the Format Cells dialog box.
Black, Text 1 color selected
• Click the OK button to close the Modify Table Quick Style dialog box.
• Select the range A8:H8 and then
Q&A
apply the White, Background 1 (column 1, row 1) font color to the range. Why should the color of the header row be changed to white? The white font color allows the text in the header rows to stand out against the background color of the header row.
OK button
Figure 5–14
C6427_05_CTP.4c.indd 352
6/12/07 8:23:26 AM
To Enter Records into a Table The next step is to enter the sales reps’ records into the table. As indicated earlier, the computational fields in columns I and J will be added after the data is in the table.
1 • If necessary, select
Excel Chapter 5
Project — Silver Photography Accessories Sales Rep Table EX 353
cell A9 to activate the table.
• Type sales rep information for row 9 as shown in Figure 5–15. After typing the data for a field, press the RIGHT ARROW key to move to the next field. After you type the YTD sales, press the TAB key to start a new record.
first two rows of table entered
cell A12 selected
table sizing handle
• Type sales rep
Q&A
information for Figure 5–15 row 10 as shown in Figure 5–15. After typing the data for a field, press the RIGHT ARROW key to move to the next field. After you type the YTD sales, click cell A12 to select it (Figure 5–15). Is row 10 now part of the table? Yes. Pressing the TAB key adds the next row below the table to the table. Row 10 is now part of the sales rep table.
2 • Drag the table
Q&A
sizing handle to the top of cell H12 to add another row to the table (Figure 5–16). Why does row 11 have a different background color than row 10? The quick style used to create the table includes a type of formatting called row banding. Row banding causes adjacent rows to have different formatting so that each record in the table is distinguished from surrounding rows.
C6427_05_CTP.4c.indd 353
cell A12 selected
new row added to table by dragging table sizing handle
Figure 5–16
6/12/07 8:23:28 AM
EX 354 Excel Chapter 5 Creating, Sorting, and Querying a Table
3 • Enter the sales rep record for the third sales rep as shown in Figure 5–17.
• Drag the table sizing
Q&A
handle to cell H21 to add 10 new rows to the table (Figure 5–17).
third sales rep added to table
Why were all of the rows not added to the table in Step 1? Steps 1 through 3 demonstrate three different methods of adding rows to a table. The first method can be used when you are adding a number of rows ten new rows added to the table and do to table not know how many Figure 5–17 rows you are going to add. The second method can be used when you need to add one additional row to a table that you previously created. The third method can be used when you know exactly how many rows you need in a table.
4 • Enter the remaining sales reps’ records as shown in Figure 5–18.
• Select cell A23 Q&A
(Figure 5–18). What happens if I enter an invalid Gender code?
all records entered in sales rep table
If you entered an incorrect Gender code while entering the sales reps‘ records, then Excel should have displayed the dialog box in Figure 5–11 on page EX 350. After you click the Retry or Figure 5–18 Cancel button in the error message dialog box, Excel requires you to reenter all values up to and including the value in error. Other Ways 1. Press ALT+J, T
C6427_05_CTP.4c.indd 354
6/12/07 8:23:31 AM
Adding Computational Fields to the Table The next step is to add the computational fields % of Quota in column I and Grade in column J. The first computational field involves dividing the YTD Sales in column H by the Quota in column G. The second computational field involves a table lookup to determine a grade based upon the % of Quota in column I.
Excel Chapter 5
Adding Computational Fields to the Table EX 355
To Add New Fields to a Table Adding new fields to a table in a worksheet illustrates another of Excel’s powerful table capabilities. As shown in the following steps, if you add a new column heading in a column adjacent to the current column headings in the table, then Excel automatically adds the adjacent column to the table’s range and copies the format of the table heading to the new column headings. Adding a new row to a table works in a similar manner. The first step in adding the two new fields is to enter the two column headings, or field names, in cells I8 and J8, enter the first % of Quota formula in cell I9, and then format the two cells immediately below the new column headings. The formula for the % of Quota in cell I9 is YTD Sales / Quota or =H9 / G9. After the formula is entered in cell I9, the formula is automatically copied to the range I10:I21. When you enter a formula in the first row of a field, Excel creates a calculated column. A calculated column is a column in a table in which each row uses a common formula that references other fields in the table.
1 • Select cell I8, type % of Quota, click cell J8, type Grade.
• Select cell I9, enter =h9 / g9 as the formula, and then click the Enter button on the formula bar (Figure 5–19).
new columns automatically added to table
formula is =H9/G9
Excel automatically copies formula to all rows in table in column I
Figure 5–19
C6427_05_CTP.4c.indd 355
6/12/07 8:23:33 AM
EX 356 Excel Chapter 5 Creating, Sorting, and Querying a Table
2 • Select the range I9:I21 and then click the Percent Style button on the Ribbon. Click the Increase Decimal button on the Ribbon twice.
Center button
Increase Decimal button
Percent Style button
=H9 / G9
• Click the Center button on the Ribbon to center the range I9:I21 (Figure 5–20).
• Select the range
calculated column populated automatically when formula entered in first row
A7:J7, right-click the selected range, click Format Cells on the shortcut menu, click the Alignment tab, click the Horizontal box arrow, click Center Across Selection, and then click the OK button.
two decimal places in column I
3 • Select the range
BTW
J9:J21 and then click the Center button on the Home tab on the Ribbon. Select cell J9 to deselect the range J9:J21.
Lookup Functions Lookup functions are powerful, useful, and interesting in the way they work. For additional information on lookup functions, enter vlookup in the Search box in the Excel Help window.
C6427_05_CTP.4c.indd 356
Figure 5–20
Adding a Lookup Table The entries in the % of Quota column give the user an immediate evaluation of where each sales rep’s YTD Sales stand in relation to their annual quota. Many people, however, dislike numbers as an evaluation tool. Most prefer simple letter grades, which, when used properly, can group the sales reps in the same way an instructor groups students by letter grades. Excel contains functions that allow you to assign letter grades based on a table. Excel has several lookup functions that are useful for looking up values in tables, such as tax tables, discount tables, parts tables, and grade tables. The two most widely used lookup functions are the HLOOKUP and VLOOKUP functions. Both functions look up a value in a table and return a corresponding value from the table to the cell assigned the function. The HLOOKUP function is used when the table direction is horizontal, or across the worksheet. The VLOOKUP function is used when a table direction is vertical, or down the worksheet. The VLOOKUP function is by far the most often used because most tables are vertical, as is the table in this chapter.
6/12/07 8:23:35 AM
The grading scale in this chapter (Table 5–3) is similar to one that your instructor uses to determine your letter grade. As shown in Table 5–3, any score greater than or equal to 92% equates to a letter grade of A. Scores greater than or equal to 80 and less than 92 are assigned a letter grade of B, and so on. The VLOOKUP function requires that the table indicate only the lowest score for a letter grade. Furthermore, the table entries must be in sequence from lowest score to highest score. Thus, the entries in Table 5–3 must be resequenced for use with the VLOOKUP function so they appear as shown in Table 5–4. The general form of the VLOOKUP function is: =VLOOKUP(lookup_value, table_array, col_index_num)
To Create a Lookup Table
Table 5–3 Typical Grade Table % of Quota
Grade
92% and higher
A
80% to 91%
B
70% to 79%
C
60% to 69%
D
0 to 59%
F
Table 5–4 Typical Grade Table Modified for VLOOKUP Function % of Quota
Grade
0
F
60%
D
Select column headings L and M. Point to the boundary on the right side of the column M heading above row 1 and then drag to the right until the ScreenTip indicates, Width: 11.00 (82 pixels).
2
Select cell L1 and then enter Grade Table as the table title.
3
If necessary, scroll the worksheet to the left and click cell A7 to select it. Scroll the worksheet to the right so that cell L1 is visible. Click the Format Painter button on the Ribbon and then click cell L1. Drag through cell M1 and then click the Merge & Center button on the Home tab on the Ribbon.
4
Select the range I8:J8. While holding down the CTRL key, point to the border of the range I8:J8 and drag to the range L2:M2 to copy the column headings, % of Quota and Grade.
C6427_05_CTP.4c.indd 357
BTW
70% The VLOOKUP function searches the far-left column of the table 80% array. The far-left column of the table_array contains what are called 92% the table arguments. In this example, the table arguments are made up of percentages (see Table 5–4). The VLOOKUP function uses the % of Quota value (called the lookup_value) in the record of a sales rep to search the far-left column of the table array for a particular value and then returns the corresponding table value from the column indicated by the col_index_num value. In this example, the grades are in the second or far-right column. For the VLOOKUP function to work correctly, the table arguments must be in ascending sequence, because the VLOOKUP function will return a table value based on the lookup_value being less than or equal to the table arguments. Thus, if the % of Quota value is 77.61% (fifth record in table), then the VLOOKUP function returns a grade of C, because 77.61% is greater than or equal to 70% and less than 80%. The following steps create the grade table in the range L1:M7.
1
Excel Chapter 5
Adding a Lookup Table EX 357
C B A
The VLOOKUP Function A score that is outside the range of the table causes the VLOOKUP function to return an error message (#N/A) to the cell. For example, any % of Quota score less than zero in column I of Figure 5–20 would result in the error message #N/A being assigned to the corresponding cell.
6/12/07 8:23:39 AM
EX 358 Excel Chapter 5 Creating, Sorting, and Querying a Table
5
Enter the table entries in Table 5–4 in the range L3:M7. Select the range L3:M7, click the Bold button on the Ribbon, and then click the Center button on the Ribbon. Select cell J9 to deselect the range L3:M7 (Figure 5–21).
BTW
grade table values
Sensitive Information in a List If you have a list with one or more columns of sensitive information, such as salary information, you can hide the columns by selecting them and then pressing CTRL+0. Next, password protect the worksheet. To view the hidden columns, unprotect the worksheet, select the two adjacent columns, and then press CTRL+SHIFT+RIGHT PARENTHESIS.
C6427_05_CTP.4c.indd 358
grade table values determine sales reps’ grades in column J
Figure 5–21
6/12/07 8:23:40 AM
To Use the VLOOKUP Function to Determine Letter Grades The following steps show how to use the VLOOKUP function and the grade table to determine the letter grade for each sales rep based on the sales rep’s % of Quota value. In this case, cell I9 is the lookup_value; $L$3:$M$7 is the table_array; and 2 is the col_index_num in the table_array.
Excel Chapter 5
Adding a Lookup Table EX 359
1 • With cell J9 selected,
Q&A
type =vlookup(i9, $l$3:$m$7, 2 as the cell entry (Figure 5–22). Why are absolute cell references used in the function? It is most important that you use absolute cell references ($) for the table_ array ($L$3:$M$7) in the VLOOKUP function or Excel will not adjust the cell references when it creates the calculated column in the next step. This will cause unexpected results in column J.
Enter button
VLOOKUP function
range where table is located column number of letter grades
ScreenTip shows general form of VLOOKUP function
Figure 5–22
2 • Click the Enter button to create a
Q&A
calculated column for the Grade field (Figure 5–23). What happens when the Enter button is clicked? Because the cell I9 is the first record in a table, Excel creates a calculated column in column I by copying the VLOOKUP function through row 21. As shown in Figure 5–23, any % of Quota value below 60 in column I returns a grade of F in column J. The 13th record (Lopez in row 21) receives a grade of B because its % of Quota value is 85.08%. A % of Quota value of 92% is required to move up to the next letter grade. The second record (Dillig) receives a grade of F because his % of Quota value is 49.16%, which is less than 60%.
VLOOKUP function assigned to calculated column
VLOOKUP function returned grades and all grades automatically determined in calculated column
Figure 5–23
C6427_05_CTP.4c.indd 359
6/12/07 8:23:42 AM
EX 360 Excel Chapter 5 Creating, Sorting, and Querying a Table
3 • Scroll the worksheet
Q&A
so that row 7 is the top row and then select cell A23 to show the completed sales rep table (Figure 5–24). How is the VLOOKUP function determining the grades? From column J, you can see that the VLOOKUP function is not searching for a table argument that matches the lookup_ value exactly. The VLOOKUP function table is begins the search at complete the top of the table and works downward. As soon as it finds the first table argument greater than the lookup_ value, it returns the Figure 5–24 previous table value. The letter grade of F is returned for any value greater than or equal to 0 (zero) and less than 60. A score less than 0 returns an error message (#N/A) to the cell assigned the VLOOKUP function. Other Ways 1. Click Insert Function box in formula bar, click ‘Or select a category‘ box arrow, click Lookup & Reference, click VLOOKUP in ‘Select a function‘ list 2. Click Formulas tab on Ribbon, click Lookup & Reference button, click VLOOKUP
C6427_05_CTP.4c.indd 360
6/12/07 8:23:45 AM
Guidelines for Creating a Table in Excel When you create a table in Excel, you should follow some basic guidelines, as listed in Table 5–5.
Excel Chapter 5
Conditional Formatting EX 361
Table 5–5 Guidelines for Creating a Table in Excel Table Size and Workbook Location 1. Do not enter more than one table per worksheet. 2. Maintain at least one blank row between a table and other worksheet entries. 3. A table can have a maximum of 16,384 fields and 1,048,576 records on a worksheet.
Column Headings (Field Names) 1. Place column headings (field names) in the first row of the table. 2. Do not use blank rows or rows with dashes to separate the column headings (field names) from the data. 3. Apply a different format to the column headings and the data. For example, bold the column headings and format the data below the column headings using a regular style. Most quick table styles follow these guidelines. 4. Column headings (field names) can be up to 32,767 characters in length. The column headings should be meaningful.
Contents of Table 1. Each column should have similar data. For example, Hire Date should be in the same column for all sales reps. 2. Format the data to improve readability, but do not vary the format of the data in a column.
Conditional Formatting Excel provides a variety of formatting options for visually representing the value in a cell based on its value. Conditional formatting allows you to create rules that change the formatting of a cell or range of cells based on the value of a cell. Excel includes five types of conditional formats: highlight, top and bottom rules, data bars, color scales, and icon sets. You can combine different types of formats on any cell or range. For example, based on a cells value, you can format it to include both an icon and a specific background color. You also can apply multiple conditional formatting rules to a cell or range. The Conditional Formatting Rules Manager dialog box allows you to view all of the rules for the current selection or for the entire workbook. You open the dialog box by clicking the Conditional Formatting button on the Home tab on the Ribbon and then clicking the Manage Rules command on the Conditional Formatting menu. The dialog box also allows you to view and change the order in which the rules are applied to a cell or range. You also can stop the application of subsequent rules after one rule is found to be true. For example, if the first rule specifies that a negative value in the cell results in a red background color applied to the cell, then you may not want to apply any other conditional formats to the cell. In this case, put a check mark in the Stop If True column for the rule in the Conditional Formatting Rules Manager dialog box. The project in this chapter uses an icon set as a type of conditional format. The exercises at the end of this chapter include instructions regarding the use of other types of conditional formats.
C6427_05_CTP.4c.indd 361
6/12/07 8:23:46 AM
EX 362 Excel Chapter 5 Creating, Sorting, and Querying a Table
To Add a Conditional Formatting Rule with an Icon Set The Grade field was added to the table in order to provide a visual cue to the user of the worksheet regarding each sales rep’s performance. One method to achieve a similar result is to display an icon next to the % of Quota percentage for each sales rep. Conditional formatting provides a number of icons, including icons with the appearance of traffic signals, flags, bars, and arrows. Icon sets include sets of three, four, or five icons. You use an icon set depending on how many ways you need to group your data. For example, in the case of grades for the sales reps, there are five different grades and, therefore, an icon set that includes five icons should be used. You define rules for the conditions under which each icon of the five is displayed in a cell. The following steps add a conditional format to the % of Quota field in the Sales Rep table.
1 • Select the range
Conditional Formatting button
I9:I21 and then click the Conditional Formatting button on the Home tab on the Ribbon.
New Formatting Rule dialog box
• Click New Rule on
Format all cells based on their values selected
the Conditional Formatting menu.
• When the New Formatting Rule dialog box is displayed, click the Format Style box arrow and point to Icon Sets in the list (Figure 5–25).
Format Style box arrow
Icon Sets format style
range I9:I21 selected
Figure 5–25
C6427_05_CTP.4c.indd 362
6/12/07 8:23:47 AM
2 • Click Icon Sets in the list to display the Icon area in the Edit the Rule Description area.
Excel Chapter 5
Conditional Formatting EX 363
• Click the Icon Style box arrow to display the Icon Style list and then scroll and point to 5 Arrows (Colored) in the list (Figure 5–26).
I Experiment • Click a variety of icon styles in the Icon Styles list to view the options in the Edit the Rule Description area for each option.
Icon area appears when Icon Sets format style selected
3 • Click 5 Arrows (Colored) in the list.
Icon Style box arrow
• Click the top Type box arrow and then click Number in the list.
• Change the Type to Number for the remaining Type boxes. 5 Arrows (Colored) icon style
• Type 0.92 in the first Value box, 0.8 in the second Value box, and 0.7 in the third Value box.
• Type 0.6 in the final Value box
Q&A
and then press the TAB key to complete the conditions (Figure 5–27).
Figure 5–26
Why do the numbers next to each icon change as I type? The area below the word Icon represents the current conditional formatting rule. Excel automatically updates this area as you change the conditions on the right side of the Edit the Rule Description area. Use this area as an easy-to-read status of the conditions that you are creating.
values typed as decimal fraction number
all types changed to Number
icons and associated rules listed in Icon area
OK button
Figure 5–27
C6427_05_CTP.4c.indd 363
6/12/07 8:23:49 AM
EX 364 Excel Chapter 5 Creating, Sorting, and Querying a Table
4 • Click the OK button to display icons in each row of the table in the % of Quota field.
icons appear next to % of Quota percentages based on new conditional formatting rule
• Select cell A23
Q&A
(Figure 5–28). What do the icons represent? In addition to the Grade field, the conditional formatting icons provide a visual representation of the sales reps’ progress on attaining their sales quotas. The green arrow and its direction represents a grade of A, the red arrow and its direction a grade of F, and the three different yellow arrows and their directions represent the B, C, and D levels.
Figure 5–28
Working with Tables in Excel When a table is active, the Design tab on the Ribbon provides powerful commands that allow you to alter the appearance and contents of a table quickly. This section explores the use of some of these commands, such as toggling total and header rows in a table.
C6427_05_CTP.4c.indd 364
6/12/07 8:23:51 AM
To Use the Total Row Check Box The Total Row check box on the Design tab allows you to insert a row at the bottom of the table called the total row. Within the total row, it sums the values in the far-right column of the table, if the values are numeric. If the values in the far-right column of the table are text, then Excel counts the number of records. For example, in Figure 5–30 on the next page, the 13 in cell J22 on the right side of the total row is a count of the number of sales rep records. Excel provides additional computations for the total row, as shown in the following steps.
1 • Select cell A9 to
Header Row check box
make the table active and then click the Design tab on the Ribbon (Figure 5–29).
Excel Chapter 5
Working with Tables in Excel EX 365
Design tab Banded Columns check box
Total Row check box
I Experiment • Select a variety of
cell A9 selected
combinations of check boxes in the Table Styles Options group on the Design tab on the Ribbon. When finished, make sure that the check boxes are set as shown in Figure 5–29.
Figure 5–29
C6427_05_CTP.4c.indd 365
6/12/07 8:23:53 AM
EX 366 Excel Chapter 5 Creating, Sorting, and Querying a Table
2 • Click the Total Row check box on the Ribbon to add the total row and display the record count in the far-right column of the table, column J.
Total Row check box selected
• Select cell H22. • When Excel displays an arrow on the right side of the cell, click the arrow to display a list of available statistical functions (Figure 5–30).
YTD Sales Total row arrow YTD Sales cell in Total row active
list of available statistical functions for YTD Sales Total cell
Sum function
Figure 5–30
3 • Click Sum in the list. • Select cell G22, click the arrow on the right side of the cell, and then click Sum in the list.
• Select cell C22, click the arrow on the right side of the cell, and then click Average in the list.
• Select cell A9 (Figure 5–31). average of values in Age column
sum of Quota values
sum of YTD Sales values
record counts of values in Grade column
Figure 5–31
C6427_05_CTP.4c.indd 366
6/12/07 8:23:54 AM
4 • Click the Total Row check box on the Ribbon to hide the total row (Figure 5–32).
Page Layout tab Header Row check box
Excel Chapter 5
Working with Tables in Excel EX 367
I Experiment • Click the Header
Q&A
Row, Banded Rows, and Banded Columns check boxes on the Ribbon. When finished viewing the formatting caused by checking these check boxes, uncheck the check boxes. What are banded columns? As you have learned, banded rows include alternating colors Total row hidden every other row. Similarly, banded columns provide alternating colors every other column. You also can include a different color for the first and/or last column in a table. The quick style that you choose for a Figure 5–32 table must have these colors defined in the quick style. The quick style used in this chapter does not include special formatting for the first and last columns.
C6427_05_CTP.4c.indd 367
6/12/07 8:23:57 AM
EX 368 Excel Chapter 5 Creating, Sorting, and Querying a Table
To Print the Table When a table is selected and you display the Print dialog box, an option appears that allows you to print just the contents of the active table. The following steps print the table in landscape orientation using the Fit to option.
1 • Select cell A9 to make the table active and then click the Page Layout tab on the Ribbon.
• Click the Page Setup Dialog Box Launcher to display the Page Setup dialog box.
Page Setup Dialog Box Launcher
Print dialog box
• When Excel displays the Page Setup dialog box, click Landscape in the Orientation area and then click Fit to in the Scaling area.
2 • Click the Print button to display the Print dialog box. When Excel displays the Print dialog box, click Table in the Print what area (Figure 5–33).
Table option button selected
3 • Click the OK button to print the table (Figure 5–34).
4 • Click the Page Setup Dialog Box
OK button
Launcher to display the Page Setup dialog box. Click Portrait in the Orientation area and then click Adjust to in the Scaling area.
Figure 5–33
• Click the OK button to close the Page Setup dialog box.
Figure 5–34
C6427_05_CTP.4c.indd 368
6/12/07 8:23:59 AM
BTW
Sorting a Table The data in a table is easier to work with and more meaningful if the records are arranged sequentially based on one or more fields. Arranging records in a specific sequence is called sorting. Data is in ascending sequence if it is in order from lowest to highest, earliest to most recent, or alphabetically from A to Z. For example, the records in the Silver Photography Accessories Sales Rep table were entered in no particular order. Data is in descending sequence if it is sorted from highest to lowest, most recent to earliest, or alphabetically from Z to A. The field or fields you select to sort the records are called sort keys. You can sort data in a table using one of the following techniques:
Sort Order Excel uses the following order of priority: numbers from smallest to largest positive, (space), special characters, text, (blanks). For example, the sort order is: 0 1 2 3 4 5 6 7 8 9 (space) ! “ # $ % & ( ) * ,./:;?@[\]^_`{|}~+ <=>ABCDEFGHIJK LMNOPQRSTUVW X Y Z (blanks).
Excel Chapter 5
Sorting a Table EX 369
1. Select a cell in the field on which to sort, click the Sort & Filter button on the Home tab on the Ribbon, and then click one of the sorting options on the Sort & Filter menu. 2. With the table active, click the column heading arrow in the column on which to sort and then click one of the sorting options in the table. 3. Use the Sort button on the Data tab on the Ribbon. 4. Right-click anywhere in a table and then point to Sort on the shortcut menu to display the Sort submenu.
To Sort a Table in Ascending Sequence by Name Using the Sort & Filter Button The following example shows how to sort the table in ascending sequence by name using the Sort & Filter button on the Home tab on the Ribbon.
1 • If necessary, click the Home tab on
Sort & Filter button
the Ribbon.
• Select cell A9, click the Sort &
Q&A
Filter button on the Ribbon, and then point to the Sort A to Z command on the Sort & Filter menu (Figure 5–35).
Sort A to Z command
What if the column I choose includes numeric or date data? If the column you choose includes numeric data, then the Sort & Filter menu would show the Sort Smallest to Largest and Sort Largest to Smallest commands instead of the Sort A to Z and Sort Z to A commands. If the column you choose includes date data, then the Sort & Filter menu would show the Sort Oldest to Newest and Sort Newest to Oldest commands instead of the Sort A to Z and Sort Z to A commands.
cell selected in column on which to sort
Sort & Filter menu
Figure 5–35
C6427_05_CTP.4c.indd 369
6/12/07 8:24:03 AM
EX 370 Excel Chapter 5 Creating, Sorting, and Querying a Table
2 • Click the Sort A to Z command to sort the sales rep table in ascending sequence by name (Figure 5–36).
I Experiment • Select other fields in the table and use the same procedure to sort on the fields you choose. When you are finished, select cell A9 and repeat the first task in step 2 above. records sorted in ascending sequence by name
Other Ways 1. Select field in table, on Data tab on the Ribbon click Sort A to Z button 2. Click column heading arrow of field on which to sort, click Sort A to Z
Figure 5–36
3. Right-click column to sort, point to Sort on shortcut menu, click Sort A to Z 4. Press ALT+A, A
To Sort a Table in Descending Sequence by Name Using the Sort Z to A button on the Data Tab The following steps show how to sort the records in descending sequence by name.
1
If necessary, select cell A9.
2
Click the Data tab on the Ribbon.
3
Click the Sort Z to A button on the Ribbon to sort the sales rep table in descending sequence by name (Figure 5–37).
records sorted in descending sequence by name
Figure 5–37
C6427_05_CTP.4c.indd 370
6/12/07 8:24:05 AM
To Sort a Table Using the Sort Command on a Column Heading AutoFilter Menu The following step shows how to sort the table by hire date using the Sort Ascending command on a column heading list.
1 • If necessary, click the
Excel Chapter 5
Sorting a Table EX 371
Home tab on the Ribbon.
• Click the Hire Date arrow to display the Hire Date AutoFilter menu (Figure 5–38).
not necessary to select cells in column on which to sort when using commands in a column heading
Sort Oldest to Newest command
Hire Date arrow
• Click Sort Oldest to Newest in the Hire Date AutoFilter menu to sort the table in ascending sequence by hire date.
Hire Date AutoFilter menu
Figure 5–38 Other Ways 1. Select field in table, on Data tab on Ribbon click Sort Oldest to Newest button 2. Right-click column to sort, point to Sort on shortcut menu, click Sort Oldest to Newest 3. Press ALT+A, D
C6427_05_CTP.4c.indd 371
6/12/07 8:24:08 AM
EX 372 Excel Chapter 5 Creating, Sorting, and Querying a Table
To Sort a Table on Multiple Fields Using the Custom Sort Command Excel allows you to sort on many fields in a single sort operation. You can sort on a maximum of 256 fields in a single sort operation. For instance, the sort example that follows uses the Custom Sort command on the Sort & Filter menu to sort the Silver Photography Accessories Sales Rep table by quota (column G) within gender (column B) within sales area (column F). The Sales Area and Gender fields will be sorted in ascending sequence; the Quota field will be sorted in descending sequence. The phrase, sort by quota within gender within sales area, means that the records in the table first are arranged in ascending sequence by sales area (Inside and Outside). Within sales area, the records are arranged in ascending sequence by gender (M or F). Within gender, the records are arranged in descending sequence by the sales rep’s quota. In this case, Sales Area is the major sort key (Sort by field), Gender is the intermediate sort key (first Then by field), and Quota is the minor sort key (second Then by field). Sorting a table on multiple fields is illustrated below.
1 • With a cell in the table active, click the Sort & Filter button on the Home tab on the Ribbon to display the Sort & Filter menu (Figure 5–39).
Sort & Filter button
table sorted by hire date
Custom Sort command
Figure 5–39
2 • Click the Custom Sort command on the Sort & Filter menu to display the Sort dialog box.
Sort dialog box Add Level button
Sort by box arrow
Sort On box Order box
• When Excel displays the Sort dialog box, click the Sort by box arrow to display the field names in the table (Figure 5–40).
Sales Area
Figure 5–40
C6427_05_CTP.4c.indd 372
6/12/07 8:24:09 AM
3 • Click Sales Area. If necessary, select Values in the Sort On box. If necessary, select A to Z in the Order box.
Excel Chapter 5
Sorting a Table EX 373
• Click the Add Level button.
• Click the Then by box arrow and then click Gender in the Then by list. If necessary, select Values in the Sort On box, and if necessary, select A to Z in the Order box.
Delete Level button
Largest to Smallest selected for Quota field
three sort levels added
• Click the Add Level button.
• Click the second Then by box arrow and then click Quota in the Then by list. If necessary, select Values in the Sort On box. Select Largest to Smallest in the Order box (Figure 5–41).
OK button
Figure 5–41
C6427_05_CTP.4c.indd 373
6/12/07 8:24:12 AM
EX 374 Excel Chapter 5 Creating, Sorting, and Querying a Table
4 • Click the OK button
Q&A
to sort the table by quota within gender within sales area (Figure 5–42). How are the records sorted? As shown in Figure 5–42, Excel sorts the records in ascending sequence by sales area in column F. Within each sales area, the records are in ascending sequence by gender in column B. Finally, within gender, the records are sorted in descending sequence by the quotas in column G. Remember, if you make a mistake in a sort operation, you can return the records to their original order by clicking the Undo button on the Quick Access Toolbar or by sorting the table by hire date.
within each sales area, records are in ascending sequence by gender
records are in ascending sequence by sales area
within each gender type, records are in descending sequence by quota
Figure 5–42
5 • After viewing the sorted table, click the Hire Date arrow and then click Sort Oldest to Newest in the Hire Date AutoFilter menu to sort the table into its original sequence. Other Ways 1. Click minor field column heading arrow, click Sort Z to A button on Data tab on Ribbon, click intermediate field column heading arrow, click Sort A to Z button on Data tab on Ribbon, click major field column heading arrow, click Sort A to Z button on Data tab on Ribbon 2. Press ALT+A, S
C6427_05_CTP.4c.indd 374
Displaying Automatic Subtotals in a Table Displaying automatic subtotals is a powerful tool for summarizing data in a table. To display automatic subtotals, Excel requires that you sort the table on the field on which the subtotals will be based, convert the table to a range, and then use the Subtotal button on the Data tab on the Ribbon. When Excel displays the Subtotal dialog box, you select the subtotal function you want to use. The field on which you sort prior to clicking the Subtotal button is called the control field. When the control field changes, Excel displays a subtotal for the numeric fields selected in the Subtotal dialog box. For example, if you sort on the State field and request subtotals for the Quota and YTD Sales fields, then Excel recalculates the subtotal
6/12/07 8:24:13 AM
and grand total each time the State field changes. The most common subtotal used with the Subtotals command is the SUM function, which causes Excel to display a sum each time the control field changes.
Excel Chapter 5
Displaying Automatic Subtotals in a Table EX 375
To Display Automatic Subtotals in a Table In addition to displaying subtotals, Excel also creates an outline for the table. The following steps show how to display subtotals for the Quota field and YTD Sales field by state.
1 • Click the State arrow in cell E8 and then click Sort A to Z in the State AutoFilter menu to sort the table in ascending order by State.
• With cell A9 active,
Q&A
right-click anywhere in the table and then point to the Table command on the shortcut menu to display the Table submenu (Figure 5–43).
shortcut menu
Why does the table need to be converted to a range? It is most important that you convert the table to a range before attempting to click the Subtotal button. If the table is not converted to a range, then the Subtotal button on the Data tab on the Ribbon is dimmed (not available).
Table submenu
Table command
Convert to Range command
Figure 5–43
C6427_05_CTP.4c.indd 375
6/12/07 8:24:15 AM
EX 376 Excel Chapter 5 Creating, Sorting, and Querying a Table
2 • Click the Convert to Range
Data tab
command on the Table submenu.
• When Excel displays the Microsoft Office Excel dialog box, click the Yes button to convert the table to a range.
• Click the Data tab on the Ribbon and then click the Subtotal button on the Ribbon to display the Subtotal dialog box.
Subtotal button
Subtotal dialog box displays subtotal each time State field changes
At each change in box arrow
• When Excel displays the Subtotal dialog box, click the ‘At each change in’ box arrow and then click State.
Sum function selected
• If necessary, select Sum in the Use function list.
• In the ‘Add subtotal to’ list, click Grade to clear it and then click Quota and YTD Sales to select them (Figure 5–44).
subtotals by state will be added to Quota field and YTD Sales field
new subtotals will replace any current subtotals adds Summary (grand total) below data
Figure 5–44
3 • Click the OK button
Q&A
to add subtotals to the range (Figure 5–45). What Excel changes displays table with does Excel outline make to the worksheet?
new rows contain YTD Sales by state
As shown in Figure 5–45, Excel adds eight subtotal new rows contain rows and one grand Quota subtotals total row to the by state table, including one subtotal for each different state and one Grand Total grand total row for row added to show the entire table. The grand totals names for each subFigure 5–45 total row are derived from the state names and appear in bold. Thus, the text, AZ Total, in cell E11 identifies the subtotal row that contains Quota and YTD Sales totals for Arizona. Other Ways 1. Press ALT+A, B
C6427_05_CTP.4c.indd 376
6/12/07 8:24:17 AM
To Zoom Out on a Subtotaled Table and Use the Outline Feature The following steps show how to use the Zoom Out button on the status bar to reduce the magnification of the worksheet so that the table is more readable. The steps also illustrate how to use the outline features of Excel to hide and unhide data and totals.
Excel Chapter 5
Displaying Automatic Subtotals in a Table EX 377
1 • Click the Zoom Out button on the status bar once to reduce the zoom percent to 90% (Figure 5–46).
2 • Click the row level
Q&A
symbol 2 on the left side of the window to hide all detail rows and display only the subtotal and grand total rows (Figure 5–47). How can I use the outlining features? By utilizing the outlining features of Excel, you quickly can hide and show detail rows. You can click the row level symbols to expand or collapse rows in the worksheet. Row level symbol 1, immediately below the Name box, hides all rows except the Grand Total row. Row level symbol 2 shows hides the only grand detail records total so the subtotal rows and Grand Total row row level bar appear as shown in Figure 5–47. Row level symbol 3 shows all rows.
Grand Total row Zoom Out button
Figure 5–46
row level symbols only subtotal rows and Grand Total row show when row level symbol 2 is clicked
shows all records hides all detail records
show detail symbol
hide detail symbol
Figure 5–47
C6427_05_CTP.4c.indd 377
6/12/07 8:24:20 AM
EX 378 Excel Chapter 5 Creating, Sorting, and Querying a Table
3 • Click each of the lower three show detail symbols (+) on the left side of the window to display detail records for OR, UT, and WA and change the show detail symbols to hide detail symbols (Figure 5–48).
row level symbol 3
show detail symbols change to hide detail symbols detail records that correspond to hide detail symbols
4 • Click the row level symbol 3 on the left side of the window to show all detail rows.
• Click the Zoom In
Q&A
button on the status bar once to change the zoom percent back to 100%.
show detail symbols unhide corresponding detail records
Can I group and outline without subtotals? Yes. You do not have to use the Subtotals button to outline a worksheet. You can outline a worksheet by using the Figure 5–48 Group button on the Data tab on the Ribbon. Usually, however, the Group button is useful only when you already have total lines in a worksheet. Other Ways 1. To group and outline, on Data tab on Ribbon, click Group, click Group 2. To group and outline, press ALT+A, B 3. To zoom, hold CTRL key while scrolling Intellimouse wheel towards you 4. To zoom, press ALT+W, Q, select magnification, press ENTER key 5. To zoom, click Zoom button on View tab on Ribbon, select magnification
C6427_05_CTP.4c.indd 378
6/12/07 8:24:23 AM
To Remove Automatic Subtotals from a Table The following steps show how to remove the subtotals and convert the range back to a table.
1 • Click Subtotal on the Ribbon to
Excel Chapter 5
Displaying Automatic Subtotals in a Table EX 379
display the Subtotal dialog box (Figure 5–49).
2 • Click the Remove All button. 3 • Select the range A8:J21 and then
Subtotal dialog box
click the Home tab on the Ribbon.
• Click the Format as Table button on the Ribbon and then click the Custom quick style in the Format as Table gallery.
• When Excel displays the Format As Table dialog box, click the OK button.
Remove All button
Figure 5–49 Other Ways 1. Press ALT+A, B, ALT+R
The following steps sort the Silver Photography Accessories Sales Rep table into its previous sort order, sorted in ascending sequence by hire date.
1
Select cell A9 (or any cell in the table) to make the table active.
2
Click the Hire Date arrow and then click Sort Oldest to Newest in the Hire Date AutoFilter menu to sort the table in ascending sequence by hire date.
C6427_05_CTP.4c.indd 379
BTW
To Sort a Table Using a Column Heading List Sorting Some spreadsheet specialists use the fill handle to create a series in an additional field in the list that is used only to reorder the records into their original sequence.
6/12/07 8:24:25 AM
EX 380 Excel Chapter 5 Creating, Sorting, and Querying a Table
BTW
Sort Options You can sort left to right across rows by clicking the Options button in the Sort dialog box (Figure 5–41 on page EX 373) and then clicking Sort left to right in the Orientation area. You also can click Case sensitive to sort lowercase letters before the same capital letters for an ascending sort.
Querying a Table Using AutoFilter An alternative to using a data form to find records in a table that meet comparison criteria is to use the column heading arrows. The Filter button on the Data tab on the Ribbon or the Filter command on the Sort & Filter menu on the Home tab on the Ribbon places the arrows to the right of the column headings in a table. Thus, the query technique that uses the column heading arrows is called AutoFilter. When you first create a table, Excel automatically enables AutoFilter; the column heading arrows thus appear to the right of the column headings. You can hide the arrows so they do not show by toggling one of the two commands listed above. AutoFilter displays all records that meet the criteria as a subset of the table by hiding records that do not pass the test. Clicking a column heading arrow causes Excel to display, among other commands, a list of all the items in the field (column) in an AutoFilter menu. If you deselect an item from the AutoFilter menu, Excel immediately hides records that contain the item. The item you deselect from the AutoFilter menu is called the filter criterion. If you select a filter criterion from a second column heading while the first is still active, then Excel displays a subset of the first subset. The process of filtering activity based on one or more filter criteria is called a query.
To Query a Table Using AutoFilter The following steps show how to query the Silver Photography Accessories Sales Rep table using AutoFilter, so that the table displays only those records that pass the following test: Gender = F AND Sales Area = Inside
1 • Click the Gender arrow in cell B8
Q&A
to display the Gender AutoFilter menu (Figure 5–50). What is displayed below the Text Filters command on the AutoFilter menu? The list below the Text Filters command is a list of all of the values that occur in the selected column. The top item, (Select All), indicates that all values for this field currently are displayed in the table.
clicking Gender arrow causes Excel to display Gender AutoFilter menu
Gender AutoFilter menu includes sort commands, entries in field, and other useful query commands
Figure 5–50
C6427_05_CTP.4c.indd 380
6/12/07 8:24:27 AM
2 • Click M in the Gender list to remove the check mark and cause Excel to hide all records representing males, so that only records representing females appear.
• Click the OK button. • Click the Sales Area arrow in row 8 to display the Sales Area AutoFilter menu (Figure 5–51).
row headings of selected records that passed level test are blue
filter icon indicates Gender field is being used to filter records
Excel Chapter 5
Querying a Table Using AutoFilter EX 381
Sales Area arrow
Sort by Color command Sales Area AutoFilter menu
Excel displays only records representing female sales reps; records representing male sales reps are hidden
Filter by Color command
Figure 5–51
3 • Click Outside in the Sales Area list to remove the check mark and hide all records that represent females who are not inside sales reps (Figure 5–52).
filter icons indicate fields being used to filter records
Q&A
• Click the OK button. Why are the row headings of some rows displayed in blue?
Q&A
Excel displays row headings in blue to indicate that these rows are the result of a filtering process.
Excel displays only records representing inside female sales reps
Figure 5–52
Are both filters now applied to the table? Yes. When you select a second filter criterion, Excel adds it to the first. Hence, in the previous steps, each record must pass two tests to appear as part of the final subset of the table.
C6427_05_CTP.4c.indd 381
6/12/07 8:24:28 AM
BTW
EX 382 Excel Chapter 5 Creating, Sorting, and Querying a Table
Protected Worksheets The Sort, Subtotal, and AutoFilter commands are unavailable if the worksheet or workbook is protected, unless you selected them in the ‘Allows users of this worksheet to‘ list in the Protect Sheet dialog box when you protect the worksheet or workbook.
More About AutoFilter Other important points regarding AutoFilter include the following: 1. When AutoFilter is enabled and records are hidden, Excel displays a filter icon in the table column heading arrows used to establish the filter and the row headings of the selected records in blue. 2. If the column heading arrows do not show, then you must manually enable AutoFilter by clicking the Filter command on the Sort & Filter menu on the Home tab on the Ribbon. The Filter button also is on the Data tab on the Ribbon. 3. To remove a filter criterion for a single field, select the Select All option from the column heading AutoFilter menu for that field. 4. When you create a formula in the total row of a table, the formula automatically recalculates the values even when you filter the list. For example, the results shown in the total row in Figure 5–31 on page EX 366 automatically update if you apply a filter to the table. 5. You can filter and sort a column by color or conditional formatting using the Sort by Color and Filter by Color commands on the AutoFilter menu (Figure 5–51 on the previous page).
To Show All Records in a Table The following steps illustrate how to show all records in the table following a query.
1 • With the table
Data tab
Filter button
active, click the Data tab on the Ribbon and then point to the Filter button on the Ribbon (Figure 5–53).
2 • Click the Filter button on the Ribbon to display all of the records in the table.
Other Ways 1. Press ALT+A, T 2. Click column heading arrow that includes a filter icon, click (Select All) in AutoFilter menu
C6427_05_CTP.4c.indd 382
Figure 5–53
6/12/07 8:24:31 AM
To Enter Custom Criteria Using AutoFilter One of the commands available in all AutoFilter menus is Custom Filter. The Custom Filter command option allows you to enter custom criteria, such as multiple options or ranges of numbers. The following steps show how to enter custom criteria to show records in the table that represent sales reps whose ages are between 30 and 40, inclusive; that is, they are greater than or equal to 30 and less than or equal to 40 (30 Age 40).
Excel Chapter 5
Querying a Table Using AutoFilter EX 383
1 • Click the Filter button on the Data tab on the Ribbon to display the AutoFilter arrows in the table.
Age arrow
• With the table active, click the Age arrow in cell C8 to display the Age AutoFilter menu.
Age list
• When Excel displays the AutoFilter
Numbers Filters command
menu, point to the Number Filters command and then point to Custom Filter on the shortcut menu (Figure 5–54).
Numbers Filters submenu
Custom Filter command
Figure 5–54
2 • Click Custom Filter. • When Excel displays the Custom AutoFilter dialog box, click the top-left box arrow, click ‘is greater than or equal to‘ in the list, and then type 30 in the top-right box.
• Click the bottom-left box arrow, click ‘is less than or equal to‘ in the list, and then type 40 in the bottom-right box (Figure 5–55).
Custom AutoFilter dialog box is greater than or equal to selected from list
age must be greater than or equal to 30 age must be less than or equal to 40
And option button selected information regarding wildcard characters
is less than or equal to selected from list
OK button
Figure 5–55
C6427_05_CTP.4c.indd 383
6/12/07 8:24:33 AM
EX 384 Excel Chapter 5 Creating, Sorting, and Querying a Table
3 • Click the OK
Filter button
button in the Custom AutoFilter dialog box to display records in the table that represent sales reps whose ages are between 30 and 40 inclusive (Figure 5–56).
filter icon indicates Age field used to filter records
4 • After viewing the records that meet the custom criteria, click the Filter button on the Ribbon.
I Experiment
records representing sales reps whose ages are greater than or equal to 30 AND less than or equal to 40
• Create filters on
Q&A
other fields in the table, such as Gender and State. When you are finished, click the Filter button and then repeat the steps above so that the worksheet appears as it does in Figure 5–56.
Figure 5–56
How are the And and Or option buttons used? You can click the And option button or the Or option button to select the AND or the OR operator. The AND operator indicates that both parts of the criteria must be true; the OR operator indicates that only one of the two must be true. Use the AND operator when the custom criteria is continuous over a range of values, such as (30 ≤ Age ≤ 40). Use the OR operator when the custom criteria is not continuous, such as Age less than or equal to 30 OR greater than or equal to 40 (30 ≤ Age ≥ 40).
C6427_05_CTP.4c.indd 384
6/12/07 8:24:35 AM
BTW
Using a Criteria Range on the Worksheet You can set up a criteria range on the worksheet and use it to manipulate records that pass the comparison criteria. Using a criteria range on the worksheet involves two steps: 1. Create the criteria range and name it Criteria. 2. Use the Advanced button on the Data tab on the Ribbon.
The AND and OR Operators AND means each and every one of the comparison criteria must be true. OR means only one of the comparison criteria must be true.
Excel Chapter 5
Using a Criteria Range on the Worksheet EX 385
To Create a Criteria Range on the Worksheet To set up a criteria range, first copy the column headings in the table to another area of the worksheet. If possible, copy the field names to rows above the table, in case the table is expanded downward or to the right in the future. Next, enter the comparison criteria in the row immediately below the field names you just copied to the criteria range. Then use the Name box in the formula bar to name the criteria range, Criteria. The following step shows how to create a criteria range in the range A2:J3 to find records that pass the test: Gender = F AND Age > 25 AND Grade > C A grade greater than or equal to C alphabetically means that only sales reps with grades of D and F pass the test.
1 • Click the Home tab on the Ribbon.
• Select the range A7:J8 and then click the Copy button on the Ribbon.
criteria range includes field names and comparison criteria
• Click cell A1 and
Copy button
Name box
title identifies Criteria Area
gender = F
age > 25
grade > C (D or F)
then press the ENTER key to copy the contents on the Office Clipboard to the destination area A1:J2.
• Change the title to Criteria Area in cell A1, enter F in cell B3, enter >25 in cell C3, and then enter >C in cell J3.
• Select the
Q&A
range A2:J3, click the Name box in the Figure 5–57 formula bar, type Criteria as the range name, press the ENTER key, and then click cell J4 (Figure 5–57). Must the text in the column headings in the criteria range match those in the table exactly? Yes. To ensure the column headings in the criteria range are spelled exactly the same as the column headings in the table, copy and paste the column headings in the table to the criteria range as shown in the previous set of steps.
C6427_05_CTP.4c.indd 385
6/12/07 8:24:37 AM
EX 386 Excel Chapter 5 Creating, Sorting, and Querying a Table
To Query a Table Using the Advanced Filter Dialog Box Using the Advanced Filter dialog box is similar to using the AutoFilter query technique, except that it does not filter records based on comparison criteria you select from a table. Instead, this technique uses the comparison criteria set up in a criteria range (A2:J3) on the worksheet. The following steps show how to use the Advanced Filter dialog box to query a table and show only the records that pass the test established in the criteria range in Figure 5–57 on the previous page (Gender = F AND Age > 25 AND Grade > C).
1 • Select cell A9 to activate the table.
Data tab Advanced button
• Click the Data tab on the Ribbon
Q&A
and then click the Advanced button on the Ribbon to display the Advanced Filter dialog box (Figure 5–58). What is displayed already in the Advanced Filter dialog box? In the Action area, the ‘Filter the list, in-place’ option button is selected automatically. Excel automatically selects the table (range $A$8:$J$21) in the List range box. Excel also automatically selects the criteria range ($A$2:$J$3) in the Criteria range box, because the name Criteria was assigned to the range A2:J3 earlier.
Advanced Filter dialog box
instructs Excel to display records that meet criteria in current list location on worksheet
table automatically selected because table is active
Excel automatically selects range assigned name Criteria
OK button
Figure 5–58
C6427_05_CTP.4c.indd 386
6/12/07 8:24:39 AM
2 • Click the OK button in the
Q&A
Advanced Filter dialog box to hide all records that do not meet the comparison criteria (Figure 5–59).
Excel Chapter 5
Extracting Records EX 387
What is the main difference between the AutoFilter query technique and using the Advanced Filter dialog box? Like the AutoFilter query technique, the Advanced Filter command displays a subset of the table. The primary records that meet difference between comparison criteria the two is that the Advanced Filter command allows you to create more complex comparison criteria, because the criteria range can be as many rows long as necessary, allowing for many sets of comparison criteria.
blue row headings indicate list is filtered
gender = F
age > 25
grade > C (D or F)
Figure 5–59
To Show All Records in a Table 1
Click the Filter button on the Data tab on the Ribbon.
Q&A
The following step illustrates how to show all records in the table. Why was AutoFilter turned off? When the Advanced Filter command is invoked, Excel disables the AutoFilter command, thus hiding the column heading arrows in the active table as shown in Figure 5–59. Other Ways 1. Press ALT+A, T
Extracting Records If you select the ‘Copy to another location’ option button in the Action area of the Advanced Filter dialog box (Figure 5–58), Excel copies the records that meet the comparison criteria in the criteria range to another part of the worksheet, rather than displaying them as a subset of the table. The location where the records are copied is called the extract range. Creating an extract range requires steps similar to those used to create a criteria range earlier in the chapter. Once the records that meet the comparison criteria in the criteria range are extracted (copied to the extract range), you can create a new table or manipulate the extracted records.
C6427_05_CTP.4c.indd 387
6/12/07 8:24:43 AM
EX 388 Excel Chapter 5 Creating, Sorting, and Querying a Table
To Create an Extract Range and Extract Records To create an extract range, copy the field names of the table and then paste them to an area on the worksheet, preferably well below the table range. Next, name the pasted range Extract by using the Name box in the formula bar. Finally, use the Advanced Filter dialog box to extract the records. The following steps show how to create an extract range below the Silver Photography Accessories Sales Rep table and then extract records that meet the following criteria, as entered earlier in the Criteria range: Gender = F AND Age > 25 AND Grade > C
1 • Click the Home tab
Data tab Advanced button
on the Ribbon.
• Select range A7:J8, click the Copy button on the Ribbon, select cell A25, and then press the ENTER key to copy the contents on the Office Clipboard to the destination area A25:J26.
Advanced Filter dialog box
instructs Excel to display records that meet criteria in current table location on worksheet
• Select cell A25 and
table range
then type Extract Area as the title.
criteria range
• Select the range A26:J26, type the name Extract in the Name box in the formula bar, and then press the ENTER key.
extract range
OK button
2 • Select cell A9 to activate the table and then click the Data tab on the Ribbon.
title identifies Extract Area
extract range
• Click the Advanced
Figure 5–60
button on the Ribbon to display the Advanced Filter dialog box.
• When Excel displays the Advanced Filter dialog box, click ‘Copy to another location’ in the Action area (Figure 5–60).
C6427_05_CTP.4c.indd 388
6/12/07 8:24:44 AM
3 • Click the OK button to copy any
Q&A
records that meet the comparison criteria in the criteria range from the table to the extract range (Figure 5–61).
Excel Chapter 5
Extracting Records EX 389
What happens to the rows in the extract range if I perform another advanced filter operation? Each time the Advanced Filter dialog box is used and the ‘Copy to another location’ option button is selected, Excel clears cells below the field names in the extract range. Hence, if you change the comparison criteria in the criteria range and then use the Advanced Filter dialog box a second time, Excel clears the previously extracted records before it copies a new set of records that pass the new test.
Excel copies records that meet criteria age > 25, gender = F, and grade > C to extract range
gender = F
grade > C (D or F)
age > 25
Figure 5–61 Other Ways 1. Press ALT+A, Q
As indicated earlier, when the Advanced Filter dialog box is used, Excel disables AutoFilter, thus hiding the column heading arrows in an active table. The following steps show how to enable AutoFilter.
1
Click the Filter button on the Data tab on the Ribbon to display the column heading arrows in the table.
2
Click the Home tab on the Ribbon.
C6427_05_CTP.4c.indd 389
BTW
To Enable AutoFilter Setting Up the Extract Range When setting up the extract range, all of the column headings do not have to be copied in the list to the proposed extract range. Instead, copy only those column headings you want, in any order. You also can type the column headings rather than copy them, although this method is not recommended because it increases the likelihood of misspellings or other typographical errors.
6/12/07 8:24:46 AM
EX 390 Excel Chapter 5 Creating, Sorting, and Querying a Table
More About the Criteria Range The comparison criteria in the criteria range determine the records that will pass the test when the Advanced Filter dialog box is used. This section describes examples of different comparison criteria.
A Blank Row in the Criteria Range If the criteria range contains a blank row, it means that no comparison criteria have been defined. Thus, all records in the table pass the test. For example, the blank row in the criteria range shown in Figure 5–62 means that all records will pass the test. all records will pass test because no comparison criteria defined
Figure 5–62
Using Multiple Comparison Criteria with the Same Field If the criteria range contains two or more entries below the same field name, then records that pass either comparison criterion pass the test. For example, based on the criteria range shown in Figure 5–63, all records that represent sales reps with a State value of MT or NM will pass the test.
State = MT or State = NV
BTW
Figure 5–63 The Criteria Area When you add items in multiple rows to a criteria area, you must redefine the range of the name Criteria before you use it. To redefine the name Criteria, click the Name Manager button on the Formulas tab on the Ribbon. When Excel displays the Name Manager dialog box, select Criteria in the list and then click the Delete button. Next, select the new Criteria area and name it Criteria using the Name box.
C6427_05_CTP.4c.indd 390
If an AND operator applies to the same field name (Age > 50 AND Age < 55), then you must duplicate the field name (Age) in the criteria range. That is, add the field name Age in cell K2 to the right of Grade and then adjust the range assigned to the name Criteria by using the Define Name command on the Formulas tab on the Ribbon.
Comparison Criteria in Different Rows and below Different Fields When the comparison criteria below different field names are in the same row, then records pass the test only if they pass all the comparison criteria. If the comparison criteria for the field names are in different rows, then the records must pass only one of the tests. For example, in the criteria range shown in Figure 5–64, female sales reps OR outside sales reps pass the test.
6/12/07 8:24:48 AM
Gender = F or Sales Area = Outside
Excel Chapter 5
Using Database Functions EX 391
Using Database Functions
BTW
Figure 5–64
Excel has 12 database functions that can be used to evaluate numeric data in a table. One of the functions is called the DAVERAGE function. As the name implies, the DAVERAGE function is used to find the average of numbers in a table field that pass a test. This function serves as an alternative to finding an average using the Subtotal button on the Data tab on the Ribbon. The general form of the DAVERAGE function is: =DAVERAGE(table range, “field name”, criteria range) where table range is the range of the table, field name is the name of the field in the table, and criteria range is the comparison criteria or test to pass. Another often used table function is the DCOUNT function. The DCOUNT function will count the number of numeric entries in a table field that pass a test. The general form of the DCOUNT function is:
Database Functions Database functions are useful when working with lists of data, such as the one in this chapter. Remembering the function arguments and their order within parentheses is not easy, however. Thus, it is recommended that you use the Insert Function button in the formula bar to assign a database function to your worksheet.
=DCOUNT(table range, “field name”, criteria range) where table range is the range of the table, field name is the name of the field in the table, and criteria range is the comparison criteria or test to pass.
To Use the DAVERAGE and DCOUNT Database Functions The following steps use the DAVERAGE function to find the average age of female sales reps and the average age of male sales reps in the table. The DCOUNT function is used to count the number of sales reps records that have a grade of A. The first step sets up the criteria areas that are required by these two functions.
1
Select cell O1 and then enter Criteria as the criteria area title. Select cell L1, click the Format Painter button on the Ribbon, and then click cell O1. Center the title, Criteria, across the range O1:Q1.
2
Select cell O2 and then enter Gender as the field name. Select cell P2 and enter Gender as the field name. Select cell Q2 and then enter Grade as the field name. Select cell L2. Click the Format Painter button on the Ribbon. Drag through the range O2:Q2.
3
Enter F in cell O3 as the Gender code for female sales reps. Enter M in cell P3 as the Gender code for male sales reps. Enter A in cell Q3 as the Grade value. Select M3, click the Format Painter button on the Ribbon, and then drag through the range O3:Q3.
4
Enter Average Female Age = = = = = > in cell O4. Enter Average Male Age = = = = = = => in cell O5. Enter Grade A Count = = = = = = = = = > in cell O6.
5
Select cell R4 and then enter =daverage(a8:j21, “Age”, o2:o3) as the database function.
6
Select cell R5 and then enter =daverage(a8:j21, “Age”, p2:p3) as the database function.
C6427_05_CTP.4c.indd 391
6/12/07 8:24:50 AM
EX 392 Excel Chapter 5 Creating, Sorting, and Querying a Table
7
Select cell R6 and then enter =dcount(a8:j21, “Age”, q2:q3) as the database function.
8
Select the range O4:R6 and then click the Bold button on the Ribbon.
9
Select the range R4:R5 and then click the Comma Style button on the Ribbon (Figure 5–65).
Female criterion Grade criterion Male criterion =DAVERAGE(A8: J21, “Age”, O2:O3) =DAVERAGE(A8: J21, “Age”, P2:P3) =DCOUNT(A8: J21, “Age”, Q2: Q3)
Figure 5–65
BTW
More About Using Database Functions Excel Help The best way to become familiar with Excel Help is to use it. Appendix C includes detailed information about Excel Help and exercises that will help you gain confidence in using it.
C6427_05_CTP.4c.indd 392
In Figure 5–65, the first value in the DCOUNT function, A8:J21, refers to the table range defined earlier in this chapter (range A8:J21). Instead of using the cell range, you can name the table using the Name box in the formula bar and then use the table name as the first argument in the database functions. Database is the name most often assigned to a table. If the table were named Database, then the DCOUNT function would be entered as: =DCOUNT(Database, “Age”, Q2:Q3) Excel uses the criteria range Q2:Q3 to select the records in the range Database where the Grade is A; it then counts the numeric Age field in these records to determine the number of records that pass the criteria. Excel requires that you surround the field
6/12/07 8:24:52 AM
name Age with quotation marks unless the field has been assigned a name through the Name box in the formula bar. The third value, Q2:Q3, is the criteria range for the grade count. In the case of the DCOUNT function, it is required that you select a numeric field to count even though the value of the numeric field itself is not used.
Excel Chapter 5
Using the SUMIF and COUNTIF Functions EX 393
Other database functions that are similar to the functions described in previous chapters include the DMAX, DMIN, and DSUM functions. For a complete list of the database functions available for use with a table, click the Insert Function box in the formula bar. When Excel displays the Insert Function dialog box, select Database in the ‘Or select a category’ list. The ‘Select a function’ box displays the database functions. If you click a database function name, Excel displays a description of the function above the OK button in the Insert Function dialog box.
Using the SUMIF and COUNTIF Functions The SUMIF and COUNTIF functions are useful when you want to sum values in a range or count values in a range only if they meet criteria. The range need not be a table. For example, assume you want to sum the YTD sales of the sales reps that have a grade of A. Or, assume you want to count the number of male sales reps. The first question can be answered by using the SUMIF function as follows:
BTW
Other Database Functions
Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
=SUMIF(J9:J21,”A”,H9:H21) where the first argument J9:J21 is the range containing the numbers to add, the second argument “A” is the criteria, and the third argument H9:H21 is the range containing the cells with which to compare the criteria. The second question can be answered by using the COUNTIF function as follows: =COUNTIF(B9:B21,”M”) where the first argument B9:B21 is the range containing the cells with which to compare the criteria.
To Use the SUMIF and COUNTIF Functions The following steps enter identifiers and these two functions in the range O8:R9.
1
Enter Grade A YTD Sales Sum = = = => in cell O8.
2
Enter Male Sales Rep Count = = = = => in cell O9.
3
Select cell R8 and then enter =SUMIF(j9:j21,”A”,h9:h21) as the function.
4
Select cell R9 and then enter =COUNTIF(b9:b21,”M”) as the function.
5
Select the range O8:R9 and then click the Bold button on the Ribbon.
6
Select cell R8, click the Comma Style button on the Ribbon, and then click the Decrease Decimal button on the Ribbon twice.
C6427_05_CTP.4c.indd 393
6/12/07 8:24:54 AM
7
Double-click the right border of column heading R to change the width of column R to best fit (Figure 5–66).
Q&A
EX 394 Excel Chapter 5 Creating, Sorting, and Querying a Table
Are there any differences when using these functions on a range? Yes. The COUNTIF, SUMIF, and database functions will work on any range. The difference between using these functions on a range and table is that if the function references a table, then Excel automatically adjusts the first argument as a table grows or shrinks. The same cannot be said if the function’s first argument is a range reference that is not defined as a table.
Comma Style button
Decrease Decimal button
=SUMIF(J9: J21, “A”, H9:H21)
=COUNTIF(B9: B21, “M”)
BTW
Figure 5–66
Printing To print individual sections of the worksheet, click the Name box in the formula bar, click the name of the section (Criteria or Extract) you want to print, and then click Print on the Office Button menu. When Excel displays the Print dialog box, click Selection in the Print what area and then click the Print button.
C6427_05_CTP.4c.indd 394
To Print the Worksheet and Save the Workbook The following steps print the worksheet on one page and save the workbook.
1
Select any cell outside the table.
2
Click the Page Layout tab on the Ribbon and then click the Page Setup Dialog Box Launcher to display the Page Setup dialog box.
3
Click Landscape in the Orientation area. Click Fit to in the Scaling area.
4
Click the Print button. When the Print dialog box appears, click the OK button to print the worksheet (Figure 5–67).
5
Click the Save button on the Quick Access Toolbar to save the workbook using the file name, Silver Photography Accessories Sales Rep Table.
6
Click the Page Setup Dialog Box Launcher to display the Page Setup dialog box. Click Portrait in the Orientation area and then click Adjust to in the Scaling area.
7
Click the OK button to close the Page Setup dialog box.
6/12/07 8:24:55 AM
Excel Chapter 5
Saving a Workbook in Different File Formats EX 395
Saving a Workbook in Different File Formats Excel workbooks usually are saved in a file format called Microsoft Excel Workbook. A file saved in the Microsoft Excel Workbook file format has a file extension of xlsx. A file extension, which usually is three or four characters in length, is used by Windows Vista to classify files by application. By default, you do not see the file extensions when you use the Save As or Open dialog boxes, but the file extensions are appended to the file name and separated by a period. Excel allows you to save a workbook in more than 30 different file formats, so that the data can be transferred to other applications easily. Table 5–6 summarizes the more popular file formats available in Excel via the ‘Save as type’ box in the Save As dialog box.
BTW
Figure 5–67
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential – proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
Table 5–6 Popular File Formats Available with the Save As Command in Excel
C6427_05_CTP.4c.indd 395
File Formats
Extension
Microsoft Excel Workbook
xlsx
Microsoft Excel 97 – Excel 2003 Workbook
xls
XML Spreadsheet 2003
xml
XML Data
xml
Single File Web Page
mht
Web Page
htm
Template
xltx
Text (Tab delimited)
txt
Unicode Text
txt
CSV (Comma delimited)
csv
Formatted Text (Space delimited)
prn
6/12/07 8:24:57 AM
EX 396 Excel Chapter 5 Creating, Sorting, and Querying a Table
Plan Ahead
Save the worksheet in a different file format. Often, the best way to share data in a worksheet with other applications is to save the file as a text file. The CSV file format is most the most common type of text file. When saving data to a text file, Excel will place one row from the worksheet on one line of text. In this case, each sales rep record will be represented on one line of text in the CSV file. The Grade column is not included in the range to save because it is computed using the grade table, which will not be part of the new file.
To Save a Workbook in CSV File Format The following steps show how to save the table (range A8:I21) in the Silver Photography Accessories Sales Rep Table workbook in a CSV (Comma delimited) file format so that the file can be read by most applications. In this example, the table is copied to a new workbook, saved using the CSV file format, and then displayed and printed in Notepad. Office
1 • Click the Home tab on the Ribbon. • Select the table in the range A8:I21.
Paste button
• Click the Copy button on
Button Copy button
right border of column A
the Ribbon.
• Click the Office Button and then click New on the Office Button menu.
Select All button
• When the New Workbook dialog box is displayed, click the Create button.
• With cell A1 selected in the new workbook, click the Paste button on the Ribbon.
• Click the Select All button, point to the right border of the column A heading, and double-click to set all column widths to best fit.
• Select cell A16 (Figure 5–68).
Figure 5–68
C6427_05_CTP.4c.indd 396
6/12/07 8:25:21 AM
2 • With a USB flash
Save As dialog box
Save button UDISK 2.0 (E) selected
drive connected to one of the computer’s USB ports, click the Save button on the Quick Access Toolbar. Change the file name to Silver Photography Accessories Sales Rep Table CSV (Figure 5–68).
Excel Chapter 5
Saving a Workbook in Different File Formats EX 397
Excel workbook saved earlier in chapter
new file name
3 • Click the ‘Save as
Save as type box arrow
type’ box arrow and then scroll down and point to CSV (Comma delimited) in the ‘Save as type’ list as shown in Figure 5–69.
• Click CSV (Comma delimited) in the Save as type list.
• If necessary, click
CSV (Comma delimited) selected
Computer in the Favorite Links section of the Navigation pane and then double-click UDISK 2.0 (E:) to Figure 5–69 select the USB flash drive as the new save location. Click the Save button in the Save As dialog box. Click the OK button and the Yes button in the Microsoft Office Excel dialog boxes when they appear.
Q&A
• Click the workbook Close button on the right side of the Excel title bar. Can I open the CSV file in Excel? Yes. If you open the Silver Photography Accessories Sales Rep Table CSV in Excel, it will place the fields from the CSV file in the same cells as shown in Figure 5–68, but without some of the formatting. Other Ways 1. On Office Button menu click Save As, type file name, select file type, select drive or folder, click Save button in Save As dialog box 2. Press CTRL+S, type file name, select file type, select drive or folder, click Save button in Save As dialog box
C6427_05_CTP.4c.indd 397
6/12/07 8:25:23 AM
EX 398 Excel Chapter 5 Creating, Sorting, and Querying a Table
To Use Notepad to Open and Print the CSV File The following steps show how to use Notepad to open and print the CSV file.
1 • Click the Start button on the Windows Vista taskbar to display the Start menu and then click All Programs at the bottom of the left pane on the Start menu to display the All Programs list.
• Click Accessories in the All Programs list and then click Notepad to start Notepad. • If the Notepad window is not maximized, click the Maximize button next to the Close button on its title bar, click File on the menu bar, and then click Open.
Notepad application active
2 • When the Open dialog box
column headings in row 1
appears, if necessary, click Computer in the Favorite Links section of the Navigation pane and then double-click UDISK 2.0 (E:) to select the USB flash drive as the new open location. Select All Files in the ‘Files of type’ list.
• Double-click Silver Photography
Q&A
Accessories Sales Rep Table CSV to display the file in Notepad (Figure 5–70).
commas separate field values
quotation marks surround data values containing spaces and commas
What is shown in the CSV file?
Figure 5–70 shows the contents of the Silver Photography Accessories Sales Rep Table CSV file. The column headings are on the first line, Figure 5–70 separated by commas. Each record is on a separate line. Commas separate the fields in each record; quotation marks surround any fields with data containing spaces or commas. Data saved in this format can be read by most applications, including Excel.
3 • Click File on the menu bar and then click Print.
• When the Print dialog box appears, click the Print button to print the CSV version of the Silver Photography Accessories Sales Rep table (Figure 5–71).
• Click the Close button on the right side of the Notepad title bar to quit Notepad.
C6427_05_CTP.4c.indd 398
Figure 5–71
6/12/07 8:25:25 AM
To Quit Excel The following steps quit Excel.
1
Click the Close button on the right side of the title bar.
2
If the Microsoft Office Excel dialog box is displayed, click the No button.
Excel Chapter 5
Chapter Summary EX 399
Chapter Summary In this chapter, you learned how to create, sort, and filter a table (also called a database); create subtotals; use database functions such as SUMIF and COUNTIF; and save a workbook in different file formats. The items listed below include all the new Excel skills you have learned in this chapter. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12.
13. 14.
Format a Range as a Table (EX 346) Validate Data (EX 348) Modify a Table Quick Style (EX 351) Enter Records in a Table (EX 353) Add New Fields to a Table (EX 355) Create a Lookup Table (EX 357) Use the VLOOKUP Function to Determine Letter Grades (EX 359) Add a Conditional Formatting Rule with an Icon Set (EX 362) Use the Total Row Check Box (EX 365) Print the Table (EX 368) Sort a Table in Ascending Sequence by Name Using the Sort & Filter Button (EX 369) Sort a Table in Descending Sequence by Name Using the Sort Z to A Button on the Data Tab (EX 370) Sort a Table Using the Sort Command on a Column Heading AutoFilter Menu (EX 371) Sort a Table on Multiple Fields Using the Custom Sort Command (EX 372)
15. Display Automatic Subtotals in a Table (EX 375) 16. Zoom Out on a Subtotaled Table and Use the Outline Feature (EX 377) 17. Remove Automatic Subtotals from a Table (EX 379) 18. Sort a Table Using a Column Heading List (EX 379) 19. Query a Table Using AutoFilter (EX 380) 20. Show All Records in a Table (EX 382) 21. Enter Custom Criteria Using AutoFilter (EX 383) 22. Create a Criteria Range on the Worksheet (EX 385) 23. Query a Table Using the Advanced Filter Dialog Box (EX 386) 24. Create an Extract Range and Extract Records (EX 388) 25. Use the DAVERAGE and DCOUNT Database Functions (EX 391) 26. Use the SUMIF and COUNTIF Functions (EX 393) 27. Save a Workbook in CSV File Format (EX 396) 28. Use Notepad to Open and Print the CSV File (EX 398)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this chapter.
C6427_05_CTP.4c.indd 399
6/12/07 8:25:30 AM
EX 400 Excel Chapter 5 Creating, Sorting, and Querying a Table
Learn It Online
STUDENT ASSIGNMENTS
Learn It Online is a series of online student exercises that test your knowledge of chapter content and key terms. Instructions: To complete the Learn It Online exercises, start your browser, click the Address bar, and then enter the Web address scsite.com/ex2007/learn. When the Excel 2007 Learn It Online page is displayed, click the link for the exercise you want to complete and then read the instructions.
Chapter Reinforcement TF, MC, and SA A series of true/false, multiple choice, and short answer questions that test your knowledge of the chapter content.
Who Wants To Be a Computer Genius? An interactive game that challenges your knowledge of chapter content in the style of a television quiz show.
Flash Cards An interactive learning environment where you identify chapter key terms associated with displayed definitions.
Wheel of Terms An interactive game that challenges your knowledge of chapter key terms in the style of the television show Wheel of Fortune.
Practice Test A series of multiple choice questions that test your knowledge of chapter content and key terms.
Crossword Puzzle Challenge A crossword puzzle that challenges your knowledge of key terms presented in the chapter.
Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter.
Querying a List Instructions: Assume that the figures that accompany each of the following six problems make up the criteria range for the Fritz’s Luxury Kennel Guest List shown in Figure 5–72. Fill in the comparison criteria to select records from the list to solve each of these six problems. So that you understand better what is required for this assignment, the answer is given for the first problem. You can open the workbook Apply 5-1 Fritzs Luxury Kennel Guest List from the Data Files for Students and use the Filter button to verify your answers. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book.
Figure 5–72
C6427_05_CTP.4c.indd 400
6/12/07 8:25:31 AM
1. Select records that represent female dogs who are less than 5 years old. Owner Name
Dog Name
Gender
Age
F
<5
Breed
Cage Size
Breed
Cage Size
Excel Chapter 5
Apply Your Knowledge EX 401
Owner Name
Dog Name
Gender
Age
3. Select records that represent male dogs whose owners’ last names begin with the letter A and who are greater than 5 years old. Owner Name
Dog Name
Gender
Age
Breed
STUDENT ASSIGNMENTS
2. Select records that have a breed of Beagle or Bulldog.
Cage Size
4. Select records that represent female dogs who are at least 4 years old and need a cage size of greater than 1. Owner Name
Dog Name
Gender
Age
Breed
Cage Size
5. Select records that represent male dogs who are Golden Retrievers or need a cage size of 3. Owner Name
Dog Name
Gender
Age
Breed
Cage Size
6. Select records that represent dogs who are at least 4 years old and are either the Newfoundland breed or Golden Retriever breed. Owner Name
C6427_05_CTP.4c.indd 401
Dog Name
Gender
Age
Breed
Cage Size
6/12/07 8:25:34 AM
EX 402 Excel Chapter 5 Creating, Sorting, and Querying a Table
Extend Your Knowledge
STUDENT ASSIGNMENTS
Extend the skills you learned in this chapter and experiment with new skills. You may need to use Help to complete the assignment.
More Conditional Formatting Instructions: Start Excel. Open the workbook Extend 5-1 Jensen Basketball Poles from the Data Files for Students. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. You have been asked to add conditional formatting to highlight the lowest and highest total expenses, and to add conditional formatting to show data bars for net income that is greater than zero (Figure 5–73). Complete the following tasks to add and manage conditional formatting rules in the worksheet.
Conditional Formatting Rules Manager dialog box
Stop If True check box
lowest value in range B20:F20 highest value in range B20: F20
second rule not applied if first rule’s condition is true
Figure 5–73
C6427_05_CTP.4c.indd 402
6/12/07 8:25:34 AM
2. With the range B20:F20 selected, add a second rule to the range following the procedure from Step 1. When creating the new rule, select Bottom in the ‘Format values that rank in the’ list and type 1 in the center text box. Click the Format button and then select the red color (column 2, row 7) in the Background Color area. Click the OK button in the Format Cells dialog box and then click the OK button in the New Formatting Rules dialog box. 3. With the range B20:F20 selected, click the Conditional Formatting button on the Home tab on the Ribbon and then click Manage Rules to view the rules for the range. Click the Close button in the Conditional Formatting Rules Manager dialog box.
Excel Chapter 5
1. Save the workbook using the file name, Extend 5-1 Jensen Basketball Poles Complete. Select the range B20:F20. Click the Conditional Formatting button on the Home tab on the Ribbon and then click New Rule. When Excel displays the New Formatting Rule dialog box, select ‘Format only top or bottom ranked values’ in the Select a Rule Type list. In the ‘Format values that rank in the’ area, type 1 in the center text box. Click the Format button in the Preview area. When Excel displays the Format Cells dialog box, click the Fill tab, click the green color (column 5, row 7) in the Background Color area, and then click the OK button. Click the OK button in the New Formatting Rule dialog box.
STUDENT ASSIGNMENTS
Extend Your Knowledge EX 403
4. Select the range B24:F24. Add a new conditional formatting rule to format all cells based on their values. Select the Data Bar format style. Select Red, Accent 1, Darker 25% (column 5, row 5) in the Bar Color palette and then close the New Formatting Rule dialog box. 5. With range B24:F24 selected, add a new conditional formatting rule. Select ‘Format only cells that contain’ as the rule type. Format only cells with a cell value less than zero. Do not select a format using the Format button. Make sure that the Preview area indicates that no format is set and then click the OK button to add the rule. 6. With the range B24:F24 selected, click the Conditional Formatting button on the Home tab on the Ribbon and then click Manage Rules to view the rules for the range. Click the Stop If True check box for the first rule in the dialog box to ensure that the second rule is not applied to negative values in the range (Figure 5–73). Click the OK button to close the Conditional Formatting Rules Manager dialog box. 7. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Change the print orientation to landscape. Print the worksheet using the Fit to option. Save the workbook. 8. Select the range B15:F19. Click the Conditional Formatting button on the Home tab on the Ribbon, point to Color Scales on the Conditional Formatting menu, and then click Green – Yellow – Red Color Scale in the Color Scales gallery. Print the worksheet using the Fit to option. Do not save the workbook. Submit the assignment as requested by your instructor.
C6427_05_CTP.4c.indd 403
6/12/07 8:25:37 AM
EX 404 Excel Chapter 5 Creating, Sorting, and Querying a Table
Make It Right
STUDENT ASSIGNMENTS
Analyze a workbook and correct all errors and/or improve the design.
Tables, Conditional Formatting, and Database Functions Instructions: Start Excel. Open the workbook Make It Right 5-1 Van Dyl Kitchen Accessories Sales Rep List and then save the file using the file name, Van Dyl Kitchen Accessories Sales Rep List Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students, or see your instructor for information on accessing the files required for this book. Correct the following table, conditional formatting, and database function problems so that the worksheet appears as shown in Figure 5–74.
Figure 5–74
1. Use the Table Style Options group on the Design tab on the Ribbon to make certain that the table in the worksheet includes banded rows. 2. The table does not show all of the rows because the Age field is filtered. Ensure that all rows in the table are displayed. 3. The conditional formatting for the % of Quota field uses only four icons in the rule instead of five. Change the icon style of the rule to use 5 Arrows (Colored).
C6427_05_CTP.4c.indd 404
6/12/07 8:25:38 AM
4. The values used by the conditional formatting rule to choose each arrow style are incorrect and should be based on the values listed in the grade table. Edit the conditional formatting rule so that the values in the grade table are reflected in the rules. 5. Correct the third argument in the DAVERAGE function used to calculate the average male age.
Excel Chapter 5
In the Lab EX 405
7. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. 8. Save the workbook and submit the revised workbook as requested by your instructor.
In the Lab Create a workbook using the guidelines, concepts, and skills presented in this chapter. Labs are listed in order of increasing difficulty.
STUDENT ASSIGNMENTS
6. Correct the second and third arguments in the SUMIF function used to calculate the grade A YTD sales sum.
Lab 1: Creating, Filtering, and Sorting a Table and Determining Subtotals Problem: You are employed by Whitman Publishing, a company that supplies textbooks to the college market. The national sales force is divided into districts within divisions within regions. The three regions are the Southeast region (1), Midwest region (2), and Western region (3). The director of the Accounting department has asked you to create a sales rep table (Figure 5–75), run queries against the table, generate various sorted reports, and generate subtotal information.
Figure 5–75
Continued >
C6427_05_CTP.4c.indd 405
6/12/07 8:25:40 AM
EX 406 Excel Chapter 5 Creating, Sorting, and Querying a Table
In the Lab
continued
Instructions Part 1: Create the table shown in Figure 5–75 on the previous page using the techniques learned in this chapter and following the instructions below. 1. Bold the entire worksheet.
STUDENT ASSIGNMENTS
2. Enter the table title in row 6 and apply the Title cell style. Enter and format the field names in row 7. 3. Use the Format as Table button on the Home tab on the Ribbon to create a table using data from the range A7:J7. Use Table Style Medium 3 to format the table. Format the first row below the field names and then enter the rows of data shown in rows 8 through 20 of Figure 5–75. Change the Sheet1 tab name to Whitman Publishing Sales Reps and delete Sheet2 and Sheet3. 4. With a cell in the table active, click the Design tab on the Ribbon and then click the Total Row check box in the Table Style Options group. Show the record count in the Gender column, the average age in the Age column, and sums in the Quota and Sales columns as shown in Figure 5–75. 5. Add the icon set 3 arrows (colored) using conditional formatting to the Age column (G8:G20): Age >=50; 35=
C6427_05_CTP.4c.indd 406
6/12/07 8:25:46 AM
Table 5–7 Whitman Publishing Sales Rep Table Filter Criteria Region
Div
Dist
C
3
Rep
Lname
Fname
Age
1 2
D
4
Sales
2 2
>5,000,000
5
>30
6
>40 and < 50
7
F
>50
8
1
9
1
>3,500,000
D <39
10 11 12
Quota
M
2 3
Gender
F
>4,000,000
M
>=5,500,000
All
All
>=500 All
All
All
All
All
All
All
All
STUDENT ASSIGNMENTS
Filter
Excel Chapter 5
In the Lab EX 407
Instructions Part 3: Open the workbook Lab 5-1 Whitman Publishing Sales Rep Table created in Part 1. Do not save the workbook in this part. Sort the table according to the following six sort problems. Print the table for each sort problem in landscape orientation using the Fit to option (or write down the last name in the first record for submission to your instructor). Begin problems 2 through 6 by sorting the Rep field in ascending sequence to sort the table back into its original order. 1. Sort the table in descending sequence by region. 2. Sort the table by district within division within region. All three sort keys are to be in ascending sequence. 3. Sort the table by division within region. Both sort keys are to be in descending sequence. 4. Sort the table by representative number within district within division within region. All four sort keys are to be in ascending sequence. 5. Sort the table in descending sequence by sales. 6. Sort the table by district within division within region. All three sort keys are to be in descending sequence. 7. Hide columns I and J by selecting them and pressing CTRL+0 (zero). Print the table. Select columns H and K. Press CTRL+SHIFT+RIGHT PARENTHESIS to display the hidden columns. Close the Lab 5-1 Whitman Publishing Sales Rep Table workbook without saving changes. Submit the assignment as requested by your instructor. Instructions Part 4: Open the Lab 5-1 Whitman Publishing Sales Rep Table workbook created in Part 1 and complete the following tasks. Do not save the workbook in this part. 1. Click a cell in the table to activate the table. Click the Design tab on the Ribbon and then click the Total Row check box to remove the total row. Sort the table by district within division within region. Select ascending sequence for all three sort keys. 2. Select cell A8. Right-click anywhere in the table, point to the Table command on the shortcut menu, and then click the Convert to Range command on the Table submenu. When Excel displays the Microsoft Office Excel dialog box, click the Yes button to convert the table to a range. Click the Data tab on the Ribbon and then click the Subtotal button on the Ribbon. When Excel displays the Subtotal dialog box, click the ‘At each change in’ box arrow and then click Region #. If necessary, select Sum in the Use function list. In the ‘Add subtotal to’ list, click Quota and Sales to select them and then click the OK button. Print the table. Click row level symbol 1 and print Continued >
C6427_05_CTP.4c.indd 407
6/12/07 8:25:47 AM
EX 408 Excel Chapter 5 Creating, Sorting, and Querying a Table
In the Lab
continued
STUDENT ASSIGNMENTS
the table. Click row level symbol 2 and print the table. Click row level symbol 3. Click the Subtotal button on the Ribbon and then click the Remove All button in the Subtotal dialog box to remove all subtotals. Close the workbook without saving changes. Submit the assignment as requested by your instructor. Instructions Part 5: Open the Lab 5-1 Whitman Publishing Sales Rep Table workbook created in Part 1. Copy the table (range A7:J20) to a new workbook. Save the new workbook in a CSV (Comma delimited) file format using the file name, Lab 5-1 Whitman Publishing Sales Rep Table CSV. Close the workbook. Start Notepad and open the CSV file. Print the CSV file. Close Notepad. Open the CSV file in Excel. Quit Excel. Submit the assignment as requested by your instructor.
In the Lab Lab 2: Sorting, Finding, and Advanced Filtering Problem: Computer Consultants, Inc. specializes in supplying computer consultants to companies in need of programmers. The company uses a table (Figure 5–76) that shows whether a consultant is knowledgeable in a programming language. The chief financial officer, Cheryl Riiz, has asked you to sort, query, and determine some statistics from the table. Carefully label each required printout by using the part number and step. If a step results in multiple printouts, label them a, b, c, and so on.
Figure 5–76
C6427_05_CTP.4c.indd 408
6/12/07 8:25:48 AM
Instructions Part 1: Start Excel and perform the following tasks. 1. Open the workbook Lab 5-2 Consultant Specialist Table from the Data Files for Students. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Do not save the workbook in this part.
Excel Chapter 5
In the Lab EX 409
a. Sort the records in the table into descending sequence by name. Susie Wongley should appear first in the table. Li Bhua should appear last. Print the table. Undo the sort. b. Sort the records in the table by age within gender. Select ascending sequence for the age and descending sequence for gender. Li Bhua should be the first record. Print the table. Undo the sort. c. Sort the table by Java within C++ within C# within VB. Apply sort descending for all four fields. Sort the table first on Java, then C++, then C#, and finally VB. Those who are proficient in all four programming languages will rise to the top of the table. Jorge Diaz should be the first record. Print the table. Close the workbook without saving it. Submit the assignment as requested by your instructor.
STUDENT ASSIGNMENTS
2. Complete the following tasks:
Instructions Part 2: Open the workbook Lab 5-2 Consultant Specialist Table (Figure 5–76) from the Data Files for Students. Do not save the workbook in this part. Select a cell within the table. If the column heading arrows do not appear, then click Filter on the Data tab on the Ribbon. Use the column heading arrows to find the records that meet the criteria in items 1 through 4 below. Use the Show All command on the Filter submenu before starting items 2, 3, and 4. Print the table for each problem. You should end up with the following number of records for items 1 through 4: item 1 should have 6; item 2 should have 3; item 3 should have 3; and item 4 should have 7. Close the workbook without saving the changes. Submit the assignment as requested by your instructor. 1. Find all records that represent employees who are male and are proficient in Java. 2. Find all records that represent employees with more than 9 years of experience (Yrs) and who are certified in VB and HTML. 3. Find all records that represent female employees who are at least 30 years old and are proficient in COBOL. 4. Find all records that represent employees who have at least 5 years of experience (Yrs) and who are proficient in VBA and HTML. Instructions Part 3: Open the workbook Lab 5-2 Consultant Specialist Table from the Data Files for Students and then save the workbook using the file name, Lab 5-2 Consultant Specialist Table Final. Perform the following tasks:. 1. Add a criteria range by copying the table title and field names (range A9:M10) to the range A1:M2 (Figure 5–77). Change cell A1 to Criteria Area and then color the title area as shown in Figure 5–77. Use the Name box in the formula bar to name the criteria range (A2:M3) Criteria.
Figure 5–77 Continued >
C6427_05_CTP.4c.indd 409
6/12/07 8:25:50 AM
EX 410 Excel Chapter 5 Creating, Sorting, and Querying a Table
In the Lab
continued
STUDENT ASSIGNMENTS
2. Add an extract range by copying the table title and field names (range A9:M10) to the range A35:M36 (Figure 5–78). Change cell A35 to Extract Area and then color the title area as shown in Figure 5–78. Use the Name box in the formula bar to name the extract range (range A36:M36) Extract.
Figure 5–78
3. With the table active, use the Advanced button on the Data tab on the Ribbon to extract records that pass the tests listed below in a through d. Print the entire worksheet using landscape orientation and the Fit to option for each extract. a. Extract the records that represent employees who are male and older than 30 (Figure 5–77 on the previous page). You should extract seven records (Figure 5–78). b. Extract the records that represent female employees who are proficient in Java, but not in RPG. You should extract two records. c. Extract the records that represent male employees who are at least 35 years old and are proficient in at least four programming languages. The field Count in column M uses the COUNTIF function to count the number of Ys in a record. A count of 4 means the record represents a specialist with expertise in four areas. You should extract two records. d. Extract the records that represent employees who are proficient in three programming languages or fewer. You should extract 4 records. 4. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook using the file name, Lab 5-2 Consultant Specialist Table Final. Close the workbook. Submit the assignment as requested by your instructor.
C6427_05_CTP.4c.indd 410
6/12/07 8:25:52 AM
2. Use the database function DAVERAGE and the appropriate criteria in the range O2:Q3 to determine the average age of the males and females in the range. Use the table function DCOUNT and the appropriate criteria in the range O2:Q3 to determine the record count of those who are proficient in HTML. The DCOUNT function requires that you choose a numeric field in the table to count, such as Age. 3. Use the SUMIF function to determine the Java Y Sum Count in cell R9. That is, sum the Count field for all records containing a Y in the Java column. Use the COUNTIF function to determine the HTML N Count in cell R10. 4. Print the worksheet in landscape orientation using the Fit to option. Save the workbook using the file name, Lab 5-2 Consultant Specialist Table Final. Submit the assignment as requested by your instructor.
Excel Chapter 5
Instructions Part 4: Open the workbook Lab 5-2 Consultant Specialist Table Final created in Part 3. If you did not complete Part 3, then open Lab 5-2 Consultant Specialist Table from the Data Files for Students. Perform the following tasks: 1. Scroll to the right to display cell G1 in the upper-left corner of the window. Enter the criteria in the range O1:Q3 as shown in Figure 5–79. Enter the row titles in cells O5:O10 as shown in Figure 5–79.
STUDENT ASSIGNMENTS
In the Lab EX 411
Figure 5–79
C6427_05_CTP.4c.indd 411
6/12/07 8:25:54 AM
EX 412 Excel Chapter 5 Creating, Sorting, and Querying a Table
STUDENT ASSIGNMENTS
In the Lab Lab 3: Creating a Table with a Lookup Function Problem: You are a member of the Do-Gooders’ Student Club, a club for young adults interested in helping the less fortunate. The president has asked for a volunteer to create a table of the club’s members (Figure 5–80). You decide it is a great opportunity to show your Excel skills. Besides including a member’s GPA in the table, the president also would like a GPA letter grade assigned to each member based on the GPA value in column G. Instructions Part 1: Perform the following tasks to create the table shown in the range A7:H17 in Figure 5–80. 1. Bold the entire worksheet. Create the table shown in Figure 5–80 using the techniques learned in this chapter. Assign appropriate formats to row 8, the row immediately below the field names. Rename the Sheet1 tab and delete Sheet2 and Sheet3. 2. Enter the data shown in the range A8:G17. 3. Enter the Grade table in the range J6:K20. In cell H8, enter the function =vlookup(g8, $j$8:$k$20, 2) to determine the letter grade that corresponds to the GPA in cell G8. Copy the function in cell H8 to the range H9:H17.
Figure 5–80
C6427_05_CTP.4c.indd 412
6/12/07 8:25:55 AM
4. Select the Total Row option on the Design tab on the Ribbon to determine the maximum age, the pledge amount, and the record count in the Grade column in row 18. 5. Enter the total row headings in the range A20:A23. Use the SUMIF and COUNTIF functions to determine the totals in the range C20:C23.
Excel Chapter 5
In the Lab EX 413
7. Save the workbook using the file name, Lab 5-3 Do-Gooders’ Student Club Table. Print the worksheet in landscape orientation. At the bottom of the printout, explain why the dollar signs ($) are necessary in the VLOOKUP function in Step 3. Submit the assignment as requested by your instructor. Instructions Part 2: Open the workbook Lab 5-3 Do-Gooders’ Student Club Table. Do not save the workbook in this part. Sort the table as follows. Print the table after each sort. After completing the third sort, close the workbook without saving the changes. 1. Sort the table in ascending sequence by the Pledge Amount.
STUDENT ASSIGNMENTS
6. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor.
2. Sort the table by GPA within Gender. Use descending sequence for both fields. 3. Sort the table by Age within Gender. Use ascending sequence for both fields. Instructions Part 3: Open the workbook Lab 5-3 Do-Gooders’ Student Club Table and then save the file using the file name, Lab 5-3 Do Gooders’ Student Club Table Final. Use the concepts and techniques presented in this chapter to set up a Criteria area above the table, set up an Extract area below the Grade table, and complete the following extractions. Extract the records that meet the following three criteria sets and print the worksheet for each: 1. Gender =F; GPA > 3.50 (Three records pass the test.) 2. Age > 23 (Four records pass the test.) 3. Gender = M; Age < 21 (Two records pass the test.) Extract the records that meet the following criteria: 21 < Age < 25. It is necessary that you add a second field called Age to the immediate right of the Criteria range, delete the name Criteria, and then define the Criteria range to include the new field. Four records pass the final test. Select a cell outside the table and print the workbook in landscape orientation. Save the workbook with the last criteria range. Submit the assignment as requested by your instructor.
C6427_05_CTP.4c.indd 413
6/12/07 8:25:57 AM
EX 414 Excel Chapter 5 Creating, Sorting, and Querying a Table
Cases and Places Apply your creative thinking and problem solving skills to design and implement a solution.
STUDENT ASSIGNMENTS
• EASIER •• MORE DIFFICULT • 1: Inventory Level Priority Create an inventory table from the data in Table 5–8. Also include an Amount field and a Priority field. Both are calculated columns. Amount equals Inventory times Price. Create a Priority Code table in the range I1:J6 using the data shown in Table 5–9. Use the VLOOKUP function to determine the priority to assign to each record. Add the total row to the table. Print the worksheet in landscape orientation using the Fit to option. Save the workbook. Table 5–8 Educational Percussion, Inc. Inventory List
Table 5–9 Priority Codes
Item number
Description
Inventory
B60338
Bar Chime
Inventory Price 619
Priority
14.25
0
1 2
M44910
Maraca
873
9.50
250
C71610
Castanet
579
17.60
400
3 4 5
S80787
Shekere
537
22.50
600
T36275
Tambourine
764
12.45
800
T74695
Triangle
208
8.30
W59366
Woodblock
268
7.95
C24890
Clave
385
13.80
C87343
Cabasa
387
14.05
W15840
Whistle
699
6.85
C49955
Cowbell
237
18.25
• 2: Conditional Formatting and Sorting a Table Open the table created in Cases and Places Exercise 1. Add conditional formatting to the Priority field using the Icon Sets format style and the 5 Ratings icon style. Complete the following three sorts, print each sorted version of the table, and then undo the sorts in preparation for the next sort: (a) sort the table in ascending sequence (smallest to largest) by inventory, (b) sort the table by amount (ascending) within priority code (descending), and (c) sort the table in descending sequence by priority code. With the table sorted by priority, toggle off the total row, convert the table to a range, and then use the Subtotal button on the Data tab on the Ribbon to determine subtotals for each priority code. Print the table with the subtotals. Save the workbook with the subtotals.
• 3: Filtering a Table and Multiple Conditional Formats Open the table created in Cases and Places Exercise 1. Add a second conditional format to the priority code field using a Data Bar format style and a Bar color of your choice. If necessary remove the subtotals and then convert the range back to a table. Filter (query) the table using the column heading arrows. Make sure you show all records before each query. Print the table for each of the following queries: (1) priority code equal to 2, (2) inventory greater than 250 and less than 600, (3) priority code equals 1 and inventory greater than 30, and (4) price greater than 9.00. The number of records that show in the queries are: (1) 3, (2) 5, (3) 2, and (4) 8.
C6427_05_CTP.4c.indd 414
6/12/07 8:25:58 AM
Make It Personal
Gather information about companies at which you may want to work in your next job. Obtain information for at least ten companies in five different states. Include company name, state, city, miles from your current residence, and assign a rating for each company between 1 and 4, with 4 being the most preferred. Add a conditional format using the Data Bar format style, edit the formatting rule to show only bars, and change the width of the column to at least 20 characters. Complete the following sorts, print each sorted version of the table, and then undo the sorts in preparation for the next sort: (a) alphabetically (A to Z) by state, and (b) descending (smallest to largest) by miles from home. Filter the list for records with a preference greater than 2. Print the table and then show all of the records. Group the records by state, using the Average function in the Use function list in the Subtotal dialog box. Print the worksheet.
•• 5: Creating a Table of Students Working Together
Have your group design a table that includes a row for each student. The table should contain the following information: (1) last initial and first initial, (2) gender, (3) age, (4) college start date, (5) resident state, (6) major, (7) credit hours required for degree, (8) credit hours towards degree, (9) percent of degree completed (computational field), (10) anticipated graduation year, and (11) letter grade based on GPA (1 = D, 2 = C, 3 = B, and 4 = A). Use the concepts and techniques introduced in this chapter to design and create a table from the data collected along with a grade field that corresponds to the GPA. Add conditional formatting to the gender, age, percent of degree completed, and anticipated graduation year fields. Also, run sorts, determine subtotals, and use the database, COUNTIF, and SUMIF functions to generate statistics.
C6427_05_CTP.4c.indd 415
Excel Chapter 5
•• 4: Creating a Table of Companies
STUDENT ASSIGNMENTS
Cases and Places EX 415
6/12/07 8:25:59 AM
This page intentionally left blank
C6394_FM_CTP.4c.indd xvi
8/8/07 3:59:57 PM
Microsoft Office Excel 2007
6
Creating Templates and Working with Multiple Worksheets and Workbooks
Objectives You will have mastered the material in this chapter when you can: • Create and use a template • Use the ROUND function • Define, apply, and remove a style
• Add a header or footer, change margins, and insert and move a page break
• Add a worksheet to a workbook
• Save a workbook as a PDF or XPS file
• Create formulas that use 3-D cell references
• Use the Find and Replace commands
• Utilize custom format codes
• Draw a Clustered Cone chart
C6428_06_CTP.4c.indd 417
• Use WordArt to create a title and create and modify shapes
• Create a workspace • Consolidate data by linking workbooks
6/14/07 7:58:55 AM
Microsoft 2003 Microsoft Offi Office ce Word Excel 2007
6
Creating Templates and Working with Multiple Worksheets and Workbooks Introduction Many business applications require data from several worksheets to be summarized on one worksheet. For example, a company may keep data from various regions in different worksheets. If you enter each region’s inventory data on a worksheet in a workbook, you can click the sheet tabs at the bottom of the Excel window to move from worksheet to worksheet, or region to region. On another, separate worksheet, you then can enter formulas that reference cells on the other worksheets, which allows you to summarize worksheet data. The process of summarizing data included on multiple worksheets on one worksheet is called consolidation. Another important concept presented in this chapter is the use of a template. A template is a special workbook you can create and then use as a pattern to create new, similar workbooks or worksheets. A template usually consists of a general format (worksheet title, column and row titles, and numeric format) and formulas that are common to all the worksheets. One efficient way to create the workbook is first to create a template, save the template, and then copy the template to a workbook as many times as necessary.
Project — Profit Potential Worksheets with Cone Chart The project in the chapter follows proper design guidelines and uses Excel to create the worksheet shown in Figure 6–1. NextDVR sells DVR (digital video recorder) equipment to cable television providers throughout the United States. The company purchases DVR equipment from a number of suppliers and then resells the equipment to customers in three regional offices. The company’s chief operating officer would like to know the profit potential of the inventory currently stored at the three regional offices. She also would like to see the regional information on separate worksheets, and then consolidated into one worksheet.
EX 418
C6428_06_CTP.4c.indd 418
6/14/07 7:58:57 AM
Microsoft Office Excel 2007
(a) Louisville Worksheet
Louisville sheet tab
Kansas City sheet tab
Portland sheet tab
(b) Kansas City Worksheet
(c) Portland Worksheet consolidate data on one worksheet
Clustered Cone chart compares profit potential by DVR company
data from Louisville, Kansas City, and Portland worksheets consolidated into Company worksheet
Company sheet tab
Clustered Cone Chart sheet tab
(d) Consolidated Worksheet
(e) Clustered Cone Chart Figure 6–1
EX 419
C6428_06_CTP.4c.indd 419
6/14/07 7:58:57 AM
EX 420 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
BTW
The requirements document for the NextDVR Profit Potential workbook is shown in Figure 6–2. It includes the needs, source of data, summary of calculations, chart requirements, special requirements, and other facts about its development.
Workbook Survival For workbooks to be successful and survive their expected life cycle in a business environment, they must be well documented and easy to understand. You document a workbook by adding comments to cells that contain complex formulas or to cells containing content that may not be understood easily. The documentation also should take into consideration those who will maintain the workbook after you leave. You create easy to understand workbooks by reviewing alternative designs prior to creating the workbook. The more time you spend documenting and designing a workbook, the easier it will be for users and spreadsheet maintenance specialists to understand.
Figure 6–2
C6428_06_CTP.4c.indd 420
6/14/07 7:59:03 AM
Overview As you read this chapter, you will learn how to create the worksheet shown in Figure 6–1 by performing these general tasks: • Create and format the template
Excel Chapter 6
Project — Profit Potential Worksheets with Cone Chart EX 421
• Add a worksheet to the workbook • Reference data on other worksheets • Create a Clustered Cone chart and add WordArt to the chart • Print the worksheet with proper page breaks • Create a workspace and consolidate data by linking workbooks General Project Decisions While creating an Excel worksheet, you need to make several decisions that will determine the appearance and characteristics of the finished worksheet. As you create the worksheet to meet the requirements shown in Figure 6–2, you should follow these general guidelines:
Plan Ahead
1. Design the template and plan the formatting. Templates help speed and simplify work because Excel users often work with the same types of problems over and over again. Using a template allows you to begin your work with a preformatted worksheet. In the case of the NextDVR Profit Potential worksheet, the template saves the work of formatting the three region worksheets and the consolidated worksheet. The formatting is done once in the template, and then that formatting automatically is carried over to the new worksheets. 2. Identify additional worksheets needed in the workbook. After the template is created using dummy data and the required formulas (Figure 6–4 on page EX 424) and then saved, it will be copied to a workbook made up of four worksheets. Actual data for the three regions will replace the dummy data on the three region worksheets. The data from the three region worksheets then will be consolidated on the company worksheet. 3. Plan the layout and location of the required chart. The chart requires additional artwork, including a callout, and would therefore be more suited for placement on a new worksheet. A Clustered Cone chart type is a proper choice for this chart because data from a few vendors is compared. The tapering of the cones allows space for additional elements, such as the callout, without any overlapping. 4. Examine the alternatives for printing a number of worksheets, including headers, margins, and page breaks. When working with multiple worksheets, using properly formatted page headers and footers is important. Excel allows you to print page numbers and the sheet name of each sheet. In addition, margins and page breaks also can be adjusted to provide professional looking printed worksheets. 5. Identify workbooks to be consolidated into a workspace and then linked to create a consolidated workbook of the initial workbooks. The special requirement for the project listed in the requirements document (Figure 6–2) asks that methods to combine workbooks together should be investigated. Each of the three regions has sent a similar workbook that represents their own profit potentials. Excel allows you to work with these workbooks in a workspace and then link the workbooks together to provide a consolidated view of the data in the workbooks. (continued)
C6428_06_CTP.4c.indd 421
6/14/07 7:59:05 AM
EX 422 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Plan Ahead
(continued) In addition, using a sketch of the worksheet can help you visualize its design. The sketch of the template (Figure 6–3a) consists of titles, column and row headings, location of data values, and a general idea of the desired formatting. The sketch of the Clustered Cone chart (Figure 6–3b) consists of a chart title, which will be added using WordArt, and a callout that emphasizes the cylinder representing the greatest profit potential. When necessary, more specific details concerning the above guidelines are presented at appropriate points in the chapter. The chapter also will identify the actions you perform and decisions made regarding these guidelines during the creation of the worksheet shown in Figure 6–1 on page EX 419.
NextDVR, Inc. Regions Profit Potential
DD-MMM-YYYY
Company
Units On Hand
Average Unit Cost
Total Cost
Average Unit Price
XXXXXXXXXXX
$ 2,229
$ 2,229.99
$ 2,222,229.99
$ 2,229.99
Total
$22,229
$22,222,229.99
Profit Potential
Total Value
$ 2,222,229.99 $ 2,222,229.99
$22,222,229.99 $22,222,229.99
Profit Potential
(a) Sketch of Template
Greatest Profit Potential
...... Cone 1
Cone 2
Cone 3
..........Cone 4
(b) Sketch of Clustered Cone Chart Figure 6–3
C6428_06_CTP.4c.indd 422
6/14/07 7:59:05 AM
To Start Excel If you are using a computer to step through the project in this chapter and you want your screen to match the figures in this book, you should change your computer’s resolution to 1024 ⫻ 768. For information about how to change a computer’s resolution, see page APP 21 in Appendix E. The following steps, which assume Windows is running, start Excel based on a typical installation of Microsoft Office on your computer. You may need to ask your instructor how to start Excel for your computer.
Templates Templates are most helpful when you need to create several similar or identical workbooks. They help reduce work and ensure consistency. Templates can contain: (1) text and graphics, such as a company name and logo; (2) formats and page layouts; and (3) formulas or macros.
Excel Chapter 6
With a good understanding of the requirements document, an understanding of the necessary decisions, and a sketch of the template, the next step is to use Excel to create the template.
BTW
Creating the Template EX 423
Note: If you are using Windows XP, see Appendix F for alternate steps.
1
Click the Start button on the Windows Vista taskbar to display the Start menu.
2
Click All Programs at the bottom of the left pane on the Start menu to display the All Programs list.
3
Click Microsoft Office in the All Programs list to display the Microsoft Office list.
4
Click Microsoft Office Excel 2007 to start Excel and display a blank worksheet in the Excel window.
5
If the Excel window is not maximized, click the Maximize button next to the Close button on its title bar to maximize the window.
6
If the worksheet window in Excel is not maximized, click the Maximize button next to the Close button on its title bar to maximize the worksheet window within Excel.
Creating the Template The first step in building the workbook is to create and save a template that contains the titles, column and row headings, formulas, and formats used on each of the sheets. Design the template and plan the formatting. The template will be used to create a number of other worksheets. Thus, it is important to consider the layout, cell formatting, and contents of the page.
Plan Ahead
• Set row heights and column widths. Row heights and column widths should be set to sizes large enough to accommodate future needs. • Use placeholders for data when possible. Placeholders are used in a template to guide users of the template regarding what type of data to enter in cells. For example, the word Region should be used in the subtitle to indicate to a user of the template to place the Region name in the subtitle. (continued)
C6428_06_CTP.4c.indd 423
6/14/07 7:59:07 AM
EX 424 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Plan Ahead
(continued) • Use dummy data to verify formulas. When a template is created, dummy data — that is, sample data used in place of actual data to verify the formulas in the template — should be used in place of actual data to verify the formulas in the template. Selecting simple numbers such as 1, 2, and 3 allows you to check quickly to see if the formulas are generating the proper results. In templates with more complex formulas, you may want to use numbers that test the extreme boundaries of valid data. • Format cells in the template. Formatting should be applied to titles and subtitles that can be changed to provide cues to users of the worksheets. For example, by using a fill color for the title and subtitle, when each regions’ worksheets are created, the fill color can be changed. All numeric cell entry placeholders – dummy data – should be properly formatted for unit numbers and currency amounts.
After the template is saved, it can be used every time a similar workbook is developed. Because templates help speed and simplify their work, many Excel users create a template for each application on which they work. Templates can be simple — possibly using a special font or worksheet title; or they can be more complex — perhaps utilizing specific formulas and format styles, such as the template for the NextDVR Profit Potential workbook. Creating a template, as shown in Figure 6–4, follows the same basic steps used to create a workbook. The only difference between developing a workbook and a template is the file type used to save the template.
template
dummy data entered into template
SUM function determines values in Total row
Figure 6–4
C6428_06_CTP.4c.indd 424
6/14/07 7:59:07 AM
Click the Select All button immediately above row heading 1 and to the left of column heading A and then click the Bold button on the Ribbon. Select cell A1 to deselect the worksheet.
2
Drag the bottom boundary of row heading 4 down until the ScreenTip, Height 30.75 (41 pixels), appears.
3
Drag the right boundary of column heading A to the right until the ScreenTip, Width: 13.00 (96 pixels), appears.
4
Click column heading C, drag through to column heading G, and then drag the right boundary of column heading G right until the ScreenTip, Width: 13.00 (96 pixels), appears. Select cell A1 to deselect columns C through G.
BTW
1
Selecting a Range of Cells You can select any range of cells with entries surrounded by blank cells by clicking a cell in the range and pressing CTRL+SHIFT+ASTERISK (*).
BTW
The first step in creating the template is to change the font style to bold and adjust the height of row 4 to 30.75 points and column widths of columns A and C through G to 13.00 characters.
Displaying Future Dates You can display a future date, such as tomorrow’s date, in a cell by adding a number to the NOW or TODAY function. For example, =NOW()+1 displays tomorrow’s date in a cell and =NOW()+14 displays a date two weeks in the future. The function =NOW() – 1 displays yesterday’s date.
BTW
To Bold the Font and Adjust the Row Heights and Column Widths of the Template
Manipulating Dates You can use the DATE function to change a year, month, and day to a serial number that automatically is formatted to mm/dd/yyyy. For example, if cell A1 equals the year 2008, cell A2 equals the month 2, cell A3 equals day 10, and cell A4 is assigned the function =DATE (A1, A2, A3), then 2/10/2008 appears in cell A4. The DATE function is most useful in formulas where year, month, and day are formulas, not constants.
Excel Chapter 6
Creating the Template EX 425
To Enter the Title, Subtitle, and Row Titles in the Template The following steps enter the titles in cells A1 and A2 and the row titles in column A.
1
Type NextDVR, Inc. in cell A1 and then press the DOWN ARROW key.
2
Type Region Profit Potential in cell A2 and then press the DOWN ARROW key twice to make cell A4 active.
3
Type Company and then press the DOWN ARROW key.
4
With cell A5 active, enter the remaining row titles in column A as shown in Figure 6–5 on the next page.
To Enter Column Titles and the System Date in the Template 1
Select cell B4. Type Units and then press ALT+ENTER. Type On Hand and then press the RIGHT ARROW key.
2
Type Average and then press ALT+ENTER. Type Unit Cost and then press the RIGHT ARROW key.
3
With cell D4 active, enter the remaining column titles in row 4 as shown in Figure 6–5.
4
Select cell G3. Type =now() and then press the ENTER key. Right-click cell G3 and then click Format Cells on the shortcut menu. When Excel displays the Format Cells dialog box, click Date in the Category list and then double-click 3/14/01 13:30 in the Type list. Select cell A14 to deselect cell G3.
Q&A
The next step is to enter the column titles in row 4 and the system date in cell G3.
Why was the date not formatted as it appears in Figure 6–4? The format assigned to the system date in cell G3 is temporary. For now, it ensures that the system date will appear properly, rather than as a series of number signs (#). The system date will be assigned a permanent format later in this chapter.
C6428_06_CTP.4c.indd 425
6/14/07 7:59:09 AM
EX 426 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Bold button
Select All button NOW function displays current system date
BTW
worksheet title and subtitle in cells A1 and A2
Dummy Numbers As you develop more sophisticated workbooks, it will become increasingly important that you create good test data to ensure your workbooks are free of errors. The more you test a workbook, the more confident you will be in the results generated. Always take the time to select test data that tests the limits of the formulas.
column titles in row 4
row titles in the range A5:A12
Figure 6–5
To Enter Dummy Data in the Template Using the Fill Handle While creating the NextDVR template in this chapter, dummy data is used for the units on hand values in the range B5:B11 and the average unit cost values in the range C5:C11. The dummy data is entered by using the fill handle to create a series of numbers in columns B and C. The series in column B begins with 1 and increments by 1; the series in column C begins with 2 and increments by 2. Recall that you must enter the first two numbers in a series so that Excel can determine the increment amount. If the cell to the right of the start value is empty and you want to increment by 1, however, you can create a series by entering only one number as shown in the following steps.
1 • Select cell B5. • Type 1 and then press the ENTER key.
• Select the range B5:C5. • Drag the fill handle through cells B11 and C11. Do not release the mouse button (Figure 6–6).
series start value is at 1
cell to right of cell with series start value
ScreenTip indicates series stop value resulting from dragging fill handle through row 11
Figure 6–6
C6428_06_CTP.4c.indd 426
6/14/07 7:59:09 AM
2 • Release the mouse button to create the series 1 through 7 in increments of 1 in the range B5:B11 (Figure 6–7).
Excel Chapter 6
Creating the Template EX 427
series 1 through 7 created in range B5:B11
Figure 6–7
3 • Select cell C5. Type 2 and then press the DOWN ARROW key.
• Type 4 and then press the ENTER key.
• Select the range C5:C6. Drag the
Q&A
fill handle through cell C11 to create the series 2 through 14 in increments of 2 in the range C5:C11 (Figure 6–8). What other types of series can I create?
values 2 and 4 entered in cells C5 and C6 define start value and increment value
Excel allows you to create many series 2 through 14 types of series, including a date created in range C5: series (Jan, Feb, Mar, etc.), an C11 using fill handle auto fill series (1, 1, 1, etc.), and a linear series (1, 2, 3, etc. or 2, 4, 6, etc.), which was created in the previous steps. A fourth type of series is a growth series. A growth Figure 6–8 series multiplies values by a constant factor. You can create a growth series by entering an initial value in the first cell, selecting the range to fill, clicking the Fill button on the Home tab on the Ribbon, clicking Series, clicking Growth in the type area, and then entering a constant factor in the Step value box. Other Ways 1. Enter first number, while holding down CTRL key drag through range
C6428_06_CTP.4c.indd 427
2. Enter start value, select range, click Fill button on Home tab, click Series, enter parameters, click OK button
6/14/07 7:59:12 AM
BTW
EX 428 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Accuracy The result of an arithmetic operation, such as multiplication or division, is accurate to the factor with the least number of decimal places.
The ROUND Function and Entering Formulas in the Template The next step is to enter the four formulas for the first DVR company (JVC) in the range D5:G5. When you multiply or divide decimal numbers that result in an answer with more decimal places than the format allows, you run the risk of the column totals being off by a penny or so. For example, as shown in the worksheet sketch in Figure 6–3a on page EX 422, columns C through G use the Currency and Comma style formats with two decimal places. And yet, the formulas used to calculate values for these columns result in several additional decimal places that Excel maintains for computation purposes. For this reason, it is recommended that you use the ROUND function on formulas that potentially can result in more decimal places than the format displays in a given cell. The general form of the ROUND function is
BTW
=ROUND (number, number of digits) Fractions The forward slash (/) has multiple uses. For example, dates often are entered using the slash. In formulas, the slash represents division. What about fractions? To enter a fraction, such as ½, type .5 or 0 ½ (i.e., type zero, followed by a space, followed by the number 1, followed by a slash, followed by the number 2). If you type ½ without the preceding zero, Excel will store the value in the cell as the date January 2.
where the number argument can be a number, a cell reference that contains a number, or a formula that results in a number; and the number of digits argument can be any positive or negative number used to determine the number of places to which the number will be rounded. The following is true about the ROUND function: 1. If the number of digits argument is greater than 0 (zero), then the number is rounded to the specified number of digits to the right of the decimal point. 2. If the number of digits argument is equal to 0 (zero), then the number is rounded to the nearest integer. 3. If the number of digits argument is less than 0 (zero), then the number is rounded to the specified number of digits to the left of the decimal point. Table 6–1 shows the four formulas to enter in the template in the range D5:G5. The ROUND function is used to round the value resulting from the formula assigned to cell E5 to two decimal places. Table 6–1 Formulas Used to Determine Profit Potential
BTW
Cell
Changing Modes You change from Enter mode or Edit mode to Point mode by typing the EQUAL SIGN (=) followed by clicking a cell or clicking the Insert Function box on the formula bar, selecting a function, and then clicking a cell. You know you are in Point mode when the word Point appears on the left side of the status bar at the bottom of the Excel window.
C6428_06_CTP.4c.indd 428
Description
Formula
Entry
D5
Total Cost
Units On Hand x Average Unit Cost
=B5 * C5
E5
Average Unit Price
ROUND(Average Unit Cost / (1-.42), 2)
=ROUND(C5 / (1–.42), 2)
F5
Total Value
Units On Hand x Average Unit Price
=B5 * E5
G5
Profit Potential
Total Value – Total Cost
=F5 – D5
The most difficult formula to understand in Table 6–1 is the one that determines the average unit price, which also is called the average selling price. To make a net profit, companies must sell their merchandise for more than the unit cost of the merchandise plus the company’s operating expenses (taxes, rent, upkeep, and so forth). To determine what selling price to set for an item, companies often first establish a desired margin and then determine a selling price. Most companies look for a margin of 30% to 75%. NextDVR, Inc., for example, tries to make a margin of 42% on each of its digital cameras. The formula for the average unit price in Table 6–1 helps the company determine the price at which to sell an item so that it ends up with a 42% margin. For example, if an item costs NextDVR $2.00 (the unit cost), then the company must sell it for $3.45 [$2.00 / (1–.42)] to make a 42% margin. Of this $3.45, $2.00 goes to pay the unit cost of the item; the other $1.45 is the gross profit potential (42% x $3.45 = $1.45).
6/14/07 7:59:15 AM
To Enter Formulas Using Point Mode and Determine Totals in the Template The following steps use Point mode to enter the four formulas in Table 6–1 in the range D5:G5. After the formulas are entered for JVC DVRs in row 5, the formulas will be copied for the remaining six companies. The Sum button then is used to determine the totals in row 12.
Excel Chapter 6
Creating the Template EX 429
1 • Select cell D5, type = to start the formula, click cell B5, type * (asterisk), click cell C5, and then click the Enter box in the formula bar (Figure 6–9). formula assigned to cell D5
value of 1 ⫻ 2 appears in cell D5
Figure 6–9
2 • Select cell E5, type =round(c5/(1-.42),2), and then click the Enter box in the formula bar to display the formula =ROUND(C5/(1-0.42), 2) in the formula bar and the value 3.45 (3.448276 rounded to two decimal places) as the average unit price in cell E5 (Figure 6–10).
ROUND function assigned to cell E5
value of 2 / (1 - .42) rounded to two decimal places appears in cell E5
Figure 6–10
C6428_06_CTP.4c.indd 429
6/14/07 7:59:16 AM
EX 430 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
3 • Select cell F5, type = to start the formula, click cell B5, type * (asterisk), click cell E5, and then click the Enter box in the formula bar to display the formula =B5*E5 in the formula bar and the value 3.45 (1 x 3.45) as the total value in cell F5 (Figure 6–11).
formula assigned to cell F5
value of 1 ⫻ 3.45 appears in cell F5
Figure 6–11
4 • Select cell G5, type = to start the formula, click cell F5, type - (minus sign), click cell D5, and then click the Enter box in the formula bar to display the formula =F5 – D5 in the formula bar and the value 1.45 (3.45 – 2) as the profit potential in cell G5 (Figure 6–12).
formula assigned to cell G5
value of 3.45 – 2 appears in cell G5
Figure 6–12
C6428_06_CTP.4c.indd 430
6/14/07 7:59:22 AM
5 • Select the range D5:G5 and then point to the fill handle (Figure 6–13).
range D5:G5 selected
Excel Chapter 6
Creating the Template EX 431
fill handle
Figure 6–13
6 • Drag down through the range D6:G11 to copy the formulas in the range D5:G5 to the range D6:G11. Excel automatically adjusts the cell references so each formula references the data in the row to which it is copied (Figure 6–14).
formulas in range D5:G5 copied to range D6:G11
Figure 6–14
C6428_06_CTP.4c.indd 431
6/14/07 7:59:24 AM
EX 432 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
7 • Select cell B12, and then click the Sum button on the Ribbon twice. Sum button
• Select cell D12 and then click the Sum button twice.
• Select the range F12:G12 and then click the Sum button.
• Select cell A14 to deselect the range F12:G12 and display the values based on the dummy data entered earlier in columns B and C (Figure 6–15).
sum of range B5:B11
sum of range D5:D11
sum of range F5:F11
sum of range G5:G11
Figure 6–15
C6428_06_CTP.4c.indd 432
6/14/07 7:59:28 AM
To Save the Template Saving a template is just like saving a workbook, except that the file type Template is selected in the Save as type box in the Save As dialog box. The following steps save the template on a USB drive in drive E using the file name, NextDVR Profit Potential Template.
1 • Update the document properties
Excel Chapter 6
Creating the Template EX 433
file will be saved on USB flash drive UDISK 2.0 (E:)
with your name and any other relevant information.
• With a USB flash drive connected to one of the computer’s USB ports, click the Save button on the Quick Access Toolbar to display the Save As dialog box.
• When Excel displays the Save As dialog box, type NextDVR Profit Potential Template in the File name box.
• Click the Save as type box arrow
template file name
and then click Excel Template in the list.
Save button
• Select UDISK 2.0 (E:) as the new save location (Figure 6–16).
file will be saved as Excel Template
2 • Click the Save button in the
Q&A
Save As dialog box to save the template on the USB drive and display the file name, NextDVR Profit Potential Template, on the title bar (Figure 6–17 on the next page). Why does Excel change the folder name when the Excel Template file type is chosen? When the Excel Template file Figure 6–16 type is chosen in the Save as type box, Excel automatically changes the contents of the Save in box to the Templates folder created when Office 2007 was installed. In a production environment — that is, when you are creating a template for a business, school, or personal application — the template typically would be saved in the Templates folder, not on the USB flash drive. Other Ways 1. Press CTRL+S, type file name, select Excel Template in Save as type box, select drive or folder, click Save button in Save As dialog box
C6428_06_CTP.4c.indd 433
6/14/07 7:59:30 AM
BTW
EX 434 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Summing a Row or Column You can reference an entire column or an entire row in a function argument by listing only the column or only the row. For example, =sum(a:a) sums all the values in all the cells in column A, and =sum(1:1) sums all the values in all the cells in row 1. You can verify this by entering =sum(a:a) in cell C1 and then begin entering numbers in a few of the cells in column A. Excel will respond by showing the sum of the numbers in cell C1.
Formatting the Template The next step is to format the template so it appears as shown in Figure 6–17. The following list summarizes the steps required to format the template. 1. Format the titles in cells A1 and A2. 2. Format the column titles and add borders to rows 4 and 12. 3. Assign the Currency style format with a floating dollar sign to the nonadjacent ranges C5:G5 and D12:G12. 4. Assign a Custom style format to the range C6:G11. 5. Assign a Comma style format to the range B5:B12. 6. Create a format style and assign it to the date in cell G3. template file name is displayed on title bar
title area with light blue background, Title cell style, and thick box border
four-digit year format assigned using a style
centered column titles with Heading 3 cell style Currency style format with floating dollar sign and two decimal places Custom format #,##0.00_);[Blue](#, ##0.00)
total row with Total cell style
Comma style format with no decimal places
Figure 6–17
BTW
To Format the Template Title and Subtitle Copying To copy the contents of a cell to the cell directly below it, click in the target cell and press CTRL+D.
The steps used to format the template title and subtitle include changing cell A1 to 28-point with the Title cell style; changing cell A2 to 22-point with the Title cell style; centering both titles across columns A through G; changing the title background color to light blue and the title font to white; and drawing a thick box border around the title area. The color scheme associated with the default Office template also will be changed to a new color scheme. One reason to change the color scheme is to add variety to the look of the worksheet that you create. The following steps format the title and subtitle.
1
C6428_06_CTP.4c.indd 434
Click the Page Layout tab on the Ribbon. Click the Colors button on the Ribbon and then click Apex in the Colors gallery.
6/14/07 7:59:31 AM
2
Select the range A1:A2. Click the Home tab on the Ribbon and apply the Title cell style to the range. Select cell A1. Click the Font Size box arrow on the Ribbon and then click 28 in the Font Size list. Select the range A1:G1. Click the Merge & Center button on the Ribbon.
3
Select cell A2, click the Font Size box arrow on the Ribbon, and then click 22 in the Font Size list. Select the range A2:G2. Click the Merge & Center button on the Ribbon.
4
Select the range A1:A2, click the Fill Color button arrow on the Ribbon, and then click Light Blue (column 7, row 7) on the Fill Color palette.
5
Click the Font Color button arrow on the Ribbon and then click White, Background 1 (column 1, row 1) on the Font Color palette.
6
Click the Borders button arrow on the Ribbon and then click Thick Box Border in the Borders gallery.
7
Select cell A14 to deselect the range A1:A2.
Excel Chapter 6
Formatting the Template EX 435
To Format the Column Titles and Total Row The next steps center and underline the column titles and draw a top and double bottom border on the Total row in row 12.
1
Select the range A4:G4, click the Center button on the Ribbon, and then apply the Heading 3 cell style to the range.
2
Select the range A12:G12, assign the Total cell style to the range, and then select cell A14 (Figure 6–18).
Borders button arrow
Font Size box arrow
Cell Styles button Merge & Center button
Center button
title area with light blue background, Title cell style, and thick box border centered column titles with Heading 3 cell style
total row with Total cell style
Figure 6–18
C6428_06_CTP.4c.indd 435
6/14/07 7:59:33 AM
EX 436 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
To Assign a Currency Style Using the Format Dialog Box As shown in Figure 6–17 on page EX 434, the template for this chapter follows the standard accounting format for a table of numbers; that is, it contains floating dollar signs in the first row of numbers (row 5) and the totals row (row 12). Recall that while a fixed dollar sign always appears in the same position in a cell (regardless of the number of significant digits), a floating dollar sign always appears immediately to the left of the first significant digit in the cell. To assign a fixed dollar sign to rows 5 and 12, select the range and then click the Accounting Number Format button on the Home tab on the Ribbon. Assigning a floating dollar sign, by contrast, requires you to select the desired format in the Format Cells dialog box. The following steps use the Format Cells dialog box to assign a Currency style with a floating dollar sign and two decimal places to the ranges C5:G5 and D12:G12.
1 • Select the range C5:G5. • While holding down the CTRL key, select the nonadjacent range D12:G12 and then right-click the selected ranges to highlight the nonadjacent ranges and display the shortcut menu (Figure 6–19).
shortcut menu
Format Cells command
nonadjacent ranges selected
Figure 6–19
C6428_06_CTP.4c.indd 436
6/14/07 7:59:37 AM
2 • Click Format Cells on the shortcut menu.
• When Excel displays the Format Cells dialog box, if necessary click the Number tab, click Currency in the Category list, and then click the red ($1,234.10) in the Negative numbers list (Figure 6–20).
Excel Chapter 6
Formatting the Template EX 437
Format Cells dialog box
Number tab
sample of how formatted value of $280.00 will appear in cell D12
Currency category selected
two decimal places
desired negative number format
OK button
Figure 6–20
3 • Click the OK button to assign the Currency style with a floating dollar sign and two decimal places to the ranges C5:G5 and D12:G12. Select cell A14 to deselect the nonadjacent ranges (Figure 6–21).
Currency Style format assigned to nonadjacent ranges formatted cells are properly aligned; others will be aligned when they are formatted
Figure 6–21 Other Ways 1. Press CTRL+1, click Number tab, select format, click OK button
C6428_06_CTP.4c.indd 437
6/14/07 7:59:39 AM
EX 438 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
To Create and Assign a Custom Format Code and a Comma Style Format Excel assigns a format code to every format style listed in the Category list in the Number sheet in the Format Cells dialog box. As shown in Table 6–2, a format code is a series of format symbols that defines how a cell entry assigned a format will appear. To view the entire list of format codes that come with Excel, select Custom in the Category list (Figure 6–20 on the previous page). Table 6–2 Format Symbols in Format Codes Format Symbol
Example of Symbol
Description
# (number sign)
###.##
Serves as a digit placeholder. If the value in a cell has more digits to the right of the decimal point than number signs in the format, Excel rounds the number. Extra digits to the left of the decimal point are displayed.
0 (zero)
0.00
Functions like a number sign (#), except that if the number is less than 1, Excel displays a 0 in the ones place.
. (period)
#0.00
Ensures Excel will display a decimal point in the number. The placement of period symbols determines how many digits appear to the left and right of the decimal point.
% (percent)
0.00%
Displays numbers as percentages of 100. Excel multiplies the value of the cell by 100 and displays a percent sign after the number.
, (comma)
#,##0.00
Displays a comma as a thousands separator.
( )
#0.00;(#0.00)
Displays parentheses around negative numbers.
$ or + or –
$#,##0.00; ($#,##0.00)
Displays a floating sign ($, +, or –).
* (asterisk)
$*##0.00
Displays a fixed sign ($, +, or –) to the left in the cell followed by spaces until the first significant digit.
[color]
#.##;[Red]#.##
Displays the characters in the cell in the designated color. In the example, positive numbers appear in the default color, and negative numbers appear in red.
“
$0.00 “Surplus”; $-0.00 “Shortage”
Displays text along with numbers entered in a cell.
#,##0.00_)
Skips the width of the character that follows the underscore.
“ (quotation marks)
_ (underscore)
Before creating custom format codes or modifying an existing custom format code, you should understand their makeup. As shown below, a format code can have up to four sections: positive numbers, negative numbers, zeros, and text. Each section is divided by a semicolon. $*#,##0.00; [Blue]#,##0.00; 0.00; “The answer is”@
for positive numbers
for negative numbers
for zero
for text
A format code need not have all four sections. For most applications, a format code will have only a positive section and possibly a negative section. The next step is to create and assign a custom format code to the range C6:G11. To assign a custom format code, you select the Custom category in the Category list in the Format Cells dialog box, select a format code close to the one to be created, and then modify or customize the selected format code. The following steps create and assign a custom format code.
C6428_06_CTP.4c.indd 438
6/14/07 7:59:42 AM
1 • Select the range C6:G11, right-click the selected range, and then click Format Cells on the shortcut menu.
Format Cells dialog box
• When Excel displays the Format Cells dialog box, if necessary, click the Number tab, and then click Custom in the Category list.
Excel Chapter 6
Formatting the Template EX 439
Number tab
sample of how formatted value of $4.00 will appear in cell C6
red changed to blue edit customized format code in this box
• If necessary, scroll down and then click #,##0.00_); [Red](#,##0.00) in the Type list.
Custom category selected
• In the Type text box,
Q&A
change the word Red to Blue (Figure 6–22).
OK button
What is displayed in the dialog box? The Custom format has been modified to show negative numbers in blue. In the Sample area, Excel displays a sample of the custom format assigned to the first number in the selected range.
C6428_06_CTP.4c.indd 439
Figure 6–22
6/14/07 7:59:43 AM
EX 440 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
2 • Click the OK button to display the numbers in the range C6:G11 using the custom format code created in Step 1.
Comma Style button
• Select the range B5:B12, click the Comma Style button on the Ribbon, and then click the Decrease Decimal button on the Ribbon twice to display the numbers in the range B5:B12 using the Comma style format with no decimal places (Figure 6–23).
Decrease Decimal button
Q&A
• Select cell A14. Can I reuse the custom format code? Yes. When you create a new custom format code, Excel adds it to the bottom of the Type list in the Number sheet in the Format Cells dialog box to make it available for future use.
Comma style format with no decimal places
custom format #,##0.00_); [Blue](#,##0.00) applied to range C6:G11
Figure 6–23
To Create a New Style A style is a group of format specifications that are assigned to a style name. Most of the cell styles in the Cell Styles gallery that is displayed when you click the Cell Styles button on the Home tab include formatting only of visual characteristics, such as font, font size, font color, and fill color. Excel makes several general styles available with all workbooks and themes, as described in Table 6–3. You can apply these existing styles to a cell or cells in a worksheet, modify an existing style, or create an entirely new style. Table 6–3 Styles Available with All Workbooks via the Cell Styles Button on the Home Tab Style Name
Description
Normal
Number = General; Alignment = General, Bottom Aligned; Font = Arial 10; Border = No Borders; Patterns = No Shading; Protection = Locked
Comma
Number = (*#,##0.00);_(*(#,##0.00);_(*”-”_);_(@_)
Comma(0)
Number = (*#,##0_);_(*(#,##0);_(*”-”_);_(@_)
Currency
Number = ($#,##0.00_);_($*(#,##0.00);_($*”-”??_);_(@_)
Currency(0)
Number = ($#,##0_);_($*(#,##0);_($*”-”_);_(@_)
Percent
Number = 0%
Using the New Cell Style button in the Cell Styles gallery on the Home tab, you can create and then assign a style to a cell, a range of cells, a worksheet, or a workbook in the same way you assign a format using the buttons on the Ribbon. In fact, the Comma Style button, Currency Style button, and Percent Style button assign the Comma, Currency, and Percent styles in Table 6–3, respectively. Excel automatically assigns the Normal style in Table 6–3 to all cells when you open a new workbook.
C6428_06_CTP.4c.indd 440
6/14/07 7:59:45 AM
By right-clicking styles in the Style gallery, you also can delete, modify, and duplicate styles. The Merge Styles button in the Cell Styles gallery allows you to merge styles from other workbooks. You add a new style to a workbook or merge styles when you plan to use a group of format specifications over and over. The following steps show how to create a new style called Four-Digit Year by modifying the existing Normal style. The new style will include the following formats: Number = 14-Mar-2001 and Alignment = Horizontal Center and Bottom Aligned. After the Four-Digit Year style is created, it will be assigned to cell G3, which contains the system date.
1 • Click the Cell Styles
Excel Chapter 6
Formatting the Template EX 441
Cell Styles button
button on the Home tab on the Ribbon to display the Cell Styles gallery (Figure 6–24).
Cell Styles gallery
New Cell Style button
Figure 6–24
2 • Click the New Cell Style button in the Cell Styles gallery.
Style dialog box
style name changed from Style 1 to Four-Digit Year
• When Excel displays the Style dialog box, type Four-Digit Year as the new style name (Figure 6–25).
Format button
Style 1 style format specifications
Figure 6–25
C6428_06_CTP.4c.indd 441
6/14/07 7:59:47 AM
EX 442 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
3 • Click the Format button to display the Format Cells dialog box.
Format Cells dialog box
• When Excel displays the Format Cells dialog box, if necessary, click the Number tab, click Date in the Category list, and then click 14-Mar-2001 in the Type list (Figure 6–26).
Number tab
Date category selected
dd-mmm-yyyy format selected in Type list
OK button
Figure 6–26
4 • Click the Alignment tab, click the Horizontal box arrow, click Center in the Horizontal list, and then click the OK button.
• When the Style dialog box becomes active, click Font, Border, Fill, and Protection to clear the check boxes (Figure 6–27).
5 • Click the OK button to add the new Four-Digit Year style to the list of styles available with the NextDVR Profit Potential Template file in the Cell Styles gallery.
Four-Digit Year style format specifications
OK button
Figure 6–27 Other Ways 1. Press ALT+H, J, N
C6428_06_CTP.4c.indd 442
6/14/07 7:59:51 AM
To Apply a New Style In earlier steps, cell G3 was assigned the system date using the now() function. The next step is to assign cell G3 the Four-Digit Year style, which centers the contents of the cell and assigns it the date format dd-mmm-yyyy.
1 • Select cell G3 and then click the
Excel Chapter 6
Formatting the Template EX 443
Cell Styles button
Cell Styles button on the Ribbon to display the Cell Styles gallery (Figure 6–28).
Four-Digit Year custom style
Figure 6–28
2 • Click the Four-Digit Year style to assign the Four-Digit Year style to cell G3 (Figure 6–29).
• Select cell A14. Four-Digit Year style assigned to cell G3
Figure 6–29 Other Ways 1. Press ALT+H, J
C6428_06_CTP.4c.indd 443
6/14/07 7:59:54 AM
BTW
EX 444 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Creating Customized Formats Each format symbol within the format code has special meaning. Table 6–2 on page EX 438 summarizes the more frequently used format symbols and their meanings.
More About Using Styles Keep in mind the following additional points concerning styles: 1. A style affects the format of a cell or range of cells only if the corresponding check box is selected in the ‘Style Includes area’ in the Style dialog box (Figure 6–27 on page EX 442). For example, if the Font check box is not selected in the Style dialog box, then the cell assigned the style maintains the font format it had before the style was assigned. 2. If you assign two different styles to a range of cells, Excel adds the second style to the first, rather than replacing it. 3. You can merge styles from another workbook into the active workbook by using the Merge Styles button in the Cell Styles gallery. You must, however, open the workbook that contains the desired styles before you use the Merge Styles button. 4. The six check boxes in the Style dialog box are identical to the six tabs in the Format Cells dialog box (Figure 6–26 on page EX 442).
BTW
To Spell Check, Save, and Print the Template Normal Style The Normal style is the format style that Excel initially assigns to all cells in a workbook. If you change the Normal style, Excel applies the new format specifications to all cells that are not assigned another style.
With the formatting complete, the next step is to spell check the template, save it, and then print it.
1
Select cell A1. Click the Spelling button on the Review tab. Correct any misspelled words.
2
Click the Save button on the Quick Access Toolbar to save the workbook.
3
Print the workbook.
4
Click the Close Window button on the right side of the worksheet window to close the workbook and leave Excel open.
BTW
Using Templates Opening a Workbook at Startup You can instruct Windows to open a workbook (or template) automatically when you turn on your computer by adding the workbook (or template) to the Startup folder. Use Windows Explorer to copy the file to the Startup folder. The Startup folder is in the All Programs list.
C6428_06_CTP.4c.indd 444
Before using the template to create the NextDVR Profit Potential workbook, you should be aware of how templates are used and their importance. If you click the New command on the Office Button menu, the New Workbook dialog box is displayed (Figure 6–30). The New Workbook dialog box includes a My templates link in the Templates list, which you can click to view a list of Excel templates that you have saved on your computer in the New dialog box. Recall that Excel automatically chose Templates as the Save in folder when the template in this chapter initially was saved (Figure 6–16 on page EX 443). Saving templates in the Templates folder, rather than in another folder, is the standard procedure in the business world. If the NextDVR Profit Potential template created in this chapter had been saved in the Templates folder, then the template would appear in the New Workbook dialog box after clicking My templates in the Templates list. The template then could have been selected to start a new workbook.
6/14/07 7:59:56 AM
When you select a template from the New Workbook or New dialog box to create a new workbook, Excel names the new workbook using the template name with an appended digit 1 (for example, Template1). This is similar to what Excel does when you first start Excel and it assigns the name Book1 to the workbook. Excel provides additional workbook templates, which you can access by clicking the links in the Templates list shown in Figure 6–30. Additional workbook templates also are available on the Web. To access the templates on the Web, click the links in the Microsoft Office Online section of the Templates list.
Excel Chapter 6
Using Templates EX 445
New Workbook dialog box
My templates Microsoft Office Online template group
Figure 6–30
C6428_06_CTP.4c.indd 445
6/14/07 7:59:57 AM
EX 446 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Creating a Workbook from a Template With the template created, the next step is to use it to create the NextDVR Profit Potential workbook shown in Figure 6–1 on page EX 419.
To Open a Template and Save It as a Workbook The following steps open the NextDVR Profit Potential template and save it as a workbook.
1 • With Excel active, click the Office Button and then click Open on the Office Button menu.
Open dialog box
UDISK 2.0 (E:) drive selected in Address bar
• When Excel displays the Open dialog box, select UDISK 2.0 (E:) in the Address bar.
• Click the file name NextDVR Profit Potential Template to select it (Figure 6–31).
template selected
Open button
Figure 6–31
C6428_06_CTP.4c.indd 446
6/14/07 7:59:59 AM
2 • Click the Open button in the Open
Save As dialog box Address bar
dialog box.
• When Excel displays the NextDVR
Excel Chapter 6
Creating a Workbook from a Template EX 447
Profit Potential Template, click the Office Button and then click Save As on the Office Button menu.
• When the Save As dialog box appears, type NextDVR Profit Potential in the File name box.
• Click the Save as type box arrow and then click Excel Workbook (Figure 6–32).
3 • Click the Save button in the
Q&A
Save As dialog box to save the workbook.
Save as type box arrow file name
instructs Excel to save template as a workbook
Save button
How does Excel automatically select the file type and file name? In a production environment in which templates are saved to the Templates folder, Excel automatically selects Excel Workbook as the file type when you attempt to save a template as a workbook. Excel also appends the digit 1 to the template name as described earlier.
Figure 6–32
To Add a Worksheet to a Workbook A workbook contains three worksheets by default. The number of worksheets you can have in a workbook is limited only by the amount of memory in your computer. Identify additional worksheets needed in the workbook. The NextDVR Profit Potential workbook requires four worksheets — one for each of the three regions and one for the company totals. Thus, a worksheet must be added to the workbook.
Plan Ahead
When you add a worksheet, Excel places the new sheet tab to the left of the active tab. To keep the worksheet with the dummy data shown in Figure 6–29 on page EX 443 on top — that is, to keep its tab (Sheet1) to the far left — spreadsheet specialists often add a new worksheet between Sheet1 and Sheet2, rather than to the left of Sheet1. The following steps select Sheet2 before adding a worksheet to the workbook.
C6428_06_CTP.4c.indd 447
6/14/07 8:00:01 AM
EX 448 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
1 • Click the Sheet2 tab
Insert Cells button arrow
at the bottom of the window and then click the Insert Cells button arrow on the Home tab on the Ribbon to display the Insert menu (Figure 6–33).
Insert menu Insert Sheet command
Sheet2 selected
Figure 6–33
2 • Click Insert Sheet
Q&A
to add a fourth worksheet named Sheet 4 between Sheet 1 and Sheet 2 (Figure 6–34). Can I start a new workbook with more sheets?
new Sheet4 inserted
between Sheet1 and Yes. An alternative Sheet2 to adding worksheets is to change the default number of worksheets before you open a new workbook. To Figure 6–34 change the default number of worksheets in a blank workbook, click the Excel Options button on the Office Button menu, and then change the number in the ‘Include this many sheets‘ box in the ‘When creating new workbooks’ area of the Excel Options dialog box. Recall from Chapter 4 that you can delete a worksheet by right-clicking the sheet tab of the worksheet you want to delete and then clicking Delete on the shortcut menu.
Other Ways 1. Right-click tab, click Insert on shortcut menu 2. Press ALT+H, I, S
C6428_06_CTP.4c.indd 448
6/14/07 8:00:03 AM
To Copy the Contents of a Worksheet to Other Worksheets in a Workbook With four worksheets in the workbook, the next step is to copy the contents of Sheet1 to Sheet4, Sheet2, and Sheet3. Sheet1 eventually will be used as the Company worksheet with the consolidated data. Sheet4, Sheet2, and Sheet3 will be used for the three region worksheets.
Excel Chapter 6
Creating a Workbook from a Template EX 449
1 • Click the Sheet1 tab. • Click the Select All button and
Copy button
then click the Copy button on the Ribbon (Figure 6–35). Select All button
Sheet1 active
Figure 6–35
C6428_06_CTP.4c.indd 449
6/14/07 8:00:07 AM
EX 450 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
2 • Click the Sheet4 tab.
Paste button
• While holding down the SHIFT key,
[Group] indicates multiple worksheets are selected
click the Sheet3 tab so all three blank worksheets in the workbook are selected.
• Click the Paste button on the
Q&A
Ribbon to copy the data on the Office Clipboard to Sheet4, Sheet2, and Sheet3 (Figure 6–36). Why does the word Group appear on the title bar? Because multiple worksheets are selected, the term [Group] follows the template name on the title bar.
3 • Click the Sheet1 tab and then press the ESC key to remove the marquee surrounding the selection.
• Hold down the SHIFT key and then
Sheet4, Sheet2, and Sheet3 selected contents of Sheet4 after copy and paste operation
click the Sheet3 tab. Select cell A14.
• Hold down the SHIFT key and then click the Sheet1 tab to deselect Sheet4, Sheet2, and Sheet3 (Figure 6–37). Figure 6–36
• Click the Save button on the Quick Q&A
Access Toolbar. Can I use the ENTER key to paste the data? Yes. The ENTER key could have been used to complete the paste operation in Step 2, rather than the Paste button on the Ribbon. Recall that if you complete a paste operation using the ENTER key, then the marquee disappears and the Office Clipboard no longer contains the copied data following the action. Because the Paste button on the Ribbon was used, the ESC key was used in Step 3 to clear the marquee and Office Clipboard of the copied data.
Sheet4, Sheet2, and Sheet3 deselected
Figure 6–37 Other Ways 1. Select source area, click Copy button on Home tab, select worksheets, click Paste button on Home tab
C6428_06_CTP.4c.indd 450
2. Right-click source area, click Copy on shortcut menu, select worksheets, click Paste on shortcut menu
3. Select source area, press CTRL+C, select worksheets, press CTRL+V
6/14/07 8:00:09 AM
To Drill an Entry through Worksheets The next step is to replace the dummy numbers in the range C5:C11 with the average unit cost for each type of DVR (Table 6–4). The average unit costs for each category are identical on all four sheets. For example, the average unit cost for the JVC DVR in cell C5 is $185.61 on all four sheets. To speed data entry, Excel allows you to enter a number once and drill it through worksheets so it is entered in the same cell on all the selected worksheets. This technique is referred to as drilling an entry. The following steps drill the seven average unit cost entries in Table 6–4 through all four worksheets in the range C5:C11.
Excel Chapter 6
Creating a Workbook from a Template EX 451
Table 6–4 Average Unit Cost Entries Company
Average Unit Cost
JVC
185.61
Motorola
165.79
Philips
302.99
Sanyo
296.09
Sony
184.49
Tivo
165.80
Toshiba
297.38
1 • With Sheet1 active, hold down the SHIFT key and then click the Sheet3
tab to select all four tabs at the bottom of the window.
• Select cell C5. Type 185.61 and then press the DOWN ARROW key.
• Enter the six remaining average unit costs in Table 6–4 in the range C6:C11 to display the average unit cost entries as shown in Figure 6–38.
Excel drills average unit costs entered on Sheet1 through to same cells on Sheet4, Sheet2, and Sheet3
Sheet4, Sheet2, Sheet3 selected
Figure 6–38
C6428_06_CTP.4c.indd 451
6/14/07 8:00:12 AM
EX 452 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
2 • Hold down the SHIFT key and then click the Sheet1 tab to deselect Sheet4, Sheet2, and Sheet3. • One at a time, click the Sheet4 tab, the Sheet2 tab, and the Sheet3 tab to verify that all four sheets are identical Q&A
(Figure 6–39). What is the benefit of drilling data through worksheets? In the previous set of steps, seven new numbers were entered on one worksheet. As shown in Figure 6–39, by drilling the entries through the four other worksheets, 28 new numbers now appear, seven on each of the four worksheets. Excel’s capability of drilling data through worksheets is an efficient way to enter data that is common among worksheets.
same average unit costs appear on all four sheets
Sheet1 Sheet4 Sheet2 Sheet3
Figure 6–39
BTW
To Modify the Louisville Sheet Drilling an Entry Besides drilling a number down through a workbook, you can drill a format, a function, or a formula down through a workbook.
With the skeleton of the NextDVR Profit Potential workbook created, the next step is to modify the individual sheets. The following steps modify the Louisville sheet (Sheet 4) by changing the sheet name, tab color, and worksheet subtitle; changing the color of the title area; and entering the units on hand values in column B. Table 6–5 Louisville Units On Hand Cell
C6428_06_CTP.4c.indd 452
Units on Hand
B5
335
B6
220
B7
323
6/14/07 8:00:14 AM
Table 6–5 Louisville Units On Hand (continued) Cell
Units on Hand
B8
144
B9
195
B10
364
B11
273
1
Double-click the Sheet4 tab. Type Louisville and then press the ENTER key. Right-click the Louisville tab, point to Tab Color on the shortcut menu, and then click Light Green (column 5, row 1 in the Standard Colors area) on the Color palette.
2
Double-click cell A2, drag through the word, Region, and then type Louisville to change the worksheet subtitle.
3
Select the range A1:A2, click the Fill Color button arrow on the Ribbon, and then click Light Green (column 5, row 1 in the Standard Colors area) on the Fill Color palette.
4
Enter the data listed in Table 6–5 in the range B5:B11 (Figure 6–40).
5
Select cell A14 and then click the Save button on the Quick Access Toolbar.
Excel Chapter 6
Creating a Workbook from a Template EX 453
worksheet subtitle changed
Louisville sheet complete
Louisville units on hand data
sheet renamed Louisville and tab color changed
Figure 6–40
C6428_06_CTP.4c.indd 453
6/14/07 8:00:25 AM
EX 454 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
BTW
To Modify the Kansas City Sheet Importing Data Costs, such as those entered into the range C5:C11, often are maintained in another workbook, a file, or a database. If the costs are maintained elsewhere, ways exist to link to a workbook or import data from a file or database into a workbook. Linking to a workbook is discussed later in this chapter. For information on importing data, see the From Other Sources button on the Data tab on the Ribbon.
The following steps modify the Kansas City sheet (Sheet 2). Table 6–6 Kansas City Units On Hand Cell
Units on Hand
B5
403
B6
281
B7
228
B8
312
B9
357
B10
278
B11
345
1
Double-click the Sheet2 tab. Type Kansas City and then press the ENTER key. Right-click the Kansas City tab, point to Tab Color on the shortcut menu, and then click Red (column 2, row 1 in the Standard Colors area) on the Color palette.
2
Double-click cell A2, drag through the word, Region, and then type Kansas City to change the worksheet subtitle.
3
Select the range A1:A2, click the Fill Color button arrow on the Ribbon, and then click Red (column 2, row 1 in the Standard Colors area) on the Fill Color palette.
4
Enter the data listed in Table 6–6 in the range B5:B11 (Figure 6–41).
5
Select cell A14 and then click the Save button on the Quick Access Toolbar.
worksheet subtitle changed
Kansas City sheet complete Kansas City units on hand data
sheet renamed Kansas City and tab color changed
Figure 6–41
C6428_06_CTP.4c.indd 454
6/14/07 8:00:27 AM
To Modify the Portland Sheet As with the Louisville and Kansas City sheets, the sheet name, tab color, worksheet subtitle, data, and background colors must be changed on the Portland sheet. The following steps modify the Portland sheet.
Excel Chapter 6
Creating a Workbook from a Template EX 455
Table 6–7 Portland Units On Hand Cell
Units on Hand
B5
253
B6
215
B7
352
B8
387
B9
339
B10
282
B11
400
1
Double-click the Sheet3 tab. Type Portland and then press the ENTER key. Right-click the Portland tab, point to Tab Color on the shortcut menu, and then click Purple (column 10, row 1 in the Standard Colors area) on the Color palette.
2
Double-click cell A2, drag through the word, Region, and then type Portland to change the worksheet subtitle.
3
Select the range A1:A2, click the Fill Color button arrow on the Ribbon, and then click Purple (column 10, row 1 in the Standard Colors area) on the Fill Color palette.
4
Enter the data listed in Table 6–7 in the range B5:B11 (Figure 6–42).
5
Select cell A14 and then click the Save button on the Quick Access Toolbar.
worksheet subtitle changed
Portland sheet complete
Portland units on hand data
sheet renamed Portland and tab color changed
Figure 6–42
C6428_06_CTP.4c.indd 455
6/14/07 8:00:30 AM
EX 456 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Referencing Cells in Other Sheets in a Workbook With the three region sheets complete, the next step is to modify Sheet1, which will serve as the consolidation worksheet containing totals of the data on the Louisville, Kansas City, and Portland sheets. Because this sheet contains totals of the data, you need to understand how to reference cells in other sheets in a workbook before modifying Sheet1. To reference cells in other sheets in a workbook, you use the sheet name, which serves as the sheet reference, and the cell reference. For example, you refer to cell B5 on the Louisville sheet as shown below. =Louisville!B5 Using this method, you can sum cell B5 on the three region sheets by selecting cell B5 on the Sheet1 sheet and then entering: = Louisville!B5 + Kansas City!B5 + Portland!B5 A much quicker way to total the three cells is to use the SUM function as follows:
BTW
=SUM(Louisville:Portland!B5) Circular References A circular reference is a formula that depends on its own value. The most common type is a formula that contains a reference to the same cell in which the formula resides.
The SUM argument (Louisville:Portland!B5) instructs Excel to sum cell B5 on each of the three sheets (Louisville, Kansas City, and Portland). The colon (:) between the first sheet name and the last sheet name instructs Excel to include these sheets and all sheets in between, just as it does with a range of cells on a sheet. A range that spans two or more sheets in a workbook such as Louisville:Portland!B5 is called a 3-D range. The reference to this range is a 3-D reference. A sheet reference such as Portland! always is absolute. Thus, the sheet reference remains constant when you copy formulas.
Entering a Sheet Reference You can enter a sheet reference in a cell by typing the sheet reference or by clicking the appropriate sheet tab while in Point mode. When you click the sheet tab, Excel activates the sheet and automatically adds the sheet name and an exclamation point after the insertion point in the formula bar. Next, select or drag through the cells you want to reference on the sheet. If the range of cells to be referenced is located on several worksheets (as when selecting a 3-D range), click the first sheet tab and then select the cell or drag through the range of cells. Next, while holding down the SHIFT key, click the sheet tab of the last sheet you want to reference. Excel will include the cell(s) on the first sheet, the last sheet, and any sheets in between.
BTW
To Modify the Company Sheet 3-D References If you are summing numbers on noncontiguous sheets, hold down the CTRL key rather than the SHIFT key when selecting the sheets.
C6428_06_CTP.4c.indd 456
This section modifies the Company sheet by changing the sheet name, tab color, and subtitle and then entering the SUM function in each cell in the range B5:B11. The SUM functions will determine the total units on hand at the three regions, by company. Cell B5 on the Company sheet, for instance, will contain the sum of the JVC DVR units on hand in cells Louisville!B5, Kansas City!B5, and Portland!B5. Before determining the totals, the following steps change the sheet name from Sheet1 to Company, color the tab, and change the worksheet subtitle to Company Profit Potential.
6/14/07 8:00:32 AM
1
Double-click the Sheet1 sheet tab, type Company and then press the ENTER key. Right-click the Company tab, point to Tab Color on the shortcut menu, and then click Light Blue (column 7, row 1 in the Standard Colors area) on the Color palette.
2
Double-click cell A2, drag through the word, Region, and then type Company as the worksheet subtitle. Press the ENTER key.
Excel Chapter 6
Creating a Workbook from a Template EX 457
To Enter and Copy 3-D References Using the Paste Button Menu The following steps enter the 3-D references used to determine the total units on hand for each of the seven DVR companies. In these steps, the Formulas command on the Paste button menu on the Ribbon is used to complete the paste operation. When the Formulas command is used, the paste operation pastes only the formulas, leaving the formats of the destination area unchanged.
1 • Select cell B5 and
Sum button
then click the Sum button on the Ribbon to display the SUM function and ScreenTip (Figure 6–43).
worksheet subtitle changed no range added within parentheses because text data is above and to the left of cell B5
cell B5 should contain sum of Louisville, Kansas City, and Portland Units on Hand
sheet renamed Company and tab color changed
Figure 6–43
C6428_06_CTP.4c.indd 457
6/14/07 8:00:32 AM
EX 458 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
SUM function entered in cell B5 of Company sheet
2 • Click the Louisville tab and then
Enter box
click cell B5. While holding down the SHIFT key, click the Portland tab to surround cell Louisville!B5 with a marquee (Figure 6–44). marquee surrounds selected cell on Louisville sheet
Louisville units on hand data
SUM function entered on Company sheet
Louisville sheet active
Kansas City and Portland sheets selected
Figure 6–44
3 • Click the Enter box in the formula bar to enter the SUM function with the 3-D references in cell Company!B5 (Figure 6–45).
SUM function with 3-D references entered in cell Company!B5 991 in cell B5 is sum of cell B5 on Louisville sheet (335), Kansas City sheet (403), and Portland sheet (253)
after SUM function entered, new Company sheet tab name appears
Figure 6–45
C6428_06_CTP.4c.indd 458
6/14/07 8:00:34 AM
4 • With cell B5 active, click the Copy button on the Ribbon to copy the SUM function and the formats assigned to cell B5 to the Office Clipboard (Figure 6–46).
Copy button
Excel Chapter 6
Creating a Workbook from a Template EX 459
marquee surrounds source area
Figure 6–46
5 • Select the range B6:B11 and then click the Paste button arrow on the Ribbon to display the Paste button menu (Figure 6–47).
Paste button arrow
Formulas command
Paste button menu
destination range is B6:B11
Figure 6–47
C6428_06_CTP.4c.indd 459
6/14/07 8:00:37 AM
EX 460 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
6 • Click Formulas on the Paste button menu to copy the SUM function in cell B5 to the range B6:B11 (Figure 6–48) and automatically adjust the cell references in the SUM function to reference the corresponding cells on the three sheets in the workbook.
formulas automatically recalculated
• Press the ESC key to clear the marquee surrounding cell B5 and then select cell A14 to deselect the range B6:B11.
total units on hand at the three stores for each brand of DVR
• Click the Save button
total units on hand for entire company
on the Quick Access Toolbar to save the NextDVR Profit Potential workbook.
company profit potential based on current units on hand of all three regions
Figure 6–48
More About Pasting If you click the Paste button on the Ribbon to complete the paste operation, rather than using the Formulas command as shown in Figure 6–47 on the previous page, then any formats assigned to cell B5 also will be copied to the range B6:B11. Completing the paste operation by using the fill handle or by pressing the ENTER key also will copy any formats from the source area to the destination area. When you use the Formulas command on the Paste button menu, Excel copies the SUM function, but not the format, assigned to cell B5. In this example, the format assigned to cell B5 is the same as the format assigned to the range B6:B11, so it does not matter if you use the Paste button or the Formulas command. In many cases, however, the formats of the source area and destination area differ; the Paste button menu, thus, is a useful option to complete the copy and paste operation. Table 6–8 summarizes the commands available on the Paste button menu, as shown in Figure 6–47. Table 6–8 Paste Button Menu Commands
C6428_06_CTP.4c.indd 460
Command
Description
Paste
Pastes in the same manner as clicking the Paste button.
Formulas
Pastes the formulas from the source area, but not the formats.
Paste Values
Pastes the value of the formula from the source area, but not the formulas or formats.
No Borders
Pastes the formula and all formats from the source area, except for borders.
6/14/07 8:00:40 AM
Command
Description
Transpose
Pastes the formula and formats from the source area, but transposes the columns and rows. For example, if you are summing numbers in a column in the source area, then Excel will sum numbers in a row in the destination area.
Paste Link
Pastes the cell reference of the source area in the destination area.
Paste Special
Displays the Paste Special dialog box that allows you to choose what you want pasted from the source area to the destination area.
Paste as Hyperlink
Pastes the contents of the Office Clipboard as a hyperlink, which you then can edit.
As Picture
Displays the As Picture submenu, which allows you to convert the contents of the Office Clipboard to an image.
Drawing the Clustered Cone Chart The requirements document shown in Figure 6–2 on page EX 420 requires a Clustered Cone chart. The Clustered Cone chart is similar to a 3-D Bar chart in that it can be used to show trends or illustrate comparisons among items. Plan the layout and location of the required chart. The Clustered Cone chart in Figure 6–49, for example, compares the total profit potential of the different brands of DVRs in inventory. The chart should be placed on a separate worksheet so that the company and region worksheets maintain a similar look. WordArt is used to draw the reflected chart title, Profit Potential, in an eye-catching and professional format. A text box, arrow, and brace are used to highlight the DVR brand with the greatest profit potential.
BTW
Table 6–8 Paste Button Menu Commands (continued)
Excel Chapter 6
Drawing the Clustered Cone Chart EX 461
The Move Chart Button The Move Chart button on the Design contextual tab on the Ribbon can be used to move a chart from a chart sheet to a worksheet. Click the Move Chart button on the Ribbon, select the Object in check box, and then select a destination worksheet for the chart in the Object in list in the Move Chart dialog box.
Plan Ahead
cones show profit potential for different types of DVRs
chart title drawn using WordArt text box, arrow, and brace added to emphasize greatest profit potential
Clustered Cone chart drawn on separate sheet
Figure 6–49
C6428_06_CTP.4c.indd 461
6/14/07 8:00:42 AM
EX 462 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
To Draw the Clustered Cone Chart The following steps add a Clustered Cone chart to a new sheet and then change the layout of the chart to rotate it, remove the series label, and add a title to the horizontal axis.
1 • With the Company
Move Chart button
sheet active, select the range A5:A11.
• Hold down the CTRL key and then select the range G5:G11.
• Click the Insert tab on the Ribbon. Clustered Cone chart added to Company worksheet
• Click the Column button on the Ribbon and then click Clustered Cone (column 1, row 4) in the Column gallery to insert a Clustered Cone chart (Figure 6–50).
Figure 6–50
C6428_06_CTP.4c.indd 462
6/14/07 8:00:44 AM
2 • Click the Move Chart button on the Ribbon.
Excel Chapter 6
Drawing the Clustered Cone Chart EX 463
• When Excel displays the Move Chart dialog box, click New sheet and then type Clustered Cone Chart as the sheet name.
• Click the OK button in the Move Chart dialog box to move the chart to a new sheet (Figure 6–51).
chart moved to new sheet
Figure 6–51
3 • Click the Layout tab on the Ribbon and then click the 3-D Rotation button on the Ribbon to display the Format Chart Area dialog box.
Layout tab
3-D Rotation button
chart rotated on x and y-axis
• Type 70 in the X text box in the Rotation area to rotate the chart 70% along the X-axis.
• Type 30 in the Y text
legend
box in the Rotation area to rotate the chart 30% along the Y-axis.
• Click the Close button in the Format Chart Area dialog box (Figure 6–52).
Figure 6–52
C6428_06_CTP.4c.indd 463
6/14/07 8:00:45 AM
EX 464 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
4 • Click the Legend button on the Ribbon and then click None to remove the legend from the right side of the chart (Figure 6–53).
Legend button
5 • Click the Axis Titles button on the Ribbon to display the Axis Titles menu.
chart enlarged after legend removed
• Point to Primary Horizontal Axis Title on the Axis Titles menu and then click Title Below Axis in the Primary Horizontal Axis Title gallery to add a title to the horizontal axis.
• Select the horizontal
Q&A
axis title and type Company as the new title (Figure 6–54). Figure 6–53
What does the chart show? The Clustered Cone chart compares the profit potential of the seven different brands of digital cameras. You can see from the chart that, of the DVRs in inventory, the Toshiba brand DVRs have the greatest profit potential and the Motorola brand cameras have the least profit potential.
Axis Titles button
horizontal axis title added and changed to Company
Other Ways 1. Select range, click Chart type button in Charts group on Insert tab, click Chart type in gallery
Figure 6–54
2. Select range, press F11
C6428_06_CTP.4c.indd 464
6/14/07 8:00:50 AM
To Format the Clustered Cone Chart The following steps color the sheet tab, move the sheet, change the color of the cylinders and the chart walls, and format the y-axis (values axis) and x-axis (category axis).
1
Right-click the Clustered Cone Chart sheet tab, point to Tab Color on the shortcut menu, and then click Aqua, Accent 3 (column 7, row 1) on the Color palette.
2
If necessary, drag the tab split box (Figure 6–55) to the right to ensure all five tabs show. Drag the Clustered Cone Chart sheet tab to the right of the Portland sheet tab.
3
Click the chart wall behind the cones, click the Home tab on the Ribbon, click the Fill Color button arrow on the Ribbon, and then click Lavender, Accent 5, Lighter 40% (column 9, row 4) on the Fill Color palette.
4
Click the floor of the chart below the cones, click the Fill Color button arrow on the Ribbon, and then click White, Background 1, Darker 15% (column 1, row 3) on the Fill Color palette.
5
Click one of the cylinders to select all the cones, click the Fill Color button arrow on the Ribbon, and then click Aqua, Accent 3 (column 7, row 1) on the Fill Color palette.
6
Click the x-axis and then click the Bold button on the Ribbon. Click the y-axis and then click the Bold button on the Ribbon. Click outside the chart area to display the chart as shown in Figure 6–55.
Excel Chapter 6
Drawing the Clustered Cone Chart EX 465
wall color of chart changed to lavender
cone color changed to aqua
floor color of chart changed to dark white chart sheet dragged to right of Portland sheet and tab color changed to aqua
tab split box
Figure 6–55
C6428_06_CTP.4c.indd 465
6/14/07 8:00:56 AM
EX 466 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
To Add a Chart Title Using the WordArt Tool Earlier, you learned how to add a chart title by using the Chart Title button on the Layout tab on the Chart Tools contextual tab on the Ribbon. You also learned how to format it using the Home tab on the Ribbon. You also can create a chart title using the WordArt tool. The WordArt tool allows you to create shadowed, skewed, rotated, and stretched text on a chart sheet or worksheet and apply other special text formatting effects. The WordArt text added to a worksheet is called an object. The following steps show how to add a chart title using the WordArt tool.
1 • With the Clustered
Insert tab WordArt button
Cone Chart sheet active, click anywhere on the chart, and then click the Insert tab on the Ribbon.
• Click the WordArt
WordArt gallery
button on the Ribbon to display the WordArt gallery.
Gradient Fill – Accent 4, Reflection selection
• When Excel displays the WordArt gallery, point to the Gradient Fill – Accent 4, Reflection (column 5, row 4) selection in the WordArt gallery (Figure 6–56).
Figure 6–56
2 • Click the Gradient Fill – Accent 4, Reflection selection in the WordArt gallery to insert a new WordArt object.
• When Excel displays the WordArt object on the chart, type Profit Potential as the title of the Clustered Cone chart (Figure 6–57).
edge of WordArt object
WordArt object added to chart and modified
Figure 6–57
C6428_06_CTP.4c.indd 466
6/14/07 8:00:58 AM
3 • Select the text in the WordArt object to display the Mini toolbar (Figure 6–58).
Excel Chapter 6
Drawing the Clustered Cone Chart EX 467
Font Size box arrow
Mini toolbar
Figure 6–58
4 • Click the Font Size box arrow on the Mini toolbar and then click 44 in the Font Size list to change the font size of the WordArt object to 44 (Figure 6–59). Font Size changed to 44 and WordArt object resized automatically
Figure 6–59
C6428_06_CTP.4c.indd 467
6/14/07 8:01:01 AM
EX 468 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
5 • Drag the top edge of the WordArt object so that the object is positioned above the cones in the chart as shown in Figure 6–60.
WordArt object dragged to top of chart as chart title
Figure 6–60
6 • Click outside the chart area to deselect the WordArt object (Figure 6–61). chart formatted
Figure 6–61 Other Ways 1. Click WordArt button on Insert tab
C6428_06_CTP.4c.indd 468
2. Right-click object, click Format Shape on shortcut menu
6/14/07 8:01:04 AM
To Add a Text Box, Arrow, and Brace to the Chart A text box, arrow, and a brace can be used to annotate (call out or highlight) other objects or elements in a worksheet or chart. For example, in a worksheet, you may want to annotate a particular cell or group of cells by adding a text box, arrow, and brace. In a chart, you may want to emphasize a column or slice of a Pie chart. A text box is a rectangular area of variable size in which you can add text. You use the sizing handles to resize a text box in the same manner you resize an embedded chart or a WordArt object. If the text box has the same color as the background, then the text appears as if it was written freehand, because the box itself does not show. An arrow allows you to connect an object, such as a text box, to an item that you want to annotate. A brace allows you to point out a large item or a group of items that you want to annotate. The following steps add the text box, arrow, and brace indicated in the sketch of the chart in Figure 6–3b on page EX 422 and also shown in Figure 6–49 on page EX 461.
1 • Click the Insert tab on the Ribbon.
Excel Chapter 6
Drawing the Clustered Cone Chart EX 469
Insert tab Shapes button
• Click the Shapes button on the Ribbon to display the Shapes gallery (Figure 6–62). Text box button
Shapes gallery
Figure 6–62
C6428_06_CTP.4c.indd 469
6/14/07 8:01:07 AM
EX 470 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
2 • Click the Text Box button (column 1, row 1) in the Shapes gallery to select it.
• Point to the upper-left corner of the planned text box location, and then drag the crosshair to the lower-right corner.
• With the insertion point active
Q&A
in the text box, type Greatest Profit Potential as the text to display in the text box as shown in Figure 6–63. What if the Text Box button is not in that location in the Shapes gallery? When Excel is first installed on a computer, it places commonly used shapes in the Recently Used Shapes area in the Shapes gallery. If users of your computer have used other shapes, they may have displaced the Text Box button in the Recently Used Shapes area. The Text Box shape also appears as the first shape in the Basic Shapes area in the Shapes gallery.
shape added to chart above fourth and fifth cones and text in box changed to Greatest Profit Potential
Figure 6–63 Format tab
Subtle Line – Dark 1 shape style
3 • Click the Insert tab on the Ribbon, click the Shapes button on the Ribbon, and then click the Left Brace button in the Shapes gallery (column 4, row 2).
brace shape added to chart and color changed
• Point to the bottom-left corner of the Toshiba cone and then drag up to the top of the Toshiba cone and then slightly to the left to draw the brace. • Click the Subtle Line - Dark 1
Q&A
shape style in the Shape Styles group to select it and change the color of the brace (Figure 6–64). Why should I add the brace before adding the arrow? The arrow will connect the text box shape and the brace shape. Placing the start and ending points of the arrow will be easier with the targets already in place.
C6428_06_CTP.4c.indd 470
Figure 6–64
6/14/07 8:01:09 AM
4 • Click the Insert tab on the Ribbon, click the Shapes button on the Ribbon, and then click the Arrow button in the Shapes gallery (column 3, row 1).
Excel Chapter 6
Adding a Header, Changing the Margins, and Printing the Workbook EX 471
• Point immediately to the right of the letter t in Profit in the text box, and then drag the arrow to the center of the brace to draw the arrow.
arrow shape added to chart and color changed
• Click the Subtle Line - Dark 1 shape style in the Shape Styles group to select it and change the color of the brace.
• Click outside the chart area to deselect the chart (Figure 6–65).
5 • Click the Company
Figure 6–65
tab and then select cell A14 to deselect the chart range.
• Click the Save button on the Quick Access Toolbar to save the workbook.
Adding a Header and Footer, Changing the Margins, and Printing the Workbook A header is printed at the top of every page in a printout. A footer is printed at the bottom of every page in a printout. By default, both the header and footer are blank. You can change either so that information, such as the workbook author, date, page number, or tab name, prints at the top or bottom of each page. Sometimes, you will want to change the margins to increase or decrease the white space surrounding the printed worksheet or chart. The default margins in Excel for both portrait and landscape orientation are set to the following: Top = .75 inch; Bottom = .75 inch; Left = .7 inch; Right = .7 inch. The header and footer are set at .3 inch from the top and bottom, respectively. You also can center a printout horizontally and vertically. Changing the header and footer and changing the margins are all part of page setup, which defines the appearance and format of a printed worksheet. To change page setup characteristics, select the desired sheet(s) and then click the Page Layout tab on
C6428_06_CTP.4c.indd 471
6/14/07 8:01:13 AM
EX 472 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
the Ribbon. Remember to select all the sheets you want to modify before you change the headers, footers, or margins, because the page setup characteristics will change only for selected sheets. The headers and footers for chart sheets must be assigned separately from worksheets.
To Add a Header and Footer, Change Margins, and Center the Printout Horizontally As you modify the page setup, remember that Excel does not copy page setup characteristics when one sheet is copied to another. Thus, even if you assigned page setup characteristics to the template before copying it to the NextDVR Profit Potential workbook, the page setup characteristics would not copy to the new sheet. The following steps use the Page Setup dialog box to change the headers, footers and margins and center the printout horizontally.
1 • With the Company sheet active,
Page Layout tab
scroll to the top of the document.
• While holding down the SHIFT key, click the Portland sheet tab to select the four worksheet tabs.
• Click the Page Layout tab on the
Page Setup Dialog Box Launcher
Ribbon (Figure 6–66).
four worksheets selected
Figure 6–66
C6428_06_CTP.4c.indd 472
6/14/07 8:01:15 AM
2 • Click the Page Setup
Page Setup dialog box
Dialog Box Launcher to display the Page Setup dialog box.
Margins tab
• When Excel displays
Excel Chapter 6
Adding a Header, Changing the Margins, and Printing the Workbook EX 473
Header is .3” from top of page
the Page Setup dialog box, if necessary, click the Margins tab.
Top box
• Double-click the Top box and then type 1.5 to change the top margin to 1.5 inch.
Left and Right boxes
• Enter .5 in both the Left box and Right box to change the left and right margins to .5 inch.
Bottom box center printout horizontally
center printout vertically
• Click the Horizontally check box in the ‘Center on page’ area to select it. This will center the worksheet on the page horizontally (Figure 6–67).
3 • Click the OK button in the Page Setup dialog box to close it.
OK button
Figure 6–67
worksheet displayed in Page Layout view
• Click the Page Layout button on the status bar to display the worksheet in Page Layout view (Figure 6–68).
Page Layout button
Figure 6–68
C6428_06_CTP.4c.indd 473
6/14/07 8:01:17 AM
EX 474 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
4 • If necessary, scroll the worksheet up until the Header area is displayed. Click the left Header box, type J. Quasney (or your name if you are stepping through the chapter on a computer), press the ENTER key, and then type Profit Potential to complete the entry.
Current Date button
left header will show name and workbook name
Current Time button
Sheet Name button
center header will show sheet name
right header will show date and time
• Click the center section box and then click the Sheet Name button on the Ribbon to instruct Excel to insert the sheet name that appears on the sheet tab as part of the header.
• Click the right
Figure 6–69 Header box, click the Current Date button on the Ribbon, press the COMMA key, press the SPACEBAR, and then click the Current Time button on the Ribbon to insert the date and time in the Header (Figure 6–69).
5 • Scroll the workbook
Number of Pages button
down to view the Footer area.
• Click the middle
Q&A
section box, type Page, press the SPACEBAR, click the Page Number button on the Ribbon, press the SPACEBAR, type of, press the SPACEBAR, and then click the Number of Pages button on the Ribbon to add the footer (Figure 6–70).
Page Number button
What does Excel insert when I click a button in the Header & Footer Tools group on the Ribbon?
page footer will show page number and total number of pages
Figure 6–70
When you click a button in the Header & Footer Tools group on the Ribbon (Figure 6–70), Excel enters a code (similar to a format code) into the active header or footer section. A code such as &[Page] instructs Excel to insert the page number.
C6428_06_CTP.4c.indd 474
6/14/07 8:01:22 AM
6 • Click anywhere on the worksheet
Next Page button
to deselect the page footer.
Previous Page button
• Click the Normal view button on
Close Print Preview button
the status bar and then select cell A14. Click the Page Layout tab on the Ribbon and then click the Page Setup Dialog Box Launcher on the Ribbon to display the Page Setup dialog box.
Excel Chapter 6
Adding a Header, Changing the Margins, and Printing the Workbook EX 475
page header
top margin set at 1.5”
• Click the Print Preview button in the Page Setup dialog box to preview the Company sheet (Figure 6–71).
7 • Click the Next Page button and Previous Page button on the Print Preview tab on the Ribbon to preview the other pages.
left and right margins set at .5”
• After previewing the printout, click the Close Print Preview button on the Ribbon.
page 1 of 4
page footer
Figure 6–71
To Add a Header to the Clustered Cone Chart Sheet The following steps add the same header applied to the four worksheets in the previous steps to the Clustered Cone Chart sheet.
1
Click the Clustered Cone Chart tab and then on the Page Layout tab, click the Page Setup Dialog Box Launcher.
2
When Excel displays the Page Setup dialog box, click the Header/Footer tab, click the Custom Header button, and in the left header box type J. Quasney (or your name if you are stepping through the chapter on a computer). Press the ENTER key and then type Profit Potential to complete the entry.
3
In the center header box, type &[Tab] to instruct Excel to print the sheet name in the Center Header section.
4
In the right header box, type &[Date], &[Time] to instruct Excel to print the sheet name in the Right Header section.
5
Click the OK button in the Header dialog box and then click the OK button in the Page Setup dialog box.
6
Click the Company tab. Click the Save button on the Quick Access Toolbar to save the workbook.
C6428_06_CTP.4c.indd 475
6/14/07 8:01:25 AM
EX 476 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
BTW
To Print All Worksheets in a Workbook Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
The following steps print all five sheets in the workbook by selecting all the sheets before clicking the Print command on the Office Button menu.
1
Ready the printer.
2
Click the Company sheet tab. While holding down the SHIFT key, click the Clustered Cone Chart tab.
3
Click the Print command on the Office Button menu and then click the OK button in the Print dialog box to print the workbook as shown in Figure 6–72a and 6-72b.
4
Hold down the SHIFT key and then click the Company sheet tab to deselect all sheets but the Company sheet.
To Print Nonadjacent Sheets in a Workbook In some situations, nonadjacent sheets in a workbook may need to be printed. To select nonadjacent sheets, select the first sheet and then hold down the CTRL key and click the nonadjacent sheets. The following steps show how to print the nonadjacent Company, Louisville, and Clustered Cone Chart sheets.
1
With the Company sheet active, hold down the CTRL key, click the Louisville sheet tab, and then click the Clustered Cone Chart tab.
2
Click the Print command on the Office Button menu and then click the OK button in the Print dialog box.
3
Hold down the SHIFT key and click the Company sheet tab to deselect the Louisville and Clustered Cone Chart sheets.
Selecting and Deselecting Sheets Beginning Excel users sometimes have difficulty trying to select and deselect sheets. Table 6–9 summarizes how to select and deselect sheets. Table 6–9 Summary of How to Select and Deselect Sheets
C6428_06_CTP.4c.indd 476
Task
How to Carry Out the Task
Select adjacent sheets
Select the first sheet by clicking its tab and then hold down the SHIFT key and click the sheet tab at the other end of the list of adjacent sheet tabs.
Select nonadjacent sheets
Select the first sheet by clicking its tab and then hold down the CTRL key and click the sheet tabs of the remaining sheets you want to select.
Multiple sheets selected and you want to select a sheet that is selected, but not active (sheet tab name not in bold)
Click the sheet tab you want to select.
Multiple sheets selected and you want to select the active sheet (sheet tab name in bold)
Hold down the SHIFT key and then click the sheet tab of the active sheet.
6/14/07 8:01:29 AM
Excel Chapter 6
Adding a Header, Changing the Margins, and Printing the Workbook EX 477
(a) Four Worksheets
left header
custom header added to Clustered Cone chart
center header
right header
Clustered Cone chart printed in landscape orientation
(b) 3-D Clustered Cone Chart Figure 6–72
C6428_06_CTP.4c.indd 477
6/14/07 8:01:30 AM
EX 478 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
To Insert and Remove a Page Break When you print a worksheet or use the Page Setup dialog box, Excel inserts page breaks that show the boundaries of what will print on each page. These page breaks are based upon the margins selected in the Margins sheet in the Page Setup dialog box and the type of printer you are using. If the Page breaks option is selected, then Excel displays dotted lines on the worksheet to show the boundaries of each page. For example, the dotted line in Figure 6–73 shows the right boundary of the first page. If the dotted line does not show on your screen, then click Excel Options on the Office Button menu. When Excel displays the Excel Options dialog box, click the Advanced command to display Advanced Excel options. Scroll the window until the ‘Display options for this worksheet’ area appears. Click the Show page breaks check box (Figure 6–75 on page EX 480). You can insert both horizontal and vertical page breaks in a worksheet. Manual page breaks are useful if you have a worksheet that is several pages long and you want certain parts of the worksheet to print on separate pages. For example, say you had a worksheet that comprised ten departments in sequence and each department had many rows of information. If you wanted each department to begin on a new page, then inserting page breaks would satisfy the requirement. To insert a horizontal page break, you select a cell in column A or an entire row that you want to print on the next page and then click the Breaks button on the Page Layout tab. When the Breaks menu is displayed, click the Insert Page Break command. To insert a vertical page break, you select a cell in row 1 or an entire column that you want to print on the next page and then click the Insert Page Break command. Excel displays a dotted line to indicate the beginning of a new page. To remove a page break, you select the cell in the row immediately below or to the right of the dotted line that indicates the page break you want to remove and then click the Remove Page Break command on the Insert Breaks menu. Excel also includes a Page Break view that allows you to change page breaks by dragging them. The following steps insert both a horizontal and vertical page break.
1 • With the Company sheet active,
Page Layout tab Breaks button
select cell B12 and then click the Page Layout tab on the Ribbon.
• Click the Breaks button on the
Q&A
Ribbon and then click Insert Page Break on the Breaks menu to insert a page break (Figure 6–73). What appears on the worksheet? Excel inserts a dotted line above row 12 indicating a horizontal page break and inserts a dotted line to the left of column B indicating a vertical page break (Figure 6–73).
page 1
page 3
page 2
page 4
Figure 6–73
C6428_06_CTP.4c.indd 478
6/14/07 8:05:36 AM
2 • With cell B12 active,
Breaks button
click the Breaks button on the Ribbon to display the Breaks menu (Figure 6–74).
• Click Remove Page
Q&A
Remove Page Break command
Breaks menu
Break to remove the page breaks.
Excel Chapter 6
Adding a Header, Changing the Margins, and Printing the Workbook EX 479
Is there a way to move page breaks? Yes. An alternative to using the Breaks command on the Page Layout tab on the Ribbon to insert page breaks is to click the Page Break Preview button on the status bar. When the Page Break preview appears, you can drag the blue boundaries, which represent page breaks, to new locations.
page break removed
original page break remains
Figure 6–74 Other Ways 1. Click Page Break Preview button on View tab, click OK button, drag page breaks
2. Select cell, press ALT+P, B, I
To Hide Page Breaks When working with a workbook, page breaks can be an unnecessary distraction, especially to users who have no interest in where pages break. The following steps show how to hide the dotted lines that represent page breaks.
C6428_06_CTP.4c.indd 479
6/14/07 8:05:44 AM
EX 480 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
1 • Click the Office
Office Button
Excel Options dialog box
Button and then click the Excel Options button on the Office Button menu.
• When Excel displays the Excel Options dialog box, click the Advanced button to display Advanced Excel options.
Advanced button
• Scroll the window until the ‘Display options for this worksheet’ area appears.
Show page breaks check box
• Click the ‘Show page breaks’ check box to clear the check box (Figure 6–75).
OK button
Figure 6–75
2 • Click the OK button to hide the page breaks as shown in Figure 6–76.
dotted line representing vertical page break hidden
Figure 6–76 Other Ways 1. Press ALT+P, B, R
Saving a Workbook as a PDF or XPS file Excel provides additional options for distributing your final workbook project. Often you may want to distribute copies of a workbook to others who do not have access to Excel. The printed pages shown in Figure 6–72 on page EX 477 provide one method for distributing the workbook. Excel also allows you to distribute an electronic version of the printed pages using two different file formats: PDF and XPS. For each of these file formats, the workbook appears in an electronic format to the reader of the workbook, with one worksheet displayed as a separate page. The reader may not make changes to the documents; they, therefore, often are considered electronic printed versions of the workbook.
C6428_06_CTP.4c.indd 480
6/14/07 8:05:47 AM
When you distribute a workbook as a PDF or XPS file, those who want to read the workbook must have a reader program installed. The most common PDF reader is Acrobat Reader from Adobe. Microsoft provides a reader for its newer XPS file format. To save a workbook in the PDF and XPS file formats, you must install an add-on program from Microsoft’s Web site. The add-on program is available as a free download from Microsoft, and a link to the Web site is provided in Excel Help. Once installed, the Save As submenu on the Office Button menu includes a new PDF or XPS command. When you click the command, Excel displays the Publish as PDF or XPS dialog box which allows you to choose a file name for the document, a location to save the document, and other options.
BTW
The Find and Replace Commands A string can be a single character, a word, or a phrase in a cell on a worksheet. You display the Find & Select menu by clicking the Find & Select button on the Ribbon. The Find command on the Find & Select menu is used to locate a string. The Replace command on the Find & Select menu is used to locate one string and then replace it with another string. The Find and Replace commands are not available for a chart sheet. Both the Find and Replace commands cause the Find and Replace dialog box to be displayed. The Find and Replace dialog box has two variations. One version displays minimal options, while the other version displays all of the available options. When you invoke the Find or Replace command, Excel displays the dialog box variation that was used the last time either command was invoked.
Excel Chapter 6
The Find and Replace Commands EX 481
The Find Command If you want to search only a specified range of a worksheet, then select the range before invoking the Find command. The range can consist of adjacent cells or nonadjacent cells.
To Find a String The following steps show how to locate the string, Toshiba, in the four worksheets: Company, Louisville, Kansas City, and Portland. The Find and Replace dialog box that displays all the options will be used to customize the search to include the entire workbook and to use the match case and match entire cell contents options. Match case means that the search is case sensitive and the cell contents must match the word exactly the way it is typed. Match entire cell contents means that the string cannot be part of another word or phrase and must be unique in the cell. Unlike the Spelling command, which starts the spell checker at the active cell and works downward, the Find and Replace commands always begin at cell A1, regardless of the location of the active cell.
1 • Click the Home tab on the Ribbon.
Find & Select button
• With the Company sheet active, click the Find & Select button on the Ribbon (Figure 6–77).
Find command
Find & Select menu
Figure 6–77
C6428_06_CTP.4c.indd 481
6/14/07 8:05:51 AM
EX 482 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
2 • Click Find. Find and Replace dialog box
• When Excel displays the Find and Replace dialog box, click the Options button so that it appears as shown in Figure 6–78.
Within box arrow
• Type Toshiba in
Q&A
the Find what box, click the Within box arrow, select Workbook, and then click the Match case and ‘Match entire cell contents’ check boxes to select them (Figure 6–78).
Format button
string to find
check box determines if search is case sensitive
search entire workbook
check box determines if string must be unique in cell
Why does the appearance of the Options button change?
Find Next button
Figure 6–78
The two greater than signs pointing to the left on the Options button indicate that the more comprehensive Find and Replace dialog box is active.
3 • Click the Find Next button to cause Excel to begin the search at cell A1 on the Company sheet and make cell A11 the active cell (Figure 6–79) because it is the first cell to match the search string.
4 • Continue clicking
Excel makes first cell with matching string Toshiba the active cell
the Find Next button to find the string, Toshiba, on the other sheets in the workbook.
Find Next button
Close button
Figure 6–79
• Click the Close Q&A
button in the Find and Replace dialog box to terminate the process and close the Find and Replace dialog box. What if Excel does not find the search string? If the Find command does not find the string for which you are searching, Excel displays a dialog box indicating it has searched the selected worksheets and cannot find the search string. Other Ways 1. Press CTRL+F
C6428_06_CTP.4c.indd 482
6/14/07 8:05:52 AM
Working with the Find and Replace Dialog Box The Format button in the Find and Replace dialog box in Figure 6–78 allows you to fine-tune the search by adding formats, such as bold, font style, and font size, to the string. The Within box options include Sheet and Workbook. The Search box indicates whether the search will be done vertically through rows or horizontally across columns. The Look in box allows you to select Values, Formulas, or Comments. If you select Values, Excel will look for the search string only in cells that do not have formulas. If you select Formulas, Excel will look in all cells. If you select Comments, Excel will look only in comments. If you select the Match case check box, Excel will locate only cells in which the string is in the same case. For example, philips is not the same as Philips. If you select the ‘Match entire cell contents’ check box, Excel will locate only the cells that contain the string and no other characters. For example, Excel will find a cell entry of Philips, but not Philips DVRs.
Excel Chapter 6
The Find and Replace Commands EX 483
To Replace a String with Another String The Replace command is used to replace the found search string with a new string. You can use the Find Next and Replace buttons to find and replace a string one occurrence at a time, or you can use the Replace All button to replace the string in all locations at once. The following steps show how to use the Replace All button to replace the string, Philips, with the string, Royal Philips, formatted as red italic font.
1 • With the Company sheet active,
Find & Select button
click the Find & Select button on the Ribbon and then click Replace.
• When Excel displays the Find and Replace dialog box, type Philips in the Find what box and Royal Philips in the Replace with box. Find and Replace dialog box
• Click the Format button to the right of the Replace with box. When Excel displays the Replace Format dialog box, click the Font tab, click the Color box arrow, click Red (column 2, row 1 in the Standard colors area), click Italic in the Font style list, and then click the OK button.
• If necessary, click the Within box arrow and then click Workbook.
• If necessary, click the Match case and ‘Match entire cell contents’ check boxes to select them (Figure 6–80).
Replace tab
string to find
preview of italic red format to use with replacement string
Replace with string
Replace with Format button
search entire workbook
Replace All button
Find Next button
Replace button
Figure 6–80
C6428_06_CTP.4c.indd 483
6/14/07 8:05:56 AM
EX 484 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
2 • Click the Replace All button to replace the string (Figure 6–81).
3 • Click the OK button in the Microsoft Office Excel dialog box. Philips replaced with Royal Philips formatted in red italic font
• Click the Close
Q&A
button in the Find and Replace dialog box.
Microsoft Office Excel dialog box indicates four replacements made in workbook
What happens when Excel replaces the string? OK button
Excel replaces the string, Philips, with the replacement string, Royal Philips (cell A7), throughout the four worksheets in the workbook. The replacement string is formatted as red italic font. Excel does not replace the string, Philips, on the Clustered Cone Chart sheet. Excel displays the Microsoft Office Excel dialog box indicating four replacements were made.
Close button
Figure 6–81
Other Ways 1. Press CTRL+H
To Quit Excel The following steps quit Excel without saving changes to the NextDVR Profit Potential workbook.
C6428_06_CTP.4c.indd 484
1
Click the Close button on the right side of the Excel title bar.
2
When Excel displays the Microsoft Office Excel dialog box, click the No button.
6/14/07 8:05:58 AM
Earlier in this chapter, the data from three worksheets were consolidated into another worksheet in the same workbook using 3-D references. An alternative to this method is to consolidate data from worksheets in other workbooks. Consolidating data from other workbooks also is referred to as linking. A link is a reference to a cell or range of cells in another workbook. In this case, the 3-D reference also includes a workbook name. For example, the following 3-D reference pertains to cell B5 on the Kansas City sheet in the workbook NDVR Kansas City Profit Potential located on drive E. ‘E:\[NDVR Kansas City Profit Potential.xls]Kansas City’!B5
location
workbook name
sheet name
cell reference
Consolidation You also can consolidate data across different workbooks using the Consolidate button on the Data tab on the Ribbon, rather than by entering formulas. For more information on the Consolidate button, type consolidate in the Search box in the Excel Help dialog box, and then click the ‘Consolidate data in multiple worksheets’ link in the Results list.
Excel Chapter 6
Consolidating Data by Linking Workbooks
BTW
Consolidating Data by Linking Workbooks EX 485
The single quotation marks surrounding the location, workbook name, and sheet name are required if any of the three names contain spaces. If the workbook you are referring to is in the same folder as the active workbook, the location (E:\) is not necessary. The brackets surrounding the workbook name are required. To illustrate linking cells between workbooks, the Company, Louisville, Kansas City, and Portland worksheets from the workbook created earlier in this chapter are on the Data Files for Students in separate workbooks as described in Table 6–10. In the workbook names in Table 6–10, the NDVR stands for NextDVR. The region workbooks contain the region data, but the NDVR Company workbook does not include any consolidated data. The consolidation of data from the three region workbooks into the NDVR Company Profit Potential workbook will be completed later in this section. Table 6–10 Workbook Names Worksheet in NextDVR Profit Potential Workbook
Saved on The Data Files for Students Using the Workbook Name
Company
NDVR Company Profit Potential
Louisville
NDVR Louisville Profit Potential
Kansas City
NDVR Kansas City Profit Potential
Portland
NDVR Portland Profit Potential
The remaining sections of this chapter demonstrate how to search for the four workbooks in Table 6–10 on drive E, how to create a workspace from the four workbooks, and finally how to link the three region workbooks to consolidate the data into the NDVR Company Profit Potential workbook.
C6428_06_CTP.4c.indd 485
6/14/07 8:06:00 AM
EX 486 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
To Search for and Open Workbooks Excel has a powerful search tool that you can use to locate workbooks (or any file) stored on disk. You search for files using the Search text box in the Open dialog box. If you view files on the Data Files for Students, then you would see the four workbooks listed in the right column of Table 6–10. The following steps, however, show how to search for workbooks when you cannot remember exactly the name of the file or its location. In this example, the string NDVR (the first four characters in the workbook names) will be used to locate the workbooks. The located workbooks then are opened and arranged so that each one appears in its own window.
1 • Start Excel following the steps on
Search box
page EX 423 and then click the Office Button.
• Click Open on the Office Button menu and then select UDISK (E:) in the Address bar (Figure 6–82).
UDISK 2.0 (E:) drive selected
• Type NDVR in the Search box.
Figure 6–82
2 • Press the ENTER key to display a list of the four workbooks described in Table 6–10 on the previous page in the File list (Figure 6–83).
Excel found four files in drive E: with NDVR in file name of workbook
Figure 6–83
C6428_06_CTP.4c.indd 486
6/14/07 8:06:01 AM
3 • In the File list, while holding down
Switch Windows button
Arrange All button
the CTRL key, click each of the three region workbook names one at a time and then click the company workbook name.
Excel Chapter 6
Consolidating Data by Linking Workbooks EX 487
active workbook
• Click the Open button to open the four workbooks.
Switch Windows menu
• Click the View tab on the Ribbon and then click the Switch Windows button to display the names of the four workbooks with a check mark to the left of the active workbook (Figure 6–84).
Figure 6–84
4 • Click the Arrange All button on the Ribbon.
• When Excel displays the Arrange
Q&A
Windows dialog box, click Vertical, and then, if necessary, click the ‘Windows of active workbook’ check box to clear it (Figure 6–85).
Arrange Windows dialog box
How can I arrange workbooks in the Excel window? As shown in Figure 6–85, multiple opened workbooks can be arranged in four ways. The option name in the Arrange Windows dialog box identifies the resulting window’s configuration. You can modify any of the arranged workbooks by clicking within its window to activate it. To return to showing one workbook, double-click its title bar as described in Step 6 on the next page.
ways to arrange workbooks in Excel window
Vertical option button selected Windows of active workbook check box
OK button
Figure 6–85
C6428_06_CTP.4c.indd 487
6/14/07 8:06:04 AM
EX 488 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
5 • Click the OK button in the Arrange Windows dialog box to display the four opened workbooks as shown in Figure 6–86.
four workbooks tiled vertically in Excel window
6 • Double-click the NDVR Company Profit Potential title bar to maximize it and hide the other opened workbooks. Figure 6–86 Other Ways 1. Press ALT+F, O
To Create a Workspace File If you plan to consolidate data from other workbooks, it is recommended that you first bind the workbooks together using a workspace file. A workspace file saves information about all the workbooks that are open. The workspace file does not contain the actual workbooks; rather, it stores information required to open the files associated with the workspace file, including file names, which file was active at the time of the save, and other display settings. To create a workspace file, click the Save Workspace button on the View tab on the Ribbon. After you create and save a workspace file, you can open all of the associated files by opening the workspace. The following steps show how to create a workspace file from the files opened in the previous set of steps.
1 • With the four NDVR workbooks
View tab
Save Workspace button
opened and the Company Profit Potential workbook active, if necessary, click the View tab on the Ribbon (Figure 6–87). NDVR Company Profit Potential Workbook active
Figure 6–87
C6428_06_CTP.4c.indd 488
6/14/07 8:06:08 AM
2 • Click the Save Workspace button on the Ribbon.
Save Workspace dialog box
• When Excel displays the Save
UDISK 2.0 (E:) selected
Excel Chapter 6
Consolidating Data by Linking Workbooks EX 489
Q&A
Workspace dialog box, select UDISK 2.0 (E:) in the Address bar and then type NextDVR Workspace in the File name box (Figure 6–88). Can I still open the workbooks separately or must I always open the workspace? After the workspace is saved to disk, you can open the workbooks one at a time as you did in the past, or you can open all of the associated workbooks by opening the workspace. When you invoke the Open command, workspace file names appear in the Open dialog box, the same as any workbook file name.
3 • Click the Save button in the Save Workspace dialog box to save the file names of the workbooks open, of the workbooks displaying, and other display settings.
workspace file name
Save button file type is Workspaces
Figure 6–88
• If the Microsoft Office Excel dialog box is displayed for any of the workbooks, click the No button. • Click the Office Button and then click the Exit Excel button on the Office Button menu to quit Excel. • If the Microsoft Office Excel dialog box is displayed for any of the workbooks, click the No button. Other Ways 1. Press ALT+W, K
To Consolidate Data by Linking Workbooks The following steps show how to open the workspace file NextDVR Workspace and consolidate the data from the three region workbooks into the NDVR Company Profit Potential workbook.
1
Start Excel as described on page EX 423. Click the Office Button and then click Open on the Office Button menu. When Excel displays the Open dialog box, select UDISK 2.0 (E:) in the Address bar. Double-click NextDVR Workspace to open the four workbooks saved in the workspace. Make NDVR Company Profit Potential the active worksheet. If necessary, double-click the NDVR Company Profit Potential window title bar to maximize it.
2
Select cell B5. Click the Sum button on the Home tab on the Ribbon. Click the View tab on the Ribbon and then click the Switch Windows button arrow on the Ribbon. Click NDVR Louisville Profit Potential on the Switch Windows menu. Click cell B5. Delete the dollar signs ($) in the reference to cell B5 in the formula bar. Click immediately after B5 in the formula bar and then press the COMMA key.
C6428_06_CTP.4c.indd 489
6/14/07 8:06:11 AM
Workspace Files A workspace file saves display information about open workbooks, such as window sizes, print areas, screen magnification, and display settings. Workspace files do not contain the workbooks themselves.
3
Click the Switch Windows button arrow on the Ribbon and then click NDVR Kansas City Profit Potential. Select cell B5. Delete the dollar signs ($) in the reference to cell B5 in the formula bar. Click immediately after B5 in the formula bar and then press the COMMA key.
4
Click the Switch Windows button arrow on the Ribbon and then click NDVR Portland Profit Potential. Select cell B5. Delete the dollar signs ($) in the reference to cell B5 in the formula bar. Click the Enter box.
5
With cell B5 active in the NDVR Company Profit Potential workbook, drag the cell’s fill handle through cell B11. Select cell B5 (Figure 6–89).
6
Click the Save button on the Quick Access Toolbar. If Excel displays a dialog box, select Overwrite changes. Click the OK button. Click the Office Button, click Print on the Office Button menu, and then click the OK button in the Print dialog box to print the workbook.
Q&A
BTW
EX 490 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Why did the formulas need to be edited for each workbook? As you link workbooks, remember that the cell reference inserted by Excel each time you click a cell in a workbook is an absolute cell reference ($B$5). You must edit the formula and change these to relative cell references because the SUM function later is copied to the range B6:B11. If the cell references are left as absolute, then the copied function always would refer to cell B5 in the three workbooks no matter where you copy the SUM function.
NDVR Company Profit Potential shows consolidation of three store workbooks SUM function with file names, sheet name, and cell references
location E:\ not required in cell reference because linked workbooks are in same folder as active workbook
BTW
sum of values in cell B5 in three workbooks
Excel Help The best way to become familiar with Excel Help is to use it. Appendix C includes detailed information about Excel Help and exercises that will help you gain confidence in using it.
SUM function in cell B5 copied to cells B6:B11
Figure 6–89
Updating Links Later, if you open the NDVR Company Profit Potential workbook by itself, also called the dependent workbook, Excel will update the links automatically if the linked workbooks are open. The linked workbooks are called the source workbooks. If the linked workbooks are not open, then Excel displays a security warning in a pane below the Ribbon. If you click the Options button in the security warning pane, Excel displays the Microsoft
C6428_06_CTP.4c.indd 490
6/14/07 8:06:13 AM
To Close All Workbooks at One Time and Quit Excel To close all four workbooks at one time and quit Excel, complete the following steps.
1
Click the Office Button and then click the Exit Excel button on the Office Button menu.
2
If Excel displays the Microsoft Office Excel dialog box, click the No button.
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential — proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
Excel Chapter 6
Office Security Options dialog box and asks if you would like to enable automatic update of links. If you click the ‘Enable this content’ option button and click the OK button in the dialog box, Excel reads the data in the source workbooks and recalculates formulas in the dependent workbook, but it does not open the source workbooks. If the three source workbooks are open along with the dependent workbook as in the previous set of steps, Excel automatically updates the links (recalculates) in the NDVR Company Profit Potential workbook when a value changes in any one of the source workbooks.
BTW
Chapter Summary EX 491
Chapter Summary In this chapter, you learned how to create and use a template, customize formats, create styles, change chart types, draw and enhance a Clustered Cone chart using WordArt, annotate using text boxes and arrows, use 3-D reference to reference cells in other sheets, add, remove, and change pages breaks, use the Find and Replace commands, and create a workspace file. The items listed below include all the new Excel skills you have learned in this chapter. 1. Save the Template (EX 433) 2. Create and Assign a Custom Format Code and a Comma Style Format (EX 438) 3. Create a New Style (EX 440) 4. Apply a New Style (EX 443) 5. Open a Template and Save It as a Workbook (EX 446) 6. Add a Worksheet to a Workbook (EX 447) 7. Copy the Contents of a Worksheet to Other Worksheets in a Workbook (EX 449) 8. Drill an Entry through Worksheets (EX 451) 9. Enter and Copy 3-D References Using the Paste Button Menu (EX 457) 10. Format the Clustered Cone Chart (EX 465) 11. Add a Chart Title Using the WordArt Tool (EX 466)
12. Add a Text Box, Arrow, and Brace to the Chart (EX 469) 13. Add a Header and Footer, Change Margins, and Center the Printout Horizontally (EX 472) 14. Add a Header to the Clustered Cone Chart Sheet (EX 475) 15. Print All Worksheets in a Workbook (EX 476) 16. Print Nonadjacent Sheets in a Workbook (EX 476) 17. Insert and Remove a Page Break (EX 478) 18. Hide Page Breaks (EX 479) 19. Find a String (EX 481) 20. Replace a String with Another String (EX 483) 21. Search for and Open Workbooks (EX 486) 22. Create a Workspace File (EX 488) 23. Consolidate Data by Linking Workbooks (EX 489)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this chapter.
C6428_06_CTP.4c.indd 491
6/14/07 8:06:15 AM
EX 492 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Learn It Online
STUDENT ASSIGNMENTS
Learn It Online is a series of online student exercises that test your knowledge of chapter content and key terms. Instructions: To complete the Learn It Online exercises, start your browser, click the Address bar, and then enter the Web address scsite.com/ex2007/learn. When the Excel 2007 Learn It Online page is displayed, click the link for the exercise you want to complete and then read the instructions.
Chapter Reinforcement TF, MC, and SA A series of true/false, multiple choice, and short answer questions that test your knowledge of the chapter content.
Who Wants To Be a Computer Genius? An interactive game that challenges your knowledge of chapter content in the style of a television quiz show.
Flash Cards An interactive learning environment where you identify chapter key terms associated with displayed definitions.
Wheel of Terms An interactive game that challenges your knowledge of chapter key terms in the style of the television show Wheel of Fortune.
Practice Test A series of multiple choice questions that test your knowledge of chapter content and key terms.
Crossword Puzzle Challenge A crossword puzzle that challenges your knowledge of key terms presented in the chapter.
Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter.
Consolidating Data in a Workbook Instructions: Follow the steps below to consolidate the four quarterly payroll sheets on the Annual Totals sheet in the workbook Apply 6-1 Annual Payroll Totals (Figure 6–90). At the conclusion of the instructions, the Annual Payroll Totals sheet should display as shown in the lower screen in Figure 6–90. Perform the following tasks. 1. Start Excel. Open the workbook Apply 6-1 Annual Payroll Totals from the Data Files for Students and then save the workbook as Apply 6-1 Annual Payroll Totals Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. One by one, click the first four tabs and review the quarterly payroll totals. Click the Annual Totals tab. 2. Determine the annual payroll totals on the Annual Totals sheet by using the SUM function and 3-D references to sum the hours worked on the four quarterly sheets in cell B11. Do the same to determine the annual gross pay in cell C11. Copy the range B11:C11 to the range B12:C14 by using the Copy button on the Home tab on the Ribbon and the Formulas command on the Paste button menu on the Home tab on the Ribbon. 3. Change the document properties as specified by your instructor. Select all five worksheets. Add a worksheet header with your name, course number, and other information requested by your instructor. Add the page number and total number of pages to the footer. Center all worksheets horizontally on the page and print without gridlines. Preview and print the five worksheets. Click the Annual Totals tab to select the sheet. 4. Save the workbook with the new page setup. Close the workbook. 5. Submit the assignment as specified by your instructor.
C6428_06_CTP.4c.indd 492
6/14/07 8:06:17 AM
Excel Chapter 6 STUDENT ASSIGNMENTS
Apply Your Knowledge EX 493
Figure 6–90
C6428_06_CTP.4c.indd 493
6/14/07 8:06:18 AM
EX 494 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Extend Your Knowledge
STUDENT ASSIGNMENTS
Extend the skills you learned in this chapter and experiment with new skills. You may need to use Help to complete the assignment.
Making Use of the Chart Tools on the Design Tab Instructions: Complete the following tasks. 1. Start Excel. Open the workbook Extend 6-1 Tennis Summary from the Data Files for Students and then save the workbook as Extend 6-1 Tennis Summary Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Click the Chart tab. Click the chart to select it and display the Design tab on the Ribbon. 2. Click the Change Chart Type button on the Design tab on the Ribbon and then choose a Line chart to change the 3-D Bar chart to a Line chart. One at a time, repeat this step for each of the following chart types: Bar chart, Area chart, Surface chart, and Doughnut chart. Finally, choose the Column chart type 3-D Cone (column 1, row 3). 3. Click the More arrow (lower arrow) in the Chart Layouts group on the Design tab on the Ribbon to display the Chart Layouts gallery. Choose Layout 2 (column 2, row 1) in the Chart Layouts gallery. Repeat this step for the following layouts: Layout 8 and Layout 9. Finally, choose Layout 5 (column 2, row 2). 4. Click the More arrow (lower arrow) in the Chart Styles group on the Design tab on the Ribbon to display the Chart Styles gallery. One at a time, choose three different Chart Styles. Finally, choose Style 38 (column 6, row 5) as shown in Figure 6–91. Remove the axis title from the left side of the chart. 5. Change the document properties as specified by your instructor. Change the Chart sheet header with your name, course number, and other information requested by your instructor. Change the print orientation to landscape. Print the Chart sheet using the Fit to option. Save the workbook. 6. Submit the assignment as specified by your instructor.
Figure 6–91
C6428_06_CTP.4c.indd 494
6/14/07 8:06:28 AM
Analyze a workbook and correct all errors and/or improve the design.
Chart Manipulation, Using WordArt, and Correcting 3-D Cell References Instructions: Start Excel. Open the workbook Make It Right 6-1 Gems for Everyone and then save the workbook as Make It Right 6-1 Gems for Everyone Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Correct the following design and formula problems so that the Company Totals sheet appears with an embedded chart as shown in Figure 6–92.
Excel Chapter 6
Make It Right
STUDENT ASSIGNMENTS
Make It Right EX 495
Figure 6–92
Perform the following tasks: 1. Click the Chart sheet tab to display the 3-D Pie chart and then click the chart. 2. Click the Design tab on the Ribbon and then complete the following chart tasks: a. Change the 3-D Pie Chart to Clustered Cylinder Chart (column 1, row 2 in the Column area). b. Change the chart layout to Layout 4 by clicking the More arrow (lower arrow) in the Chart Layouts group and choosing Layout 4. One at a time, select each of the total numbers at the top of the columns. Change the font size to 6 by typing 6 in the Font Size box on the Home tab on the Ribbon. Drag the total numbers above the cylinders. Delete the Series 1 label below the chart. c. Click the More arrow (lower arrow) in the Chart Styles group on the Design tab on the Ribbon to display the Chart Styles gallery. Choose Style 40 (column 8, row 5). Continued >
C6428_06_CTP.4c.indd 495
6/14/07 8:06:30 AM
EX 496 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Make It Right
continued
STUDENT ASSIGNMENTS
d. Use the WordArt button on the Insert tab on the Ribbon to add the chart title, Quarterly Sales. Choose the Fill – Accent 6, Warm Matte Bevel (column 2, row 6). Move the chart title above the chart. Change the font size of the chart title to 28. e. Click the Design tab on the Ribbon and then click the Move Chart button to move the chart to the Company Totals sheet. Drag the chart to the range A10:F25. Make any necessary adjustments so that the chart appears as shown in Figure 6–92 on the previous page. 3. Select cell B4, the supposed sum of cell B4 on the 2008 and 2009 sheets. Note that the SUM function is not referencing cell B4 on the 2008 sheet. Reenter the SUM function and select the appropriate range to sum. Do the same for cell B5. Copy the range B4:B5 to the range C4:E5. 4. Change the document properties as specified by your instructor. Change the three worksheet headers to include your name, course number, and other information requested by your instructor. 5. Save the workbook, and submit the revised workbook as requested by your instructor.
In the Lab Create a workbook using the guidelines, concepts, and skills presented in this chapter. Labs are listed in order of increasing difficulty.
Lab 1: Using a Template to Create a Multiple-Sheet Workbook Problem: Rings and Things is a company that specializes in hand jewelry for women. The company has four stores in Biloxi, Hartford, Peoria, and Seattle and a corporate office in Indianapolis. All of the stores sell their products via direct mail, telesales, and walk-ins. Every year, the corporate officers in Indianapolis use a template to create a year-end sales analysis workbook. The workbook contains four sheets, one for each of the three stores and one sheet to consolidate data and determine the company totals. The Consolidated sheet appears as shown in Figure 6–93.
Figure 6–93
C6428_06_CTP.4c.indd 496
6/14/07 8:06:32 AM
Instructions Part 1: Perform the following tasks. 1. Open the template Lab 6-1 Rings and Things Annual Sales Analysis Template from the Data Files for Students. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Save the template as a workbook using the file name, Lab 6-1 Part 1 Rings and Things Annual Sales Analysis. Make sure Excel Workbook is selected in the ‘Save as type’ list when you save the workbook. 2. Add a worksheet to the workbook between Sheet1 and Sheet2 and then paste the contents of Sheet1 to the three empty sheets. 3. From left to right, rename the sheet tabs Consolidated, Direct Mail, Telesales, and Walk Ins. Color the tabs as shown in Figure 6–93. On each of the three sales channel sheets, change the subtitle in cell A2 to match the tab name. Use the title, Consolidated, in cell A1 of the Consolidated worksheet. Change the title style for each title area in the range A1:F1 to match its tab color. Enter the data in Table 6–11 into the three sales channel sheets.
Excel Chapter 6
The template used to create the annual sales analysis workbook is part of the Data Files for Students. Rebecca Smart, the company’s accountant, has asked you to use the template to create the year-end sales analysis workbook.
STUDENT ASSIGNMENTS
In the Lab EX 497
Table 6–11 Rings and Things Annual Sales Data by Store and Sales Channel
Biloxi
Sales Returns
Hartford
Sales Returns
Peoria
Sales Returns
Seattle
Sales Returns
Direct Mail
Telesales
Walk Ins
4873275
3291010
1950125
275375
289500
45102
5239100
2152675
2101054
463201
500250
62198
3925750
4235100
3100500
225198
324519
156340
3278109
1975200
2984290
352679
125500
367109
4. On the Consolidated worksheet, use the SUM function, 3-D references, and copy and paste capabilities of Excel to total the corresponding cells on the three sales channel sheets. First, compute the sum in cell B4 and then compute the sum in cell B5. Copy the range B4:B5 to the range C4:E5. The Consolidated sheet should resemble Figure 6–93. 5. Change the document properties as specified by your instructor. Select all four sheets. Add a worksheet header with your name, course number, and other information requested by your instructor. Add the page number and total number of pages to the footer. Change the left and right margins to .5. 6. With the four sheets selected, preview and then print the workbook in landscape orientation and use the Black and white option. 7. Save the workbook with the new page setup characteristics. Close the workbook. 8. Submit the assignment as specified by your instructor. Instructions Part 2: Complete the following tasks. 1. Start Excel. Open the workbook Lab 6-1 Part 1 Rings and Things Annual Sales Analysis and then save the workbook using the file name, Lab 6-1 Part 2 Rings and Things Annual Sales Analysis. 2. Create an embedded Clustered Horizontal Cylinder chart in the range A8:H25 on the Consolidated worksheet by charting the range A3:E5. Continued >
C6428_06_CTP.4c.indd 497
6/14/07 8:06:35 AM
EX 498 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
In the Lab
continued
3. Move the chart to a separate sheet by clicking the Move Chart button on the Design tab on the Ribbon. Name the sheet tab Chart and color the sheet tab red. Drag the Chart sheet tab to the far right.
STUDENT ASSIGNMENTS
4. Increase the font size of the labels on both axes to 12-point bold. Increase the font size of the legends on the right side of the chart to 14-point. 5. Apply the chart colors shown in Figure 6–94 to the cylinders and to the walls by right-clicking the items one at a time and selecting the appropriate commands. 6. Use the WordArt button on the Insert tab on the Ribbon to add the chart title Annual Sales and Returns. Select Fill - Accent, 2 Matte Bevel (column 3, row 6) from the WordArt gallery. 7. Add the two text boxes and arrows and change their colors to red as shown in Figure 6–94. 8. Add a header to the Chart sheet with your name, course number, and other information requested by your instructor. Add the page number and total number of pages to the footer. Preview and print all five sheets at one time. Save the workbook and then close the workbook. 9. Submit the assignment as specified by your instructor.
Figure 6–94
Instructions Part 3: Complete the following tasks. 1. Start Excel. Open the workbook Lab 6-1 Part 2 Rings and Things Annual Sales Analysis. Do not save the workbook in this part. 2. Select cell A1 on the Consolidated worksheet. Select all the worksheets except for the Chart sheet.
C6428_06_CTP.4c.indd 498
6/14/07 8:06:35 AM
4. Repeat Step 3, but find only cells that match exactly the word Sales. If necessary, click the Options button to display the desired check box. Use the Find & Select button to find all occurrences of the word Sales. Write down the number of occurrences and the cell locations that match exactly with the word Sales. 5. Use the Find & Select button to find all occurrences of the word, sales, in bold white font. For this find operation, clear the check mark from the Match entire cell contents check box. 6. Use the Replace command to replace the word, Sales, with the word, Revenue, on all four sheets. Print the four sheets. Close the workbook without saving changes. 7. Submit the assignment as specified by your instructor.
In the Lab
Excel Chapter 6
3. Use the Find & Select button on the Home tab on the Ribbon to list all occurrences of the word, Sales, in the workbook. Use the Find All button in the Find and Replace dialog box. Write down the number of occurrences and the cell locations of the word Sales.
STUDENT ASSIGNMENTS
In the Lab EX 499
Lab 2: Consolidating Data by Linking Workbooks Problem: The Apply Your Knowledge exercise in this chapter calls for consolidating the Hours Worked and Gross Pay from four worksheets on a fifth worksheet in the same workbook (see Figure 6–90 on page EX 493). This exercise takes the same data stored in four separate workbooks and consolidates the Hours Worked and Gross Pay by linking to a fifth workbook. Instructions Part 1: Perform the following tasks. 1. Start Excel. Open the following five files from the Data Files for Students. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. You can open them one at a time or you can open them all at one time by selecting the five files and then clicking the Open button. • Lab 6-2 Emp Annual Payroll Totals • Lab 6-2 Emp Quarter 1 Payroll Totals • Lab 6-2 Emp Quarter 2 Payroll Totals • Lab 6-2 Emp Quarter 3 Payroll Totals • Lab 6-2 Emp Quarter 4 Payroll Totals 2. Click the Switch Windows button on the View tab on the Ribbon and then click Lab 6-2 Emp Annual Payroll Totals. 3. Click the Save Workspace button on the View tab on the Ribbon. When the Save Workspace dialog box is displayed, save the workspace using the file name, Lab 6-2 Emp Payroll Workspace. 4. Close all the open workbooks. Open the workspace Lab 6-2 Emp Payroll Workspace. When the Lab 6-2 Emp Annual Payroll Totals window is displayed, click the Maximize button in the upperright corner to maximize the window. Save the workbook using the file name, Lab 6-2 Part 1 Emp Annual Payroll Totals. 5. Consolidate the data in the four quarterly payroll workbooks into the range B11:C14 in the workbook Lab 6-2 Part 1 Emp Annual Payroll Totals by doing the following: a. Click cell B11. Click the Home tab on the Ribbon and then click Sum button. b. Click the Switch Windows button on the View tab on the Ribbon and then click Lab 6-2 Emp Quarter 1 Payroll Totals. When the workbook is displayed, click cell C11, click the Switch Windows button on the View tab on the Ribbon, and then click Lab 6-2 Part 1 Emp Annual Continued >
C6428_06_CTP.4c.indd 499
6/14/07 8:06:38 AM
EX 500 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
In the Lab
continued
STUDENT ASSIGNMENTS
Payroll Totals. Change the absolute cell reference $C$11 in the formula bar to the relative cell reference C11 by deleting the dollar signs. Click immediately after C11 in the formula bar and then press the COMMA key. c. Click the Switch Windows button on the View tab on the Ribbon and then click Lab 6-2 Emp Quarter 2 Payroll Totals. When the workbook is displayed, click cell C11, click the Switch Windows button on the View tab on the Ribbon, and then click Lab 6-2 Part 1 Emp Annual Payroll Totals. Change the absolute cell reference $C$11 in the formula bar to the relative cell reference C11 by deleting the dollar signs. Click immediately after C11 in the formula bar and then press the COMMA key. d. Click the Switch Windows button on the View tab on the Ribbon and then click Lab 6-2 Emp Quarter 3 Payroll Totals. When the workbook is displayed, click cell C11, click the Switch Windows button on the View tab on the Ribbon, and then click Lab 6-2 Part 1 Emp Annual Payroll Totals. Change the absolute cell reference $C$11 in the formula bar to the relative cell reference C11 by deleting the dollar signs. Click immediately after C11 in the formula bar and then press the COMMA key. e. Click the Switch Windows button on the View tab on the Ribbon and then click Lab 6-2 Emp Quarter 4 Payroll Totals. When the workbook is displayed, click cell C11, click the Switch Windows button on the View tab on the Ribbon, and then click Lab 6-2 Part 1 Emp Annual Payroll Totals. Change the absolute cell reference $C$11 in the formula bar to the relative cell reference C11 by deleting the dollar signs. Press the ENTER key to sum the four quarter hours worked. You should end up with an annual total of 653.75 hours worked in cell B11. f. With the workbook Lab 6-2 Part 1 Emp Annual Payroll Totals window active, select cell B11. Drag the fill handle through cell C11 to display the annual gross pay in cell C11. Select the range B11:C11. Drag the fill handle down to cell C14. When the Auto Fill Options button is displayed next to cell C14, click the Auto Fill Options button and then click the Fill Without Formatting option. The totals in row 15 should be exactly the same as the totals in row 15 in the lower figure of Figure 6–90 on page EX 493. 6. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Preview and print the annual payroll totals. Save the workbook using the file name, Lab 6-2 Part 1 Emp Annual Payroll Totals. Close all workbooks. Submit the assignment as specified by your instructor. Instructions Part 2: Perform the following tasks to update the hours worked for Quarter 2 and Quarter 4. 1. Start Excel. Open Lab 6-2 Emp Quarter 2 Payroll Totals from the Data Files for Students. Change the hours worked for employee K457 in row 12 from 123.00 to 223.25. Save the workbook using the file name, Lab 6-2 Emp Quarter 2 Payroll Totals. Close the workbook. 2. Open Lab 6-2 Emp Quarter 4 Payroll Totals. Change the hours worked for employee M235 in row 13 from 189.00 to 211.00. Save the workbook using the file name, Lab 6-2 Emp Quarter 4 Payroll Totals. Close the workbook. 3. Open Lab 6-2 Part 1 Emp Annual Payroll Totals workbook saved earlier in Part 1 of this exercise. Save the workbook using the file name, Lab 6-2 Part 2 Emp Annual Payroll Totals. Click the Data tab on the Ribbon. Click the Edit Links button in the Connections group on the Data tab. Select each file in the Edit Links dialog box and then click the Update Values button to instruct Excel to apply the current values in the four source workbooks to the consolidated workbook (Figure 6–95). 4. Preview and print the consolidated workbook. Save the workbook. Submit the assignment as specified by your instructor.
C6428_06_CTP.4c.indd 500
6/14/07 8:06:38 AM
Excel Chapter 6 STUDENT ASSIGNMENTS
In the Lab EX 501
Figure 6–95
In the Lab Lab 3: Returning Real-Time Stock Quotes to the Stock Portfolio Worksheet Problem: You belong to the Learn-N-Earn Stock Club, which has been investing in the stock market for the past several years. As vice-president of the club, you maintain a summary of the club’s stock market investments in an Excel workbook (Figure 6–96a on the next page). Each day you go through the Business section of the newspaper and manually update the current prices in column G to determine the value of the club’s equities. You recently heard about the Web query capabilities of Excel and have decided to use them to update the club’s stock portfolio automatically. Instructions: Perform the following steps to have Web queries automatically update the current price in column G and the major indices in the range B12:B15 of Figure 6–96a. 1. Start Excel. Open the workbook Lab 6-3 Learn-N-Earn Stock Club Portfolio Basics from the Data Files for Students and then save the workbook using the file name, Lab 6-3 Learn-N-Earn Stock Club Portfolio. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. After reviewing the worksheet, you should notice that it lacks current prices in column G and the major indices in the range B12:B15. 2. Click Sheet2 and then select cell A1. Click the Data tab on the Ribbon and then click the Existing Connections button. When Excel displays the Existing Connections dialog box, doubleclick MSN MoneyCentral Investor Stock Quotes. When Excel displays the Import Data dialog box, click the OK button. When Excel displays the Enter Parameter Value dialog box, click the Learn-N-Earn Portfolio sheet tab at the bottom of the screen and drag through the range B3:B10. Click the ‘Use this value/reference for future refreshes’ check box to select it. The Enter Parameter Value dialog box should display as shown in Figure 6–96b on the next page. Click the OK button. The Web query should return a worksheet with up-to-date stock quotes similar to the one shown in Figure 6–96c on the next page. Rename the Sheet2 tab Stock Quotes. 3. Click the Learn-N-Earn Portfolio tab. Click cell G3. Type = (equal sign). Click the Stock Quotes tab. Click cell D4. Press the ENTER key. Use the fill handle to copy cell G3 on the Learn-N-Earn Portfolio sheet to the range G4:G10. You now should have current prices for the stock portfolio that are the same as the last prices on the Stock Quotes worksheet in column D. 4. Click Sheet3 and then select cell A1. If necessary, click the Data tab on the Ribbon and then click Existing Connections. When Excel displays the Existing Connections dialog box, double-click MSN Money Central Investor Major Indices. When Excel displays the Import Data dialog box, Continued >
C6428_06_CTP.4c.indd 501
6/14/07 8:06:39 AM
EX 502 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
In the Lab
continued
click the OK button. Rename the Sheet3 tab Major Indices. The worksheet should be similar to the one shown in Figure 6–96d.
STUDENT ASSIGNMENTS
(a) Learn-N-Earn Portfolio Worksheet
(b) Enter Parameter Value Dialog Box
(d) Major Indices
(c) Up-To-Date Stock Quotes Figure 6–96
C6428_06_CTP.4c.indd 502
6/14/07 8:06:41 AM
6. Change the document properties as specified by your instructor. Select all three worksheets and then change the header with your name, course number, and other information requested by your instructor. Add a page number as the footer. Change the top margin to 1.5 inches. Select cell A16 and then save the workbook using the file name, Lab 6-3 Learn-N-Earn Stock Club Portfolio. 7. Print the three worksheets using the ‘Black and white’ option in landscape orientation. Use the Fit to option in the Page sheet in the Page Setup dialog box to print the sheets on one page. 8. Select cell A16 and then save the workbook. Submit the assignment as specified by your instructor.
C6428_06_CTP.4c.indd 503
Excel Chapter 6
5. Click the Learn-N-Earn Portfolio sheet tab. Select cell B12. Type = (equal sign). Click the Major Indices sheet tab. Select cell D4 (the last Dow Jones Industrial Average Index). Press the ENTER key. Select cell B13. Type = (equal sign). Click the Major Indices tab. Select cell D12 (the last NASDAQ Composite Index). Press the ENTER key. Select cell B14. Type = (equal sign). Click the Major Indices tab. Select cell D16 (the last Russell 2000 Index). Press the ENTER key. Select cell B15. Type = (equal sign). Click the Major Indices tab. Select cell D6 (the last Dow Jones Transportation Average Index). Press the ENTER key. Select cell A16.
STUDENT ASSIGNMENTS
In the Lab EX 503
6/14/07 8:06:49 AM
EX 504 Excel Chapter 6 Creating Templates and Working with Multiple Worksheets and Workbooks
Cases and Places Apply your creative thinking and problem solving skills to design and implement a solution.
STUDENT ASSIGNMENTS
• EASIER •• MORE DIFFICULT • 1: Public Safety Division Budget Proposal San Pueblo’s Public Safety division comprises three departments —Streets and Sanitation, Fire, and Police. The departments have submitted figures comparing this year’s budget with next year’s budget in four categories (Table 6–12). Develop a template that can be used to prepare each department’s budget and the Public Safety division’s consolidated total budget within one workbook. Include this year’s budget, next year’s budget, and the variance [(next year’s budget – this year’s budget) / this year’s budget] for each expenditure. Indicate totals where appropriate. Create an embedded chart on the Public Safety division’s worksheet comparing the division’s expenditures this year and next. Table 6–12 San Pueblo’s Public Safety Division Expenditures Streets and Sanitation Next Year This Year Equipment Maintenance Miscellaneous Salaries and Benefits
Fire Next Year
Police
This Year Next Year This Year
212000
198150
62350
78345
225175
220650
68350
62450
22750
17000
98375
102500
48125
44520
37600
38200
47500
32800
116000
112400
198000
211000
150000
162750
• 2: Creating a Consolidated Balance Sheet Jeans-For-Teens is a New York-based company that sells high-end jeans globally. After launching its Web site five years ago, the company has attracted so many clients from Europe that the owners opened a shop in Paris. The New York and Paris shops’ assets last year, respectively, were: cash $825,101 and $650,450; accounts receivable $557,190 and $325,860; marketable securities $345,213 and $211,450; inventory $845,258 and $326,120; and equipment $82,250 and $56,200. The liabilities for each store were: notes payable $1,512,381 and $345,000; accounts payable $213,360 and $179,900; and income tax payable $82,100 and $125,350. The stockholders’ equity was: common stock $812,300 and $235,000; and retained earnings $324,242 and $162,400. Use the concepts and techniques presented in this project to design a template as a balance worksheet to reflect the figures above. Include totals for assets, liabilities, and stockholders’ equity. Use the template to create a balance worksheet for the New York store, the Paris store, and the consolidated balance worksheet for the corporation.
• • 3: Analyzing Company Profits by Category Elite Software sells computer software and supplies. Merchandise is divided into six categories based on profit margin: individual application packages (22%), integrated application packages (9%), entertainment software (16%), system software (25%), learning aids (18%), and supplies (10%). Last year’s sales data has been collected for the State Street and Western Avenue Stores as shown in Table 6–13. Develop a template that can be used to determine marketing strategies for next year. Include sales, profit margins, profits (sales × profit margin), total sales, total profits, and functions to determine the most and least sales, profit margins, and profits. Use the template to create a worksheet for each outlet, a consolidated worksheet for the entire company, and a chart on a separate sheet reflecting the company’s profits by category.
C6428_06_CTP.4c.indd 504
6/14/07 8:06:49 AM
State Street Store
Western Avenue Store
Individual applications
$148,812
$52,864
Integrated applications
140,135
93,182
Entertainment software
62,912
72,345
System software
22,769
25,278
9,562
21,397
44,215
34,921
Learning aids Supplies
•• 4: Analyzing Annual College Expenses and Resources Make It Personal
College expenses are skyrocketing and your resources are limited. To plan for the upcoming year, you have decided to organize your anticipated expenses and resources in a workbook. The data required to prepare the workbook is shown in Table 6–14.
Excel Chapter 6
Table 6–13 Last Year’s Sales for State Street and Western Avenue Stores
STUDENT ASSIGNMENTS
Cases and Places EX 505
Table 6–14 Next Year’s Anticipated College Expenses and Resources Expenses
Semester 1
Semester 2
Summer
Room and Board
5750
5750
2150
Tuition
8750
8750
2200
Books
1200
1450
230
Clothes
575
350
150
Entertainment
600
500
200
Miscellaneous
400
350
175
Savings
2500
2500
500
Parents
5000
7500
1200
Job
1000
1200
400
Financial Aid
6275
3450
2505
Scholarship
2500
2500
500
Resources
Create a template with the data for the first semester in Table 6–14 in mind. Use dummy data in the template. Sum both the expenses and resources for the semester in the template. Save the template and then use it to create a workbook with each of the three semesters on a separate worksheet. Use 3-D cell references to consolidate the data on a worksheet in the workbook. Include a 3-D pie chart that compares the annual expenses. Use the concepts and techniques described in this chapter to format the workbook and chart.
•• 5: Creating a Consolidated Budget Proposal Using Linking Techniques Working Together
Complete the exercise outlined in Cases and Places 1 using separate workbooks for each department, rather than a single workbook. As a team, create an appropriate template. Assign each member of the team one or more of the four required workbooks to build using the template. After the workbooks have been created, use the concepts and techniques presented in this project to consolidate the data by creating a workspace and linking the workbooks. Test the linkage to the division workbook by changing values in the department workbooks.
C6428_06_CTP.4c.indd 505
6/14/07 8:06:50 AM
This page intentionally left blank
C6394_FM_CTP.4c.indd xvi
8/8/07 3:59:57 PM
Microsoft Office Excel 2007
Graphics Feature
SmartArt and Images
Objectives You will have mastered the material in this Graphics feature when you can: • Insert a SmartArt graphic on a worksheet
• Insert an image on a worksheet • Modify an image on a worksheet
• Modify a SmartArt graphic • Add effects to a SmartArt graphic
C6428_SF2_CTP.4c.indd 507
6/12/07 8:47:09 AM
EX 508 Excel Graphics Feature SmartArt and Images
Graphics Feature Introduction Like a chart, a graphic or image often conveys information or an idea better than words or numbers. You insert and modify graphics and images in order to enhance the visual appeal of an Excel workbook. Many of the skills you learn when working with graphics and images in Excel will be similar when working in Word, PowerPoint, or Outlook.
Project — Adding SmartArt and Images to a Worksheet The director of the Malik Legal Services Information Technology department would like to enhance the department’s directory to be more visually appealing to those inside and outside of the department. The directory currently exists in a table in an Excel worksheet. The director would like a photograph and department organization chart added to the directory. Figure 1 shows the results of adding and modifying both a SmartArt graphic and an image. The SmartArt graphic is arranged as an organization chart. Other boxes and levels of the organization can be added to the graphic quickly. The SmartArt graphic also can be resized, positioned, and formatted much in the same way in which you have worked with charts in previous chapters. The image on the top right is a photograph that has been inserted into the worksheet, resized, repositioned, and formatted with a rounded corner and reflection.
Overview As you read through this feature, you will learn how to create and modify SmartArt graphics and insert and modify images by performing the following tasks: • Insert a SmartArt graphic on a worksheet • Modify a SmartArt graphic • Add effects to a SmartArt graphic • Insert an image on a worksheet • Modify an image on a worksheet Plan Ahead
General Project Decisions 1. Choose the type of graphic to use for the organization chart. The requirements for the worksheet ask for an organization chart. The SmartArt graphics provided with most Microsoft Office applications include a template for an organization chart. Using the built-in SmartArt graphics organization chart template is, therefore, a good starting point for the chart. 2. Determine the contents and layout of the organization chart. The organization chart reflects the hierarchy of the organization that it represents. An organization hierarchy can be inferred from the job titles shown in the table in Figure 1. 3. Specify the formatting for the organization chart. Because visual appeal is important, the chart should be formatted with 3-D effects, and colors should be added to make the chart more appealing. (continued)
C6428_SF2_CTP.4c.indd 508
6/12/07 8:47:12 AM
(continued) 4. Obtain the image to be used in the worksheet. The image to be used is included with the Data Files for Students. Once the image is inserted on the worksheet, the image file no longer is needed because a copy of the image becomes part of the worksheet. When obtaining an image, you must use only those images for which you have permission. Several sources exist that provide royalty-free images, meaning that you do not have to pay for the image to use it. 5. Determine placement and formatting for the image. Placing the image to the right of the table is appropriate because the image is not likely to change size over time. The organization chart, however, may change size in the future and should be placed below the table and image. If the organization gets larger, the worksheet provides more space below the table and image for this growth. The image also can be set off from the table by using a rounded border. An artistic reflection of the image provides an additional visual enhancement to the worksheet.
Plan Ahead
Excel Chapter Excel Graphics Feature2
Project — Adding SmartArt and Images to a Worksheet EX 509
When necessary, more specific details concerning the above guidelines are presented at appropriate points in the feature. The feature also will identify the actions you perform and decisions made regarding these guidelines during the addition of the organization chart and image to an existing worksheet.
image inserted in worksheet
Organization Chart type SmartArt graphic
effects added to image
Figure 1
C6428_SF2_CTP.4c.indd 509
6/12/07 8:47:13 AM
EX 510 Excel Graphics Feature SmartArt and Images
Working with SmartArt Graphics A SmartArt graphic is a customizable diagram that you use to pictorially present lists, processes, and relationships. For example, the manufacturing process to produce an item can be illustrated with a SmartArt graphic. Excel includes seven types of SmartArt graphics: List, Process, Cycle, Hierarchy, Relationship, Matrix, and Pyramid. Each type of graphic includes several layouts, or templates, from which to choose. After selecting a SmartArt graphic type and layout, you customize the graphic to meet your needs and present your information and ideas in a compelling manner.
To Open a Workbook, Turn Off Gridlines, and Insert an Organization Chart Many entities maintain an organization chart that represents the hierarchy of the employees in the organization. The following steps open a workbook that contains an employee list, and then add, move, and size a SmartArt organization chart.
1 • Connect a USB flash drive to one of the computer’s USB ports.
Gridlines check box check mark removed
View tab
• Start Excel and then open the workbook, Malik Legal Services IT Department, from the Data Files for Students.
• Save the workbook using the file name, Malik Legal Services IT Department Complete.
2 • Click the View tab on
Q&A
the Ribbon and then click the Gridlines check box to turn off gridlines on the worksheet (Figure 2).
department employee table
gridlines removed from worksheet
Why should I turn off gridlines? Figure 2 Although useful during the process of creating a worksheet, many spreadsheet specialists remove the gridlines to reduce the clutter on the screen. This is especially true when working with graphics and images on a worksheet.
C6428_SF2_CTP.4c.indd 510
6/12/07 8:47:15 AM
3 • Click the Insert tab on the Ribbon and then click the SmartArt button on the Ribbon to display the Choose a SmartArt Graphic dialog box.
I Experiment
Insert tab SmartArt button
Organization Chart layout
Choose a SmartArt Graphic dialog box
preview area
Excel Chapter Excel Graphics Feature2
Working with SmartArt Graphics EX 511
• Click a variety of SmartArt graphics types and layouts to view previews of the graphics in the preview area of the Choose a SmartArt Graphic dialog box.
Hierarchy SmartArt graphic type selected
4 • Click Hierarchy in the Type list on the left side of the Choose a SmartArt Graphic dialog box. The middle portion of the dialog box (the layout list) displays a gallery of hierarchy Figure 3 charts, and the right side of the dialog box (the preview area) displays a preview of the selected SmartArt graphic.
OK button
• Click Organization Chart (column 1, row 1) in the layout list to see a preview of the chart in the preview area (Figure 3).
C6428_SF2_CTP.4c.indd 511
6/12/07 8:47:17 AM
EX 512 Excel Graphics Feature SmartArt and Images SmartArt Tools Design tab contextual tab is displayed
5 • Click the OK button
Q&A
to insert an Organization Chart SmartArt graphic in the worksheet. If necessary, click the Text Pane button on the Ribbon to display the Text pane. (Figure 4). What is displayed on the screen?
top sizing handle
Text pane
Two panes are added to the worksheet. The left pane is the Text pane. The Text pane is displayed only when the chart is selected. The Text pane includes one line for each box in the chart and allows you to add text to the chart quickly. The right pane is the SmartArt graphic with the Hierarchy type and the Organization Chart layout. The chart is displayed over the data in the worksheet, but it will be repositioned in the following steps.
Organization Chart SmartArt graphic inserted in worksheet
top level of chart
assistant level of chart
Figure 4
top of SmartArt graphic moved to bottom of row 13
Text pane moved to right side of SmartArt graphic
6 • While holding down the ALT key, click and drag the top of the chart to the bottom of row 13.
left sizing handle
right edge of SmartArt graphic moved to right edge of column H
• Click the middle sizing handle on the right edge of Figure 5 the chart and while holding down the ALT key, drag the sizing handle until the right edge of the chart is aligned with the right edge of column H.
Q&A
• Drag the Text pane to the right side of the chart (Figure 5). Why should I drag the Text pane to the right side of the chart? The chart will be widened further to the left. If the Text pane remains on the left side of the chart, then it will display on top of the resized chart and obscure the view of the chart.
C6428_SF2_CTP.4c.indd 512
6/12/07 8:47:19 AM
7 • If necessary, scroll the worksheet down until row 30 is displayed.
• Click the middle sizing handle on the left edge of the chart and while holding down the ALT key, drag the sizing handle until the left edge of the chart is aligned with the right edge of column A.
• Click the middle sizing handle on the bottom edge of the chart and while holding down the ALT key, drag the sizing handle until the bottom edge of the chart is aligned with the bottom edge of row 29 (Figure 6).
Excel Chapter Excel Graphics Feature2
Working with SmartArt Graphics EX 513
left edge of SmartArt graphic moved to right edge of column A
bottom of SmartArt graphic moved to bottom of row 29
Figure 6 Other Ways 1. To turn off gridlines, press ALT+W+V+G
C6428_SF2_CTP.4c.indd 513
2. To insert SmartArt graphic, press ALT+N+M, select layout, click OK button
6/12/07 8:47:23 AM
EX 514 Excel Graphics Feature SmartArt and Images
To Add Shapes and Modify Text in the Organization Chart The default organization chart layout includes five shapes: a shape for a manager at the top of the chart, a shape for the manager’s assistant on the left side in the second row of the chart, and three shapes for subordinates in the third row of the chart. The Malik Legal Services Information Technology department requires two additional shapes in the organization chart: a shape at the top of the chart for the Director level of management, and a shape below the lower-left shape for the Security Specialist job title. The following steps add two new shapes to the organization chart and then modify the text in all of the shapes.
1 • Right-click the top shape in the organization chart to display the shortcut menu.
• Point to Add Shape on the shortcut menu to display the Add Shape submenu (Figure 7).
top shape selected
shortcut menu
Add Shape submenu Add Shape Above command
Figure 7
C6428_SF2_CTP.4c.indd 514
6/12/07 8:47:25 AM
2 • Click Add Shape
Add Shape button arrow
Q&A
Above to add a new shape to the organization chart (Figure 8). Why does Excel change the layout of the chart? When a new shape is added to a SmartArt graphic, Excel rearranges the shapes in the graphic to fit in the same area. In Figure 8, the size of each shape and the font size of the text in each shape is reduced to accommodate the added shape. Excel also arranges the third level of the organization chart in a vertical alignment in order to better fit the added shape.
Excel Chapter Excel Graphics Feature2
Working with SmartArt Graphics EX 515
new shape added to organization chart and corresponding entry added to Text pane layout of organization chart automatically changed when new shape added to fit new shape in same area
first shape in third level of organization chart
Figure 8
3 • Click the first shape in the third level of the organization chart to select it.
• Click the Add Shape button arrow on the Ribbon to display the Add Shape menu.
• Click Add
layout of
organization chart Shape Below automatically on the Add changed when new shape added Shape menu to fit new shape in same area to add a new shape below the first shape in the third level of the organization chart (Figure 9).
new shape added to organization chart and corresponding entry added to Text pane
Figure 9
C6428_SF2_CTP.4c.indd 515
6/12/07 8:47:26 AM
EX 516 Excel Graphics Feature SmartArt and Images
4 • Click the top shape
Q&A
in the organization chart and then type Phil Johansen to add text to the shape (Figure 10). Why does Excel add the same text to the Text pane?
text typed in shape automatically added to corresponding entry in Text pane
top shape selected
As changes are made to text in the chart, the Text pane reflects those changes as an outline. You can type text in the shapes or type text in the Text pane, as shown in the following step.
Figure 10
5 • Click the entry under Phil Johansen in the Text pane to select it.
• Type Carrie Pecak in the second line of the Text pane to change the text in the shape in the second level of the organization chart (Figure 11).
text typed in Text pane automatically added to corresponding shape
second level shape selected
Figure 11
C6428_SF2_CTP.4c.indd 516
6/12/07 8:47:30 AM
6 • Repeat Step 4 for each of the remaining shapes in the organization chart and enter text in each shape as shown in Figure 12.
Excel Chapter Excel Graphics Feature2
Working with SmartArt Graphics EX 517
• Click the Save button on the Quick Access Toolbar.
text added to shapes and Text pane
Figure 12 Other Ways 1. Click line in Text pane, press ENTER key 2. Select shape, press CTRL+C, press CTRL+V
C6428_SF2_CTP.4c.indd 517
6/12/07 8:47:33 AM
EX 518 Excel Graphics Feature SmartArt and Images
To Change the Position of Shapes and Add Effects to the Organization Chart With all of the necessary data in the chart, the next step is to customize the chart by changing its layout to reflect the structure of the Information Technology department. The shapes in the third and fourth rows of the organization chart should be spread out to reduce the clutter in the chart. The following steps arrange the chart to be more readable and visually appealing.
1 • Click the lower-right
SmartArt Styles More button
shape in the organization chart (Diana Landry) and then drag the shape to the right until the right edge of the shape is aligned with the right edge of the organization chart as shown in Figure 13.
• Click the shape containing the text, David Ko, and then drag the shape to the left until the right edge of the shape is aligned approximately with the right edge of column B as shown in Figure 13.
lower-left shape moved to lowerleft corner of SmartArt graphic
shape repositioned
right edge of shape moved to right edge of SmartArt graphic
• Click the shape containing the text, Andriana Pineiro, and then drag the shape to the left until the lower-left Figure 13 corner of the shape is aligned with the lower-left corner of the organization chart as shown in Figure 13.
C6428_SF2_CTP.4c.indd 518
6/12/07 8:47:35 AM
2 • Click the SmartArt Styles More button to display the SmartArt Styles gallery.
Cartoon style
I Experiment • Point to a variety of
Excel Chapter Excel Graphics Feature2
Working with SmartArt Graphics EX 519
SmartArt Styles gallery
SmartArt styles in the SmartArt Styles gallery to preview the styles in the worksheet.
3 • Point to the Cartoon style in the SmartArt Styles gallery to display a preview of preview of Cartoon style the style in the organization chart (Figure 14).
Figure 14
4 • Click the Cartoon style in the SmartArt Styles gallery to apply the style to the organization chart. • Click the Change Colors button on the Ribbon to display the Change Colors gallery.
I Experiment • Point to a variety of color schemes in the Change Colors gallery to preview the color schemes in the worksheet.
C6428_SF2_CTP.4c.indd 519
6/12/07 8:47:37 AM
EX 520 Excel Graphics Feature SmartArt and Images
5 • Point to the Colorful
Change Colors button
Range – Accent Colors 4 to 5 color scheme in the Change Colors gallery to display a preview of the color scheme in the organization chart (Figure 15).
Colorful Range – Accent Colors 4 to 5 color scheme Change Colors gallery
preview of new color scheme
Figure 15
6 • Click the Colorful Range – Accent Colors 4 to 5 color scheme in the Change Colors gallery to apply the color scheme to the organization chart.
• Click the Format tab on the Ribbon. Click the Shape Effects button arrow to display the Shape Effects gallery.
I Experiment • Point to a variety of shape effect types in the Shape Effects gallery and then point to a variety of selections in the galleries to preview the various shape effects in the worksheet.
C6428_SF2_CTP.4c.indd 520
6/12/07 8:47:38 AM
7 • Point to the Preset
Format tab Shape Effects button arrow
button on the Shape Effects menu to display the Preset gallery.
Preset command
• Point to the Preset 5
Excel Chapter Excel Graphics Feature2
Using Images on a Worksheet EX 521
Preset 5 effect
effect in the Preset gallery to display a preview of the effect in the organization chart (Figure 16).
Preset gallery
Shape Effects menu
Preset 5 effect preview
Figure 16
8 • Click the Preset 5 effect in the Preset gallery to apply the effect to the organization chart.
• Select cell A14. • Click the Save button on the Quick Access Toolbar. Other Ways
Using Images on a Worksheet Excel allows you to insert images on a worksheet and then modify the image by changing its shape and size, and adding borders effects. You can enhance a worksheet by including an image such as a corporate logo, photograph, diagram, or map. To use an image, the image must be stored digitally in a file.
C6428_SF2_CTP.4c.indd 521
1. To change style, select SmartArt graphic, press ALT+J+S+S, click style 2. To change color scheme, select SmartArt graphic, press ALT+J+S+C, click color scheme
6/12/07 8:47:40 AM
EX 522 Excel Graphics Feature SmartArt and Images
To Insert and Modify an Image in the Worksheet The following steps insert an image of some of the Malik Legal Services Information Technology department members in the worksheet, position and resize the image, and add an effect to the image. The image, which was taken with a digital camera, is available on the Data Files for Students.
1 • Click the Insert tab
Insert tab
Insert Picture from File button
on the Ribbon.
• With your USB flash drive connected to one of the computer’s USB ports, click the Insert Picture from File button on the Ribbon to display the Insert Picture dialog box.
Insert Picture dialog box
UDISK 2.0 (E:) selected
• If the Folders list is displayed below the Folders button, click the Folders button to remove the Folders list.
Malik Legal Services IT Department image file
• If necessary, click Computer in the Favorite Links section and then scroll until UDISK 2.0 (E:) appears in the list of available drives.
Insert button
• Double-click UDISK 2.0 (E:) to select the USB flash drive, drive E in this case, as the device that contains the picture. Your USB flash drive may have a different drive letter and name.
Figure 17
• Click Malik Legal Services IT Department to select the file name (Figure 17).
C6428_SF2_CTP.4c.indd 522
6/12/07 8:47:42 AM
2 • Click the Insert
Q&A
button to insert the picture in the worksheet (Figure 18). How does Excel determine where to insert the image? Excel inserts the image so the upper-left corner of the image is located at the upper-left corner of the selected cell, which is cell A14 in Figure 18.
Excel Chapter Excel Graphics Feature2
Using Images on a Worksheet EX 523 Picture Tools contextual tab appears when image selected
image inserted in worksheet
Figure 18
C6428_SF2_CTP.4c.indd 523
6/12/07 8:47:44 AM
EX 524 Excel Graphics Feature SmartArt and Images
3 • Scroll the worksheet vertically until row 1 appears.
• Click anywhere in the image and while pressing the ALT key, drag the image so that its upper-left corner is aligned with the upper-left corner of cell E1.
Picture Styles More button
• While pressing the ALT key, drag the
Q&A
lower-right sizing handle of the image to the lower-right corner of cell I12 (Figure 19). Why should I press the ALT key as I drag and resize the image? When you press the ALT key as you drag or resize an image, Excel snaps, or aligns, the image to the borders of a cell. If you do not hold the ALT key, the corners of the image can be placed anywhere within a cell.
C6428_SF2_CTP.4c.indd 524
image moved to new location in worksheet
Figure 19
6/12/07 8:47:45 AM
4 • Click the Picture
Reflected Rounded Rectangle picture style
Styles More button on the Ribbon to display the Picture Styles gallery.
I Experiment
Excel Chapter Excel Graphics Feature2
Feature Summary EX 525
Picture Styles gallery
• Point to a variety of picture styles in the Picture Styles gallery and then point to a variety of styles in the galleries to preview them in the worksheet.
5 • Point to the Reflected Rounded Rectangle picture style (column 5, row 1) to see a preview of the style in the worksheet (Figure 20).
preview of image with reflection and rounded border
Figure 20
6 • Click the Reflected Rounded Rectangle picture style to apply the style to the image. • Click the Save button on the Quick Access Toolbar. Other Ways 1. Press ALT+N, P
To Quit Excel The following steps quit Excel.
1
Click the Close button on the right side of the title bar.
2
If Excel displays a Microsoft Office Excel dialog box, click the Yes button to save the workbook.
Feature Summary This Graphics feature introduced you to inserting and modifying SmartArt graphics and images. The items listed below include all the new Office 2007 skills you have learned in this Web feature. 1. Open a Workbook, Turn Off Gridlines, and Insert an Organization Chart (EX 510) 2. Add Shapes and Modify Text in the Organization Chart (EX 514)
C6428_SF2_CTP.4c.indd 525
3. Change the Position of Shapes and Add Effects to the Organization Chart (EX 518) 4. Insert and Modify an Image in the Worksheet (EX 522)
6/12/07 8:47:47 AM
EX 526 Excel Graphics Feature SmartArt and Images
In the Lab
STUDENT ASSIGNMENTS
Modify a workbook using the guidelines, concepts, and skills presented in this Graphics feature. Labs are listed in order of increasing difficulty.
Lab 1: Inserting a Hierarchy Chart and Image on a Worksheet Problem: You are the director of your town’s softball league and are planning the league’s playoff schedule. You want to create a worksheet that illustrates the playoff matchups for the teams in one of the divisions. Instructions: Start Excel and open the Lab GF-1 Mitchelltown Softball League workbook from the Data Files for Students and then save it as Lab GF-1 Mitchelltown Softball League Complete. Perform the following tasks: 1. Insert a SmartArt graphic using the Hierarchy type and select the Horizontal Hierarchy layout type (column 1, row 2) in the layout area in the Choose a SmartArt Graphic dialog box. 2. Select the hierarchy chart and then click the Right to Left button on the Design tab on the Ribbon to change the layout of the hierarchy chart to read from left to right. 3. Right-click the lower shape in the middle column of the hierarchy chart, point to Add Shape on the shortcut menu, and then click Add Shape Below on the Add Shape submenu. 4. Move and resize the chart so that the upper-left corner of the chart is aligned with the upper-left corner of cell A15 and the lower-right corner of the chart is aligned with the lower-right corner of cell F30. 5. From top to bottom, change the text in the shapes in the left column of the hierarchy chart to read Angels, Sox, Mariners, and Mets. Change the text in both shapes in the middle column of the hierarchy chart to Winner Game 1. Change the text in the shape on the right side of the hierarchy chart to Division Champion. 6. Change the color scheme of the hierarchy chart to Colorful – Accent Colors (column 1, row 2) in the Change Colors gallery. 7. Change the font size of the text in the shapes to 16 using the Font Size box on the Home tab on the Ribbon. 8. Use the Shape Effects gallery to change the effects on the chart to Preset 9 in the Preset gallery. 9. Insert the Mitchelltown Softball League.jpg image file from the Data Files for Students on the worksheet. 10. Move and resize the image so that the upper-left corner of the image is aligned with the upper-left corner of cell A1 and the lower-right corner of the image is aligned with the lower-right corner of cell F6. 11. Select the image. Click the Format tab on the Ribbon and then select the Reflected Perspective Right picture style (column 5, row 4) in the Picture Styles gallery. 12. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook. Submit the assignment as requested by your instructor.
C6428_SF2_CTP.4c.indd 526
6/12/07 8:47:48 AM
Lab 2: Inserting a Balance Chart and Image on a Worksheet Problem: Your company is considering moving to a new location. You have been asked to create a high-level overview of the pros and cons regarding the move to the location. Instructions: Start Excel and open the Lab GF-2 Pendel Support Services workbook from the Data Files for Students and then save it as Lab GF-2 Pendel Support Services Complete. Perform the following tasks: 1. Insert a SmartArt graphic using the Relationship type and select the Balance layout type (column 1, row 1) in the layout area in the Choose a SmartArt Graphic dialog box. 2. Move and resize the chart so that the upper-left corner of the chart is aligned with the upper-left corner of cell A4 and the lower-right corner of the chart is aligned with the middle of the corner of cell H18. 3. Use the Text pane to enter text for the balance chart. Enter the values shown in Table 1, making certain that the pros column shows on the left of the chart. Be sure to delete the unused shape on the right side of the balance chart by right-clicking the shape and then clicking Cut on the shortcut menu. The upper-left shape in the chart should read Pros, and the upper-right shape in the chart should Table 1 Pros and Cons read Cons. Note that the direction of the tilt of the Pros Cons balance chart changes when more pros than cons are entered in the chart. Central Location Expensive Lease 4. Change the color scheme of the hierarchy chart to Colored Fill – Accent 1 (column 2, row 3) in the Change Colors gallery.
Convenient Parking
Excel Graphics Feature
In the Lab
STUDENT ASSIGNMENTS
In the Lab EX 527
Congested Area
Closer to Customers
5. Apply the Inset SmartArt style to the balance chart (column 2, row 2) on the SmartArt Styles gallery. 6. Insert the Pendel Support Services Offices.jpg image file from the Data Files for Students on the worksheet. 7. Move and resize the image so that the upper-left corner of the image is aligned with the upper-left corner of cell H4 and the lower-right corner of the image is aligned with the lower-right corner of cell M17. 8. Select the image. Click the Format tab on the Ribbon. Click the Picture Effects button on the Ribbon, point to Shadow in the Picture Effects gallery, and then select Perspective Diagonal Upper Left (column 1, row 8) in the Shadow gallery. 9. Click the Picture Effects button on the Ribbon, point to Bevel in the Picture Effects gallery, and then select Divot (column 1, row 4) in the Bevel gallery. 10. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. Save the workbook. Submit the assignment as requested by your instructor.
C6428_SF2_CTP.4c.indd 527
6/12/07 8:47:49 AM
This page intentionally left blank
C6394_FM_CTP.4c.indd xvi
8/8/07 3:59:57 PM
Microsoft Office Excel 2007
7
Using Macros and Visual Basic for Applications (VBA) with Excel
Objectives You will have mastered the material in this chapter when you can: • Use passwords to assign protected and unprotected status to a worksheet
• Add controls, such as command buttons, scroll bars, check boxes, and spin buttons to a worksheet
• Use the macro recorder to create a macro
• Assign properties to controls
• Execute a macro and view and print code for a macro • Understand Visual Basic for Applications (VBA) code and explain event-driven programs • Customize the Quick Access Toolbar by adding a button
C6478_07_CTP.4c.indd 529
• Use VBA to write a procedure to automate data entry into a worksheet • Understand Do-While and If-Then-Else statements • Review a digital signature on a workbook
8/6/07 8:06:34 AM
Microsoft 2003 Microsoft Offi Office ce Word Excel 2007
7
Using Macros and Visual Basic for Applications (VBA) with Excel Introduction Before a computer can take an action and produce a desired result, it must have a step-by-step description of the task to be accomplished. The step-by-step description is a series of precise instructions called a procedure. Program and code are other names for a procedure. The process of writing a procedure is called computer programming. Every Excel command and Ribbon button has a corresponding procedure that the computer will execute, or carry out the step-by-step instructions, when you click the command or button. In a Windows Vista environment, the instructions associated with a task are executed when an event takes place, such as clicking a button, clicking a command, dragging a scroll box, or right-clicking a screen element. Because Excel does not have a command or button for every possible worksheet task, Microsoft has included a powerful programming language called Visual Basic for Applications. Visual Basic for Applications (VBA) is a programming language that allows you to customize and extend the capabilities of Excel. You can create a macro to group together commonly used combinations of tasks, which then can be reused later. In this chapter, you will learn how to create macros using a code generator called a macro recorder. A macro is a procedure composed of VBA code. It is called a macro, rather than a procedure, because it is created using the macro recorder. You also will learn how to add buttons to the Quick Access Toolbar and then associate these with macros. Finally, you will learn the basics of VBA, including creating a user interface, setting the properties, and writing the code.
Project — Caliber Steel 401(k) Investment Model Worksheet The project in the chapter follows proper design guidelines and uses Excel to create the worksheets shown in Figure 7–1 and Figure 7–2. Caliber Steel provides a 401(k) retirement savings plan to its employees. A 401(k) plan is a retirement savings plan that allows employees to invest pretax dollars through payroll deductions. To help recruit employees and show the benefit of the plan, the human resources department uses an investment model workbook to demonstrate how the plan works. The department requires that the workbook be automated with an easy-to-use interface that steps the user through the entry of data.
EX 530
C6478_07_CTP.4c.indd 530
8/6/07 8:06:35 AM
Microsoft Office Excel 2007
The 401(k) investment model workbook in this chapter is created according to the following three phases: Phase 1 — Use the macro recorder to create a macro that prints the worksheet in portrait orientation using the Fit to option. Assign the macro to a button on the Quick Access Toolbar (Figure 7–1a), so a user can execute the macro by clicking the button.
Quick Access Toolbar customized to include button that executes a recorded macro
when user clicks New Data button, Excel executes procedure that accepts data in cells D5:D10
401(k) data in range D5:D10
Excel calculates future value of investment in cell F10
Phase 2 — Create a New Data button on the worksheet as shown in Figure 7–1a, assign the button properties, and write an associated procedure (Figure 7–1b) that steps the user through entering the required data. Phase 3 — Create an area on the worksheet called the Personalization Center (Figure 7–2) that allows the user to enter his or her name and annual salary using a button and the remaining data using scroll bars, a check box, and spin buttons. Verify that the annual salary entered is procedure written in positive. Visual Basic for Applications Figure 7–3 (VBA) illustrates the requirements document for the Caliber Steel 401(k) Investment Model worksheet. It includes the needs, source of data, summary of calculations, and other facts about its development. The requirements document indicates that the development of the worksheet should be done in three phases, as outlined above.
table lists future value, employee investment, employer match, and return on investment for different years of service
(a) Worksheet
Visual Basic Editor active
(b) Visual Basic for Applications Figure 7–1
EX 531
C6478_07_CTP.4c.indd 531
8/6/07 8:06:35 AM
EX 532 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
clicking button requests employee to enter name (cell D5) and annual salary (cell D6) scroll bar changes employee investment (cell D7) scroll bar changes employer match (cell D8) check mark indicates if employer matches a portion of employee investment spin buttons change expected annual return (cell D9) spin buttons change years of service (cell D10)
Figure 7–2
Personalization Center created using VBA allows user to enter most of data using mouse rather than keyboard
Figure 7–3
C6478_07_CTP.4c.indd 532
8/6/07 8:06:38 AM
Overview As you read this chapter, you will learn how to modify the existing Caliber Steel workbook as shown in Figure 7–1 and Figure 7–2 by performing these general tasks: • Use passwords to protect and unprotect a worksheet
Excel Chapter 7
Project — Caliber Steel 401(k) Investment Model Worksheet EX 533
• Use the macro recorder to create a macro • Execute a macro, view and print code for a macro, and assign a macro to a button on the Quick Access Toolbar • Add controls to a worksheet and assign properties to the controls • Use VBA to write a procedure to automate data entry into a worksheet • Test and validate incoming data
General Project Decisions While working with an Excel worksheet, you need to make several decisions that will determine the appearance and characteristics of the finished worksheet. As you update an existing worksheet to meet the requirements shown in Figure 7–3, you should follow these general guidelines:
Plan Ahead
1. Ascertain the steps needed to create a macro. A macro is created by performing a set of steps and recording the steps as they are performed. The steps and order of the steps should be determined and rehearsed before creating the macro. 2. Create the user interface. In this chapter, two separate user interfaces are created that automate the entry of the employee’s investment model data. Excel provides several types of controls, such as buttons, text boxes, and spin buttons, that you can use in a user interface. Which controls you use for each task is determined by the type of data the control is used to enter. 3. Determine properties for controls in the user interface. Each type of control includes a different set of properties that you set as you design the user interface. For example, the size, color, and shape of a button are all properties of the button. The properties that you set give meaning and limitations to the user regarding the control’s use. 4. Establish the Visual Basic code needed for each control. When a user interacts with a control, such as clicking a button, Visual Basic code that is associated with that action is executed. Which actions will require a response from Visual Basic code? What should that response from the Visual Basic code be? For example, what precise actions should occur on a worksheet when a button is clicked? As a worksheet developer, you design and write the Visual Basic code. 5. Evaluate the completed user interface through testing. The final step in creating a user interface is to test it in order to prove that the interface behaves as designed and as a user expects. In addition, using a sketch of the worksheet can help you visualize its design. Figure 7–4 shows a sketch of the Personalization Center described in Phase 3 in the requirements document, to provide a visual representation of the more complex aspects of the requirements. The sketch for the Phase 3 Personalization Center includes labels, scroll bars, a check box, and spin buttons, so that the user can enter data using the mouse, rather than the keyboard. The sketch in Figure 7–4 indicates the cells that change as the user interacts with the controls in the Personalization Center. For example, as the user moves the Employee Investment scroll bar, the value in cell D7 changes. When necessary, more specific details concerning the above guidelines are presented at appropriate points in the chapter. The chapter also will identify the actions you perform and decisions made regarding these guidelines during the modification of the worksheet shown in Figure 7–1 on page EX 531 and Figure 7–2 on page EX 532.
C6478_07_CTP.4c.indd 533
8/6/07 8:06:40 AM
EX 534 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Caliber Steel
401(k) Plan Retirement Forecasting Employee name
XXXXXXXXX
Annual Salary
$
Employee Investment % Employer Match % Expected Annual Return Years of Service
Personalization Center
Client
$ ZZ,ZZ9.99
Z9. 99%
Employer
$ ZZ,ZZ9.99
Z9. 99%
Total
$ ZZ,ZZ9.99
ZZ,ZZ9.99
Enter Name and Salary Employee Investment
0
Z9. 99% 99
Future Value
13 Employer Match
$ ZZ,ZZ9.99
0
Investment Results Year s of Years Service
Future Value $ ZZZ,ZZ9.99
clicking button requests employee to enter name and annual salary
Monthly Contribution
6
Include Employer Match?
Employee Investment
Employer Match
Return on Investment
$ ZZZ,ZZ9.99
$ ZZZ,ZZ9.99
$ ZZZ,ZZ9.99
Annual Return
4%
(1% to 20%)
5 10
Years of Service
30
(1 to 45 years)
scroll bar changes employee investment scroll bar changes employer match check mark indicates if employer matches a portion of employee investment spin buttons change expected annual return and years of service
text boxes display expected annual return and years of service labels used to prompt user data table displays results
BTW
Figure 7–4 Opening Workbooks Macros are an easy place for computer virus programmers to hide computer viruses. For this reason, Microsoft Office Excel 2007 displays a warning whenever you open a workbook that contains a macro. The dialog box requires that you choose to enable or disable the attached macro before it will open the workbook. If you disable the macro and the macro contains a virus, it cannot damage your system. You should enable macros only if you trust the author who created the workbook with the macro.
C6478_07_CTP.4c.indd 534
With a good understanding of the requirements document, an understanding of the necessary decisions, and a sketch of the worksheet, the next step is to use Excel to open the existing Caliber Steel Investment Model workbook.
To Start Excel and Open a Workbook If you are using a computer to step through the project in this chapter and you want your screen to match the figures in this book, you should change your computer’s resolution to 1024 ⫻ 768. For information about how to change a computer’s resolution, see page APP 21 in Appendix E. The following steps start Excel and open the workbook Caliber Steel from the Data Files for Students.
1
Start Excel.
2
Open the file Caliber from the Data Files for Students and then save the workbook using the file name, Caliber Steel.
8/6/07 8:06:41 AM
If the Excel window is not maximized, double-click its title bar to maximize it.
4
If the worksheet window in Excel is not maximized, click the Maximize button next to the Close button on its title bar to maximize the worksheet within Excel (Figure 7–5). What does the worksheet contain?
Excel Chapter 7
3
Q&A
Project — Caliber Steel 401(k) Investment Model Worksheet EX 535
As shown in Figure 7–5, the 401(k) Investment Model worksheet in the Caliber Steel workbook is divided into two parts. The top part contains the data (range D5:D10) and the results (range F6:F10). The bottom part of the worksheet is a data table that organizes the results of four formulas in the range C15:F24 — future value (column C), employee investment (column D), employer match (column E), and return on investment (column F) — based on the years of service in column B. In the data table, the return on investment (column F) is the future value less the sum of the employee and employer investments.
dimmed buttons indicate worksheet is protected
Caliber Steel workbook
data for Edward Munoz
results
teal background indicates year in data table that agrees with years of service in cell D10 data table
Ready mode
401(k) Investment Model sheet
Figure 7–5
C6478_07_CTP.4c.indd 535
8/6/07 8:06:45 AM
BTW
EX 536 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Gaining Confidence in a Workbook Some Excel commands provide additional ways to uncover details of workbooks created by another author. For example, the Page Setup Dialog Box Launcher on the Page Layout tab on the ribbon and the Print Preview command can tell you if the author used any unusual settings. To list the macros in the workbook, click the Developer tab on the Ribbon and then click the Macros button on the Ribbon.
Learning More about a Workbook Created by Someone Else When you modify a workbook created by someone else, such as the Caliber Steel workbook, you should learn as much as you can about the workbook before you modify it. You can learn more about a workbook by doing the following: 1. Press CTRL+ACCENT MARK ( `) to display the formulas version to gain an understanding of what formulas and functions are used in the worksheet and which cells are referenced by the formulas and functions. 2. Use Range Finder or the auditing commands to show which cells are referenced in formulas and functions. You double-click a cell with a formula or function to activate Range Finder. 3. Check which cells are locked and which cells are unlocked. Usually all cells in a workbook are locked, except for those in which you enter data. For example, on the 401(k) Investment Model worksheet, only the cells in the range D5:D10 are unlocked. 4. Enter sample data and verify the results.
BTW
The worksheet shown in Figure 7–5 is protected. When buttons are dimmed even when Excel is in Ready mode, then the worksheet is protected. In this case, the cells in the range D5:D10 are unlocked so users can enter data, but the rest of the cells in the worksheet are protected and, therefore, cannot be changed. Later in this project, the worksheet will be unprotected so that changes can be made to it. Additionally, each cell in the range D5:D10 is assigned a cell name associated with the labels in the range B5:B10.
401(k) Plans Most employers who make contributions to 401(k) or similar plans require an employee to be vested before the employer matching contributions are granted to the employee. Usually a company requires three to five years of continuous employment before an employee is completely vested. Virtually all 401(k) plans, however, can be transferred from one employer to another.
C6478_07_CTP.4c.indd 536
To Enter Data in a Selected Range of Cells To illustrate the entry of sample data, the following steps enter the sample data: Employee Name (cell D5) — Ali Kunar; Annual Salary (cell D6) — $68,400.00; Employee Investment % (cell D7) — 9.00%; Employer Match % (cell D8) — 6.00%; Expected Annual Return (cell D9) — 8.00%; and Years of Service (cell D10) — 25. Before entering the data, selecting the range D5:D10 automatically makes the next cell in the range the active one when you complete a cell entry by pressing the ENTER key. The following steps enter the sample data in the selected range D5:D10. As each cell is selected, view the Name box in order to understand the cell name that is assigned to each cell.
1
Select the range D5:D10. In cell D5, type Ali Kunar as the employee name and then press the ENTER key.
2
In cell D6, type 68400 as the annual salary and then press the ENTER key.
3
In cell D7, type 9% as the employee investment percentage and then press the ENTER key.
4
In cell D8, type 6% as the employer match percentage and then press the ENTER key.
5
In cell D9, type 8% as the annual return and then press the ENTER key.
6
In cell D10, type 25 as the years of service and then press the ENTER key to display the new future value of $813,127.57 in cell F10 (Figure 7–6).
8/6/07 8:06:47 AM
Q&A
What do the results of the calculation mean?
Why does the pointer not match the years of service?
As shown in Figure 7–6, if Ali Kunar earns $68,400 a year and invests 9% of his income a year in the 401(k) plan, then his investment will be worth $813,127.57 in 25 years. If he works an additional 10 years, then Ali’s investment will be worth an astonishing $1,961,269.52, as shown in cell C22. These future values assume the annual return on the investment will be 8%. They also assume that Ali will never get a raise, which means the investment could be worth significantly more if he does get raises, because he is investing a percentage of his income, rather than a fixed amount. Due to an error in some versions of Excel, you must scroll the worksheet down until the pointer is no longer displayed and then scroll back to update the pointer.
Undo button arrow
Benefits of 401(k) Investment Plans Outside of winning the lottery or receiving a large inheritance, a retirement savings plan, such as a 401(k) plan, is the easiest way for a person on a fixed income to legally become a millionaire at some point in his or her lifetime. A significant benefit of the plan is that participants usually do not pay taxes on the money that they invest into the plan. After you start drawing funds from the plan, you are required to pay taxes on what you withdraw. Plans usually have penalties for withdrawing funds before you are 59 years old. For example, you may pay a 10 percent penalty on withdrawals made before you are 59 years old.
Excel Chapter 7
Click cell H5 to remove the selection from the range D5:D10. You may have to scroll down the worksheet to refresh the pointer in the range B16:B24. BTW
7
Q&A
Learning More about a Workbook Created by Someone Else EX 537
data for Ali Kunar
future value of Ali Kunar’s 401(k) plan investment
data table shows results for different years of service
Figure 7–6
C6478_07_CTP.4c.indd 537
8/6/07 8:06:47 AM
EX 538 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Undo a Group of Entries Using the Undo Button The following steps undo the cell entries to change the data in the range D5:D10 back to its original values.
1
Click the Undo button arrow on the Quick Access Toolbar (Figure 7–6).
2
When the Undo list appears, drag from the top down through Ali Kunar and then release the left mouse button to change the range D5:D10 back to its original values. Click cell H5. You may have to scroll down the worksheet to refresh the pointer in the range B16:B24.
Other Ways 1. Press ALT+2, drag through actions to undo
To Unprotect a Password-Protected Worksheet The 401(k) Investment Model worksheet in the Caliber Steel workbook is protected. When a worksheet is protected, users cannot change data in locked cells or modify the worksheet in any manner. Thus, before modifying the worksheet in the three phases, you must unprotect it. To unprotect the worksheet, you will need to enter the password assigned when it first was protected. A password ensures that users cannot unprotect the worksheet simply by clicking the Unprotect button. The password for the 401(k) Investment Model worksheet is caliber. In Excel, a password, such as caliber, can contain any combination of letters, numerals, spaces, and symbols; it also can be up to 15 characters long. Passwords are case sensitive, so if you vary the capitalization when you assign the password, you must use the same capitalization later when entering the password to unprotect the worksheet. The following steps unprotect the password-protected worksheet.
1 • Click the Review
Review tab
Q&A
tab on the Ribbon (Figure 7–7).
Unprotect Sheet button
Protect Workbook button
What other protection is available for a workbook or worksheet? The Review tab on the Ribbon shown in Figure 7–7 also has a Protect Workbook button. Protecting a workbook, instead of a worksheet, protects the structure and windows of the workbook, but not individual worksheets. Protecting the structure of a workbook means that users cannot add, delete, move, hide, unhide, or rename sheets. Protecting a workbook’s windows means users cannot move, resize, hide, unhide, or close the workbook’s windows.
C6478_07_CTP.4c.indd 538
Figure 7–7
8/6/07 8:06:49 AM
2 • Click the Unprotect Sheet button to display the Unprotect Sheet dialog box.
Excel Chapter 7
Phase 1 — Recording a Macro and Assigning It to a Toolbar Button and Menu Command EX 539
• When the Unprotect Sheet dialog box appears, type caliber in the Password text box (Figure 7–8).
3 • Click the OK button to unprotect
Q&A
the 401(k) Investment Model worksheet.
Unprotect Sheet dialog box
Can I work with the entire worksheet now? Yes. With the worksheet unprotected, you can modify the contents of cells regardless of whether they are locked or unlocked. If you decide to password-protect a worksheet, make sure you write down the password and keep it in a secure place. If you lose the password, you cannot open or gain access to the password-protected worksheet.
password characters displayed as bullets
OK button
Figure 7–8
Other Ways 1. Press ALT+R, PS
The first phase of this project creates a macro to automate printing the worksheet in portrait orientation using the Fit to option. Recall that the Fit to option ensures that the worksheet will fit on one printed page. The orientation for the printout currently is set to landscape in the Caliber Steel workbook. The planned macro will (1) change the orientation from landscape to portrait and use the Fit to option to ensure the printout fits on one page; (2) print the worksheet; and (3) reset the print settings back to their original settings. The purpose of this macro is to give users the option of printing the worksheet in landscape orientation by clicking the Print button on the Office Button menu or executing the macro to print the worksheet in portrait orientation. After the macro is created, it will be assigned to a button on the Quick Access Toolbar. Excel includes a macro recorder that creates a macro automatically based on a series of actions you perform while it is recording. As with a video recorder, the macro recorder records everything you do to a workbook over time. The macro recorder can be turned on, during which time it records your activities, and then turned off to stop the recording. After the macro is recorded, it can be played back, or executed, as often as you want. Three steps must be taken in preparation for working with macros in Excel. The Developer tab on the Ribbon includes commands used to work with macros. By default, the Developer tab does not appear in Excel, it must be made available by selecting an option in the Excel Options dialog box. Second, a security setting in Excel must be modified to allow macros to be enabled whenever you use Excel. Finally, Excel requires a workbook that includes macros to be saved as an Excel Macro-Enabled Workbook file type.
C6478_07_CTP.4c.indd 539
BTW
Phase 1 — Recording a Macro and Assigning It to a Toolbar Button and Menu Command Undoing Several Actions To undo recent actions one at a time, click the Undo button on the quick Access Toolbar. To undo several actions at once, click the Undo button arrow and select an action from the list. Excel will undo the selected action, as well as all the actions above it.
8/6/07 8:06:51 AM
EX 540 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Display the Developer Tab, Enable Macros, and Save a Workbook as a Macro-Enabled Workbook The following steps display the Developer tab on the Ribbon, enable macros, and save the workbook as a macro-enabled workbook.
1 • Click the Office
Office Button
Button to display the Office Button menu and then the Excel Options button to display the Excel Options dialog box.
Excel Options dialog box
Show Developer in the Ribbon check box selected
• Click the Show Developer tab in the Ribbon check box (Figure 7–9).
OK button
Figure 7–9
2 • Click the OK button in the Excel
Developer tab added to Ribbon
Options dialog box to display the Developer tab on the Ribbon.
• Click the Developer tab (Figure 7–10). Macro Security button
Figure 7–10
C6478_07_CTP.4c.indd 540
8/6/07 8:06:53 AM
3 • Click the Macro
Trust Center dialog box
Security button on the Ribbon to display the Trust Center dialog box.
Excel Chapter 7
Phase 1 — Recording a Macro and Assigning It to a Toolbar Button and Menu Command EX 541
Disable all macros with notification option button
• When the Trust Center dialog box appears, click the ‘Enable all macros’ option button to select it (Figure 7–11).
Enable all macros option button
4 • Click the OK button to close the Macro Security dialog box.
5 • Click the Office Button and then click Save As to display the Save As dialog box.
OK button
• When the Save As dialog box appears, click the ‘Save as type’ box arrow and then click Excel Macro-Enabled Workbook in the ‘Save as type‘ list (Figure 7–12).
Save As dialog box
Figure 7–11
6 • Click the Save button in the Save As dialog box to save the workbook as an Excel Macro-Enabled Workbook file type. Excel Macro-Enabled Workbook file type selected
Save button
Figure 7–12
C6478_07_CTP.4c.indd 541
8/6/07 8:06:55 AM
EX 542 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Record a Macro to Print the Worksheet in Portrait Orientation Using the Fit to Option To create the macro to change the print settings for the Caliber Steel workbook, turn on the macro recorder and then complete the following tasks. 1. If necessary, switch from landscape orientation to portrait orientation and from 100% normal size printing to Fit to one page. 2. Print the worksheet. 3. Switch from portrait orientation to landscape orientation and from Fit to one page to 100% normal size printing. 4. Stop the macro recorder. With the macro recorder, you actually step through the task as you create the macro. Therefore, you see exactly what the macro will do before you use it. When you first create the macro, you must name it. The name is used later to reference the macro when you want to execute it. Executing a macro causes Excel to step through all of the recorded steps. The macro name in this project is PrintPortrait. A macro name can be up to 255 characters long; it can contain numbers, letters, and underscores, but it cannot contain spaces and other punctuation. The following steps record the PrintPortrait macro to print the worksheet in portrait orientation using the Fit to option.
1 • If necessary, click the Developer tab on the Ribbon.
Record Macro button
• Click the Record
Record Macro dialog box
Macro button on the Ribbon to display the Record Macro dialog box.
• When the Record Macro dialog box appears, type PrintPortrait in the Macro name text box.
macro name
CTRL+R
executes macro
Description text box allows author of macro to add comment
macro stored as part of this workbook
OK button
• Type r in the Shortcut key text box to set the shortcut key for the macro to CTRL+R.
• Make sure the
Figure 7–13
Q&A
‘Store macro in‘ box displays This Workbook and then type Macro prints worksheet in portrait orientation on one page in the Description text box (Figure 7–13). Where can I store macros? In the Record Macro dialog box, you can select the location to store the macro in the ‘Store macro in’ box. If you want a macro to be available to use in any workbook whenever you use Microsoft Excel, select Personal Macro Workbook in the ‘Store macro in‘ list. This selection causes the macro to be stored in the Personal Macro Workbook, which is part of Excel. If you click New Workbook in the ‘Store macro in’ list, then Excel stores the macro in a new workbook. Most macros created with the macro recorder are workbook-specific and thus are stored in the active workbook. Selecting This Workbook in the ‘Store macro in‘ list, as was done in the steps above, stores the macro in the active workbook.
C6478_07_CTP.4c.indd 542
8/6/07 8:07:02 AM
2 • Click the OK button to begin
Stop Recording button
Q&A
recording the macro and cause the Record Macro button to become the Stop Recording button (Figure 7–14).
Excel Chapter 7
Phase 1 — Recording a Macro and Assigning It to a Toolbar Button and Menu Command EX 543
How do I go about recording the macro? Any task you perform in Excel will be part of the macro. When you are finished recording the macro, clicking the Stop Recording button on the Ribbon or on the status bar ends the recording.
Stop Recording button on status bar
Figure 7–14
3 • Click the Page Layout tab on the Ribbon.
Page Layout tab
Page Setup Dialog Box Launcher
Page Setup dialog box
4 • Click the Page Setup
Portrait option button selected
Dialog Box Launcher to display the Page Setup dialog box.
• When the Page Setup dialog box displays, click the Page tab. If necessary, click Portrait in the Orientation area, and then click Fit to in the Scaling area (Figure 7–15).
Fit to option button selected
Print button
5 • Click the Print button in the Page Setup dialog box.
• When the Print dialog box displays, click the OK button to print the worksheet.
C6478_07_CTP.4c.indd 543
Figure 7–15
8/6/07 8:07:04 AM
EX 544 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
6 • Click the Page Setup Dialog Box Launcher to display the Page Setup dialog box. Landscape option button selected
• If necessary, when the Page Setup dialog box displays, click the Page tab; click Landscape in the Orientation area; click Adjust to in the Scaling area; and then, if necessary, type 100 in the % normal size box (Figure 7–16).
% normal size box
7 • Click the OK button
OK button
to close the Page Setup dialog box (Figure 7–15).
• Click the Developer
Q&A
tab on the Ribbon and then click the Stop Recording button to stop recording the worksheet activities.
Figure 7–16
What if I make a mistake while recording the macro? If you recorded the wrong actions, delete the macro and record it again. You delete a macro by clicking the Developer tab and then clicking the Macros button on the Ribbon. When the Macro dialog box is displayed, click the name of the macro (PrintPortrait) and then click the Delete button. Finally, record the macro again.
BTW
Other Ways 1. Click Record Macro button on Visual Basic toolbar
2. Press ALT+L, P, M
Password Protection Excel offers three basic levels of password protection: (1)file level when you save it to disk; (2) workbook level, so the window cannot be modified; and (3) worksheet level, so locked cells cannot be changed. The first level is available through the Save As command on the Office Button menu. The second and third levels are available through the Protect Sheet and Protect Workbook buttons on the Review tab on the Ribbon.
To Password-Protect the Worksheet, Save the Workbook, and Close the Workbook
C6478_07_CTP.4c.indd 544
The following steps protect the 401(k) Investment Model worksheet, save the workbook using the file name Caliber Steel1, and then close the workbook.
1
Click the Review tab on the Ribbon, and then click the Protect Sheet button on the Ribbon. When the Protect Sheet dialog box appears, type caliber in the ‘Password to unprotect sheet’ text box and then click the OK button. When the Confirm Password dialog box is displayed, type caliber and then click the OK button.
8/6/07 8:07:07 AM
2
Click the Office Button and then click Save As. When the Save As dialog box is displayed, type Caliber Steel1 in the File name text box. Make sure UDISK (E:) displays in the Save in box and then click the Save button in the Save As dialog box.
3
Click the workbook’s Close button on the right side of its menu bar to close the workbook and leave Excel active.
Excel Chapter 7
Phase 1 — Recording a Macro and Assigning It to a Toolbar Button and Menu Command EX 545
To Set the Macro Security Level to Medium A computer virus is a potentially damaging computer program designed to affect, or infect, your computer negatively by altering the way it works without your knowledge or permission. The increased use of networks, the Internet, and e-mail have accelerated the spread of computer viruses. To combat this menace, most computer users run antivirus programs that search for viruses and destroy them before they ever have a chance to infect the computer. Macros are known carriers of viruses, because of the ease with which a person can add programming code to macros. Excel provides four levels of protection from macro viruses: Disable all macros without notification, Disable all macros with notification, Disable all macros except digitally signed macros, and Enable all macros. By default, the macro security level is set to Disable all macros with notification, meaning that only macros from trusted sources can be used. Trusted sources are discussed later in this project. The following steps set the level of protection to Disable all macros with notification.
1 • Click the Developer
Trust Center dialog box
tab on the Ribbon.
• Click the Macro Security button on the Ribbon to display the Trust Center dialog box.
Disable all macros with notification option button selected Macro Security button (partially obscured)
2 • Click the ‘Disable all macros with notification’ option button (Figure 7–17).
3 • Click the OK button in the Trust Center dialog box to close it. OK button
Figure 7–17 Other Ways 1. Click Office Button, Excel Options, click Trust Center 2. Press ALT+T, M, S
C6478_07_CTP.4c.indd 545
8/6/07 8:07:09 AM
BTW
EX 546 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Macros and Protected Worksheets A macro cannot modify a protect worksheet unless you explicitly tell the macro to unprotect the worksheet. Excel displays an error message if you execute a macro that attempts to modify a protected worksheet. If you want to modify a protected worksheet using a macro, have the macro unprotect the worksheet at the beginning, and then have the macro protect the worksheet at the end.
More About Macro Security Each time you open a workbook with an associated macro and the macro security level is set to ‘Disable all macros with notification’, Excel displays a Security Warning box and an Options button immediately below the Ribbon alerting you that a macro is attached. Clicking the Options button displays the Microsoft Office Security Options dialog box. Table 7–1 summarizes the option buttons and links from which users can select to continue the process of opening a workbook with macros. Table 7–1 Option Buttons and Links in the Microsoft Office Security Options Dialog Box When Opening a Workbook with Macros Buttons and Links
Description
Help protect me from unknown content
Macros are unavailable to the user
Enable this content
Macros are available to the user to execute
More Information
Opens the Excel Help window and displays information on viruses and workbook macros
Open the Trust Center
Displays the Trust Center dialog box
If you are confident of the source (author) of the workbook and macros, click the ‘Enable this content’ option button. If you are uncertain about the reliability of the source of the workbook and macros, then click the ‘Help protect me from unknown content’ option button. For more information on this topic, click the More Information link.
To Open a Workbook with a Macro and Execute the Macro The following steps open the Caliber Steel1 workbook to illustrate the Microsoft Excel dialog box that is displayed when a workbook contains a macro. The steps then show how to execute the recorded macro PrintPortrait by using the shortcut key CTRL+R. Recall that the shortcut key was established in Step 1 of the set of steps that begin on page EX 542.
1 • With Excel active,
Security Warning box
Options button
open the Caliber Steel1 workbook.
Microsoft Office Security Options dialog box
• Click the Options button in the Security Warning box to display the Microsoft Office Security Options dialog box (Figure 7–18). Enable this content option button
OK button
Figure 7–18
C6478_07_CTP.4c.indd 546
8/6/07 8:07:10 AM
2 • Click the ‘Enable this content’ option button to select it.
Excel Chapter 7
Phase 1 — Recording a Macro and Assigning It to a Toolbar Button and Menu Command EX 547
• Click the OK button. • When the Caliber Steel1 workbook opens, press CTRL+R to run the macro and print the worksheet (Figure 7–19).
worksheet printed in portrait orientation using Fit to option
Figure 7–19 Other Ways 1. Click Run Macro button on Visual Basic toolbar 2. On Developer tab, click Macros button, double-click macro name 3. Press ALT+F8, double-click macro name 4. Press ALT+L, P, M
C6478_07_CTP.4c.indd 547
8/6/07 8:07:12 AM
EX 548 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To View and Print a Macro’s VBA Code As described earlier, a macro is comprised of VBA code, which is created automatically by the macro recorder. You can view and print the VBA code through the Visual Basic Editor. The Visual Basic Editor is used by all Office applications to enter, modify, and view VBA code. The following steps view and print the PrintPortrait macro’s VBA code.
1 • Click the Developer
Macros button
tab on the Ribbon.
• Click the Macros
Macro dialog box
button on the Ribbon to display the Macro dialog box (Figure 7–20).
Run button
Step Into button
• If necessary, when
Edit button
the Macro dialog box is displayed, click PrintPortrait in the Macro name list.
PrintPortrait macro selected
Delete button
2 • Click the Edit button
Q&A
to start the Microsoft Visual Basic Editor (Figure 7–21). What is shown in the Microsoft Visual Basic Editor?
Microsoft Visual Basic Editor window
macro stored in Caliber Steel1 workbook
Figure 7–20
Microsoft Visual Basic Editor Close button
Figure 7–21 shows name of macro the instructions, beginning with description entered in line 1 and continuRecord Macro dialog box ing sequentially to the last line, that are executed when you shortcut key run the PrintPortrait entered in Record Macro macro. By scrolldialog box ing through the top portion of VBA code VBA code, you can comprising see that the macro macro recorder generates a lot of instructions. In this case, 109 lines of code are generated to print the Microsoft Visual Basic Editor is worksheet in portrait separate application orientation using the from Excel Fit to option. The instructions in the VBA code execute when you run the macro. Your screen Figure 7–21 may appear differently depending on how it appeared the last time the Microsoft Visual Basic Editor was activated.
C6478_07_CTP.4c.indd 548
8/6/07 8:07:14 AM
3 • Use the scroll bar to scroll through
File menu name
the VBA code.
• When you are finished, click File
Excel Chapter 7
Phase 1 — Recording a Macro and Assigning It to a Toolbar Button and Menu Command EX 549
File menu
on the menu bar (Figure 7–22).
4 • Click Print.
Print command
• When the Print - VBAProject dialog box is displayed, click the OK button to print the macro code.
5 • Click the Microsoft Visual Basic Editor Close button on the right side of the title bar.
Figure 7–22 Other Ways 1. Click Visual Basic button on Developer tab
2. Right-click the worksheet tab, click View Code on shortcut menu
3. Press ALT+L, V, click Edit
To Add a Button to the Quick Access Toolbar, Assign the Button a Macro, and Use the Button You can add as many buttons as you want to the Quick Access Toolbar. You add commands that you use commonly to the Quick Access Toolbar. You also can select an icon for the commands you add. The following steps add a button to the Quick Access Toolbar, change the button image, assign the PrintPortrait macro to the button, and use the button to print the worksheet.
1 • Right-click anywhere on the Quick Access Toolbar to display the shortcut menu (Figure 7–23).
Customize Quick Access Toolbar command Quick Access Toolbar shortcut menu
Figure 7–23
C6478_07_CTP.4c.indd 549
8/6/07 8:07:17 AM
EX 550 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
2 • Click the Customize Quick Access Toolbar command on the shortcut menu to display the Customize the Quick Access Toolbar page of the Excel Options dialog box.
• Click the ‘Choose commands from’ box arrow (Figure 7–24).
Excel Options dialog box
Choose commands from box arrow
current contents of Quick Access Toolbar
Macros
Choose commands from list
3 • Click Macros in the ‘Choose commands from’ list to display a list of macros.
• If necessary, click the PrintPortait macro to select it.
• Click the Add
Q&A
button to add the PrintPortrait macro to the Customize Quick Access Toolbar list (Figure 7–25). How can I delete the buttons that I add to the Quick Access Toolbar? You can reset the Quick Access Toolbar to its installation default by clicking the Reset button on the Customize Quick Access Toolbar page of the Excel Options dialog box. If you share a computer with others, you should reset the Quick Access Toolbar before you quit Excel.
Figure 7–24
Macros selected in Choose commands from list PrintPortrait macro selected
PrintPortrait macro added to Customize Quick Access Toolbar list
Add button
Modify button
Figure 7–25
C6478_07_CTP.4c.indd 550
8/6/07 8:07:20 AM
4 • Click the Modify button to display the Modify Button dialog box.
• Click the printer icon
Excel Chapter 7
Phase 1 — Recording a Macro and Assigning It to a Toolbar Button and Menu Command EX 551
Modify Button dialog box
(column 5, row 2) in the Symbol list (Figure 7–26).
printer icon
Symbol list
OK button
5 • Click the OK button to assign the
PrintPortrait button
Figure 7–26 ScreenTip
printer icon to the new command and to close the Modify Button dialog box.
• Click the OK button in the Excel Options dialog box to close it.
• Point to the PrintPortrait button on the Quick Access Toolbar to display the ScreenTip for the button (Figure 7–27).
Figure 7–27
C6478_07_CTP.4c.indd 551
8/6/07 8:07:22 AM
BTW
EX 552 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel Visual Basic for Applications All of the applications in the Microsoft Office System 2007 (Word, Excel, Access, PowerPoint, and Outlook) use Visual Basic for Applications. Thus, what you learn in this chapter applies to the other applications as well. Today, Visual Basic for Applications is one of the most widely used Windows applications programming languages.
Phase 2 — Creating a Procedure to Automate the 401(k) Investment Model Data Entry Earlier in this chapter, on page EX 536, sample data for Ali Kunar was entered to test the formulas and verify the calculation of new future value information. A novice user, however, might not know what cells to select or how much 401(k) investment model data is required to obtain the desired results. To facilitate entering the 401(k) investment model data, Phase 2 calls for creating a Command Button control (Figure 7–28a) and an associated procedure (Figure 7–28b) that steps the user through entering data in the range D5:D10 using dialog boxes.
(a) Worksheet with New Data Command Button
Command Button control
first executable statement
(b) Procedure Associated with New Data Command Button Figure 7–28
A Command Button control is different from a toolbar button in that it is an object you draw on the worksheet. In this chapter, after a user triggers the event by clicking the New Data Command Button control, the instructions in the associated procedure guide the user through entering the required 401(k) plan data in the range D5:D10. The Command Button control also serves as the user interface. The user interface can be as simple as a button or as complex as a series of windows that accept data and display results. The user interface, together with the procedure, is called an application.
C6478_07_CTP.4c.indd 552
8/6/07 8:07:25 AM
1. The first line clears the range D5:D10. 2. The second line selects cell A1. 3. Lines 3 through 8 accept data for the cells in the range D5:D10 using the cell name, one cell at a time. Recall from the earlier review of the workbook that the cell names in the range D5:D10 are as follows: D5 is named Employee_Name; D6 is named Annual_Salary; D7 is named Employee_Investment; D8 is named Employer_Match; D9 is named Annual_Return; and D10 is named Years_of_Service.
Macros form Earlier Excel Versions Some earlier versions of Excel use a language called XLM, rather than VBA, for their macros. Excel 2007 supports both languages. That is, you can execute macros created using XLM as well as those created using VBA. Excel 2007, however, will not allow you to create macros in XLM.
Excel Chapter 7
If you step through the procedure (Figure 7–28b) beginning at the line just below Private Sub CommandButton1_Click(), you can see how a procedure methodically steps the user through entering the data in the range D5:D10. Cell names that have been assigned to the cells in the range are used in the code to make the code more readable.
BTW
Phase 2 — Creating a Procedure to Automate the 401(k) Investment Model Data Entry EX 553
Visual Basic applications are built using the three-step process shown in Figure 7–29: (1) create the user interface; (2) set the properties; and (3) write the VBA code. Before you can create the user interface, the 401(k) Investment Model worksheet in the Caliber Steel1 workbook must be unprotected. The following steps unprotect the worksheet. Step 1 — Create the User Interface
Command Button control is user interface
properties of Command Button control
Step 2 — Set the Properties
(a) Worksheet with New Data Command Button Step 3 — Write the VBA Code
(b) Properties Window for New Data Command Button
VBA code associated with Command Button control entered using Visual Basic Editor
(c) VBA Code Associated with Button Figure 7–29
C6478_07_CTP.4c.indd 553
8/6/07 8:07:26 AM
EX 554 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Unprotect a Password-Protected Worksheet
BTW
Plan Ahead
Design Mode If Excel is in Run mode and you click any control button in the Controls Gallery, Excel immediately switches to Design mode.
1
With the Caliber Steel1 workbook open, click the Review tab on the Ribbon, and then click the Unprotect Sheet button on the Ribbon.
2
When the Unprotect Sheet dialog box appears, type caliber as the password and then click the OK button to unprotect the worksheet.
Step 1 — Create the user interface. The most common way to execute a procedure in Excel is to create a Command Button control. To create the control, click the Command Button button in the Controls gallery on the Developer tab on the Ribbon. Next, you use the mouse to locate and size the control in the same way you locate and size an embedded chart. You then can assign properties and the procedure to the Command Button control while Excel is in Design mode.
Two modes of Visual Basic for Applications exist within Excel: Design mode and Run mode. Design mode allows you to resize controls, assign properties to controls, and enter VBA code. Run mode means that all controls are active and thus cannot be changed. If you click a control in Run mode, it triggers the event, and Excel executes the procedure associated with the control.
To Add a Command Button Control to the Worksheet The following steps add a Command Button control to the worksheet.
1 • Click the Developer tab on the
Developer tab Insert button
Ribbon.
Design Mode button
• Click the Insert button on the Ribbon to display the Controls gallery (Figure 7–30).
Controls gallery
ActiveX Controls area
Command Button control
Figure 7–30
C6478_07_CTP.4c.indd 554
8/6/07 8:07:29 AM
2 • Click the Command Button
Design Mode button selected
button in the ActiveX area of the Controls gallery (column 1, row 1 of ActiveX area) to switch to Design mode.
Excel Chapter 7
Phase 2 — Creating a Procedure to Automate the 401(k) Investment Model Data Entry EX 555
• Move the mouse pointer (a crosshair) to the upper-left corner of cell H5. proposed button area
• Drag the mouse pointer so the rectangle defining the button area appears as shown in Figure 7–31 and hold.
crosshair mouse pointer
Figure 7–31
3 • Release the left mouse button
Design Mode button selected when Excel is in Design mode
to add the Command Button control with the default caption CommandButton1 (Figure 7–32). CommandButton1 is selected button code shows in formula bar when button is selected
sizing handles indicate Excel is in Design mode and that the CommandButton 1 control is selected
Figure 7–32 Other Ways 1. Click Design Mode button on Developer tab
Step 2 — Determine properties for controls in the user interface. As shown in the Properties window in Figure 7–29b on page EX 553, a Command Button control has 25 different properties, such as caption (the words on the face of the button), background color, foreground color, height, width, and font. After you add a Command Button control to a worksheet, you can change any one of the 25 properties to improve the control’s appearance and modify how it works. For the 401(k) Investment Model, the control’s caption should read New Data to reflect the purpose of the button. The color of the caption’s font should be changed to a color that is consistent with the worksheet.
C6478_07_CTP.4c.indd 555
Plan Ahead
8/6/07 8:07:30 AM
EX 556 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Set the Command Button Control Properties The following steps change the Command Button control’s caption, the font size of the caption, and the color of the caption.
1 • With the Command Button control selected and Excel in Design mode, click the Properties button on the Ribbon to open the Properties window for the Command Button control.
Properties window
properties belong to CommandButton1 control
Properties button
Caption property
• If necessary, when the Properties window opens, click the Alphabetic tab, click Caption in the Properties list, and then type New Data as the caption.
Alphabetic sheet displays properties in alphabetical order
Caption property value changed from CommandButton1 to New Data
Palette tab ForeColor arrow
• Click ForeColor each row represents in the Properties a property or set of common properties list, click the of selected control ForeColor arrow, and then click the Palette tab (Figure 7–33).
desired color selected control
Figure 7–33
2 • Click blue (column 7, row 3) on the ForeColor palette.
Font dialog box
• Click Font in the Properties list and then click the Font button.
OK button
• When the Font dialog box appears, click Bold in the Font style list and 12 in the Size list (Figure 7–34).
12 selected in Size list ForeColor (font color) property changed to blue Bold selected in Font style list
Figure 7–34
C6478_07_CTP.4c.indd 556
8/6/07 8:07:33 AM
3 • Click the OK button to display the
Q&A
Command Button control. If necessary, drag the lower-right corner of the Properties window to make all of the properties display in the window (Figure 7–35).
Categorized sheet categorizes properties by appearance, behavior, font, and miscellaneous
How should I use the Properties window? The Properties window (Figure 7–35) includes two sheets: Alphabetic and Categorized. The Alphabetic sheet displays the properties in alphabetical order by property name. The Categorized sheet displays the properties in categories, such as appearance, behavior, font, and miscellaneous. Depending on the application, you can modify any one of the Command Button control properties shown in Figure 7–35, much like the previous steps changed the Caption, ForeColor, and Font properties.
Excel Chapter 7
Phase 2 — Creating a Procedure to Automate the 401(k) Investment Model Data Entry EX 557
button’s caption is New Data in 12-point blue bold font
three changed properties
Other Ways
Figure 7–35
Step 3 — Establish the Visual Basic code needed for each control. The next step is to write and then enter the procedure that will execute when the user clicks the New Data button. When you trigger the event that executes a procedure, such as clicking a button, Excel steps through the Visual Basic statements one at a time, beginning at the top of the procedure. Thus, when you plan a procedure, remember that the order in which you place the statements in the procedure is important because the order determines the sequence of execution. An event-driven program includes procedures that execute when the specific actions taken by the user or other events occur. After you know what you want the procedure to accomplish, write the VBA code on paper, creating a table similar to Table 7–2. Then, before entering the procedure into the computer, test it by putting yourself in the position of Excel and stepping through the instructions one at a time. As you do so, think about how the procedure affects the worksheet. Testing a procedure before entering it is called desk checking and is an important part of the development process. (continued)
C6478_07_CTP.4c.indd 557
Plan Ahead
BTW
1. In Design mode, right-click control, click Properties on shortcut menu
Improving Productivity If you find yourself entering the same series of Excel commands over and over, you can use the macro recorder or VBA to complete the steps automatically. This can improve your productivity by eliminating routine tasks and simplifying complex tasks.
8/6/07 8:07:36 AM
EX 558 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Plan Ahead
(continued) Adding comments before a procedure will help you remember its purpose at a later date or help somebody else understand its purpose. In Table 7–2, the first seven lines are comments. Comments begin with the word Rem (short for Remark) or an apostrophe (‘). In a procedure, comments contain overall documentation and are placed before the procedure, above the Sub statement. Comments have no effect on the execution of a procedure; they simply provide information about the procedure, such as name, creation date, and function. Comments also can be placed in between lines of code or at the end of a line of code as long as the comment begins with an apostrophe (‘).
Table 7–2 New Data Button Procedure Line
Statement
1
' New Data Button Procedure
2
' Date Created: 10/22/2008
3
' Run from: 401(k) Investment Model Sheet by clicking button labeled New Data
4
' Function: When executed, this procedure accepts 401(k) Plan Investment Model
5
'
data which causes Excel to calculate a new future value and other
6
'
investment information.
7
'
8
Private Sub CommandButton1_Click()
9
Range(“D5:D10”).ClearContents
10
Range(“A1”).Select
11
Range(“Employee_Name”).Value = InputBox(“Employee Name?”, “Enter”)
12
Range(“Annual_Salary”).Value = InputBox(“Annual Salary?”, “Enter”)
13
Range(“Employee_Investment”).Value = InputBox(“Employee Investment in %?”, “Enter”)
14
Range(“Employer_Match”).Value = InputBox(“Employer Match in %?”, “Enter”)
15
Range(“Annual_Return”).Value = InputBox(“Annual Return in %?”, “Enter”)
16
BTW
17
Range(“Years_of_Service”).Value = InputBox(“Years of Service?”, “Enter”) End Sub
The Microsoft Visual Basic Editor Window If the window displaying the VBA code appears different from the one shown in Figure 7–37 on page 560, double-click the Code window’s title bar to maximize the window. If the Project window or Properties window displays on the left side of the Microsoft Visual Basic Editor window, click its Close button.
C6478_07_CTP.4c.indd 558
Author: Louise Kizior
About the Command Button Control Code A procedure begins with a Sub statement and ends with an End Sub statement (lines 8 and 17 in Table 7–2). The Sub statement includes the keyword Private or Public followed by the name of the procedure, which Excel determines from the name of the control (in this case, CommandButton1) and the event that causes the procedure to execute (in this case, Click). Private means that the procedure can be executed only from this workbook. Public means that it can be executed from other workbooks or programs. The name of the Command Button control procedure is CommandButton1_Click(). The parentheses following the keyword Click in the Sub statement in line 8 are required. They indicate that arguments can be passed from one procedure to another. Passing arguments is beyond the scope of this chapter, but the parentheses still are required. The End Sub statement in line 17 signifies the end of the procedure and returns Excel to Ready mode. The first executable statement in Table 7–2 is line 9, which clears the cells in the range D5:D10. Line 10 selects cell A1 to remove clutter from the screen. One at a time, lines 11 through 16 accept data from the user and assign the data to the cells in the range D5:D10. Each cell in the range D5:D10 is assigned a cell name. The code uses the cell name to make the code more readable. Each one of the six statements handles one cell.
8/6/07 8:07:38 AM
Entering VBA Comments If a horizontal line displays between the comment and Sub Statement, press the ENTER key after the last comment to begin a new line. Then press the DELETE key to delete the horizontal line.
Excel Chapter 7
To the right of the equal sign in lines 11 through 16 is the InputBox function. A function returns a value to the program. In this case, the InputBox function displays a dialog box and returns the value entered by the user. For example, in line 11, the InputBox function displays a dialog box with the message, “Employee Name?” When the user responds and enters a name, the InputBox function returns the value entered to the program and assigns it to the cell named Employee_Name, which is cell D5.
BTW
Phase 2 — Creating a Procedure to Automate the 401(k) Investment Model Data Entry EX 559
To Enter the New Data Button Procedure Using the Visual Basic Editor To enter a procedure, you use the Visual Basic Editor. To activate the Visual Basic Editor, Excel must be in Design mode. To activate the Visual Basic Editor, select a control to switch Excel to Design mode and then click the View Code button on the Ribbon. The Visual Basic Editor is a full-screen editor, which allows you to enter a procedure by typing the lines of VBA code as if you were using word processing software. At the end of each line, you press the ENTER key or use the DOWN ARROW key to move to the next line. If you make a mistake in a statement, you can use the arrow keys and the DELETE or BACKSPACE key to correct it. You also can move the insertion point to previous lines to make corrections. The following steps activate the Visual Basic Editor and create the procedure for the New Data button.
1 • With the New Data button
Excel is in Design mode
selected and Excel in Design mode, point to the View Code button on the Ribbon (Figure 7–36).
View Code button
VBA code to be written for selected control
Figure 7–36
C6478_07_CTP.4c.indd 559
8/6/07 8:07:39 AM
EX 560 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Microsoft Visual Basic title bar
2 • Click the View
indicates workbook that contains procedure
Code button on the Ribbon to start the Microsoft Visual Basic Editor. insertion point
• When the
Sub and End Sub statements automatically inserted
Microsoft Visual Basic Editor starts, if the Project Explorer window appears on the left, click its Close button.
event (mouse click) that executes macro
• If necessary, double-click the title bar to maximize the Microsoft Visual Basic Editor window.
Visual Basic Editor is active
• If necessary,
Q&A
Figure 7–37 double-click the title bar of the Microsoft Visual Basic window to maximize it (Figure 7–37). Why is there already code in the Microsoft Visual Basic Editor window? The Visual Basic Editor automatically inserts the Sub and End Sub statements and positions the insertion point between the two statements.
3 • Click to the left of
apostrophe (‘) the letter P in the begins comment line word Private on the first line and press the ENTER key to add a blank line before comment lines the Sub statement.
pressing ENTER key starts new line
comments display in green
• Move the insertion point to the blank line and then type the seven comment statements (lines 1 through 7) in Table 7–2 on page EX 558. Make sure you enter an apostrophe (‘) at the beginning of each comment line.
Figure 7–38
Q&A
• Press the ENTER key to start a new line (Figure 7–38). Why does the code appear in different colors? Excel automatically displays the comment lines in green. Keywords, such as Private and Sub, appear in blue. Other code appears with a black font color.
C6478_07_CTP.4c.indd 560
8/6/07 8:07:40 AM
View Microsoft Excel button activates Excel and minimizes Visual Basic Editor
4 • Position the
Properties Window button
insertion point on the comments blank line do not between impact how procedure the Sub and functions End Sub statements.
Close button closes Visual Basic Editor and returns to Excel
procedure begins with Sub statement
• Enter lines 9 through
Q&A
16 in Table 7–2. For clarity, indent all lines between the Sub statement and End Sub statement by three spaces (Figure 7–39). How should I exit the Visual Basic Editor and return to Excel?
Excel Chapter 7
Phase 2 — Creating a Procedure to Automate the 401(k) Investment Model Data Entry EX 561
lines within procedure indented three spaces for readability
procedure ends with End Sub statement
Figure 7–39 Excel provides two ways to return control from the Visual Basic Editor to the worksheet. The Close button on the title bar (Figure 7–39) closes the Visual Basic Editor and returns control to the worksheet. The View Microsoft Excel button on the Standard toolbar (Figure 7–39) also returns control to Excel, but only minimizes the Visual Basic Editor window. If you plan to switch between Excel and the Visual Basic Editor, then use the View Microsoft Excel button; if you want to close the Visual Basic Editor and return to Excel, use the Close button.
5 • Click the Close button on the
Design Mode button
right side of the Microsoft Visual Basic title bar to return to the worksheet.
• Click the Close button on the right side of the Properties window (Figure 7–40). sizing handles indicate Excel is in Design mode
6 • Click the Design Mode button
Q&A
on the Ribbon to return to Run mode. What is the result of clicking the Design Mode button? Excel returns to Run mode, which means if you click the New Data button, Excel will execute the associated procedure.
Figure 7–40 Other Ways 1. Click Visual Basic button on Ribbon
C6478_07_CTP.4c.indd 561
2. In Design mode, right-click control, click View Code on shortcut menu
8/6/07 8:07:43 AM
BTW
EX 562 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Printing the VBA Code To print the VBA code while the Visual Basic Editor is active, click File on the menu bar and then click Print.
More About Visual Basic for Applications Visual Basic for Applications includes many more statements than those presented here. Even this simple procedure, however, should help you understand the basic composition of a Visual Basic statement. For example, each of the statements within the procedure shown in Figure 7–39 includes a period. The entry on the left side of the period tells Excel which object you want to affect. An object can be a cell, a range, a chart, a worksheet, a workbook, a button, or any other control you create on a worksheet. Objects also can be other applications in Windows or parts of other applications. The entry on the right side of the period tells Excel what you want to do to the object. You can place a method or property on the right side of the period. For example, the statement Range(“D5:D10”).ClearContents
BTW
object
Running Procedures Always save a workbook before you execute a procedure in case something unexpected occurs. This is especially true when testing a procedure.
method
clears the range D5:D10. You use a method, such as ClearContents, to change an object’s behavior. In this case, the method ClearContents is changing the behavior of the range by clearing its contents. You previously were shown how to change an object’s properties using the Properties window (Figure 7–33 on page EX 556). The following example shows that you also can change an object’s properties during execution of a procedure. The object in this case is a Command Button control. CommandButton1.Caption = “401(k) Investment Model Data” name of control
property
property value
This statement changes the value of the Caption property of the button to 401(k) Investment Model Data during execution of the procedure. As shown in Figure 7–39, the second statement in the procedure, Range(“A1”).Select selects cell A1, which, in effect, hides the heavy border that surrounds the active cell. Several of the statements in the procedure also include equal signs. An equal sign instructs Excel to make an assignment to a cell. For example, when executed as part of the procedure
BTW
Range(“Employee_Name”).Value = InputBox(“Employee Name?”, “Enter”)
Message Box Buttons By setting the second parameter of the MsgBox function, you can change the buttons that display in the message box. VBA includes several shortcuts for specifying the buttons. For example, vbAbortRetryIgnore displays Abort, Retry, and Ignore buttons in the message box. Other shortcuts include vbOKCancel, vbRetryCancel, vbYesNo, and vbYesNoCancel.
C6478_07_CTP.4c.indd 562
the equal sign instructs Excel to display a dialog box called Enter with the prompt message, Employee Name?. The statement then assigns the value entered by the user in response to the dialog box to cell D5, which is named Employee_Name. Thus, the first argument in the InputBox function is the message that should be displayed to the user, and the second argument identifies the title to be displayed in the dialog box’s title bar. A message box often is used to display informative messages to a user. A message box is a type of dialog box that does not provide an input area for the user, but allows the user only to click one or more buttons. The MsgBox function is used to display a message. For example, when executed as part of the procedure Result = MsgBox(“You must enter a value between 1 and 10,000.”, , “Input Error”) the MsgBox function displays a dialog box with Input Error on the title bar and the message, You must enter a value between 1 and 10,000., in the dialog box. By default, the dialog box includes only an OK button. In this example, the second parameter between the message and dialog box title does not include any values to list the buttons that the
8/6/07 8:07:46 AM
dialog box should display; the dialog box thus includes only an OK button. After the user clicks the OK button, a value indicating that the user clicked the OK button is assigned to the Result variable in the code above.
Excel Chapter 7
Phase 2 — Creating a Procedure to Automate the 401(k) Investment Model Data Entry EX 563
To Enter 401(k) Investment Model Data Using the New Data Button Before attempting to enter data using the New Data button, be sure you exit Design mode and return Excel to Run mode, as illustrated in Step 6 in the previous set of steps. The following steps enter 401(k) Investment Model data as follows: Employee Name (cell D5) — Millie Jenkins; Annual Salary (cell D6) — $87,200.00; Employee Investment % (cell D7) — 6.00%; Employer Match % (cell D8) — 3.00%; Expected Annual Return (cell D9) — 9.00%; and Years of Service (cell D10) — 20.
1 • Click the New Data button.
• When Excel displays
Q&A
the first Enter dialog box with the prompt message, Employee Name?, type Millie Jenkins in the text box (Figure 7–41).
dialog box automatically created by InputBox function in third executable line of procedure
message in dialog box defined by first argument in third line of procedure
What happens when I click the New Data button? Excel clears the range D5:D10 and then selects cell A1. Next, it displays the Enter dialog box shown in Figure 7–41.
first executable line in procedure clears range D5:D10
text will be entered in cell D5
Figure 7–41
2 • Click the OK button or press the ENTER key. dialog box automatically created by InputBox function in fourth line of procedure
• When Excel displays the next Enter dialog box with the prompt message, Annual Salary?, type 87200 in the text box (Figure 7–42).
message in dialog box defined by first argument in fourth line of procedure
entry (Mille Jenkins) in previous dialog box assigned to cell D5
number will be entered in cell D6
Figure 7–42
C6478_07_CTP.4c.indd 563
8/6/07 8:07:46 AM
EX 564 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
3 • Click the OK button. • When Excel displays
Q&A
the next Enter dialog box with the prompt message, Employee Investment in %?, type 6% in the text box, making certain to type the percent (%) sign (Figure 7–43). What happens when I click the OK button? Excel assigns the value $87,200.00 to cell D6, applying the formatting assigned to cell D6 to the value. Excel then displays the third Enter dialog box as shown in Figure 7–43.
dialog box automatically created by InputBox function in fifth line of procedure
message in dialog box defined by first argument in fifth line of procedure
number will be entered in cell D7
entry (87200) in previous dialog box assigned to cell D6
Figure 7–43
4 • Click the OK button. • When Excel displays the next Enter dialog box with the prompt message, Employer Match in %?, type 3% in the text box (Figure 7–44).
dialog box automatically created by InputBox function in sixth line of procedure
message in dialog box defined by first argument in sixth line of procedure number will be entered in cell D8 entry (6%) in previous dialog box assigned to cell D7
Figure 7–44
C6478_07_CTP.4c.indd 564
8/6/07 8:07:49 AM
5 • Click the OK button. • When Excel displays the next Enter dialog box with the prompt message, Annual Return in %?, type 9% in the text box (Figure 7–45).
Excel Chapter 7
Phase 2 — Creating a Procedure to Automate the 401(k) Investment Model Data Entry EX 565
dialog box automatically created by InputBox function in seventh line of procedure
message in dialog box defined by first argument in seventh line of procedure
number will be entered in cell D9
entry (3%) in previous dialog box assigned to cell D8
Figure 7–45
6 • Click the OK button to assign 9.00% to cell D9.
• When Excel displays the next Enter dialog box with the prompt message, Years of Service?, type 20 in the text box (Figure 7–46).
dialog box automatically created by InputBox function in eighth line of procedure
message in dialog box defined by first argument in eighth line of procedure
number will be entered in cell D10
entry (9%) in previous dialog box assigned to cell D9
Figure 7–46
C6478_07_CTP.4c.indd 565
8/6/07 8:07:52 AM
EX 566 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
7 • Click the OK button to display the
Q&A
results for Millie Jenkins in the range F6:F10 (Figure 7–47). What is the result on the worksheet? Figure 7–47 shows that the future value of Millie Jenkins‘ investment of $436.00 per month (cell F6) for 20 years is $436,798.01 (cell C19 and F10). After 20 years of monthly contributions, Millie Jenkins’s total 401(k) plan investment will be $104,640.00 (cell D19) and the total employer match will be $52,320.00 (cell E19).
workbook Close button
A1 is active cell due to second line of procedure
Millie Jenkins’s 401(k) plan information
401(k) plan future value based on 20 years of service and other data entry (20) in previous dialog box assigned to cell D10
future value $4,842,790.52 if Millie remains for 45 years
BTW
Figure 7–47
Data Validation The VBA code entered in Step 4 on page EX 561 does not check the incoming data to make sure it is reasonable. For example, if a user enters a negative value for the Years of Service in Step 6 on the previous page, Excel will calculate an incorrect Future Value. In the next phase of this chapter, you will learn how to write VBA code that will ensure that unreasonable numbers are rejected. See the VBA code in Figure 7–79 on page EX 593 for an example.
C6478_07_CTP.4c.indd 566
To Protect a Worksheet and Save the Workbook With Phase 2 of this chapter complete, the final step is to protect the worksheet and save the workbook.
1
Click the Review tab on the Ribbon, and then click the Protect Sheet button on the Ribbon.
2
When the Protect Sheet dialog box appears, type caliber in the ‘Password to unprotect sheet’ text box and then click the OK button. When the Confirm Password dialog box appears, type caliber and then click the OK button.
3
Click the Office Button and then click Save As on the Office Button menu. When the Save As dialog box is displayed, type Caliber Steel2 in the File name text box. Make sure UDISK 2.0 (E:) displays in the Address bar and then click the Save button.
4
Click the Close button on the right side of the title bar to close the Caliber Steel2 workbook.
8/6/07 8:07:55 AM
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry The final phase of this chapter requires that more controls are added to the worksheet to automate the 401(k) Investment Model data entry. In Phase 2, clicking the New Data button triggered Excel to display a series of input dialog boxes. This phase uses input dialog boxes only for the employee name and annual salary. The remaining data (employee investment, employer match, annual return, and years of service) is entered using scroll bars, a check box, and spin buttons to help reduce input errors that can be caused by mistyped data. Figure 7–48 shows how the Personalization Center will look when complete. When you click the Enter Name and Salary button, Excel displays input dialog boxes to accept the employee name for cell D5 and the annual salary for cell D6.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 567
button requests name and annual salary for cells D5 and D6
scroll bar used to enter employee investment % in cell D7
scroll bar used to enter employer match % in cell D8 check box used to determine if employer contributes to 401(k) plan spin button used to enter annual return in cell D9 spin button used to enter years of service in cell D10
Figure 7–48
The Employee Investment scroll bar immediately below the Enter Name and Salary button allows you to set the employee investment percentage in cell D7. Recall that a scroll bar is made up of three separate elements that you can click or drag — the scroll arrows on each side that you can click; the scroll box between the scroll arrows that you can drag; and the clickable scroll bar that extends from one scroll arrow to the other. The Employee Investment scroll bar has a minimum value of 0% and a maximum value of 13%. If you click one of its scroll arrows, the employee investment percent in cell D7 increases or decreases by 0.5%, depending on which scroll arrow you click. If you click the scroll bar on either side of the scroll box, the employee investment percent in
C6478_07_CTP.4c.indd 567
8/6/07 8:07:57 AM
EX 568 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
cell D7 increases or decreases by 1%. Finally, you can drag the scroll box to the right or left to increase or decrease the employee investment percentage in cell D7. The Employer Match scroll bar works the same way, except that the scroll bar runs from 0% to 6% and the employer match changes by 0.25% when you click a scroll arrow. The Include Employer Match? check box in the middle of the Personalization Center in Figure 7–48 determines if the Employer Match scroll bar is enabled or disabled. If the check mark is present, then the scroll bar above the check box is enabled. If the check mark is removed, then cell D8 is set equal to 0% and the scroll bar is disabled. The Annual Return spin button in the lower portion of the Personalization Center increases or decreases the expected annual return in cell D9 by 0.25% each time you click a spin button arrow. A spin button has two spin button arrows, one to increment and one to decrement the value in the cell with which it is associated. The Years of Service spin button in the lower portion of the Personalization Center increases or decreases the years of service in cell D10 by one each time you click a spin button arrow.
To Open a Workbook and Unprotect a Worksheet The following steps open the workbook Caliber Steel1, save it using the file name Caliber Steel3, and unprotect the 401(k) Investment Model worksheet.
BTW
Plan Ahead
More Controls The bottom-right button shown in Figure 7-49 is the More Controls button. If you click this button, nearly 200 additional controls, are available to incorporate in a user interface. The controls will vary depending on the software that is installed on your computer.
C6478_07_CTP.4c.indd 568
1
Open the Caliber Steel1 workbook saved in Phase 1 of this chapter.
2
Click the Options button in the Security Warning box. When the Microsoft Office Security Options dialog box appears, click the ‘Enable this content’ option button and then click the OK button to close the dialog box.
3
Click the Office Button and then click Save As on the Office Button menu. When the Save As dialog box is displayed, type Caliber Steel3 in the File name text box and then click the Save button in the Save As dialog box.
4
Click the Review tab on the Ribbon and then click the Unprotect Sheet button on the Ribbon. When the Unprotect Sheet dialog box appears, type caliber in the Password text box, and then click the OK button to unprotect the worksheet.
Step 1 — Create the user interface. The first step is to create the Personalization Center user interface shown in Figure 7–48 on the previous page. After creating the gray background for the Personalization Center in the range H5:L24, the following controls must be added: 1. One Command Button control 2. Two Scroll Bar controls 3. One Check Box control 4. Two Spin Button controls 5. Label controls to identify controls and display data When you first create a user interface, you position the controls as close as you can to their final location on the screen, and then you finalize Command Button the locations of the controls, after control button setting the properties. Spin Button Figure 7–49 shows the Controls control button gallery and where the above referenced controls can be found in the gallery.
Check Box control button Scroll Bar control button
Figure 7–49
Label control button
8/6/07 8:07:59 AM
To Add Controls to a User Interface The following steps create the controls, but make no attempt to position them exactly in the locations shown in Figure 7–48.
1 • Select the
Insert button
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 569
Design Mode button
range H5:L24.
• Click the Fill Color button arrow on the Home tab on the Ribbon and then click White, Background 1, Darker 25% (column 1, row 4) on the Fill Color palette.
mouse used to draw Command Button control in desired location
• Click the Borders button arrow on the Ribbon and then click Thick Box Border on the Borders palette.
thick border surrounds proposed Personalization Center
• Click the Developer tab on the Ribbon.
gray background defines proposed Personalization Center
• Click the Insert button on the Ribbon, click the Command Button button in the ActiveX area in the Controls gallery, and then drag the mouse pointer so the control displays as shown in Figure 7–50.
C6478_07_CTP.4c.indd 569
Figure 7–50
8/6/07 8:08:00 AM
EX 570 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
2 • Click the Insert button on the Ribbon, click the Scroll Bar button in the ActiveX area in the Controls gallery, and then move the mouse pointer to approximately the left of cell I12.
• Drag the mouse pointer so the
Q&A
Scroll Bar control displays as shown in Figure 7–51. What if I need to delete a control that I added?
mouse used to draw Scroll Bar control
If you want to delete a control, select the control while in Design mode and then press the DELETE key. If you want to resize a control, select the control while in Design mode and then drag its sizing handles. If you want to reposition a control, select the control while in Design mode and then drag it to its new location.
Figure 7–51
3 • Point to the Scroll Bar control. • Hold down the CTRL key and drag a copy of the Scroll Bar control to the location shown in Figure 7–52. It is important that you release the left mouse button before you release the CTRL key.
dragging Scroll Bar control with CTRL key pressed copies Scroll Bar control
Figure 7–52
C6478_07_CTP.4c.indd 570
8/6/07 8:08:06 AM
4 • Click the Insert button on the Ribbon, click the Check Box button in the ActiveX area in the Controls gallery, and then move the mouse pointer to the upper-left corner of the location of the Check Box control as shown in Figure 7–53.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 571
• Drag the mouse pointer so the
Q&A
rectangle defining the Check Box control area displays with the word CheckBox1 showing. Why does the check box not seem to be the right size? The check box will be resized after its caption is changed later in this chapter. mouse used to draw Check Box control
Figure 7–53
5 • Click the Insert button on the Ribbon, click the Spin Button button in the ActiveX area in the Controls gallery, and then move the mouse pointer to the upperleft corner of the location of the Spin Button control shown in Figure 7–48 on page 567.
• Drag the mouse pointer so the rectangle defining the Spin Button control area displays as shown in Figure 7–54.
mouse used to draw Spin Button control
Figure 7–54
C6478_07_CTP.4c.indd 571
8/6/07 8:08:09 AM
EX 572 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
6 • Point to the Spin Button control in the Personalization Center.
• Hold down the CTRL key and drag a copy of the Spin Button control to the second location shown in Figure 7–55. It is important that you release the left mouse button before you release the CTRL key.
dragging Spin Button control with CTRL key pressed copies Spin Button control
Figure 7–55
7 • Click the Insert button on the Ribbon, click the Label button in the ActiveX area in the Controls gallery, and then move the mouse pointer to the left of the first Scroll Bar control below the CommandButton1 button.
• Drag the mouse pointer so the
Q&A
rectangle defining the Label control displays as shown in Figure 7–56.
mouse used to draw Label control
What is the purpose of this particular Label control? This Label control is used to indicate the lowest value (zero) on the scroll bar.
Figure 7–56
C6478_07_CTP.4c.indd 572
8/6/07 8:08:11 AM
8 • Point to the Label control. • Hold down the CTRL key and then drag a copy of the Label control created in Step 7 to the center of cell J3. While holding down the CTRL key, drag the newly copied Label control to the next location where a Label control is required.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 573
dragging initial Label control with CTRL key pressed copies Label control
• Continue in this fashion until you
Q&A
have a total of 11 Label controls as shown in Figure 7–57. What appears on the added Label controls? When you create a Label control, a caption automatically is associated with it. The Caption property for the first Label control is Label1. For the next Label control you create, the Caption property is Label2, and so on. Because of the size of the Label controls in Figure 7–57, only two characters of the caption, La, appear in the Personalization Center. Figure 7–57 Other Ways 1. Select control, click Copy button on Home tab on Ribbon, click Paste button on Home tab on Ribbon
2. Right-click control, click Copy on shortcut menu, click Paste on shortcut menu
Step 2 — Determine properties for controls in the user interface. The next step is to set the properties for the 17 controls that make up the user interface. The 17 controls best can be seen by referring to Figure 7–57 and counting the button, labels, scroll bars, check box, and spin buttons. The properties will be set as follows:
3. Select control, press CTRL+C to copy, press CTRL+V to paste
Plan Ahead
1. Constant Labels and Check Box — Set the BackColor property of the Label controls that identify other controls and the Check Box control to gray, so they match the gray background of the user interface. Set the Font property to bold. Set the Caption property and Text Align property for each Label control that identifies another control. As needed, resize the Label controls so the entire caption shows. For the Label control used for the Personalization Center title, change the Caption property to Personalization Center and set the Font property to 20-point bold. 2. Command Button — Change the Caption property to Enter Name and Salary and set the ForeColor property to blue. Change the Font property to 12-point bold and resize the Command Button control so the entire caption shows. 3. Employee Investment Scroll Bar — Change the Name property to scrEmployeeInvest, the SmallChange property to 50 (0.5%), the LargeChange property to 100 (1%), the Min property to 0 (0%), and the Max property to 1300 (13%). (continued)
C6478_07_CTP.4c.indd 573
8/6/07 8:08:14 AM
EX 574 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
BTW
Plan Ahead
The Max Property One of the more difficult concepts to understand about scroll bars is why the Max property is set to such a large number (600 for the Employer Match Check Box), when the maximum value of the scroll bar is only 6% (.06). The two reasons are (1) the Max property can be set equal to only a whole number; and (2) the large number allows you to assign reasonable increments to the SmallChange and LargeChange properties of the scroll bar.
(continued) 4. Employer Match Scroll Bar — Change the Name property to scrEmployerMatch, the SmallChange property to 25 (0.25%), the LargeChange property to 100 (1%), the Min property to 0 (0%), and the Max property to 600 (6%). 5. Employer Match Check Box — Change the Name property to chkEmployerMatch and the Caption property to Include Employer Match?. Change the SpecialEffect property to fmButtonEffectFlat and change the TextAlign property to fmAlignLeft. Set the Value property to True. Resize the check box so the entire caption shows. 6. Annual Return Spin Button — Change the Name property to spnAnnualReturn, the SmallChange property to 25 (0.25%), the Min property to 0 (0%), and the Max property to 2000 (20%). 7. Years of Service Spin Button — Change the Name property to spnYearsofService, the SmallChange property to 1, the Min property to 1, and the Max property to 45. 8. Annual Return Label — Change the Name property to lblAnnualReturn, the Caption property to 5%, the BackColor property to white, the TextAlign property to 1 fmTextAlignRight, and the BorderStyle property to 1 - fmBorderStyleSingle. Resize the Label control so the entire caption shows. 9. Years of Service Label — Change the Name property to lblYearsofService, the Caption property to 10, the BackColor property to white, the TextAlign property to 1 fmTextAlignRight, and the BorderStyle property to 1 - fmBorderStyleSingle. Resize the Label control so the entire caption shows.
Preparing to Set Properties Excel automatically assigns the first Command Button control the name CommandButton1. If you create a second Command Button control, Excel will call it CommandButton2, and so on. In the controls just listed, some will have their Name property changed as indicated, while others will not. Usually, you do not change the Name property of Label controls that identify other controls in the user interface. On the other hand, controls that are referenced in the VBA code should be given names that help you recall the control. Table 7–3 summarizes the controls whose Name properties will be changed because they will be referenced in the VBA code.
BTW
Table 7–3 Referenced Controls and Their Names Determining Properties It is best to have all of your properties determined before you sit down at the computer. Using a grid, or graph paper, is often the best way to lay out a screen by hand and set properties such as height, width, and location. Other properties should be determined in this manner as well. Often, this design is detailed in a formal document called a functional specification, which is reviewed and approved by users of the finished worksheet.
C6478_07_CTP.4c.indd 574
Control
Name
Employee Investment Scroll Bar
scrEmployeeInvest
Employer Match Scroll Bar
scrEmployerMatch
Employer Match Check Box
chkEmployerMatch
Annual Return Spin Button
spnAnnualReturn
Years of Service Spin Button
spnYearsofService
Annual Return Label
lblAnnualReturn
Years of Service Label
lblYearsofService
The name of a control, such as scrEmployeeInvest, must begin with a letter; cannot exceed 255 characters; and cannot include a space, period, exclamation point, or the characters @, &, $, or #. You should develop a naming convention of your own and then use it consistently to name controls. In this book, the first three characters of the name identify the type of control. For example, scr stands for scroll bar, chk stands for check box, and spn stands for spin button. Following the three characters are words that identify what
8/6/07 8:08:16 AM
the control is controlling. In this case, scrEmployeeInvest is a scroll bar controlling the Employee Investment % value in cell D7. You also must make sure that each control in a workbook uses a unique name, because Excel does not allow the use of duplicate names.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 575
To Set Properties of the Label Controls and Check Box Control When you create a Label control, it has a white background. If the Label control identifies another control and the value remains constant, the background color must be changed so it matches the user interface background. If the Label control is going to display a value that varies, the background is left white. The following steps use the SHIFT key to select all the Label controls and the Check Box control, except the title Label control, so that the BackColor property can be changed for all selected items at one time. The Font property of the selected controls also is changed to Bold. After the BackColor and Font properties are changed, each Label control is selected and the Caption and Text Align properties are set.
1 • With Excel in Design
Properties button
mode, click the Label control in the topright of the user interface.
• Hold down the SHIFT key and then one at a time click the Check Box control and all Label controls except the title Label control, as shown on the right side of Figure 7–58.
• Release the SHIFT key. • Click the Properties
BackColor box arrow Palette tab
BackColor (background color) property selected
White, Background 1, Darker 25% color
button on the Ribbon.
• When the Properties
Q&A
window opens, click BackColor; if necessary, click the BackColor box arrow; and then click the Palette tab (Figure 7–58). Why do there seem to be fewer properties in the Property window?
Check Box and Label controls selected using mouse and SHIFT key
Every control has its Figure 7–58 own set of properties, although many controls share common properties, such as BackColor, Caption, and ForeColor. When you select multiple controls, Excel displays only those properties that are common to the controls selected.
C6478_07_CTP.4c.indd 575
8/6/07 8:08:17 AM
EX 576 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
2 • Click the White, Background 1, Darker 25% (column 1, row 3) color on the BackColor palette to add a gray background to the selected controls.
Font dialog box 12 selected Bold selected
• Click Font in the Properties window and then click the Font button.
• When the Font dialog box appears, click Bold in the Font style list and click 12 in the Size list (Figure 7–59).
Label controls and Check Box control have gray background
Figure 7–59
C6478_07_CTP.4c.indd 576
8/6/07 8:08:19 AM
3 • Click the OK button. • Click anywhere in the Personalization Center area to deselect the Label controls and Check Box control.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 577
clicking box arrow displays list of controls on worksheet
• Click the Label control to the left of the first (Employee Investment) Scroll Bar control.
• Click Caption in the Properties window and then type 0 as the caption. selected Label control displays caption 0
• Click TextAlign in the Properties window, click the TextAlign box arrow, and then click 2 – fmTextAlignCenter (Figure 7–60).
TextAlign box arrow
TextAlign property set to 2 fmTextAlignCenter
Figure 7–60
4 • Click the Label control to the right of the first Scroll Bar control. • Click Caption in the Properties window and then type 13 as the caption. • Click TextAlign in the Properties window, click the TextAlign box arrow, and then click 2 - fmTextAlignCenter.
C6478_07_CTP.4c.indd 577
8/6/07 8:08:21 AM
EX 578 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
5 • If necessary, resize the Label control so the caption 13 is visible (Figure 7–61). Label control resized so 13 is displayed
Caption property set to 13
TextAlign property set to 2 fmTextAlignCenter
Figure 7–61
6 • Click the Label control above the first Scroll Bar control.
Label control resized so Employee Investment is displayed
• Click Caption in the Properties window and then type Employee Investment as the caption.
Caption property set to Employee Investment
• Click TextAlign in the Properties window, click the TextAlign box arrow, and then click 2 fmTextAlignCenter.
• Resize the Label control so the caption Employee Investment is visible (Figure 7–62). TextAlign property set to 2 fmTextAlignCenter
Figure 7–62
C6478_07_CTP.4c.indd 578
8/6/07 8:08:23 AM
7 • Click the Label control to the left of the second Scroll Bar control.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 579
• Click Caption in the Properties window and then type 0 as the caption.
Label Caption property set to 0 (zero) and TextAlign property set to 2 - fmTextAlignCenter
• Click TextAlign in the Properties window, click the TextAlign box arrow, and then click 2 fmTextAlignCenter.
• Click the Label control on the right side of the second Scroll Bar control.
Caption property set to 6
• Click Caption in the Properties window and then type 6 as the caption.
selected Label control displays caption 6
• Click TextAlign in the Properties window, click the TextAlign box arrow, and then click 2 fmTextAlignCenter (Figure 7–63).
8 • Click the Label
TextAlign property set to 2 fmTextAlignCenter
Figure 7–63
control above the Personalization Center area.
• Click Caption in the Properties window and then type Personalization Center as the caption. • Click TextAlign in the Properties window, click the TextAlign box arrow, and then click 2 - fmTextAlignCenter. • Change the font style to 18-point, bold, and red.
C6478_07_CTP.4c.indd 579
8/6/07 8:08:26 AM
EX 580 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
9 • Resize the Label
thick box border added
control so the entire caption shows.
• Select the range H2:L3. • Click the Home tab on the Ribbon. Click the Borders button arrow on the Ribbon and then click Thick Box Border in the Borders gallery.
Label control resized so entire caption shows Caption property set to Personalization Center
• Click the Developer
Font property changed to 18-point bold font
tab on the Ribbon (Figure 7–64).
10 • Click the Label control directly above the second Scroll Bar.
• Click Caption in the Properties window and then type Employer Match as the caption.
Figure 7–64
• Click TextAlign in the Properties window, click the TextAlign box arrow, and then click 2 fmTextAlignCenter.
• Resize the Label control so the entire caption shows. Caption property set to Annual Return (1% to 20%)
• Click the Label control to the far left of the top Spin Button control.
Label control resized so entire caption shows
• Click Caption in the Properties window and then type Annual Return (1% to 20%) as the caption.
• Click TextAlign in the Properties window, click the TextAlign box arrow, and then, if necessary, click 1 fmTextAlignLeft.
TextAlign property set to 1 - fmTextAlignLeft
Figure 7–65
• Resize the Label control so the entire caption shows (Figure 7–65).
C6478_07_CTP.4c.indd 580
8/6/07 8:08:28 AM
11 • Click the Label control to the far left of the second Spin Button control.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 581
• Click Caption in the Properties window and then type Years of Service (1 to 45 years) as the caption.
• Click TextAlign in the Properties window, click the TextAlign box arrow, and then click 1 fmTextAlignLeft.
Caption property set to Years of Service (1 to 45 years)
• Resize the Label control so the entire caption shows (Figure 7–66).
Label control resized so caption can display in its entirety
TextAlign property set to 1 fmTextAlignLeft
Figure 7–66
C6478_07_CTP.4c.indd 581
8/6/07 8:08:31 AM
EX 582 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Set the Command Button Control Properties The following step changes the caption on the Command Button control from CommandButton1 to Enter Name and Salary and resizes it so the entire caption shows on the button.
1 • With Excel in Design mode, click the Command Button control in the Personalization Center.
• Click Caption in the Properties window and then type Enter Name and Salary as the caption. Command Button control resized so entire caption shows
• Click ForeColor, click the ForeColor box arrow, and then click the Palette tab.
Caption property set to Enter Name and Salary
• Click red (row 4, column 2) on the ForeColor palette.
• Click Font in the Properties window and then click the Font button.
• When the Font
MousePointer property
dialog box appears, click Bold in the Font style list, click 12 in the Size list, and then click the OK button.
• Resize the Command
Q&A
Button control so that the entire caption shows (Figure 7–67).
Figure 7–67
Can I experiment with some of the other properties in the Property window? Yes. As you can see from the Properties window shown in Figure 7–67, a Command Button control has many different properties. One that may interest you that is not used in this chapter is the MousePointer property. If you click MousePointer in the Properties window and then click the MousePointer box arrow, several mouse pointer shapes are listed, including hourglass, I-beam, arrow, and crosshair, and others with which you are familiar from your experiences in Excel. If you change the MousePointer property, the mouse pointer will change to the selected mouse pointer shape when you point to the button.
C6478_07_CTP.4c.indd 582
8/6/07 8:08:32 AM
To Set the Employee Investment Scroll Bar Control Properties The next step is to set the properties of the Employee Investment Scroll Bar control. The function of this Scroll Bar control is to assign cell D7 a value. When you use a control, such as a Scroll Bar, you must set the Min and Max properties. The Min property is the minimum value the control can register. The Max property is the maximum value the control can register. You also have to set the SmallChange and LargeChange values. The SmallChange property is the value by which the control will change each time you click the scroll arrow. The LargeChange property is the value by which the control will change each time you click the scroll bar. You can assign only whole numbers for these four properties. This increases the complexity of the VBA code, because the value the user selects using the scroll bar is assigned to cell D7, which must be assigned a percentage as a decimal number. Thus, to assign cell D7 the maximum value 0.13 (13%), the Scroll Bar control actually must have a Maximum property of 1300. Later in the VBA code, this value is divided by 10,000 to assign cell D7 a value of 0.13. The following step sets the properties of the Employee Investment Scroll Bar control.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 583
1 • With Excel in Design mode, click the Employee Investment Scroll Bar control.
• Click (Name) in the Properties window and then type scrEmployeeInvest as the name.
• If necessary, change
Q&A
the LargeChange property to 100, the Max property to 1300, the Min property to 0, and the SmallChange property to 50 (Figure 7–68). Do I need to determine the exact distance in pixels that the scroll button on the scroll bar will move?
name of Scroll Bar control changed to scrEmployeeInvest Employee Investment Scroll Bar control selected LargeChange property (scroll arrow) set to 100, or 1% Max property set to 1300, or 13% (scroll box moved to far right) Min property set to 0, or 0% (scroll box moved to far left)
SmallChange property (scroll arrow) set to 50, or 0.5%
No. Excel automatically will determine how far to move the scroll button on the scroll bar when you click the scroll button Figure 7–68 (small change) and when you click the scroll boxes (large change) from the four numeric values entered in Step 1.
C6478_07_CTP.4c.indd 583
8/6/07 8:08:34 AM
EX 584 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Set the Employer Match Scroll Bar Control Properties The next step sets the properties of the Employer Match Scroll Bar control. The property settings are similar to those assigned to the Employee Investment Scroll Bar control. After the VBA code is written, the Employer Match Scroll Bar control will assign a value to cell D8.
1 • With Excel in Design mode, click the Employer Match Scroll Bar control.
• Click (Name) in the Properties window and then type scrEmployerMatch as the name.
• Change the LargeChange property to 100, the Max property to 600, the Min property to 0, and the SmallChange property to 25 (Figure 7–69).
name of Scroll Bar control changed to scrEmployerMatch
LargeChange property (scroll arrow) set to 100, or 1%
Employer Match Scroll Bar control selected
Max property set to 600, or 6% (scroll box moved to far right) Min property set to 0, or 0% (scroll box moved to far left)
SmallChange property (scroll arrow) set to 25, or 0.25%
Figure 7–69
C6478_07_CTP.4c.indd 584
8/6/07 8:08:36 AM
To Set the Check Box Control Properties The Employer Match Check Box control enables or disables the Employer Match Scroll Bar control. In Run mode, if the Employer Match check box contains a check mark, then the Employer Match scroll bar is enabled and can be used to change the value in cell D8. If the check box is empty, then the Employer Match scroll bar is disabled. The VBA code will enable or disable the Employer Match scroll bar based on the check box status. The following step sets the properties of the Check Box control.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 585
1 • With Excel in Design mode, click the Check Box control.
• Click (Name) in the Properties window and then type chkEmployerMatch as the name.
name of Check Box control changed to chkEmployerMatch
• Click Alignment in the Properties window and then click 0 fmAlignmentLeft.
Caption property changed
• Click Caption in the Properties window and then type Include Employer Match? as the caption.
Include Employer Match check box selected and resized so entire caption shows
• Click SpecialEffect, click the box arrow in the Properties window, and then click 0 fmButtonEffectFlat.
SpecialEffect property set to 0 frmButtonEffectFlat Value property set to True, which causes check mark to display
• Click Value in the Properties window and then type True as the value.
• Resize the Check
Q&A
Box control so the entire caption shows (Figure 7–70).
Figure 7–70
What is the result of setting the Value property to True? Setting the Value property to True inserts a check mark in the Include Employer Match check box. The check box thus will contain a check mark by default.
C6478_07_CTP.4c.indd 585
8/6/07 8:08:38 AM
EX 586 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Set Properties for the Annual Return and Years of Service Spin Button Controls The Annual Return Spin Button control increments or decrements the value in cell D9 by 0.25%. The Years of Service Spin Button control increments or decrements the value in cell D10 by one. With a Spin Button control, the up arrow increases the value and the down arrow decreases the value. The Label controls to the left of the Spin Button controls (Figure 7–71) indicate the values to be assigned to the associated cells. The Min, Max, and SmallChange properties must be set. The SmallChange property indicates the change each time you click an arrow. The following steps set the properties for the Annual Return and Years of Service Spin Button controls.
1 • With Excel in Design mode, click the Annual Return Spin Button control.
• Click (Name) in the Properties window and then type spnAnnualReturn as the name.
• If necessary, change
Q&A
the Max property to 2500, the Min property to 0, and the SmallChange property to 25 (Figure 7–71). How will the Annual Return spin button work?
name of Spin Button control changed to spnAnnualReturn
Max property set to 2500, or 25% Min property set to 0, or 0% Annual Return Spin
Button control selected The least value the Annual Return spin SmallChange button can be set to property set to 25, or 0.25% is 0 (0%). The greatest value is 2500 (25%). After the VBA code is written, each time you click a button, the Expected Annual Return value in cell D9 will change by 0.25%. At this point in this phase of Figure 7–71 the chapter, no relationship exists between the Annual Return spin button and the Expected Annual Return value in cell D9. This relationship will be established later in the VBA code. A similar relationship will be established between the Years of Service spin button and the Years of Service value in cell D10.
C6478_07_CTP.4c.indd 586
8/6/07 8:08:40 AM
2 • Click the Years of Service Spin Button control.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 587
• Click (Name) in the Properties window and then type spnYearsofService as the name.
• Change the Max property to 45, the Min property to 1, and the SmallChange property to 1 (Figure 7–72).
name of Spin Button control changed to spnYearsofService
Max property set to 45 Min property set to 1
SmallChange property set to 1
Years of Service Spin Button control selected
Figure 7–72
C6478_07_CTP.4c.indd 587
8/6/07 8:08:42 AM
EX 588 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Set the Variable Label Control Properties The Label controls to the left of the two Spin Button controls (Figure 7–48 on page EX 567) are variable and will change to display the values of their respective Spin Button controls. Thus, when you select a value by clicking the Annual Return spin button, the new value will appear in the Label control next to the Annual Return spin button as well as in cell D9. The following steps set the Name property, Caption property, and TextAlign property for the two variable Label controls to the left of the Spin Button controls.
1 • With Excel in Design mode, click the Label control to the left of the Annual Return Spin Button control.
• Click (Name) in the Properties window and then type lblAnnualReturn as the name.
name of Label control changed to lblAnnualReturn
• Click Caption in the Properties window and then type 5% as the caption.
• Change the
Caption property set to 5%
BorderStyle property to 1 fmBorderStyleSingle.
Annual Return Label selected and resized so entire caption shows
• Change the BackColor property to white.
• Change the TextAlign property to 3 fmTextAlignRight.
• Resize the Label control as shown in Figure 7–73.
TextAlign property set to 3 - fmTextAlignRight
Figure 7–73
C6478_07_CTP.4c.indd 588
8/6/07 8:08:44 AM
2 • Click the Label control to the left of the Years of Service Spin Button control.
Properties window Close button
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 589
name of Label control changed to lblYearsofService
• Click (Name) in the Properties window and then type lblYearsofService as the name.
Caption property set to 10
• Click Caption in the Properties window and then type 10 as the caption.
Years of Service label selected and resized so entire caption shows
• Change the BorderStyle property to 1 fmBorderStyleSingle.
• Change the BackColor property to white.
• Change the TextAlign
TextAlign property set to 3 - fmTextAlignRight
property to 3 fmTextAlignRight.
Figure 7–74
• Resize the Label control as shown in Figure 7–74.
3 • Click the Close
Q&A
button on the right side of the Properties window title bar (Figure 7–75). How will these Label controls be used?
properties set for all objects in Personalization Center
Later, in the VBA code, the Label controls will be set equal to the corresponding Spin Button controls through the use of the names. For example, the VBA statement lblAnnualReturn = Figure 7–75 spnAnnualReturn.Value / 10000 & “%” assigns the value of the Annual Return Spin Button control divided by 10000 to its corresponding Label control. The & “%” appends a percent sign to the number that appears in the Label control.
C6478_07_CTP.4c.indd 589
8/6/07 8:08:46 AM
EX 590 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Resize and Reposition the Controls in the Personalization Center After setting the properties for all the controls, you can fine-tune the size and location of the controls in the Personalization Center. With Excel in Design mode, you have three ways to reposition a control: 1. Drag the control to its new location. 2. Select the control and use the arrow keys to reposition it. 3. Select the control and set the control’s Top and Left properties in the Properties window. To use the third technique, you need to know the distance the control is from the top of row 1 (column headings) and the far left of column A (row headings) in points. Recall that a point is equal to 1/72 of an inch. Thus, if the Top property of a control is 216, then the control is 3 inches (216/72) from the top of the window. With Excel in Design mode, you also can resize a control in two ways: 1. Drag the sizing handles. 2. Select the control and set the control’s Height and Width properties in the Properties window. As with the Top and Left properties, the Height and Width properties are measured in points. Table 7–4 lists the exact point values for the Top, Left, Height, and Width properties of each of the controls in the Personalization Center. The following steps resize and reposition the controls in the Personalization Center using the values in Table 7–4. Table 7–4 Exact Locations of Controls in Personalization Center Control
Top
Left
Height
Width
Enter Name and Salary Command Button
71.25
402.75
27.75
144
Personalization Center Label
30
358.5
23.25
229.5
Employee Investment Label
128.25
401.25
14.25
136.5
Employee Investment Scroll Bar
147
387
16.5
162
Employee Investment 0 Label
147
372
16.5
15
Employee Investment 13 Label
147
552.75
16.5
15
Employer Match Label
186.75
401.25
14.25
136.5
Employer Match Scroll Bar
205.5
387
16.5
162
Employer Match 0 Label
205.5
372
16.5
15
Employer Match 6 Label
205.5
552.75
16.5
15
Employer Match Check Box
246.75
372
24
Annual Return Label
284.25
372
36.75
88.5
173.25
Annual Return Spin Button
284.25
536.25
20.25
13.5
Annual Return value Label
284.25
508.5
20.25
28.5
Years of Service Label
326.25
372
35.25
101.25
Years of Service Spin Button
326.25
536.25
20.25
13.5
Years of Service value Label
326.25
508.5
20.25
28.5
C6478_07_CTP.4c.indd 590
8/6/07 8:08:49 AM
1 • Click the Properties button on the Ribbon.
• If necessary, drag the
Enter Name and Salary Command button control selected
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 591
Properties window to the left side of the Excel window.
• Click the Enter Name and Salary Command Button control.
• Change its Top, Left, Height, and Width properties to those listed in Table 7–4 to display the Enter Name and Salary Command Button as shown in Figure 7–76.
Height property set to 27.75 Left property set to 402.75
Top property set to 71.25 Width property set to 144
Figure 7–76
2 • One at a time, select the controls in the Personalization Center and change their Top, Left, Height, and Width properties to those listed in Table 7–4.
• Close the Properties window and then deselect the Years of Service (1 to 45 years) label by clicking cell A1 (Figure 7–77).
controls resized and repositioned by setting Height, Left, Top, and Width properties
3 • Click the Save button on the Quick Access Toolbar to save the workbook using the file name, Caliber Steel3.
Figure 7–77
C6478_07_CTP.4c.indd 591
8/6/07 8:08:50 AM
EX 592 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Plan Ahead
Step 3 — Write the code. The next step is to write a procedure for each of the following six controls: (1) Enter Name and Salary Command Button; (2) Employee Investment Scroll Bar; (3) Include Employer Match Check Box; (4) Employer Match Scroll Bar; (5) Annual Return Spin Button; and (6) Years of Service Spin Button. The design decisions and explanation for each procedure will be explained before the code is entered.
To Enter the Enter Name and Salary Button Procedure In Run mode, the function of the Enter Name and Salary button is to accept the employee name and annual salary. It also assigns values to the Scroll Bar controls and Spin Button controls, which in turn resets the values in the range D7:D10. The Enter Name and Salary Button procedure is shown in Table 7–5. Table 7–5 Enter Name and Salary Button Procedure Line
Statement
1
' Name and Salary Button Procedure
2
' Date Created: 10/21/2008
3
' Run from: 401(k) Investment Model Sheet by clicking button
4
' labeled Enter Name and Salary
5
' Function: This procedure initializes the scroll bars and spin buttons,
6
' clears the range D5:D6, selects cell A1, accepts the Employee
7
' name (cell D5) and annual salary (cell D6), and validates the
8
' annual salary before assigning it to cell D6, named Annual_Salary.
9
'
10
Author:
Louise Kizior
Private Sub CommandButton1_Click()
11
scrEmployeeInvest = 100
12
scrEmployerMatch = 0
13
spnAnnualReturn = 500
14
spnYearsofService = 10
15
Range(“D5:D6”).ClearContents
16
Range(“A1”).Select
17
Range(“Employee_Name”).Value = InputBox(“Employee Name?”, “Enter”)
18
AnnualSalary = InputBox(“Annual Salary?”, “Enter”)
19
Do While AnnualSalary <= 0
20
AnnualSalary = InputBox(“Annual salary must be > zero.”, “Please Re-enter”)
21
Loop
22
Range(“Annual_Salary”).Value = AnnualSalary
23
End Sub
Lines 1 through 9 in Table 7–5 are comments and have no bearing on the execution of this procedure. Comments help you remember the function of a procedure. Lines 10 and 23 identify the beginning and end of the procedure. Lines 11 through 14 initialize the Scroll Bar controls and Spin Button controls by assigning values to their names. Line 15 clears cells D5 and D6 in preparation to receive the employee name and annual salary. Line 16 selects cell A1 so the heavy border surrounding the active cell does not clutter the screen. Line 17 accepts the employee name and assigns it to cell D5, which is named Employee_Name. Lines 18 through 22 accept and validate the annual salary to ensure it is greater than zero. The annual salary is accepted in line 18. Line 19 is called a Do-While statement. It tests to see if the annual salary accepted in line 18 is less than or equal
C6478_07_CTP.4c.indd 592
8/6/07 8:08:54 AM
to zero. If the annual salary is less than or equal to zero, line 20 displays an error message and requests that the user re-enter the annual salary. The Loop statement in line 21 transfers control back to the corresponding Do-While statement in line 19, which tests the annual salary again. The VBA code in lines 19 through 21 is called a loop. If the variable, Annual Salary, is determined to be greater than zero in line 19, then the Do-While statement in line 19 transfers control to line 22, which assigns the value of AnnualSalary to cell D6, which is named Annual_Salary. Line 23 halts execution of the procedure and returns Excel to Ready mode. The variable, AnnualSalary, first was used in line 18. A variable is a location in the computer’s memory whose value can change as the program executes. You create variables in VBA code as you need them. In this case, a variable is needed to hold the value accepted from the user in lines 18 and 20. Variable names follow the same rules as control names (see page EX 574). The following steps enter the Enter Name and Salary Button procedure shown in Table 7–5.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 593
1 • With Excel in Design mode, click the View Code button on the Ribbon (Figure 7–36 on page EX 559).
name of Command Button control
Object box arrow Sub and End Sub statements automatically are inserted when selected control does not contain procedure
• Click the Object box arrow at
Q&A
the top of the window and then click CommandButton1 in the alphabetical list (Figure 7–78). What does the Visual Basic Editor display when the CommandButton1 control is selected? When the CommandButton1 control is selected in the Object list, the Visual Basic Editor displays the Sub and End Sub statements for the procedure and positions the insertion point between the two statements.
Figure 7–78
2 • Click before the P in Private and then press the ENTER key. Enter the lines 1 through 9 in Table 7–5. Click the blank line between the Sub and End Sub statements. Enter lines 11 through 22 in Table 7–5 (Figure 7–79) being sure to indent each line of code by three spaces for readability.
Scroll Bar controls and Spin Button controls initialized
accepts and ensures that annual salary value is positive
Figure 7–79
C6478_07_CTP.4c.indd 593
8/6/07 8:08:54 AM
EX 594 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
To Enter the Employee Investment Scroll Bar Procedure The Employee Investment Scroll Bar procedure assigns the value of the scroll bar to cell D7, which is named Employee_Investment. The procedure is shown in Table 7–6. Table 7–6 Employee Investment Scroll Bar Procedure Line
Statement
1
' Employee Investment Scroll Bar Procedure Author:
2
' Date Created: 10/21/2008
3
' Run from: 401(k) Investment Model Sheet by clicking the
4
' scroll bar labeled Employee Investment
5
' Function: This procedure assigns the value of the Employee Investment scroll
6
' bar to cell D7, named Employee_Investment.
7
'
8
Private Sub scrEmployeeInvest_Change()
9
Louise Kizior
Range(“Employee_Investment”).Value = scrEmployeeInvest.Value / 10000
10
End Sub
The first seven lines in Table 7–6 are comments. Lines 8 and 10 define the beginning and end of the procedure. Line 9 assigns the value of the Scroll Bar control (scrEmployeeInvest) divided by 10000 to cell D7, which is named Employee_Investment. Recall that the scroll bar was assigned a Max property of 1300, which is equivalent to 130,000%. Thus, the value of scrEmployeeInvest must be divided by 10000 to assign the correct percentage value to cell D7, named Employee_Investment. The following steps enter the Employee Investment Scroll Bar procedure shown in Table 7–6.
1 • With the Visual
name of Employee Investment Scroll Bar control
Object box arrow
Basic Editor active, click the Object box arrow at the top of the window and then click scrEmployeeInvest.
2 • Enter the VBA code
horizontal line divides procedures
shown in Table 7–6 (Figure 7–80).
value of Scroll Bar control assigned to cell D7
Employee Investment Scroll Bar procedure
Figure 7–80
C6478_07_CTP.4c.indd 594
8/6/07 8:08:57 AM
To Enter the Employer Match Check Box Procedure As with the other procedures, the Employer Match Check Box procedure executes only when the check box is checked. If the check box is checked, then the Value property of the check box (chkEmployerMatch) is set to True. If the check box is unchecked, then the Value property of the check box is set to False. Adding a check mark or removing a check mark triggers the event that executes the Employer Match Check Box procedure shown in Table 7–7.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 595
Table 7–7 Employer Match Check Box Procedure Line
Statement
1
' Employer Match Check Box Procedure
2
' Date Created:
3
' Run from: 401(k) Investment Model Sheet by clicking check box
4
' labeled Employer Match
5
' Function: This procedure assigns the value of the Employer Match scroll bar
6
' or 0 (zero) to cell D8, which is named Employer_Match.
7
'
8
Private Sub chkEmployerMatch_Click()
9 10 11 12 13 14 15
Author:
Louise Kizior
10/21/2008
If chkEmployerMatch.Value = True Then Range(“Employer_Match”).Value = scrEmployerMatch.Value / 10000 Else scrEmployerMatch = 0 Range(“Employer_Match”).Value = 0 End If End Sub
In Table 7–7, lines 1 through 7 are comments. Lines 8 and 15 define the beginning and end of the procedure. Lines 9 through 14 include an If-Then-Else statement. An If-Then-Else statement represents a two-way decision with action specified for each of the two alternatives. The computer never executes both the true and false alternatives; it selects one or the other. If the logical test (chkEmployerMatch = True) is true in line 9 of Table 7–7, then line 10 is executed and cell D8, named Employer_Match, is set equal to scrEmployerMatch divided by 10000 — that is, the value selected on the Employer Match scroll bar divided by 10000. If the logical test is false, then lines 12 and 13 are executed. Line 12 sets the scroll box to zero percent (0%), and line 13 sets cell D8, named Employer_Match, equal to zero percent (0%). The following steps enter the code for the Employer Match Check Box procedure.
C6478_07_CTP.4c.indd 595
8/6/07 8:08:58 AM
EX 596 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
name of Employer Match Check Box control
1 • With the Visual Basic Editor active, click the Object box arrow at the top of the window and then click chkEmployerMatch.
2 • Enter the VBA code shown in Table 7–7 (Figure 7–81).
horizontal line divides procedures
If-Then-Else statement assigns cell D8 the value 0 (zero) or value of Employer Match scroll bar divided by 10000
Employer Match Check Box procedure
Figure 7–81
To Enter the Employer Match Scroll Bar Procedure The Employer Match Scroll Bar procedure executes whenever you use the Scroll Bar control above the Employer Match Check Box control. The Employer Match Scroll Bar control is active only when the Employer Match Check Box control is checked. The Employer Match Scroll Bar procedure assigns the value of scrEmployerMatch to cell D8, named Employer_Match. The Employer Match Scroll Bar procedure is shown in Table 7–8. Table 7–8 Employer Match Scroll Bar Procedure Line 1
' Employer Match Scroll Bar Procedure
2
' Date Created: 10/21/2008
3
' Run from: 401(k) Investment Model Sheet by clicking the
4
'scroll bar labeled Employer Match
5
' Function: This procedure assigns the value of the Employer Match scroll bar
6
' to cell D8, named Employer_Match.
7
'
8
Private Sub scrEmployerMatch_Change()
9
C6478_07_CTP.4c.indd 596
Statement Author:
Louise Kizior
If chkEmployerMatch.Value = True Then
8/6/07 8:08:59 AM
Table 7–8 Employer Match Scroll Bar Procedure (continued) Line
Statement
10
Range(“Employer_Match”).Value = scrEmployerMatch.Value / 10000
11
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 597
End If
12
End Sub
Lines 9 through 11 in Table 7–8 are an If-Then statement. Line 10 in the If-Then statement assigns the value of the scroll bar (scrEmployerMatch) divided by 10,000 to cell D8, which is named Employer_Match. This statement, however, is executed only if the logical test in line 9 (chkEmployerMatch =True) is true. Thus, the Employer Match Check Box control determines whether the Employer Match Scroll Bar control is active. The following steps enter the code.
1 • With the Visual Basic
name of Employer Match Scroll Bar control
Editor active, click the Object box arrow at the top of the window and then click scrEmployerMatch.
2 • Enter the VBA code shown in Table 7–8 (Figure 7–82).
if Value property of Employer Check Box control set to True, then cell D8 equals value of Employer Match scroll bar
Employer Match Scroll Bar procedure
Figure 7–82
To Enter the Annual Return Spin Button Procedure The Annual Return Spin Button procedure executes whenever you click one of the buttons on the Annual Return Spin Button control. The procedure determines the percent value assigned to cell D9, named Annual_ Return, and to the corresponding Annual Return Label control. Recall that you set the SmallChange property of the Annual Return Spin Button control to 25, which, when divided by 10000, equals 0.25%. The Annual Return Spin Button Control procedure is shown in Table 7–9.
C6478_07_CTP.4c.indd 597
8/6/07 8:09:01 AM
EX 598 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Table 7–9 Annual Return Spin Button Procedure Line
Statement
1
' Annual Return Spin Button Procedure
2
' Date Created: 10/21/2008
3
' Run from: 401(k) Investment Model Sheet by clicking the spin
4
' button labeled Annual Return
5
' Function: This procedure assigns the value of the Annual Return spin button
6
' to cell D9, named Annual_Return.
7
'
8
Private Sub spnAnnualReturn_Change()
9
Author:
Louise Kizior
lblAnnualReturn = spnAnnualReturn.Value / 100 & “%”
10
Range(“Annual_Return”).Value = spnAnnualReturn.Value / 10000
11
End Sub
In Table 7–9, line 9 uses the names of the two controls to assign the value of the Annual Return Spin Button control to the Annual Return Label control. In this case, spnAnnualReturn is divided by 100, because a percent should appear as a whole number in the Label control. The & “%” at the end of line 9 appends a percent sign to the value. Line 10 assigns the value of spnAnnualReturn divided by 10,000 to cell D9, which has a cell name of Annual_Return. The following steps enter the code for the Annual Return Spin Button procedure.
1 • With the Visual Basic Editor active, click the Object box arrow at the top of the window and then click spnAnnualReturn.
name of Annual Return Spin Button control
2 • Enter the VBA code shown in Table 7–9 (Figure 7–83).
assigns the value of Annual Return Spin Button control to the Annual Return Label control and cell D9
Annual Return Spin Button procedure
Figure 7–83
C6478_07_CTP.4c.indd 598
8/6/07 8:09:03 AM
To Enter the Years of Service Spin Button Procedure The Years of Service Spin Button procedure executes whenever you click one of the buttons on the Years of Service Spin Button control. The procedure determines the value assigned to cell D10, named Years_of_Service, and to the corresponding Years of Service Label control. The Years of Service Spin Button procedure is shown in Table 7–10.
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 599
Table 7–10 Years of Service Spin Button Procedure Line
Statement
1
' Years of Service Spin Button Procedure Author:
2
' Date Created:
3
' Run from: 401(k) Investment Model Sheet by clicking the spin
4
' button labeled Years of Service
5
' Function: This procedure assigns the value of the Years of Service spin
6
' button to cell D10, named Years_of_Service.
7
'
8
Private Sub spnYearsofService_Change()
9
Louise Kizior
10/21/2008
lblYearsofService = spnYearsofService
10
Range(“Years_of_Service”).Value = spnYearsofService
11
End Sub
In Table 7–10, line 9 assigns spnYearsofService (the value of the Years of Service Spin Button control) to the corresponding Years of Service Label control. Line 10 assigns the value of spnYearsofService to cell D10, which has a cell name of Years_of_Service. The following steps enter the code for the Years of Service Spin Button procedure.
1 • With the Visual Basic Editor active, click the Object box arrow at the top of the window and then click spnYearsofService.
name of Years of Service Spin Button control
2 • Enter the VBA code shown in Table 7–10 (Figure 7–84).
Years of Service Spin Button procedure
assigns the value of Years of Service Spin Button control to the Years of Service Label control and cell D10
Figure 7–84
C6478_07_CTP.4c.indd 599
8/6/07 8:09:04 AM
The Visual Basic Editor When you open the Visual Basic Editor, the same windows display that displayed when you closed it the last time.
Debugging VBA Code The Visual Basic Editor allows you to locate the source of errors in your code through the use of the Debug menu. You can set a breakpoint in your code that will cause Excel to stop executing your code at a certain point. At that time, Excel shows the current executing code in the editor. You can point at variables in your code to make sure they are set correctly. Or you can step through your code line by line to make sure the code is getting executed in the expected order. Click Microsoft Visual Basic Help on the Help menu in the Visual Basic Editor window for more information about debugging.
To Close the Visual Basic Editor, Protect the Worksheet, and Save the Workbook The VBA code is complete. The following steps close the Visual Basic Editor, quit Design mode, protect the worksheet, and save the workbook. Before closing the Visual Basic Editor, you should verify your code by comparing it with Figures 7–78 through 7–84 on pages EX 593 through EX 599.
1
Click the Close button on the right side of the Visual Basic Editor title bar.
2
When the Excel window is visible, click the Design Mode button on the Ribbon to exit Design mode.
3
Click the Review tab on the Ribbon and then click the Protect Sheet button on the Ribbon. When Excel displays the Protect Sheet dialog box, type caliber in the ‘Password to unprotect sheet’ text box. Verify the password when prompted and then click the OK button.
4
Click the Save button on the Quick Access Toolbar to save the workbook using the file name, Caliber Steel3.
To Test the Controls in the Personalization Center The final step is to test the controls in the Personalization Center. To test the controls, use the following data: Employee Name — Gina Moira (cell D5); Annual Salary (cell D6) — $54,500.00; Employee Investment % (cell D7) — 6.00%; Employer Match % (cell D8) — 4.00%; Expected Annual Return (cell D9) — 8.5%; and Years of Service (cell D10) — 35.
1
Click the Enter Name and Salary button in the Personalization Center.
2
When Excel displays the Enter dialog box with the prompt message, Employee Name?, type Gina Moira as the employee name.
3
When Excel displays the Enter dialog box with the prompt message, Annual Salary?, type the negative number –54500 as the annual salary.
4
When Excel displays the Enter dialog box with the prompt message, Annual salary must be > zero, type 54500 as the annual salary.
5
Use the Employee Investment scroll bar to change the value in cell D7 to 6%.
6
Click the Include Employer Match check box if it does not have a check mark.
7
Use the Employer Match scroll bar to change the value in cell D8 to 4%.
8
Click the Annual Return spin button arrows to change the value in cell D9 to 8.5%.
9
Click the Years of Service spin button arrows to change the value in cell D10 to 35.
Q&A
BTW
BTW
EX 600 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
What is the result of interacting with the user interface to enter the 401(k) investment model data? The future value of Gina Moira’s 401(k) Plan investment is $1,178,819.67 as shown in cell F10 of Figure 7–85. If she changes her years of service to 45 years, the 401(k) Plan investment is worth $2,589,966.51 (cell C24). Both future value amounts assume she will never get a raise.
C6478_07_CTP.4c.indd 600
8/6/07 8:09:11 AM
Excel Chapter 7
Phase 3 — Creating a Personalization Center to Automate the 401(k) Investment Model Data Entry EX 601
accepts name and salary and assigns values to cells D5 and D6
sets value in cell D7
sets value in cell D8
check mark enables Employer Match Scroll Bar control sets value in cell D9
sets value in cell D10
Figure 7–85
To Reset the Quick Access Toolbar and Ribbon and Quit Excel The following steps reset the Quick Access Toolbar in order to remove the PrintPortrait button, remove the Developer tab from the Ribbon, and quit Excel.
1
Right-click anywhere on the Quick Access Toolbar and then click Customize Quick Access Toolbar on the shortcut menu.
2
When the Excel Options dialog box appears, click the Reset button and then click the OK button in the Reset Customizations dialog box. Click the OK button to close the Excel Options dialog box.
3
Click the Office Button and then click the Excel Options button on the Office Button menu.
4
Click the ‘Show Developer tab in the Ribbon’ check box to remove the check mark and then click the OK button to close the Excel Options dialog box.
5
Click the Close button on the right side of the title bar.
6
If the Microsoft Office Excel dialog box appears, click the No button.
C6478_07_CTP.4c.indd 601
8/6/07 8:09:12 AM
EX 602 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
BTW
Digital Signatures Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
Some users prefer to attach a digital signature to verify the authenticity of a document. A digital signature is an electronic, encrypted, and secure stamp of authentication on a document. This signature confirms that the file originated from the signer (file developer) and that it has not been altered. A digital signature may be visible or invisible. In either case, the digital signature references a digital certificate. A digital certificate is an attachment to a file or e-mail message that vouches for its authenticity, provides secure encryption, or supplies a verifiable signature. Many users who receive files enable the macros based on whether they are digitally signed by a developer on the user’s list of trusted sources. You can obtain a digital certificate from a commercial certificate authority, from your network administrator, or you can create a digital signature yourself. A digital certificate you create yourself is not issued by a formal certification authority. Thus, signed macros using such a certificate are referred to as self-signed projects. Certificates you create yourself are considered unauthenticated and still will generate a warning when opened if the security level is set to very high, high, or medium. Many users, however, consider self-signed projects safer to open than those with no certificates at all.
To Add a Digital Signature to a Workbook
BTW
Excel Help The best way to become familiar with Excel Help is to use it. Appendix C includes detailed information about Excel Help and exercises that will help you gain confidence in using it.
C6478_07_CTP.4c.indd 602
1
Click the Insert tab on the Ribbon and then click the Signature Line button on the Ribbon. If the Microsoft Office Excel dialog box appears, click the OK button.
2
When the Signature Setup dialog box appears, type your name in the Suggested signer text box and then click the OK button.
3
When Excel adds the signature box to the workbook, right-click anywhere in the signature box and then click Sign on the shortcut menu.
4
When the Sign dialog box appears, type your name in the signature box or click the Select Image link to select a file that contains an image of your signature.
5
Click the OK button to digitally sign the document.
Q&A
After adding a digital signature, Excel will display the digital signature whenever the document is opened. The following steps add a visible digital signature to an Excel workbook.
How can I obtain a digital certificate? If you do not have any digital certificates on your computer when you click the Sign command in Step 3, you will be prompted in the Microsoft Office Excel dialog box to obtain or create a new digital certificate (Figure 7–86). You can choose to create a certificate online with a service provider recommended by Microsoft by clicking the Signature Services from the Office Marketplace button. By doing so, other users can authenticate the signature on your workbooks because the certificate is available online. This alternative, however, may require payment. You also can click the Create your own Digital ID button to create a digital certificate that is valid only on your computer, but is free of charge.
8/6/07 8:09:14 AM
Signature Line button
Excel Chapter 7
Digital Signatures EX 603
signature box added to worksheet
Create a Digial ID dialog box
Figure 7–86
A file digital signature is a digital signature that is displayed when you e-mail a document from Excel. Excel will display the digital signature whenever the document is opened. When you open a digitally signed document, Excel displays a message announcing the signature on the status bar while the file opens. After the file is opened, Excel displays a certification icon on the status bar. You can click the icon to find out who digitally signed the document. The word, (Signed), also appears on the title bar in parentheses, indicating the document is signed digitally. The following steps show how to review a digital signature on a workbook.
1
Click the Office Button and then click Prepare on the Office Button menu.
2
Click View Signature on the Prepare submenu.
3
Select a name from the Valid signature list in the signature pane and then click the button arrow next to the name. When the shortcut menu appears, click Signature Details.
4
When you are finished reviewing the certificate, click the OK button in the Signature Details dialog box.
C6478_07_CTP.4c.indd 603
BTW
To Review a Digital Signature on a Workbook
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential – proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
8/6/07 8:09:15 AM
EX 604 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Chapter Summary In this chapter, you learned how to unprotect and protect a worksheet and workbook using a password. In Phase 1, you learned how to record a macro and assign it to a button on the Quick Access Toolbar. In Phase 2, you learned how to create a Command Button control, assign it properties, and write Visual Basic for Applications (VBA) code that executes when you click the button. In Phase 3, you learned how to create a user interface made up of a Command Button control, Scroll Bar controls, a Check Box control, Label controls, and Spin Button controls, set properties for those controls using the Properties window, write VBA code that included looping and decisionmaking, and add and review a digital signature on a workbook. The items listed below include all the new Excel skills you have learned in this chapter. 1. Enter Data in a Selected Range of Cells (536) 2. Undo a Group of Entries Using the Undo Button (EX 538) 3. Unprotect a Password-Protected Worksheet (EX 538) 4. Display the Developer Tab, Enable Macros, and Save a Workbook as a Macro-Enabled Workbook (EX 540) 5. Record a Macro to Print the Worksheet in Portrait Orientation Using the Fit to Option (EX 542) 6. Password-Protect the Worksheet, Save the Workbook, and Close the Workbook (EX 544) 7. Set Macro Security to Medium (EX 545) 8. Open a Workbook with a Macro and Execute the Macro (EX 546) 9. View and Print a Macro’s VBA Code (EX 548) 10. Add a Button to the Quick Access Toolbar, Assign the Button a Macro, and Use the Button (EX 549) 11. Add a Command Button Control to the Worksheet (EX 554) 12. Set the Command Button Control Properties (EX 556) 13. Enter the New Data Button Procedure Using the Visual Basic Editor (EX 559) 14. Enter 401(k) Investment Model Data Using the New Data Button (EX 563) 15. Protect a Worksheet and Save the Workbook (EX 566) 16. Add Controls to a User Interface (EX 569) 17. Set Properties of the Label Controls and Check Box Control (EX 575)
18. Set the Command Button Control Properties (EX 582) 19. Set the Employee Investment Scroll Bar Control Properties (EX 583) 20. Set the Employer Match Scroll Bar Control Properties (EX 584) 21. Set the Check Box Control Properties (EX 585) 22. Set Properties for the Annual Return and Years of Service Spin Button Controls (EX 586) 23. Set the Variable Label Control Properties (EX 588) 24. Resize and Reposition the Controls in the Personalization Center (EX 590) 25. Enter the Enter Name and Salary Button Procedure (EX 592) 26. Enter the Employee Investment Scroll Bar Procedure (EX 594) 27. Enter the Employer Match Check Box Procedure (EX 595) 28. Enter the Employer Match Scroll Bar Procedure (EX 596) 29. Enter the Annual Return Spin Button Procedure (EX 597) 30. Enter the Years of Service Spin Button Procedure (EX 599) 31. Close the Visual Basic Editor, Protect the Worksheet, and Save the Workbook (EX 600) 32. Test the Controls in the Personalization Center (EX 600) 33. Add a Digital Signature to a Workbook (EX 602) 34. Review a Digital Signature on a Workbook (EX 603)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this chapter.
C6478_07_CTP.4c.indd 604
8/6/07 8:09:17 AM
Learn It Online is a series of online student exercises that test your knowledge of chapter content and key terms. Instructions: To complete the Learn It Online exercises, start your browser, click the Address bar, and then enter the Web address scsite.com/ex2007/learn. When the Excel 2007 Learn It Online page is displayed, click the link for the exercise you want to complete and then read the instructions.
Chapter Reinforcement TF, MC, and SA A series of true/false, multiple choice, and short answer questions that test your knowledge of the chapter content.
Who Wants To Be a Computer Genius? An interactive game that challenges your knowledge of chapter content in the style of a television quiz show.
Flash Cards An interactive learning environment where you identify chapter key terms associated with displayed definitions.
Wheel of Terms An interactive game that challenges your knowledge of chapter key terms in the style of the television show Wheel of Fortune.
Practice Test A series of multiple choice questions that test your knowledge of chapter content and key terms.
Crossword Puzzle Challenge A crossword puzzle that challenges your knowledge of key terms presented in the chapter.
Excel Chapter 7
Learn It Online
STUDENT ASSIGNMENTS
Apply Your Knowledge EX 605
Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter.
Creating a Macro and Assigning It to a Button Instructions: Perform the steps below to enable macros, open a workbook, create a macro to print a section of the worksheet, assign the macro to a button on the Quick Access Toolbar, execute the macro, and then disable macros. 1. Start Excel. If the Developer tab does not display on the Ribbon, click the Office Button, click the Excel Options button, and then click the ‘Show Developer tab in the Ribbon’ check box. 2. To enable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click the ‘Enable all macros’ option and then click the OK button.
Continued >
C6478_07_CTP.4c.indd 605
8/6/07 8:09:18 AM
EX 606 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Apply Your Knowledge
continued
STUDENT ASSIGNMENTS
3. Open the workbook Apply 7-1 Salioto’s Food Mart (Figure 7–87) from the Data Files for Students and then save the workbook using the file name, Apply 7-1 Salioto’s Food Mart Complete as an Excel Macro-Enabled Workbook file type. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. button added to Quick Access Toolbar
Figure 7–87
4. Unprotect the worksheet. Type sheltered as the password. 5. Change the document properties as specified by your instructor. Add a worksheet header with your name, course number, and other information requested by your instructor. 6. Create a macro that prints the range A3:F5 by doing the following: a. Click the Record Macro button on the Developer tab on the Ribbon. b. When the Record Macro dialog box appears, name the macro PrintRangeA3toF5, assign the shortcut key CTRL+N, store the macro in this workbook, enter your name in the Description box, and then click the OK button to start the macro recording process. c. Select the range A3:F5, click the Office Button, and then click Print. When the Print dialog box appears, click the Selection option in the Print what area, click the OK button, and then click the Stop Recording button on the Developer tab on the Ribbon. 7. Click the Macros button on the Developer tab on the Ribbon to display the Macro dialog box. Run the PrintRangeA3toF5 macro to print the range A3:F5. Click the Macros button again, select the PrintRangeA3toF5 macro, and then click the Edit button. When the Visual Basic Editor displays the macro, click File on the menu bar and then click Print. 8. Right-click the Quick Access Toolbar and then click Customize Quick Access Toolbar. When the Excel Options dialog box is displayed, click the ‘Choose commands from’ box arrow and choose Macros. Click PrintRangeA3toF5 and then click the Add button. Click the Modify button, choose the printer icon (column 5, row 2), click the OK button to close the Modify Button dialog box, and then click the OK button to close the Excel Options dialog box. 9. Run the macro as follows: (a) click the PrintRangeA3toF5 button on the Quick Access Toolbar; and (b) press CTRL+SHIFT+N.
C6478_07_CTP.4c.indd 606
8/6/07 8:09:19 AM
10. To disable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Disable all macros with notification’ and then click the OK button. 11. Protect the worksheet using the password, sheltered.
Excel Chapter 7
Extend Your Knowledge EX 607
12. Right-click the Quick Access Toolbar and then click Customize Quick Access Toolbar. Remove the PrintRangeA3toF5 button and then click the OK button. STUDENT ASSIGNMENTS
13. Save the workbook and then quit Excel. 14. Submit the assignment as specified by your instructor.
Extend Your Knowledge Extend the skills you learned in this chapter and experiment with new skills. You may need to use Help to complete the assignment.
Creating and Using a Custom Function Instructions: Use VBA to create and then use a custom function (Figure 7–88a) that determines the commission in column C (Figure 7–88b) to pay the salespersons based on the logic shown in Table 7–11. Table 7–11 Commission Based Upon Sales Sales
Commission
Sales <= 50,000,000
0.01 * Sales
50,000,000 < Sales <= 100,000,000
0.02 * Sales
Sales > 100,000,000
0.03 * Sales
(a) Custom Function Commission
(b) Worksheet Uses Custom Function Commission in Column C Figure 7–88 Continued >
C6478_07_CTP.4c.indd 607
8/6/07 8:09:21 AM
EX 608 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Extend Your Knowledge
continued
Perform the following tasks: 1. Start Excel. If the Developer tab does not display on the Ribbon, click the Office Button, click the Excel Options button, and then click the ‘Show Developer tab in the Ribbon’ check box.
STUDENT ASSIGNMENTS
2. To enable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Enable all macros’ and then click the OK button. 3. Open the workbook Extend 7-1 Prior Aircraft Company from the Data Files for Students and then save the workbook using the file name, Extend 7-1 Prior Aircraft Company Complete as an Excel Macro-Enabled Workbook file type. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. 4. Click the Developer tab on the Ribbon and then click the Visual Basic button. Click Module on the Insert menu. Enter the custom function Commission shown in Figure 7–88a. Carefully review the code to understand how this custom function reflects the logic in Table 7–11. Close the Visual Basic Editor. 5. Enter =Commission(B3) in cell C3 of the worksheet. The argument, cell B3 ($112,389,210), replaces the variable Sales in the custom function in Figure 7–88a and the custom function returns a value ($3,371,676) to cell C3. 6. Copy cell C3 to the range C4:C9 by copying cell C3 to the Clipboard, selecting the range C4:C9, and then using the Formulas command on the Paste menu to complete the copy (Figure 7–88b). 7. To disable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Disable all macros with notification’ and then click the OK button. 8. Change the document properties as specified by your instructor. Add a worksheet header with your name, course number, and other information requested by your instructor. 9. Print both the worksheet and VBA custom function code. Print the formulas version of the worksheet. 10. Save the workbook and then quit Excel. 11. Submit the assignment as specified by your instructor.
C6478_07_CTP.4c.indd 608
8/6/07 8:09:22 AM
Analyze a workbook and correct all errors and/or improve the design.
1 Changing Properties and Correcting Visual Basic Code Instructions: Start Excel. If the Developer tab does not display on the Ribbon, click the Office Button, click the Excel Options button, and then click the ‘Show Developer tab in the Ribbon’ check box. To enable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Enable all macros’ and then click the OK button. Do the following: 1. Open the Make It Right 7-1 Loan Calculator workbook from the Data Files for Students and then save the workbook using the file name, Make It Right 7-1 Loan Calculator Complete as an Excel Macro-Enabled Workbook type file. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Click the Design Mode button on the Developer tab on the Ribbon.
Excel Chapter 7
Make It Right
STUDENT ASSIGNMENTS
Make It Right EX 609
2. Change the caption of the button to New Loan. Change the foreground color of the button to Green (Figure 7–89a) and move the button from column B to column C. 3. Click the View Code button on the Ribbon and make the following adjustments to the procedure shown in Figure 7–89b: a. Add comments before the first line of code. Include a procedure title, your name, date, and the purpose of the procedure. b. Select cell E12 while the data is entered. c. Change the variable Price (lines 5 through 9 and line 15 of Figure 7–89b) to LoanAmount and accept a loan amount between 1000 and 92000 inclusive. Also adjust the error message. d. Accept an interest rate between 2.5% and 13.5% inclusive. e. Select cell B13 before exiting the procedure. 4. Click the View Microsoft Excel button on the Standard toolbar to exit Microsoft Visual Basic and return to Excel. 5. Click the Design Mode button on the Developer tab on the Ribbon to exit Design mode. 6. Click the New Loan button and enter the following loan data: Loan Amount = $55,000; Down Payment = $4,500; Interest Rate = 10.75%; Years = 8. The monthly payment in cell C7 should equal $786.48. Enter additional data that tests the limits of acceptable loan data. 7. To disable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Disable all macros with notification’ and then click the OK button. 8. Change the document properties as specified by your instructor. Add a worksheet header with your name, course number, and other information requested by your instructor. 9. Print both the worksheet and Visual Basic code. 10. Save the workbook and then quit Excel. 11. Submit the assignment as specified by your instructor.
Continued >
C6478_07_CTP.4c.indd 609
8/6/07 8:09:22 AM
EX 610 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
continued
STUDENT ASSIGNMENTS
Make It Right
add comments
change cell selected change Price to LoanAmount
(a) Worksheet After Adjustments
adjust InterestRate limits
change cell selected
(b) Visual Basic Code Before Adjustments Figure 7–89
C6478_07_CTP.4c.indd 610
8/6/07 8:09:23 AM
Create a workbook using the guidelines, concepts, and skills presented in this chapter. Labs are listed in order of increasing difficulty.
Lab 1: Automating a Financing Worksheet Problem: Richie’s Subprime provides financing for customers who lack the usual down payments for a loan. The chief financial officer, Richard Bill, has asked you to automate the entry of financing data into a worksheet that computes the monthly payment and total cost of a loan. Part 1 Instructions: Perform the following tasks. 1. Start Excel. If the Developer tab does not display on the Ribbon, click the Office Button, click the Excel Options button, and then click the ‘Show Developer tab in the Ribbon’ check box. 2. To enable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Enable all macros’ and then click the OK button.
Excel Chapter 7
In the Lab
STUDENT ASSIGNMENTS
In the Lab EX 611
3. Open the Lab 7-1 Richie’s Subprime workbook from the Data Files for Students and then save the workbook using the file name, Lab 7-1 Part 1 Richie’s Subprime as an Excel Macro-Enabled Workbook file type. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. 4. Unprotect the worksheet using the password, smoak. 5. Click the Developer tab on the Ribbon. Click the Insert button and then click Command Button (column 1, row 1) in the ActiveX Controls area. Draw the button at the top of column F as shown in Figure 7–90.
Command Button added to worksheet
Figure 7–90
C6478_07_CTP.4c.indd 611
8/6/07 8:09:24 AM
EX 612 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
In the Lab
continued
6. With the Command Button control selected, click the Properties button on the Ribbon. If necessary, change the following properties: (a) Caption = Financing Data; (b) Font = Bold; and (c) PrintObject = False. Close the Properties window.
STUDENT ASSIGNMENTS
7. With the Command Button control selected, click the View Code button on the Ribbon. Enter the procedure shown in Figure 7–91. Check your code carefully.
Figure 7–91
8. Close the Visual Basic Editor window. Click the Design Mode button on the Ribbon to return to the workbook.
C6478_07_CTP.4c.indd 612
8/6/07 8:09:26 AM
9. Change the document properties as specified by your instructor. Add a worksheet header with your name, course number, and other information requested by your instructor. 10. Use the newly created button to determine the monthly payment for the following financing data and then print the worksheet for each data set: (a) Total Price Paid = $45,000; Down Payment = $3,500; Rate = 8.75%; and Years = 6; (b) Total Price Paid = $25,500; Down Payment = $4,000; Rate = 15.75%; and Years = 11. The Monthly Payment for (a) is $742.92 and for (b) is $343.65.
Excel Chapter 7
In the Lab EX 613
12. To disable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Disable all macros with notification’ and then click the OK button. 13. Protect the worksheet using the password, smoak. Save the workbook and then quit Excel. 14. Submit the assignment as specified by your instructor. Instructions Part 2: Perform the following tasks to add a macro to the workbook and add a button to the Quick Access Toolbar that executes the macro: 1. Start Excel. If the Developer tab does not display on the Ribbon, click the Office Button, click the Excel Options button, and then click the ‘Show Developer tab in the Ribbon’ check box. To enable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Enable all macros’ and then click the OK button.
STUDENT ASSIGNMENTS
11. Print the worksheet and then print the Visual Basic code.
2. Open the workbook Lab 7-1 Part 1 Richie’s Subprime and then save the workbook using the file name Lab 7-1 Part 2 Richie’s Subprime as an Excel Macro-Enabled Workbook file type. 3. Unprotect the worksheet using the password, smoak. 4. Create a macro that prints the formulas version of the worksheet by doing the following: a. Click the Record Macro button on the Developer tab on the Ribbon. When the Record Macro dialog box appears, name the macro PrintFormulasVersion, assign the shortcut key CTRL+V, add your name in the Description box, and store the macro in this workbook. Click the OK button to start the macro recording process. b. Press CTRL+ACCENT mark (`); click the Page Layout tab on the Ribbon; click the Scale to Fit button arrow on the Ribbon; when the Page Setup dialog box appears, click Landscape in the Orientation area; click Fit to in the Scaling area; click the Print button in the Page Setup dialog box; click the OK button in the Print dialog box; press CTRL+ACCENT mark (`); click the Scale to Fit Dialog Box Launcher on the Ribbon; click Portrait in the Orientation area; in the Scaling area, click Adjust to and type 100 in the Adjust to box; click the OK button; and click the Stop Recording button on the Developer tab on the Ribbon. 5. Click the Macros button on the Ribbon to display the Macro dialog box. Run the PrintFormulasVersion macro. Display the Macro dialog box a second time. Select the PrintFormulasVersion macro and then click the Edit button. When the Visual Basic Editor displays the macro, click File on the menu bar and then click Print. Click the View Microsoft Excel button on the Standard toolbar.
Continued >
C6478_07_CTP.4c.indd 613
8/6/07 8:09:28 AM
EX 614 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
In the Lab
continued
STUDENT ASSIGNMENTS
6. Right-click the Quick Access Toolbar and then click Customize Quick Access Toolbar. When the Excel Options dialog box is displayed, click the ‘Choose commands from’ box arrow and choose Macros. Click PrintFormulasVersion, click the Add button, and then click the OK button. The PrintFormulasVersion button should appear on the Quick Access Toolbar as shown in Figure 7–92. button added to Quick Access Toolbar
Figure 7–92
7. Run the macro as follows: (a) click the PrintFormulasVersion button on the Quick Access Toolbar; and (b) press CTRL+SHIFT+V. 8. Right-click the Quick Access Toolbar and then click Customize Quick Access Toolbar. Remove the PrintFormulasVersion button and then click the OK button. 9. To disable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Disable all macros with notification’ and then click the OK button. 10. Protect the worksheet using the password, smoak. Save the workbook and then quit Excel. 11. Submit the assignment as specified by your instructor.
C6478_07_CTP.4c.indd 614
8/6/07 8:09:28 AM
Lab 2: Automating a Projected Income Workbook Problem: You work in the planning department of Riley, Inc., a small manufacturer. Your manager needs a workbook (Figure 7–93) to be automated to make it easier for her analysts to use. Because you are taking an advanced Excel course that includes Visual Basic for Applications, she has asked you to design a user interface to automate the data entry in cells D4 (Units Sold); D5 (Price per Unit); D14 (Material Cost per Unit); and D16 (Manufacturing Cost per Unit). All other cells in the worksheet use formulas.
Excel Chapter 7
In the Lab
STUDENT ASSIGNMENTS
In the Lab EX 615
Figure 7–93
Instructions: Start Excel. If the Developer tab does not display on the Ribbon, click the Office Button, click the Excel Options button, and then click the ‘Show Developer tab in the Ribbon’ check box. To enable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Enable all macros’ and then click the OK button. Do the following: 1. Open the Lab 7-2 Riley’s Projected Income Statement workbook from the Data Files for Students and then save the workbook using the file name, Lab 7-2 Riley’s Projected Income Statement Complete as an Excel Macro-Enabled Workbook file type. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Continued >
C6478_07_CTP.4c.indd 615
8/6/07 8:09:30 AM
EX 616 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
In the Lab
continued
2. Unprotect the worksheet using the password, breakeven.
STUDENT ASSIGNMENTS
3. Draw a thick box border (column 1, row 8 in the Borders gallery) around the range F15:I21 and color the background Black, Text 1, Lighter 50% (column 2, row 2 on the Fill Color palette). 4. Use the concepts and techniques developed in this project to add the 14 controls shown in the lower-right corner of Figure 7–93. The Units Sold scroll bar should assign a value to cell D4. The Price Per Unit spin button should assign a value to cell D5. The Material Cost Per Unit spin button should assign a value to cell D14. The Mfg Cost Per Unit spin button should assign a value to cell D16. 5. Modify the properties of the 14 controls as described in Table 7–12. Save the workbook. 6. Enter the Reset Button procedure, which sets the Units Sold scroll bar (scrUnitsSold) to 25000; the Price Per Unit spin button (spnPrice) to 3000; the Material Cost Per Unit spin button (spnMaterialCost) to 200; and the Mfg Cost Per Unit spin button (spnMfgCost) to 300. It also should select cell A1. 7. The Units Sold Scroll Bar procedure should assign the value of the scroll bar (scrUnitsSold) to cell D4, which is named Units_Sold. For example: Range(“Units_Sold “).Value = scrUnitsSold.Value 8. Enter the Price Per Unit Spin Button procedure, which assigns the value of spnPrice / 100, formatted to the Currency style, to the Price Per Unit Spin Button Label control. It also should assign the value of spnPrice / 100 to cell D5, which is named Price_per_Unit. For example: lblPrice = Format$(spnPrice.Value / 100, “currency”) Range(“Price_per_Unit “).Value = spnPrice.Value / 100 The Format$ function in the first line formats the result that will be displayed in the Price Per Unit Spin Button Label control to include a floating dollar sign and two decimal positions to the right of the decimal. The value assigned to cell D5 will display in the same format because the cell was formatted to the Currency style as part of the normal worksheet formatting. 9. Enter the Material Cost Per Unit Spin Button procedure, which assigns the value of spnMaterialCost / 100, formatted to the Currency style, to the Material Cost Per Unit Spin Button Label control. It also should assign the value of spnMaterialCost / 100 to cell D14, which is named Materials_Cost_per_Unit. For example: lblMaterialCost = Format$(spnMaterialCost.Value / 100, “currency”) Range(“Material_Cost_per_Unit “).Value = spnMaterialCost.Value / 100 10. Enter the Mfg Cost Per Unit Spin Button procedure, which assigns the value of the spnMfgCost / 100, formatted to the Currency style, to the Mfg Cost Per Unit Spin Button Label control. It also should assign the value of spnMfgCost / 100 to cell D16, which is named Manufacturing_Cost_ per_Unit. For example: lblMfgCost = Format$(spnMfgCost.Value / 100, “currency”) Range(“Manufacturing_Cost_per_Unit “).Value = spnMfgCost.Value / 100 11. Close the Microsoft Visual Basic window. Click the Design Mode button on the Developer tab on the Ribbon. 12. Change the document properties as specified by your instructor. Add a worksheet header with your name, course number, and other information requested by your instructor. 13. Protect the worksheet using the password, breakeven. 14. Use the newly designed user interface to determine the operating income for the following projections and then print the worksheet for each data set: (a) Units Sold = 75,000; Price per Unit = $25.00; Material Cost per Unit = $2.50; and Manufacturing Cost per Unit = $3.70; (b) Units Sold = 34,000; Price per Unit = $42.00; Material Cost per Unit = $13.50; and Manufacturing Cost per Unit = $8.30. The Operating Income in cell D21 for (a) is $317,000 and for (b) is ($406,200).
C6478_07_CTP.4c.indd 616
8/6/07 8:09:32 AM
15. Print the worksheet. Print the procedure. Save the workbook. 16. To disable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Disable all macros with notification’ and then click the OK button. Quit Excel.
Excel Chapter 7
In the Lab EX 617
17. Submit the assignment as specified by your instructor.
Control
Caption
Font
Text Align
0 Label
0
White, 10-point bold
Center
Gray
Units Sold Label
Units Sold
White,10-point bold
Center
Gray
100,000 Label
100,000
White,10-point bold
Center
Gray
Units Sold Scroll Bar
Name
Special Max Effect
scrUnitsSold
Price Per Unit Label
100000 Price Per Unit
Price Per Unit Spin Button
spnPrice
Price Per Unit Spin Button Label
lblPrice
Material Cost Per Unit Label Material Cost Per Unit Spin Button
spnMaterial Cost
Material Cost Per Unit Spin Button Label
lblMaterial Cost
Mfg Cost Per Unit Label
White,8-point bold
Center
$30.00
10-point bold
Right
Material Cost Per Unit
White,8-point bold
Center
10-point bold
Right
Mfg Cost Per Unit
White,8-point bold
Center
spnMfgCost
Mfg Cost Per Unit Spin Button Label
lblMfgCost
$3.00
10-point bold
Reset Button
btnReset
Reset
Black,8-point bold
Back Color
100/1000
0
10
Sunken
True
Gray
0
10
Sunken
True
Gray 9999
Right
0
Small Chg/ Large Chg
Gray
9999 $2.00
Min
True 9999
Mfg Cost Per Unit Spin Button
C6478_07_CTP.4c.indd 617
Word Wrap
STUDENT ASSIGNMENTS
Table 7–12 Controls and Their Properties
0
10
Sunken
Inactive Border
8/6/07 8:09:32 AM
EX 618 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
STUDENT ASSIGNMENTS
In the Lab Lab 3: Automating a Forecast Workbook Problem: As a summer intern at Hank’s Handheld Mobile Devices, you have been asked to use your Visual Basic for Applications skills to automate the Forecast workbook as shown in Figure 7–94. The objective is to simplify data entry for the company’s financial analysts. This worksheet projects financial information for a five-year period based on the previous year’s sales and additional data. The user interface on the right side of the screen accepts the assumptions in the range I18:I22. The numbers in the range B5:F18 are based on these assumptions. The user interface in the range H2:I16 has two command buttons, one spin button, and three scroll bars. The Reset Assumptions command button resets the assumptions as follows: (a) cell I18 = 2,000; (b) cell I19 = $500.00; (c) I20 = 15%; (d) I21 = 3%; and (e) I22 = 50%. The Devices Sold in 2008 Command Button accepts and ensures the units sold figure in 2008 is greater than zero and then assigns it to cell I18. The Unit Cost spin button changes the unit cost in cell I19. The Annual Sales Growth scroll bar changes the annual sales growth in cell I20. The Annual Price Decrease scroll bar changes the annual price decrease in cell I21. The Margin scroll bar changes the margin in cell I22.
Figure 7–94
C6478_07_CTP.4c.indd 618
8/6/07 8:09:33 AM
2. Unprotect the Financial Statement worksheet using the password, mobile. 3. Set the background color of the range H2:I16 to White, Background 1 Darker 25% (column 1, row 4 on the Fill Color palette). Draw a thick box border around the range H2:I16. 4. Click the Design Mode button on the Developer tab on the Ribbon. Use the concepts and techniques developed in this project to add the 17 controls shown in Figure 7–94. The controls’ properties are described in Table 7-13.
Excel Chapter 7
Instructions: Start Excel. If the Developer tab does not display on the Ribbon, click the Office Button, click the Excel Options button, and then click the ‘Show Developer tab in the Ribbon’ check box. To enable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Enable all macros’ and then click the OK button. Complete the following tasks: 1. Open the Lab 7-3 Hank’s Handheld Mobile Devices from the Data Files for Students and then save the workbook using the file name, Lab 7-3 Hank’s Handheld Mobile Devices Complete as an Excel Macro-Enabled Workbook file type. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book.
STUDENT ASSIGNMENTS
In the Lab EX 619
5. One at a time, click the buttons, scroll bars, and spin button listed below and enter the corresponding procedures. Click the View Code button on the Developer tab on the Ribbon to display the Visual Basic window after selecting a button, scroll bar, or spin button. Click the View Microsoft Excel button on the Standard toolbar to display the workbook after you finish entering a procedure. a. Enter the Reset Assumptions Button procedure, which resets the assumptions as follows: Range(“I18”).Value = 2000 spnUnitCost = 50000 scrAnnualSalesGrowth = 1500 scrAnnualPriceDecrease = 300 scrMargin = 5000 Range(“A22”).Select b. Enter the Devices Sold in 2008 Button procedure, which accepts and validates the number of devices sold in 2008 in cell I18 as follows: DevicesSold = InputBox(“Devices Sold in 2008?”, “Enter”) Do While DevicesSold <= 0 DevicesSold = InputBox(“Devices Sold in 2008 must be > zero.”, “Please Reenter”) Loop Range(“I18”).Value = DevicesSold c. Enter the Unit Cost Spin Button procedure, which enters the unit cost in the Unit Cost Spin Button Label control and in cell I19 as follows: lblUnitCost = Format$(spnUnitCost.Value / 100, “currency”) Range(“I19”).Value = spnUnitCost.Value / 100 The Format$ function in the first line formats the result that will be displayed in the Unit Cost Spin Button Label control to include a floating dollar sign and two decimal positions to the right of the decimal.
Continued >
C6478_07_CTP.4c.indd 619
8/6/07 8:09:35 AM
EX 620 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
In the Lab
continued
d. Enter the Annual Sales Growth Scroll Bar procedure, which changes the annual sales growth in cell I20 as follows: Range(“I20”).Value = scrAnnualSalesGrowth.Value / 10000
STUDENT ASSIGNMENTS
e. Enter the Annual Price Decrease Scroll Bar procedure and the Margin Scroll Bar procedure. These procedures work in a fashion similar to the procedure for the Annual Sales Growth scroll bar, except that they assign values to cells I21 and I22, respectively. 6. Click the Design Mode button on the Developer tab on the Ribbon to turn off Design mode. 7. Use the newly designed interface to determine the five-year projections based on the following assumptions and then print the worksheet for each data set: (a) Devices Sold in 2008 = 4,750; Unit Cost = $207.00; Annual Sales Growth = 17%; Annual Price Decrease = 5%; and Margin = 57%; (b) Devices Sold in 2008 = 5,600; Unit Cost = $325.00; Annual Sales Growth = 9%; Annual Price Decrease = 3%; and Margin = 44%. The Net Income for the year 2013 in cell F18 for (a) is $335,032 and for (b) is $135,317. Table 7–13 Controls and Their Properties Control
Reset Assumptions
Name
btnReset
Caption
Back Color
Reset Assumptions
Special Effect
Max
Min
Small Chg
Large Chg
bold btnDevicesSold
2008 Button Unit Cost Label
Text Align
8-point
Button Devices Sold in
Font
Devices Sold in
8-point
2008
bold
Unit Cost
Gray
8-point
Right
bold Unit Cost Spin
spnUnitCost
100000
0
100
10000
0
25
100
10000
0
25
100
Button Unit Cost Spin
lblUnitCost
$500.00
10-point
Button Label
Right
Sunken
bold
All three 0 Labels
0
Gray
8-point
Center
bold All three 100 Labels
100
Gray
8-point
Center
bold Annual Sales
Annual Sales
Growth Label
Growth
Annual Sales
Gray
8-point
Center
bold
scrAnnualSalesGrowth
Growth Scroll Bar Annual Price
Annual Price
Decrease Label
Decrease
Annual Price
Gray
8-point
Center
bold
scrAnnualPriceDecrease
Decrease Scroll Bar Margin Label
Margin
Gray
8-point
Center
bold Margin Scroll Bar
C6478_07_CTP.4c.indd 620
scrMargin
10000
0
25
100
8/6/07 8:09:36 AM
8. Change the document properties as specified by your instructor. Add a worksheet header with your name, course number, and other information requested by your instructor. 9. Print the worksheet and the procedures. 10. Protect the worksheet using the password, mobile. Save the workbook.
Excel Chapter 7
In the Lab EX 621
12. Submit the assignment as specified by your instructor.
C6478_07_CTP.4c.indd 621
STUDENT ASSIGNMENTS
11. To disable macros, click the Macro Security button on the Developer tab on the Ribbon. When the Trust Center dialog box is displayed, click ‘Disable all macros with notification’ and then click the OK button. Quit Excel.
8/6/07 8:09:37 AM
EX 622 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel
Cases and Places Apply your creative thinking and problem solving skills to design and implement a solution.
STUDENT ASSIGNMENTS
• EASIER •• MORE DIFFICULT • 1: Adding a Macro to a Workbook Open the workbook Case 7-1 Jack’s Fish & Chips from the Data Files for Students and then save the workbook using the file name, Case 7-1 Jack’s Fish & Chips Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Create a macro that prints the formulas version of the Forecast worksheet in landscape orientation using the Fit to option. Make sure that the macro resets the Page Setup options before terminating. Execute the macro. Print the worksheet and macro. Save the workbook. Submit the assignment as specified by your instructor. • 2: Automating Data Entry in a Forecast Workbook Open the workbook Case 7-2 Jack’s Fish & Chips from the Data Files for Students and then save the workbook using the file name, Case 7-2 Jack’s Fish & Chips Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Create a Command Button control next to the Assumptions box. Change the Command Button control’s caption to Assumptions. Write a procedure for the Command Button control that accepts data for each of the five assumptions in the range B23:B27. When finished accepting the data, the procedure should display a message indicating that all of the data was accepted. Use the MsgBox function to display the message. Print the Forecast worksheet. Print the Command Button control procedure. Use the Assumptions button to enter the following data sets and then print the worksheet for each data set: (a) Food = 38%; Travel = 12%; Salaries = 35%; Storage = 2%; Marketing = 5%; (b) Food = 46%; Travel = 9%; Salaries = 27%; Storage = 6%; Marketing = 3%. The Total Net Income in cell E18 for (a) is $244,922.64 and for (b) is $275,537.97. Save the workbook. Submit the assignment as specified by your instructor. • 3: Creating a Well-Balanced User Interface Open the workbook Case 7-3 Jack’s Fish & Chips from the Data Files for Students and then save the workbook using the file name, Case 7-3 Jack’s Fish & Chips Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Create a well-balanced user interface made up of a Reset button and five scroll bars, one for each of the cells in the range B21:B25. Have the Reset button set the five assumptions to 38%, 7%, 37%, 4%, and 6%, respectively. The scroll bars should range from 0% to 100% and increment by 0.25% (scroll arrows) and 1% (scroll bars). Use the titles in the Assumptions box in the range A23:A27 for the names of the scroll bars. Print the worksheet and the Reset button control procedure. Use the interface to enter the data specified in Cases and Places Exercise 2 above. Save the workbook. Submit the assignment as specified by your instructor.
C6478_07_CTP.4c.indd 622
8/6/07 8:09:37 AM
Make It Personal
Consider the next auto that you wish to purchase and determine possible models, their current sales prices including tax, and other information regarding the financing of an auto loan. Open the workbook Case 7-4 My Loan Calculator from the Data Files for Students and then save the workbook using the file name, Case 7-4 My Loan Calculator Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Add a New Auto Loan button that accepts the values in the cells C3, C4, C5, C7, and C8. The procedure associated with the New Auto Loan button on the worksheet should validate the price, down payment, interest rate, and years as follows: (a) the price must be between $12,000 and $80,000 inclusive; (b) the down payment must be between $1,500 and $55,000 inclusive; (c) the interest rate must be between 3% and 22% inclusive; and (d) the years must be between 1 and 9 inclusive. Print the procedure. Create and enter two sets of valid test data based on your personal preference for an auto and your financial information. Print the worksheet for each set. Save the workbook. Submit the assignment as specified by your instructor.
•• 5: Creating a User Interface and Validating Incoming Data
Excel Chapter 7
•• 4: Validating Incoming Data
STUDENT ASSIGNMENTS
Cases and Places EX 623
Working Together
Open the workbook Case 7-5 My Loan Calculator from the Data Files for Students and then save the workbook using the file name, Case 7-5 My Loan Calculator Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Each member should design on paper a wellbalanced user interface that allows input for the values in the cells C3, C4, C5, C7, and C8. Use at least one text box control, at least one scroll bar control, and at least one spin button control. Use the same validation rules as detailed in Cases and Places Exercise 4. Include a text box control that is labeled as the Maximum Requested Monthly Payment. As a group, choose the best features of each design and proceed to create the interface. After creating the user interface in Excel, write the code for the controls. At the end of each procedure that you create for the controls, include a check that determines if the Monthly Payment in cell C9 is greater than the Maximum Requested Monthly Payment. If so, set the font color in the cell to red by using the Visual Basic statement, Range(“C9”).Font.Color = RGB(255, 0, 0), in the VBA code. If the value in C9 is less than or equal to the Maximum Requested Monthly Payment, then set the color in cell C9 to black by using the Visual Basic statement, Range(“C9”).Font.Color = RGB(0, 0, 0), in the VBA code. The value of cell C9 must be compared with a numeric value. Use the syntax, CDBL(txtMaxPayment.Value), to make the Maximum Requested Monthly Payment a numeric value. Save the workbook. Submit the assignment as specified by your instructor.
C6478_07_CTP.4c.indd 623
8/6/07 8:09:37 AM
This page intentionally left blank
C6394_FM_CTP.4c.indd xvi
8/8/07 3:59:57 PM
Microsoft Office Excel 2007
8
Formula Auditing, Data Validation, and Complex Problem Solving
Objectives You will have mastered the material in this chapter when you can: • Use formula auditing techniques to analyze a worksheet • Trace precedents and dependents • Add data validation rules to cells • Use trial and error to solve a problem on a worksheet • Use goal seeking to solve a problem • Circle invalid data on a worksheet
• Password-protect a workbook file • Use Excel’s Scenario Manager to record and save different sets of what-if assumptions • Create a Scenario Summary of scenarios • Create a Scenario PivotTable • Save a workbook for use in a previous version of Excel
• Use Excel’s Solver to solve a complex problem
C6479_08_CTP.4c.indd 625
8/6/07 8:11:40 AM
Microsoft 2003 Microsoft Offi Office ce Word Excel 2007
8
Formula Auditing, Data Validation, and Complex Problem Solving Introduction This chapter introduces you to formula auditing a worksheet, data validation, and solving complex problems. Formula auditing allows you to check both the cells being referenced in a formula and the formulas that reference those cells. Formula auditing a worksheet is especially helpful when you want to learn more about a workbook created by someone else or you want to verify the formulas in a newly created workbook. Data validation allows you to define cells in such a way that only certain values are accepted. This feature, introduced in Chapter 5, also lets Excel display a prompt message when the user selects the cell and an error message if the user attempts to enter a value outside of a valid range that you define. Another powerful data validation feature in Excel allows you to circle invalid data entered in a worksheet cell to indicate an error. In some situations, the simplest way to solve a problem is to keep trying different data until you are satisfied with the solution. This process is called trial and error. Often, you can use trial and error to solve a problem on your own. In other situations, a complex problem might have many possible solutions, meaning that the best way to solve the problem is to use a computer. Excel provides you with tools to solve such problems. One of these tools is Solver, which allows you to specify up to 200 different cells that can be adjusted to find a solution to a problem. Solver also lets you place constraints on the values entered in a cell. A constraint is a limitation on the possible values that a cell can contain. After you define the constraints and instruct Solver about the solution you are seeking, it will try many possible solutions until it finds the best one.
EX 626
C6479_08_CTP.4c.indd 626
8/6/07 8:11:42 AM
Microsoft Office Excel 2007
BTW
The majority of this chapter introduces you to solving complex problems that involve changing the values entered in cells to arrive at a solution, while abiding by constraints imposed on the values. The worksheet in Figure 8–1a on page EX 628 is used by Perfected Packaging to decide how to best allocate the work for a customer job among three different packaging machines. Perfected Packaging obtains bulk-quantities of items from a customer and then repackages the items in one of three package sizes: consumer-sized, retail-sized, and industrial-sized. Each machine packages items at a different rate per minute and operates at a different cost per minute. Figure 8–1a shows the details of the customer order requirements for the project in this chapter. Columns B, C, and D each refer to one of the three machines currently used to package items in bags. The row titles in rows 4 and 5 refer to known information about each machine, including its speed, based on bags per minute, and operating cost per minute. Rows 8 through 10 represent the optimal number of each bag type that each machine should fill for a particular order. The empty cells in these rows reflect the fact that some of the machines cannot fill certain types of bags. For example, cell C10 is empty because Machine 2 cannot fill industrial-sized bags. Rows 12 and 13 show total minutes and total cost per machine for each order. The values in these rows change as the numbers of each bag size are updated in rows 8 through 10. After you enter the number of each bag size for each machine, Excel determines the results of the suggested order scheduling in column E. The objective is to minimize the total cost for the order (cell E13) while producing the required number of bags within a certain time frame. All the machines are run at the same time for a particular job. The constraints for the current order under consideration are entered in the range B16:B19. In Figure 8–1b and 8–1d on the next page, Solver has modified the values of cells in the range B8:D10 to find the best combination of bags to fill on each machine to minimize cost and meet the requirements for two different customer orders: Order 1 and Order 2, respectively. When Solver finishes solving a problem, you can instruct it to create an Answer Report. An Answer Report (Figures 8–1c and 8–1e on page EX 628) shows the answer that Solver found, the values that Solver manipulated to find the answer, and the constraints that were used to solve the problem. Excel’s Scenario Manager is a what-if analysis tool that allows you to record and save different sets of what-if assumptions used to forecast the outcome of a worksheet model. This chapter shows you how to use Scenario Manager to manage the two different sets of Solver data for Orders 1 and 2. Scenario Manager also allows you to create reports that summarize the scenarios on your worksheet. Figure 8–1f on page EX 629 shows a Scenario Summary and Scenario PivotTable that concisely report the differences in the two order scenarios shown in Figures 8–1b and 8–1d.
Constraints The constraints of a problem are the rules that you must follow to solve that problem. You even may add constraints to cells that are not referenced in the formulas you are solving. Solver will modify these types of cells to meet the constraints, but they will not affect the solution. For example, you can change row or column headers or worksheet headers to better explain to the user the results of a Solver solution.
BTW
Project — Perfected Packaging Order Optimization Worksheet
The Solver Add-In If you do not have Solver installed on your computer, see your instructor about obtaining the Microsoft Office System 2007 CD-ROMs. To install the Solver Add-In, use the Excel Options button on the Office Button menu, click Add-ins, click the Go button, check the Solver option box, and then follow the instructions.
EX 627
C6479_08_CTP.4c.indd 627
8/6/07 8:11:42 AM
EX 628 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
best mix of bag filling for Order 1
(b) Solution for Order 1
constraints for Order 1
(a) Worksheet without a Solution
best mix of bag filling for Order 2
(d) Solution for Order 2 Figure 8–1
C6479_08_CTP.4c.indd 628
8/6/07 8:11:43 AM
Excel Chapter 8
Project — Perfected Packaging Order Optimization Worksheet EX 629
(c) Answer Report for Order 1
results proving problems’ constraints are met
summary of two possible production scenarios
(f) Scenario Summary and Scenario PivotTable of Solution
(e) Answer Report for Order 2
C6479_08_CTP.4c.indd 629
8/6/07 8:11:45 AM
EX 630 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
Figure 8–2 illustrates the requirements document for the Perfected Packaging Order Optimization worksheet. It includes the needs, source of data, data for two scenarios, and other facts about its development.
Figure 8–2
Overview As you read this chapter, you will learn how to modify the existing workbook as shown in Figure 8–1 by performing these general tasks: • Use formula auditing techniques to analyze a worksheet • Add data validation rules to cells • Use Solver to solve a complex problem and produce reports to summarize the solution • Use Scenario Manager to record and save two different customer orders and use reports to compare the scenarios • Save a workbook for use in a previous version of Excel • Prepare a workbook for distribution
C6479_08_CTP.4c.indd 630
8/6/07 8:11:50 AM
General Project Decisions While working with an Excel worksheet, you need to make several decisions that will determine the appearance and characteristics of the finished worksheet. As you update an existing worksheet to meet the requirements shown in Figure 8–2, you should follow these general guidelines:
Plan Ahead
Excel Chapter 8
Project — Perfected Packaging Order Optimization Worksheet EX 631
1. Analyze the formulas in the workbook to learn about the workbook. Excel provides several commands to use when analyzing, or auditing, a workbook. Tracing precedents and dependents allows you quickly to learn how cells in a worksheet are related. 2. Establish data validation rules for changing cells. Data validation commands in Excel allow you to place rules on cells that restrict a user to entering only particular values in cells. For example, the requirements document in Figure 8–2 implies that cells in the ranges B8:B10 and C8:C9, and cell D8 must be nonnegative whole numbers. Data validation rules should be applied to those cells to restrict a user from entering invalid data. 3. Propose strategies for solving a complex problem. Excel provides many methods for solving complex problems. Strategies should be tested from the least complex method to the most complex method. 4. Consider which cells in the worksheet constitute a scenario. An Excel scenario needs to recall only the values in those cells that change, or have an impact on, the solution. In essence, a scenario recalls cell values that serve as input data for the problem solved by a worksheet. 5. Evaluate the steps to take in finalizing a workbook. Before sending a workbook to colleagues and co-workers, several steps should be taken to ensure that the workbook is finalized and saved in a proper format. The steps you take to perform this task depend on several factors that are discussed later in this chapter. When necessary, more specific details concerning the above guidelines are presented at appropriate points in the chapter. The chapter also will identify the actions you perform and decisions made regarding these guidelines during the modification of the worksheets shown in Figure 8–1 on page EX 628.
With a good understanding of the requirements document and an understanding of the necessary decisions, the next step is to use Excel to learn about the existing worksheet and solve the problem.
To Start Excel and Open a Workbook If you are using a computer to step through the project in this chapter and you want your screen to match the figures in this book, you should change your computer’s resolution to 1024 ⫻ 768. For information about how to change a computer’s resolution, see page 21 in Appendix E. The following steps start Excel and open the workbook Perfected Packaging from the Data Files for Students.
1
Start Excel.
2
Open the file Perfected Packaging from the Data Files for Students and then save the workbook using the file name, Perfected Packaging2.
C6479_08_CTP.4c.indd 631
8/6/07 8:11:53 AM
EX 632 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
3
If the Excel window is not maximized, double-click its title bar to maximize it.
4
If the worksheet window in Excel is not maximized, click the Maximize button next to the Close button on its title bar to maximize the worksheet within Excel (Figure 8–3).
order processed on three machines enter number bags on each machine
three bag sizes make up typical order
total for bag size at least number specified in constraints
minimize total cost for order
constraints for current order keep total minutes for each machine type less than number specified in constraints
Figure 8–3
About the Order Optimization Worksheet The Order Optimization worksheet shown in Figure 8–3 provides information for three replication machines and three bag sizes. Rows 4 and 5 show the operating speed and operating cost for each of the three machines. The range B8:D10 contains the optimal combination of bag sizes filled on each machine for a particular order, which is the information that needs to be determined in this chapter. The empty cells — cells C10, D9, and D10 — indicate that a particular machine cannot fill a certain size bag. Rows 12 and 13 show the total minutes and cost for each machine, based on the optimal values listed in the range B8:D10. As cells in the range B8:D10 change, the values in the range B12:D13 are updated. Finally, the total cost for the order is calculated and shown in cell E13. The goals of the project in this chapter are (1) to keep the total number of bags filled
C6479_08_CTP.4c.indd 632
8/6/07 8:11:54 AM
for the order (range E8:E10) equal to or greater than the order constraints in the range B16:B19 and (2) to minimize the total order cost in cell E13 without using each machine more than the number of minutes shown in cell B16. The current worksheet displays order constraints for Order 1 in the range B16:B19. As outlined in the requirements document in Figure 8–2 on page EX 630, a second order for a different customer must be analyzed and compared with the first order so the company can decide which job to schedule first. The information in the range B16:B19 thus will be modified later in the chapter to reflect the order constraints for Order 2, so that it can be compared with Order 1.
Excel Chapter 8
Formula Auditing EX 633
Formula Auditing The term, formula auditing, refers to the practice of proving the correctness of a worksheet. Formula auditing is useful both for analyzing a complex worksheet and for finding the source of errors that may occur in your worksheet. The Formula Auditing group on the Formulas tab on the Ribbon supplies several tools that you can use to analyze the formulas in a worksheet. Excel also provides visual auditing tools that display cues to help you understand the worksheet. These cues take the form of tracer arrows and circles around worksheet cells. Tracer arrows are blue arrows that point from cell to cell and let you know what cells are referenced in a formula in a particular cell. Tracer arrows appear in red when one of the referenced cells contains an error.
To Trace Precedents The Formula Auditing group on the Formulas tab on the Ribbon contains buttons that allow you to trace the details of a formula or locate the source of errors in a worksheet. A formula that relies on other cells for a computation is said to have precedents. A precedent is a cell that is referenced in a formula. For example, if you assign cell A5 the formula =A1+A2, then cells A1 and A2 are precedents of cell A5. Tracing precedent cells shows you how a particular cell is calculated. Often a precedent cell has precedents itself. For instance, in the previous example, if you assign cell A1 the formula =B1+B2, then cell A1, which is a precedent of cell A5, also has precedents. Excel allows you to trace the precedents of a cell by clicking the Trace Precedents button in the Formula Auditing group on the Formulas tab on the Ribbon. You can audit only one cell at a time, however; that is, Excel does not allow you to audit ranges. The following steps show how to trace the precedent cells for cell E13, which displays the total cost for an order.
C6479_08_CTP.4c.indd 633
8/6/07 8:11:57 AM
EX 634 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
1 • Click the Formulas
Formulas tab
tab on the Ribbon.
Trace Precedents button
• Click cell E13 and then click the Trace Precedents button on the Ribbon to draw an arrow across the range B13:E13.
2 • Click the Trace
Q&A
Precedents button two more times to draw arrows indicating precedents of cells B13:D13 and the precedents of B12:D12 (Figure 8–4).
cells with dots are precedents
What is the meaning of the precedent arrows? The arrows in cells B13:D13 are displayed as precedents Figure 8–4 have of cell E13 arrowheads on cells that are traced and dots on cells that are direct precedents of the cells with arrowheads. For example, cells B13 through D13 are precedents of cell E13. Cell B13, Figure 8–4 which is assigned the formula =B12*B5, has precedents in cells B5 and B12. As you click the Trace Precedents button, you visually can follow the levels of precedents through the worksheet. A heavier blue line through a range of cells indicates that all cells in the range are precedents. For example, in Figure 8–4, the heavier blue line through the range B9:B10 indicates that these cells are precedents of cell B13, along with cell B4 and B8, which contain blue dots. Other Ways 1. Press ALT+M, P
C6479_08_CTP.4c.indd 634
8/6/07 8:11:57 AM
To Remove the Precedent Arrows After understanding the precedents of a particular cell, you can remove the precedent arrows one level at a time, as shown in the following steps.
1 • Click the Remove All Arrows button arrow to display the Remove All Arrows menu and then point to the Remove Precedent Arrows command on the Remove All Arrows menu (Figure 8–5).
Excel Chapter 8
Formula Auditing EX 635
Remove All Arrows button arrow
Remove All Arrows menu Remove Precedent Arrows command
2 • Click Remove Precedent Arrows to remove precedent arrows from the range B4:D12.
Figure 8–5
3 • Repeat Steps 1 and 2
Q&A
to remove the remaining precedent arrows from the range B13:D13 (Figure 8–6). Why should I trace precedents? By using the Trace Precedents button and Remove Precedent Arrows command, you slowly can begin to see the structure of the worksheet that is hidden in the formulas within the cells. By doing more analysis, you can assure yourself that you understand the worksheet and that it contains no errors.
Figure 8–6
arrows removed
Other Ways 1. Press ALT+M, A, P
C6479_08_CTP.4c.indd 635
8/6/07 8:11:59 AM
EX 636 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
To Trace Dependents A cell is a dependent if it is referenced in a formula in another cell. Often, it is useful to find out where a cell is used to perform calculations in a worksheet. In other words, you can discover which cells in the worksheet use the cell in question. Excel allows you to trace the dependent cells by clicking the Trace Dependents button in the Formula Auditing group. The following steps trace the dependents of cell B8, which shows the optimal number of bags to fill on Machine 1.
1 • Click cell B8 and
Trace Dependents button
then click the Trace Dependents button on the Ribbon to draw arrows to dependent cells E8 and B12.
2 • Click the Trace
Q&A
Dependents button two more times to draw arrows indicating the remaining dependents of cell B8 (Figure 8–7).
cells with arrowheads are dependents
What is the meaning of the dependent arrows? Figure 8–7 indicates that cells E8 and B12 depend on cell B8. Subsequently, the cells B13 and E13 depend on those cells. As indicated by the dependent arrows, before any results can be computed in cells B13 and E13, cell B8 must have a value.
cells B12:B13, E8, and E13 are dependents
Figure 8–7 Other Ways 1. Press ALT+M, D
C6479_08_CTP.4c.indd 636
8/6/07 8:12:01 AM
To Remove the Dependent Arrows When you have finished auditing the worksheet with formula auditing, the easiest way to clear all of the precedent or dependent arrows is to use the Remove All Arrows button on the Ribbon, as shown in the following step.
1 • Click the Remove
Excel Chapter 8
Formula Auditing EX 637
Q&A
All Arrows button on the Ribbon to remove all of the dependent arrows (Figure 8–8). What if a cell depends on or is a precedent of a cell in another worksheet or workbook?
Remove All Arrows button
Sometimes, a cell has precedents or dependents on other worksheets or in other workbooks. In this case, Excel draws a dashed arrow to an icon of a worksheet to indicate that the precedent or dependent cell arrows Figure 8–8 removed is outside of the current worksheet. If the workbook that contains the precedent or dependent is open and you click the dashed arrow, Excel displays the Go To dialog box that allows you to navigate to that cell. Other Ways 1. Press ALT+M, A, D
Figure 8–9 shows the buttons in the Formula Auditing group on the Formulas tab on the Ribbon. Table 8–1 summarizes the functions of the buttons in the Formula Auditing group.
Trace Precedents
Show Formulas
Trace Dependents
Error Checking
Watch Window
Remove All Arrows
Figure 8–9
BTW
Buttons in the Formula Auditing Group Tracing Precedents and Dependents When no more levels of precedents are available on the worksheet, Excel will beep if you try to trace another level. If you double-click a tracer arrow, the cell at the end of the arrow will be selected. This is useful on complex worksheets where the destination of an arrow may not be easy to ascertain.
Evaluate Formula
C6479_08_CTP.4c.indd 637
8/6/07 8:12:03 AM
BTW
BTW
EX 638 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
Gaining Confidence in a Workbook Some Excel commands provide additional ways to uncover details of workbooks created by another author. For example, the Page Setup Dialog Box Launcher on the Page Layout tab on the Ribbon, the Print Preview command on the Office Button menu, and the Excel Options button on the Office Button menu can tell you if the author used any unusual settings. To list the macros in the workbook, click the Developer tab on the Ribbon and then click the Macros button on the Ribbon.
Validation Circles Validation circles display in red to indicate that these cells contain error values. Excel will display a maximum of 256 invalid data circles at a time.
Table 8–1 Summary of Buttons in the Formula Auditing Group Name
Function
Error Checking
Checks the entire worksheet for errors. The Trace Error command on the Error Checking menu is used when the active cell contains an error value. It draws tracer arrows to the cells that may be causing the error value to appear. The Circular References command on the Error Checking menu draws circles around the cells that contain values outside of the limits defined through the Validation command on the Data menu.
Trace Precedents
Draws tracer arrows from the cells that affect the formula in the current cell.
Remove All Arrows
Removes all tracer arrows from the active worksheet.
Trace Dependents
Draws tracer arrows to the cells that use the current cell in their formula.
Show Formulas
Shows the formulas view of the active worksheet (CTRL+ ‘).
Watch Window
Opens a window that displays the values and formulas in cells that you select to monitor.
Evaluate Formula
Allows you to debug complex formulas by monitoring a formula step by step.
The Error Checking button will search the current worksheet for any errors and then display the Error Checking dialog box to help you take corrective action. You then can trace the source of the error. If you see an error in a cell — including #DIV/0!, #NAME?, #NA, #NULL!, #NUM!, #REF!, and #VALUE! — select the cell, click the Error Checking button arrow, and then click the Trace Error command on the Error Checking menu to display red tracer arrows that point to the precedent cells. You then can inspect the precedent cells to see if you can determine the cause of the error and correct it. The Watch Window button opens the Watch Window. The Watch Window allows you to monitor values and formulas in cells as you work on a worksheet. The Evaluate Formula button displays the Evaluate Formula dialog box, which allows you to debug or understand complex formulas in a worksheet, much in the manner that programmers debug source code.
BTW
Data Validation, Trial and Error, and Goal Seek
Goal Seeking Goal seeking is a methodology in which you know what value you want a formula in a cell to produce, but you do not know the value to place in a cell that is involved in the formula. You can goal seek by changing the value in a cell that is used indirectly in the formula.
C6479_08_CTP.4c.indd 638
Often, it is necessary to limit the values that should be placed in a particular cell. Excel allows you to place limitations on the values of cells by using data validation. Data validation restricts the values that a user can enter into a cell. Excel allows you to determine the restrictions placed on data entered into a cell, set an input message that the user will see when selecting the cell, and set an error message to display if the user violates the restrictions placed on the cell. By implementing these features, you reduce the likelihood of data entry errors by giving the user as much information as possible about how to use the worksheet properly. One important aspect of Excel’s data validation is that the rules apply only when the user enters data into the cell manually. That is, if a cell is calculated by a formula or set in a way other than direct input by the user, Excel does not check the validation rules. When using the Custom validation type, you can use a formula that evaluates to either true or false. If the value is false, users may not enter data in the cell. Suppose, for example, you have a cell that contains an employee’s salary. If the salary is zero, which indicates the employee no longer is with the company, you may want to prohibit a user from entering a percentage in another cell that contains the employee’s raise for the year.
8/6/07 8:12:05 AM
To Add Data Validation to Cells Recall from the requirements document for this chapter on page EX 630 that the number of bags filled must be nonnegative whole numbers. By examining the worksheet, you can see that cells in the ranges B8:B10, C8:C9, and D8 must have these restrictions. Data validation is added to cells by using the Data Validation button on the Data tab on the Ribbon. The following steps add data validation to cells in the ranges B8:B10, C8:C9, and D8.
1 • Select the range
Data tab
Excel Chapter 8
vData Validation, Trial and Error, and Goal Seek EX 639
Data Validation button
B8:B10.
• While holding down the CTRL key, select the range C8:C9.
• While holding down the CTRL key, select the cell D8.
• Click the Data tab on the Ribbon (Figure 8–10).
cells B8:B10, C8:C9, and D8 selected
Figure 8–10
2 • Click the Data Validation button on the Ribbon to display the Data Validation dialog box.
• When Excel displays the Data Validation dialog box, click the Allow box arrow and then click Whole number in the Allow list.
Data Validation dialog box Settings tab
Input Message tab
Ignore blank check box Allow changed to Whole number Data changed to greater than or equal to Minimum changed to 0
• Click the Data box arrow and then click ‘greater than or equal to’ in the Data list.
Figure 8–11
clears entries in dialog box
Q&A
• Type 0 in the Minimum box (Figure 8–11). What is the purpose of the Ignore blank check box? The Ignore blank check box should be cleared if you want to require that the user enter data in the cell. By leaving the Ignore blank check box selected, Excel allows the user to select the cell and then deselect the cell with no data being entered.
C6479_08_CTP.4c.indd 639
8/6/07 8:12:06 AM
EX 640 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
3 • Click the Input Message tab and then type Bags to Fill in the Title text box.
Error Alert tab
check box determines display setting will appear as ScreenTip heading
• Type Enter the
Q&A
number of bags to fill on the machine. The number must be a whole number that is greater than or equal to zero. in the Input message box (Figure 8–12).
input message will appear as ScreenTip when a cell in ranges B8:B10 and C8:C9, and cell D8 is selected
Figure 8–12
How else can I validate data? Excel allows several types of validation to be set in the Validation criteria area shown in Figure 8–11. Each selection in the Validation criteria area changes the type of value that Excel allows a user to enter in the cell. In the Allow list, the Any value selection allows you to enter any value, but still allows you to specify an input message for the cell. The Whole number, Decimal, Date, and Time selections permit only values of those types to be entered in the cell. The List selection allows you to specify a range that contains a list of valid values for the cell. The Text length selection allows only a certain length of text string to be entered in the cell. The Custom selection allows you to specify a formula that validates the data entered by the user.
4 • Click the Error Alert tab and then type Input Error in the Title text box.
check box determines display settings
appears on title bar of dialog box
• Type You must enter a whole number that is greater than or equal to zero. in the Error message box (Figure 8–13).
Style box arrow
OK button
5 • Click the OK button.
error message will display if user enters value in ranges B8:B10, C8:C9, and D8 that is less than zero or not a whole number
Q&A
• Click cell E21. What is the result of the new data validation rules?
Figure 8–13
If a user selects one of the cells in the ranges B8:B10, C8:C9, or D8, then Excel displays the input message defined in Figure 8–12. If the user enters a value that either is less than zero or is not a whole number in cells in the ranges B8:B10, C8:C9, and D8, then Excel displays the error message defined in Figure 8–13 and forces the user to change the value to a valid number before deselecting the cell. Other Ways 1. Press ALT+A, V, V
C6479_08_CTP.4c.indd 640
8/6/07 8:12:09 AM
To Open the Watch Window and Add Cell Watches As previously discussed, the Watch Window allows you to monitor the values and formulas in cells as you work on a worksheet. You add cells to the Watch Window using the Add Watch button on the Watch Window toolbar. The Watch Window continues to show the values of watched cells even as you navigate the worksheet and the cells are no longer in view on the screen. Similarly, if you change the view to another worksheet or workbook, the Watch Window allows you to continue to monitor the cell values. The Watch Window displays six columns of information for each cell: the workbook that contains the cell (Book), the worksheet that contains the cell (Sheet), the cell name (Name), the cell reference (Cell), the current value in the cell (Value), and the formula for the cell (Formula). The following steps open the Watch Window and add cell watches to cells in the range E8:E10 and cell E13.
1 • Click the Formulas
Formulas tab
Excel Chapter 8
Data Validation, Trial and Error, and Goal Seek EX 641
Watch Window button
tab on the Ribbon.
• Click the Watch Window button on the Ribbon to open the Watch Window (Figure 8–14).
Watch Window
Figure 8–14
2 • Click the Add Watch
Watch Window button selected when Watch Window is open
button on the Watch Window toolbar to display the Add Watch dialog box (Figure 8–15). Add Watch button Add Watch dialog box
cells to watch in Watch Window
Figure 8–15
C6479_08_CTP.4c.indd 641
8/6/07 8:12:12 AM
EX 642 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
3 • If necessary, move the Add Watch dialog box so that rows 8 through 10 of column E are not hidden.
• Select the range E8:E10.
• Hold down the CTRL key and then
click cell E13 (Figure 8–16).
selection displays in Add Watch dialog box
Add button
Figure 8–16
4 • Click the Add button in the Add Watch dialog box. Name column resized
• If necessary, expand
Q&A
the Name column to view the cell names in the third column and information about the four watched cells (Figure 8–17). How should I use the Watch Window?
values in Value column automatically update when entry is made on worksheet
four cells watched
You continue to display the Watch Window while you make adjustments to the structure of a worksheet or while Figure 8–17 you modify other values in the worksheet. To remove a watch, select the watched cell in the Watch Window and then click the Delete Watch button on the Watch Window toolbar. Other Ways 1. ALT+M, W
C6479_08_CTP.4c.indd 642
8/6/07 8:12:16 AM
To Use Trial and Error to Attempt to Solve a Complex Problem Plan Ahead
Propose strategies for solving a complex problem. When considering an approach to a complex problem in Excel, start with the least complex method of attempting to solve the problem. In general, the following methods can be useful in the order shown:
Excel Chapter 8
Data Validation, Trial and Error, and Goal Seek EX 643
1. Use trial and error to modify the input, or changing, values in the worksheet. Use a common sense approach and keep in mind the range of acceptable answers to your problem. For example, the number of bags filled by a machine in this chapter should not be a negative number. 2. Use Excel’s Goal Seek feature to have Excel automatically modify a cell’s value in a worksheet in an attempt to reach a certain goal in a dependent cell. 3. Use Excel’s Solver feature to provide Excel with all of the known rules, or constraints, of your problem as well as the goal you are seeking. Allow Solver to attempt as many different solutions to your problem as possible.
As previously discussed, trial and error refers to the practice of adjusting cells in a worksheet manually to try to find a solution to a problem. In the Order Optimization worksheet, you could adjust cells in the ranges B8:B10, C8:C9, and D8 until the criteria for the order are met. Because many combinations of possible values exist, you could try keeping one or two of the values constant while adjusting the others. Trial and error is more than just guessing. Because you understand the constraints on the problem and the goals, you can use logic to make subsequent trials better than the previous ones. For example, if you increase the number of bags filled on Machine 1 by 500 and it causes the total minutes for Machine 1 to exceed 120 minutes, you instead may try to increase the number of bags filled by 100 to see if that keeps the total minutes within the 120-minute constraint. The following steps illustrate the process of using trial and error to attempt to solve a complex problem.
1 • If necessary, resize the Watch Window so that only the cell watches appear as shown in Figure 8–18.
• Click cell B8 and type
Q&A
82.5 as the number of retail-sized bags to fill on Machine 1 and then press the ENTER key (Figure 8–18). What is the result of entering 82.5 in cell B8?
watched cell values automatically updated
Input Error dialog box error message
Excel displays the Input Error dialog Retry button box because 82.5 is not a whole number ScreenTip displays input message because cell B8 and thus is not a valid is selected entry in this cell. The Bags to Fill ScreenTip Figure 8–18 is displayed because cell B8 is selected. The Watch Window displays the updated values of the watched cells as Excel changes the values in the cells.
C6479_08_CTP.4c.indd 643
8/6/07 8:12:19 AM
EX 644 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
2 • Click the Retry button.
• Type 700 as the number of retailsized bags to fill on Machine 1 in cell B9.
• Click cell B10 and type 95 as the number of industrial-sized bags to fill on Machine 1.
values in cells B9, B10, and D8 changed
• Click cell D8 and type 1500 as the number of consumer-sized bags to fill on Machine 3 and then press the ENTER key to display the new values and update the totals in the range B12:D13 and column E (Figure 8–19).
total minutes for Machine 3 exceeds constraint
total minutes for each machine
total number of each bag type
total cost for order
Figure 8–19
C6479_08_CTP.4c.indd 644
8/6/07 8:12:23 AM
3 • Click cell B8 and type 1500 as the number of consumersized bags to fill on Machine 1.
Excel Chapter 8
Data Validation, Trial and Error, and Goal Seek EX 645
• Click cell D8, type
Q&A
0 as the number of consumer-sized bags to fill on Machine 3, and then press the ENTER key. Select cell E19 (Figure 8–20). What are some problems with using trail and error?
value in cell B8 changed from 0 to 1500
total bags meet constraints
While trial and error can be used on simple problems, it has many limitations when used value in cell D8 to solve complex changed from 1500 to 0 problems. The Order total minutes for Machine 1 exceed Optimization workconstraint sheet has six cells (B8, B9, B10, C8, C9, and D8) that can be Figure 8–20 adjusted to solve the problem. Because each cell can contain a value greater than or equal to zero, you could try many different combinations of values that result in the proper minutes and number of bags to fill in the order. Using trial and error, it is difficult to determine if the total order cost has been minimized.
To Use the Goal Seek Command to Attempt to Solve a Complex Problem If you know the result you want a formula to produce, you can use goal seeking to determine the value of a cell on which a formula depends. Goal seeking takes trial and error one step further by automatically changing the value of a cell until a single criterion is met in another cell. In this case, suppose you suspect that by varying the number of retail-sized bags filled on Machine 1, you can achieve the goal of 120 minutes for the order on Machine 1. In doing this, you hope that the other constraints of the problem also are satisfied. The following steps show how Goal Seek can be used to alter the number of retail-sized bags filled on Machine 1 to keep the total minutes used on Machine 1 at less than or equal to 120 minutes.
C6479_08_CTP.4c.indd 645
8/6/07 8:12:27 AM
EX 646 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
1 • Click the Data tab
Data tab What-If Analysis button
on the Ribbon and then click the WhatIf Analysis button on the Ribbon to display the What-If Analysis menu (Figure 8–21).
What-If Analysis menu
Goal Seek command
Figure 8–21
2 • Click Goal Seek to display the Goal Seek dialog box.
3 • Type $B$12 in the Set cell text box.
Goal Seek dialog box
• Click the To value
seek goal for this cell
text box.
• Type 120 and then click the ‘By changing cell’ text box.
goal is 120 minutes
• Click cell B9 on the worksheet.
OK button
value in cell B9 to be changed to reach goal of 120 in cell B12
• If necessary, move
marquee surrounds cell B9, indicating it is the cell to change to reach the goal of 120 in cell B12
the Goal Seek dialog box (Figure 8–22).
Figure 8–22
C6479_08_CTP.4c.indd 646
8/6/07 8:12:28 AM
4 • Click the OK button to seek the goal of 120 minutes in cell B12 (Figure 8–23).
Excel Chapter 8
Data Validation, Trial and Error, and Goal Seek EX 647
5 • Click the OK button to close the Goal Seek Status dialog box and display the updated worksheet.
Q&A
• Click cell E19 to deselect cell B12. What are some problems with using goal seeking?
number of bags in total does not meet requirements Goal Seek Status dialog box
Excel indicates it has found a solution
value changes to –515
goal met for number of minutes
Goal seeking assumes you can change the value of only one cell referenced directly or OK button indirectly to reach a Target value and desired goal. In this Current value agree example, to change the total number of minutes used on Machine 1 to 120 minutes, the number of retailsized bags to fill on Machine 1 is changed to –515. Figure 8–23 While mathematically correct, the solution contradicts the order constraints as stated in the requirements document and is illogical (the company cannot fill a negative number of bags).
total cost
Other Ways 1. Press ALT+A, W, G
To Circle Invalid Data and Clear Validation Circles The situation resulting from using Goal Seek on the Order Optimization worksheet illustrates the fact that the data validation rules of the cell apply only when a user types a value directly into the cell. Because some techniques, such as Goal Seek, can violate data validation rules, it is good practice to ensure periodically that the values of cells in a worksheet are following data validation rules. The Circle Invalid Data command on the Data Validation menu places a red validation circle around any cells containing values that violate the data validation rules. The following steps circle the invalid data on the Order Optimization worksheet and then clear the validation circles.
C6479_08_CTP.4c.indd 647
8/6/07 8:12:32 AM
EX 648 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
1 • Click the Data
Data Validation button arrow
Validation button arrow on the Ribbon to display the Data Validation menu. Watch Window Close button
• Click Circle Invalid
Q&A
Data on the Data Validation menu to place a red validation circle around cell B9 (Figure 8–24). Has the problem been solved? No. At this point, the total minutes for circle indicates invalid data Machine 1 are within order constraints, but the total retailsized bags needed for the order are not met. Even if all order constraints were met, you still have no way of knowing whether the goal to minimize cost (cell E13) has been achieved. The requirements state Figure 8–24 that total cost be minimized while satisfying the number of bags filled and minutes limitations of the order. Surely, other combinations of filling bags on machines satisfy the order requirements while producing a lower total cost.
2 • Click the Data Validation button arrow on the Ribbon to display the Data Validation menu. • Click Clear Validation Circles on the Data Validation menu to clear the red validation circles. • If necessary, select cell E19. • Click the Close button on the Watch Window title bar to close the Watch Window. Other Ways 1. ALT+A, V, I
Using Solver to Solve Complex Problems Solver allows you to solve complex problems where a number of variables can be changed in a worksheet in order to meet a goal in a particular cell. As previously noted, goal seeking allows you to change only one cell, while trial and error requires too much uncertainty and time to solve complex problems adequately.
C6479_08_CTP.4c.indd 648
8/6/07 8:12:34 AM
Solver uses a technique called linear programming to solve problems. Linear programming is a complex mathematical process used to solve problems that include multiple variables and the minimizing or maximizing of result values. Solver essentially tries as many possible combinations of solutions as it can. On each attempt to solve the problem, Solver checks to see if it has found a solution. Figure 8–25a shows the result of using Solver on the Order Optimization worksheet. Cells in the ranges B8:B10, C8:C9, and D8 are called the changing cells. Changing cells, or adjustable cells, are the cells modified by Solver to solve the problem. The total cost in cell E13 serves as the target cell, which means that Solver will attempt to meet some criteria (lowest cost) in this cell by varying the changing cells. Constraints are the requirements that have been placed on certain values in the problem. For example, the total number of consumer-sized bags should be greater than or equal to 1500 (cell B17), and the total number of minutes required by each machine should not exceed 120 minutes (cell B16).
Excel Chapter 8
Using Solver to Solve Complex Problems EX 649
Solver solution shown in the range B8:D10
constraints satisfied
cost minimized
Figure 8–25 (a) Result of Using Solver
C6479_08_CTP.4c.indd 649
8/6/07 8:12:36 AM
EX 650 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
Figure 8–25b shows a Solver Answer Report. As previously discussed, an Answer Report is a worksheet that shows the results of a Solver calculation in a concise format, showing the answer that Solver found, the values that Solver manipulated to find the answer, and the constraints that were used to solve the problem. The report satisfies the requirement to document the results of the order optimization, as shown in Figure 8–2 on page EX 630.
target cell is total cost
cells adjusted by Solver
constraints
Figure 8–25 (b) Solver Answer Report
C6479_08_CTP.4c.indd 650
8/6/07 8:12:38 AM
To Use Solver to Find the Optimal Solution to a Complex Problem The Data tab on the Ribbon includes the Solver button, which starts Solver. Note: If the Solver button does not appear on the Data tab, then you must use the Add-Ins page in the Excel Options dialog box to add it.
Excel Chapter 8
Using Solver to Solve Complex Problems EX 651
The cell that is the target for Solver is cell E13, which contains the total cost for the order. The goal is to minimize the value in that cell. The cells that can be changed by Solver to accomplish this goal are cells in the ranges B8:B10, C8:C9, and D8, which contain the number of bags to fill on each machine. The constraints are summarized in Table 8–2. Table 8–2 Constraints for Solver Cell or Range
Operator
Constraint
B8:B10
>=
0
B8:B10
int
E8
>=
B17
C8:C9
>=
0
C8:C9
int
D8
>=
0
D8
int
E9
>=
B18
E10
>=
B19
B12
<=
B16
C12
<=
B16
D12
<=
B16
The following steps show how to use Solver to find the optimal solution to solve the Order Optimization worksheet within the given constraints.
1 • If necessary, click
Solver button
Data tab
the Data tab on the Ribbon (Figure 8–26).
Figure 8–26
C6479_08_CTP.4c.indd 651
8/6/07 8:12:39 AM
EX 652 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
2 • Click the Solver button on the Ribbon to display the Solver Parameters dialog box.
Solver to minimize value in cell E13 (Total_Cost) Solver Parameters dialog box
• When Excel displays
cell E13 (Total_Cost) is target cell Collapse Dialog button
the Solver Parameters dialog box, click cell E13 to set the target cell to the name of cell E13, Total_Cost.
• Click Min in the Equal To area.
• Click the
change cells in ranges B8:B10, C8:C9, and D8
Collapse Dialog button in the By Changing Cells area to minimize the Solver Parameters dialog box.
constraints will show here once they are entered
Add button adds constraints target cell is cell E13
Figure 8–27
• Click the By Changing
marquee surrounds selected cells (some hidden)
Cells box and then select the range B8:B10.
• Hold down the CTRL key and then select the ranges C8:C9 and D8. • Click the Expand Dialog button on the right side of the minimized Solver Parameters dialog box to maximize it (Figure 8–27).
3 • Click the Add button to display the Add Constraint dialog box.
Add Constraint dialog box
greater than or equal to operator
• If necessary, move the Add
constraint is 0
Constraint dialog box so that the range B8:B10 is visible.
• Select the range B8:B10 to set the value of the Cell Reference box.
• Click the middle box arrow and
constraint is on range B8:B10
Add button
then select >= in the list.
• Type 0 in the Constraint box
Q&A
(Figure 8–28) to set the constraint on the cells in the range B8:B10 to be greater than or equal to 0. How is the Constraint box used? When adding constraints, as shown in Figure 8–28, Solver Figure 8–28 allows you to enter a cell reference followed by an operator. If the operator is <=, >=, or =, then you enter the constraint value in the Constraint box. The constraint can be a value or a cell reference. Other valid operators are int, for an integer value, or bin, for cells that contain only one of two values, such as yes/no or true/false.
C6479_08_CTP.4c.indd 652
8/6/07 8:12:41 AM
4 • Click the Add button.
• Select the range
Excel Chapter 8
Using Solver to Solve Complex Problems EX 653
B8:B10 to set the value of the Cell Reference box.
• Click the middle box arrow and then select int in the list to set a constraint on the cells in the range B8:B10 to be assigned only integer values (Figure 8–29).
constraint is on range B8:B10
value must be integer
automatically displays as integer when you choose int in middle box
OK button
Add button
Figure 8–29
5 • Click the Add button.
• Click cell E8 to set the value of the Cell Reference box.
• Click the middle box arrow and then select >= in the list.
greater than or equal to operator
• Click the Constraint box and then click cell B17 to add a constraint to cell E8 indicating that its value must be greater than or equal to the value in cell B17 (Figure 8–30).
constraint is on cell E8 Add button
Figure 8–30
C6479_08_CTP.4c.indd 653
8/6/07 8:12:45 AM
EX 654 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
6 • Click the Add button.
• Enter the remaining constraints shown in Table 8–2 on page EX 651, beginning with the constraints for the range C8:C9.
• When finished
Q&A
with the final constraint, click the OK button in the Add Constraint dialog box to close it (Figure 8–31).
Solver Parameters dialog box
Solve button Guess button
all constraints appear in list
Options button Change button
What is the purpose of the Guess button? Rather than selecting Delete button the ranges B8:B10, C8:C9, and D8 as the changing cells in Figure 8–31 Step 2, clicking the Guess button in the Solver Parameters dialog box (Figure 8–31) instructs Solver to try to determine which cells affect the target cell. The button works in much the same way as the Trace Precedents button on the Formulas tab on the Ribbon. Solver searches the formula in the target cell to determine which cells are precedents of the target cell and then automatically adds these cells to the By Changing Cells box. The Guess button is not always accurate, however, which then requires you to change the cells selected by Solver.
7 • Click the Options button.
• When Excel displays the Solver Options dialog box, click Assume Linear Model (Figure 8–32).
Solver Options dialog box OK button
available Solver parameters Load Model button Save Model button Assume Linear Model check box selected
Figure 8–32
C6479_08_CTP.4c.indd 654
8/6/07 8:12:48 AM
8 • Click the OK button. • Click the Solve
Solver Results dialog box
Q&A
button in the Solver Parameters dialog box to display the Solver Results dialog box, indicating that Solver found a solution to the problem (Figure 8–33).
Excel indicates Solver found solution
Excel Chapter 8
Using Solver to Solve Complex Problems EX 655
Reports list
Why does the answer found for cell E8 exceed the limit of 1,500 consumer-sized bags?
Save Scenario button
The limitations placed on Solver allowed for a small degree in error (Figure 8–32 on page EX 654). If no degree of error or uncertainly is allowed, then Solver may never find Figure 8–33 an exact solution. Spreadsheet specialists, therefore, often allow Solver some degree of error, and the default values shown in Figure 8–32 reflect the need to allow for some error. If this degree of uncertainty was not allowed, Solver might take an extremely long time to find a solution.
9 • Click Answer in the Reports list (Figure 8–34).
option buttons to keep solution or restore to original values
Answer selected
OK button
Figure 8–34
C6479_08_CTP.4c.indd 655
8/6/07 8:12:51 AM
EX 656 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
10 • Click the OK button
Q&A
to display the values found by Solver and the newly recalculated totals (Figure 8–35). What is the result of using Solver? Figure 8–35 shows that all of the constraints in the problem have been satisfied. The cost for the order is $757.94, which is the only solution thus far that both meets the constraints and minimizes cost.
Solver solution
constraints satisfied
cost minimized
Answer Report 1 worksheet created in workbook
Other Ways
Figure 8–35
BTW
1. Press ALT+A, Y, 2
Solver Models A model is a collection of the data in the target cell, changing cells, and constraints. When you save a model, Excel does not save the solution itself. The solution can be saved separately by using the Save Scenario button in the Solver Results dialog box shown in Figure 8–34 on page EX 655. When you save a model, the data is saved in an area you select in a worksheet. You should note carefully where you save a model, because Excel does not label or mark the model in any way.
C6479_08_CTP.4c.indd 656
Working with Solver Options The Solver Options dialog box in Figure 8–32 contains several technical parameters that allow you to configure the inner workings of Solver. Many of these parameters are beyond the scope of this discussion. Usually, you already have the information for a problem that lets you determine which parameters you need to vary to determine a solution. Table 8–3 shows the meaning of some of the more commonly used Solver parameters.
8/6/07 8:12:53 AM
Max Time
The total time that Solver should spend trying different solutions, expressed in seconds.
Iterations
The number of different combinations of possible answer values that Solver should try.
Tolerance
Instructs Solver how close it must come to the target value in order to consider the problem to be solved. For example, if the target value is 100 and the Tolerance is 5%, then 95 is an acceptable answer.
Assume Linear Model
If selected, assume that this problem is linear in nature. That is, the changing values have a proportional effect on the value of the target cell.
Assume Nonnegative
If selected, for all changing cells that do not have constraints on them, Solver should keep these numbers positive.
Excel automatically saves the most recently used Solver parameters and options. Excel also allows you to save the current target cell, changing cells, constraint values, and option values for Solver, so that you can try using new values and then reuse the previous values. To do so, clicking the Save Model button and Load Model button in the Solver Options dialog box (Figure 8–32 on page EX 654) allows you to save the values and then reuse them in the future. The Save Model button saves the target cell, changing cells, constraint values, and all of the option values in the Solver Options dialog box to a range of cells that you specify when you click the Save Model button. When you click the Load Model button, Excel prompts you to select the range where you previously saved a model. By saving models, you can tweak the Solver parameters and options without remembering or writing down the values you have tried. The Save Scenario button shown in Figure 8–33 on page EX 655 allows you to save a Solver solution in a separate area in your workbook. Scenarios are discussed in detail later in this chapter. When using Solver, three other issues must be kept in mind. First, some problems do not have solutions. The constraints may be constructed in such a way that an answer that satisfies all of the constraints cannot be found. Second, sometimes multiple answers solve the same problem. Solver does not indicate when this is the case, and you will have to use your own judgment to determine if this is the case. As long as you are confident that you have given Solver all of the constraints for a problem, however, all answers should be equally valid. Finally, Solver may require more time or iterations to solve the problem if it fails to find a solution.
C6479_08_CTP.4c.indd 657
BTW
Meaning
Solver Scenarios When you click the Save Scenario button in the Solver Results dialog box, Solver creates a record of the values of the changing cells that solved the problem. You can name this result and then be able to recall it in the future. It is important to note that the target cell value is not changed, just the changing cells’ values.
BTW
Parameter
Other Solver Reports The Sensitivity Report shows how sensitive the Solver solution is to changes in the constraints and the target cell. The Limits Report shows the upper and lower values that the changing cells can have and still solve the problem given the constraints. Both of these reports are generated as separate worksheets in the current workbook, the same way the Answer Report is.
BTW
Table 8–3 Commonly Used Solver Parameters in the Solver Options Dialog Box
Slack Values The slack value in the answer report tells you where you may have some flexibility in the answer that Solver has found. The less slack that a changing cell has, the less you can change it and still meet the constraints of the problem. Slack tells you where you still have options in the Solver answer.
Excel Chapter 8
Using Solver to Solve Complex Problems EX 657
8/6/07 8:12:55 AM
EX 658 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
To View the Solver Answer Report for Order 1 As shown in Figure 8–35, Solver automatically creates an Answer Report on a separate worksheet after it finds a solution. The Solver Answer Report summarizes the problem that you have presented to Solver. It shows the original and final values of the target cell along with the original and final values of the changing cells (adjustable cells) that Solver adjusted to find the answer. Additionally, it lists all of the constraints that you imposed on Solver. The Answer Report documents that a particular problem has been solved correctly. Because it lists all of the relevant information in a concise format, you can use the Answer Report to make certain that you have entered all of the constraints and allowed Solver to vary all the cells necessary to solve the problem. You also can use the report to reconstruct the Solver model in the future. The following steps view the Solver Answer Report.
1 • Click the Answer Report 1 tab at the bottom of the Excel window to display the Solver Answer Report (Figure 8–36).
values for target cell
values for adjustable cells
Answer Report 1 tab
Figure 8–36
C6479_08_CTP.4c.indd 658
8/6/07 8:12:56 AM
2 • Drag the Answer Report 1 tab to the right of the Order Optimization tab.
Status column
• Double-click the
Slack column
Answer Report 1 tab and type Optimal Schedule Answer Answer Report Report1 as the worksheet name.
scrolling down shows Order 1 constraints scroll bar
• Click cell A1. Right-click the Optimal Schedule Answer Report1 tab and then point to Tab Color on the shortcut menu.
• Click Dark Teal, Text 2
Excel Chapter 8
Saving the Workbook with Passwords EX 659
sheet renamed Optimal Schedule Answer Report1, tab moved, and tab color changed
Order Optimization tab
(column 4, row 1).
Figure 8–37
What is shown in the Answer Report? Figure 8–37 shows additional information about the constraints that you placed on the problem and how the constraints were used to solve the problem. Column F, the Status column, indicates whether the constraint was binding or not. A constraint that is binding is one that limited the final solution in some way. For example, the total number of retail-sized bags filled in cell E9 is binding because the solution found the minimum number required by the constraints, which is 700 bags. No fewer bags could be filled given the constraints. A constraint that is not binding is one that was not a limiting factor in the solution that Solver provided.
Saving the Workbook with Passwords Excel allows you to protect your data at the worksheet level, workbook level, and file level. At the worksheet level, you protect cells. At the workbook level, you protect the Excel window. Both of these levels of protection are available on the Review tab on the Ribbon as described in Chapter 7. The highest level of protection is file protection. File protection lets you assign a workbook one password for users who are allowed to view the workbook and a second password for users who are permitted to modify the workbook. Recall that, in Excel, a password is case sensitive and can be up to 15 characters long. File protection is performed when Excel saves a workbook. Even though you are the workbook creator, you will be prompted for the passwords when you open the workbook later. The following steps save the workbook with passwords to enable file protection.
C6479_08_CTP.4c.indd 659
BTW
Q&A
• Scroll down to view the remaining cells of the Answer Report (Figure 8–37).
File Protection Once you have protected your workbook with a password, it is important to write the password down or memorize it for future reference. Once you have saved the file with a password, it always will be a password-protected file; no way exists to bypass the requirement for a password.
8/6/07 8:12:58 AM
EX 660 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
To Save the Workbook with Passwords 1 • Click the Order
Save As dialog box
Optimization tab at the bottom of the window.
UDISK 2.0 (E:) selected
• Click the Office Button and then click Save As.
• Click the Tools button in the Save As dialog box (Figure 8–38).
file name is Perfected Packaging2
Tools button
Tools menu General Options command
Figure 8–38
2 • Click General Options on the Tools menu to display the General Options dialog box.
General Options dialog box
• Type mincost in the ‘Password to open’ text box.
• Type mincost in
Q&A
the ‘Password to modify’ text box (Figure 8–39). Why does Excel display bullets for the password?
password to open entered password to modify entered
Read-only recommended check box
OK button
Excel displays bullets in place of the password, mincost, in both instances, so that no one is able to see the password you typed. Figure 8–39
C6479_08_CTP.4c.indd 660
8/6/07 8:12:59 AM
3 • Click the OK button. • When Excel displays the Confirm Password dialog box, type mincost in the ‘Reenter password to proceed’ text box (Figure 8–40).
Excel Chapter 8
Saving the Workbook with Passwords EX 661
Confirm Password dialog box
password to open reentered
OK button
Figure 8–40
4 • Click the OK button. • When Excel displays the Confirm Password dialog box, type mincost in the ‘Reenter password to modify’ text box (Figure 8–41). password to modify reentered
OK button
Figure 8–41
C6479_08_CTP.4c.indd 661
8/6/07 8:13:02 AM
EX 662 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
5 • Click the OK button (Figure 8–42).
6 • Click the Save button
Q&A
in the Save As dialog box to save the file to the UDISK 2.0 (E:) drive with the file name, Perfected Packaging2. If the Microsoft Office Excel dialog box appears, click the OK button to close it. What is the result of using file protection?
BTW
When a user opens the workbook, Excel will prompt for a password to open the workbook. If the user enters the correct password, Excel prompts for the password to Save button modify the workbook. At this point, the user can enter Figure 8–42 the correct password or choose to open the workbook as read-only, meaning that the user can view the contents of the workbook, but cannot modify it. The Readonly recommended check box shown in Figure 8–39 allows you to notify users who open your workbook that it is best to open the workbook as read-only.
Read-Only Workbooks You can save a file and recommend read-only access to others who open the worksheet. This, however, is not a guarantee that the users will follow the recommendation. To ensure that the worksheet truly is read-only, you must use a file password and keep the password to yourself.
Using Scenario Manager to Analyze Data Excel’s Scenario Manager allows you to record and save different sets of what-if assumptions (data values) called scenarios. In this chapter, each different order being analyzed can be considered a scenario. For example, an order requiring a maximum of 120 minutes to replicate 1,500 consumer-sized bags, 700 retail-sized bags, and 95 industrial-sized bags makes up a scenario for Order 1. Also, an order requiring a maximum of 200 minutes to replicate 1,400 consumer-sized bags, 1,600 retail-sized bags, and 300 industrial-sized bags makes up a scenario for Order 2. Each set of values in these examples represents a what-if assumption. The primary uses of Scenario Manager are to: 1. Create different scenarios with multiple sets of changing cells 2. Build summary worksheets that contain the different scenarios 3. View the results of each scenario on your worksheet
C6479_08_CTP.4c.indd 662
8/6/07 8:13:05 AM
Plan Ahead
1. Cells that contain sheet title, row heading, or column heading text. These cells will not change among various scenarios that you consider in your worksheet. 2. Cells that include formulas. These cells are considered to be result, or output, cells.
BTW
Consider which cells in the worksheet constitute a scenario. When considering which cells to save in a scenario, you should plan to save as few cells in a scenario as possible. You can first rule out cells with the following three characteristics:
3. Cells that have constant values among various scenarios. For example, in the Order Optimization worksheet, the bags per minute that each machine can fill remains constant for the scenarios that should be considered according to the requirements document in Figure 8–2 on page EX 630. You should include cells that are considered to be input cells for your problem. Consider which cells change among the different situations that you want to consider and which cells contribute to the result you want to obtain. The requirements document in Figure 8–2 states that order constraints change for each order. Cells in the range B16:B19 are, therefore, changing cells for each scenario. Earlier in this chapter, trial and error and goal seeking were used to change cells in the ranges B8:B10, C8:C9, and D8. These are input cells that cause the results, or output, of the problem to change. The cells B8:B10, C8:C9, and D8, therefore, are changing cells for each scenario.
Excel Chapter 8
Using Scenario Manager to Analyze Data EX 663
Scenario Manager Worksheets are used primarily for what-if analysis. You enter values into cells, and instantaneously the results change in the dependent cells. As you continue to change values in the key cells, you lose the previous results. Scenario Manager allows you to store the different sets of values (called scenarios) so you can redisplay them easily. Each scenario can have up to 32 sets of changing cells.
The next section in this chapter shows how to use Scenario Manager for each of the three uses listed above. After you create the scenarios, you can instruct Excel to build the summary worksheets, including a Scenario Summary worksheet and a Scenario PivotTable worksheet.
To Save the Current Data as a Scenario The current data on the worksheet consists of Order 1 constraints and contains the values that correctly solve one problem presented by the first order. These values can be saved as a scenario that can be accessed later or compared side by side with other scenarios. The following steps save the current data for the Order 1 scenario using the Scenario Manager dialog box.
1 • With the Data tab active, click the What-If Analysis button on the Ribbon (Figure 8–43).
What-If Analysis button
What-If Analysis menu
Scenario Manager command
Figure 8–43
C6479_08_CTP.4c.indd 663
8/6/07 8:13:07 AM
EX 664 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
2 • Click Scenario Manager on the What-If Analysis menu to display the Scenario Manager dialog box, which indicates that no scenarios are defined (Figure 8–44).
Scenario Manager dialog box Add button
no scenarios are defined
Figure 8–44
3 • Click the Add button.
• When Excel displays the Add Scenario dialog box, type Order 1 in the Scenario name text box (Figure 8–45).
Add Scenario dialog box
name of scenario
Collapse Dialog button
selected cell E19 automatically added to Changing cells box
comment text automatically added
Figure 8–45
C6479_08_CTP.4c.indd 664
8/6/07 8:13:09 AM
4 • Click the Collapse Dialog button. • When Excel displays the Add Scenario - Changing cells dialog box, select the range B8:B10, hold down the CTRL key, and then select the ranges C8:C9, D8, and B16:B19.
Add Scenario dialog box is collapsed
• Release the CTRL key to display a
Excel Chapter 8
Using Scenario Manager to Analyze Data EX 665
Expand Dialog button
marquee around the selected cells and assign the cells to the Changing cells text box (Figure 8–46).
changing cells selected
Figure 8–46
5 • Click the Expand Dialog button to change the Add Scenario dialog box to the Edit Scenario dialog box (Figure 8–47).
Edit Scenario dialog box
changing cells specified
OK button
Figure 8–47
C6479_08_CTP.4c.indd 665
8/6/07 8:13:12 AM
EX 666 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
6 • Click the OK button
Scenario Values dialog box
Q&A
(Figure 8–48). What does Excel display in the list?
Q&A
The selected cell names appear in a numbered list with their current values (Figure 8–48). Because names were assigned to these cells when the worksheet was created, the cell names, rather than cell references, appear in the numbered list.
first 5 of 12 scenario values
cell names appear in list
OK button
scroll down to view more values
Figure 8–48
What can I do with the scenario? After the scenario has been saved, you can recall it at any time using Scenario Manager. In Figure 8–48, the values of the changing cells in the Scenario Values dialog box are defaulted to the current values in the worksheet. By changing the text boxes next to the cell names, you can save the scenario using values different than the current values.
7 • Click the OK button
Scenario Manager dialog box
scenario name
to display the Order 1 scenario in the Scenarios list (Figure 8–49).
8 • Click the Close button in the Scenario Manager dialog box.
ranges of changing cells
Close button
Other Ways
Figure 8–49
1. Press ALT+A, W, S
To Add the Data for a New Scenario After the Order 1 scenario is saved, you can enter the data for the Order 2 scenario directly in the worksheet and then use Solver to solve the Order 2 scenario (Figure 8–50a) in the same way that you solved the Order 1 scenario. The same constraints apply for both scenarios, so Solver does not require you to reenter all of the constraints. The Answer Report (Figure 8–50b) meets the requirement that you create supporting documentation for your answer. After solving the Order 2 scenario, you should save the scenario, just as you saved the Order 1 scenario.
C6479_08_CTP.4c.indd 666
8/6/07 8:13:14 AM
(a) Results of Using Solver with Second Order
Excel Chapter 8
Using Scenario Manager to Analyze Data EX 667
Solver solution is shown in the range B8:E10
cost minimized constraints satisfied
target cell is total cost
cells adjusted by Solver
constraints
(b) Solver Answer Report for Second Order Figure 8–50
C6479_08_CTP.4c.indd 667
8/6/07 8:13:17 AM
EX 668 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
The order constraints for Order 2 are that the order must be completed within 200 minutes and include 1,400 consumer-sized bags, 1,600 retail-sized bags, and 300 industrial-sized bags. These values must be entered into the appropriate cells before you can use Solver. The following step adds the data for a new scenario.
1 • Click cell B16 and type 200 as the maximum minutes for the order.
• Click cell B17 and type 1400 as the number of consumer-sized bags.
• Click cell B18 and type 1600 as the number of retail-sized bags.
• Click cell B19, type 300 as the number of industrial-sized bags, and then click cell E19 (Figure 8–51).
values for Order 2 entered
BTW
Figure 8–51
New Scenarios When you are beginning to create scenarios in a worksheet, a few guidelines can help in organizing the data. First, create a base scenario that contains the original values of the worksheet. Second, name the cells that will be changing cells and result cells, as was done in the worksheet in this project. Finally, if you plan to save different types of scenarios in a worksheet (that is, different changing cells), use a naming convention for the scenarios that will help you remember which scenario contains which set of changing cells.
C6479_08_CTP.4c.indd 668
8/6/07 8:13:20 AM
To Use Solver to Find a New Solution Next, Solver must be used to find a new solution to determine the optimal combination of bags and machines that satisfies the constraints and minimizes cost for Order 2. As was true of the Order 1 scenario, the Order 2 scenario must be solved before saving it as a scenario. Figure 8–51 shows that the total number of bags for the order in the range E8:E10 does not satisfy order constraints for Order 2. It is unknown whether a possible solution to the problem even exists. Solver must be used to make this determination, as shown in the following steps.
1 • Click the Solver
Excel Chapter 8
Using Scenario Manager to Analyze Data EX 669
Solver button
button on the Data tab on the Ribbon to display the Solver Parameters dialog box with the target cell, changing cells, and constraints used with Order 1 (Figure 8–52).
Solver Parameters dialog box
Solver displays ranges entered earlier for Order 1 scenario Solve button
Solver displays same constraints as entered earlier for Order 1 scenario
Figure 8–52
2 • Click the Solve
Solver Results dialog box
button to solve the problem using Solver.
• Click Answer in the Reports list (Figure 8–53).
Keep Solver Solution option button selected
Answer selected in Reports list
OK button
Figure 8–53
C6479_08_CTP.4c.indd 669
8/6/07 8:13:21 AM
EX 670 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
3 • Click the OK button
Q&A
to display the values found by Solver (Figure 8–54). What did Solver accomplish? As shown in Figure 8–54, Solver found a solution that satisfies all of the constraints and minimizes cost. With Order 1, the order breakdown was 288 consumer-sized bags, 697 retailsized bags, and 95 industrial-sized bags on Machine 1; cost 493 consumer-sized minimized bags and 3 retailsized bags on constraints satisfied Machine 2; and 720 consumer-sized bags on Machine 3 Solver solution with Order 2 (Figure 8–35 on constraints page EX 656). With Order 2, the order breakdown is 200 consumer-sized bags, 1300 retailAnswer Report 1 worksheet created sized bags, and in workbook 300 industrial-sized Figure 8–54 bags on Machine 1; 300 retail-sized bags on Machine 2; and 1200 consumer-sized bags on Machine 3 (Figure 8–54). The cost for Order 1 was $757.94. The cost for Order 2 is $1,075.14. Other Ways 1. Press ALT+A, Y, 2
C6479_08_CTP.4c.indd 670
8/6/07 8:13:24 AM
To View the Solver Answer Report for Order 2 The next step is to view the Answer Report for the Order 2 solution that will be presented to the company’s management.
1 • Click the Answer
Excel Chapter 8
Using Scenario Manager to Analyze Data EX 671
Report 1 tab at the bottom of the Excel window (Figure 8–55).
values for target cell
values for adjustable cells
Answer Report 1 tab
Figure 8–55
C6479_08_CTP.4c.indd 671
8/6/07 8:13:26 AM
EX 672 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
2 • Drag the Answer Report 1 tab to the right of the Optimal Schedule Answer Report1 tab.
• Double-click the Answer Report 1 tab and type Optimal Schedule Answer Report2 as the worksheet name.
scroll bar
scrolling down shows Order 2 constraints
• Click cell A1. • Right-click the Optimal Schedule Answer Report2 tab and then point to Tab Color on the shortcut menu.
• Click Bright Green, Accent 4 (column 8, row 1).
sheet renamed Optimal Schedule Answer Report2, tab moved, and tab color changed
sheet contains solutions for Order 2
Figure 8–56
• Scroll down to view the remaining cells of the Order 2 Answer Report (Figure 8–56).
To Save the Second Solver Solution as a Scenario The power of Scenario Manager becomes evident when you begin adding scenarios to your worksheet. Multiple scenarios can be compared side by side. Using multiple scenarios on the same worksheet also saves time by reusing the work that you did to create the initial worksheet. The following steps save the second Solver solution as a scenario.
1 • Click the Order Optimization tab at the bottom of the window.
What-If Analysis button
• Click the What-If Analysis button on the Ribbon (Figure 8–57).
What-If Analysis menu
Scenario Manager command
Figure 8–57
C6479_08_CTP.4c.indd 672
8/6/07 8:13:29 AM
2 • Click Scenario Manager on the What-If Analysis menu to display the Scenario Manager dialog box (Figure 8–58).
Scenario Manager dialog box
Order 1 scenario is available to review
Excel Chapter 8
Using Scenario Manager to Analyze Data EX 673
Add button
Figure 8–58
3 • Click the Add button.
• Type Order 2 in the Scenario name text box (Figure 8–59).
Add Scenario dialog box
scenario name changed to Order 2
values from Order 1 scenario display in Changing cells box
OK button
Figure 8–59
C6479_08_CTP.4c.indd 673
8/6/07 8:13:32 AM
EX 674 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
4 • Click the OK button to display the Scenario Values dialog box with the current values from the worksheet (Figure 8–60). Scenario Values dialog box
first 5 of 12 scenario values for Order 2
cell names appear in list OK button
Figure 8–60
5 • Click the OK button to display Order 2 along with Order 1 in the Scenarios list (Figure 8–61).
Scenario Manager dialog box
Q&A
6 • Click the Close button. How can I use the new Order 2 scenario?
two scenarios in list
The Order 2 scenario now can be recalled using Scenario Manager. Figure 8–60 shows the list of changing cells for the scenario. Instead of entering the data in the worksheet, you simply could enter values here to add new scenarios. Because Solver is needed to find a solution to the Order 2 scenario, however, the values were entered on the worksheet first. Close button
Figure 8–61
C6479_08_CTP.4c.indd 674
8/6/07 8:13:34 AM
To Show a Saved Scenario After a scenario is saved, you use the Show button in the Scenario Manager dialog box to view the scenario. The following steps show how to show the Order 1 scenario created earlier in the chapter.
1 • Click the What-If
Excel Chapter 8
Using Scenario Manager to Analyze Data EX 675
What-If Analysis button
Analysis button on the Ribbon (Figure 8–62).
Scenario Manager command
What-If Analysis menu
Figure 8–62
2 • Click Scenario Manager on the What-If Analysis menu.
• If necessary, in the Scenario Manager dialog box, select Order 1 in the Scenarios list (Figure 8–63).
Scenario Manager dialog box
Order 1 selected
Changing cells text box lists ranges of changing cells
Show button Close button
Figure 8–63
C6479_08_CTP.4c.indd 675
8/6/07 8:13:37 AM
EX 676 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
3 • Click the Show
Q&A
button and then click the Close button to display the data for the Order 1 scenario in the worksheet (Figure 8–64). What can I do to view the worksheet with the previous data? You can undo showing the Order 1 scenario results by clicking the Undo button on the Quick Access Toolbar. If desired, you then can click the Redo button on the Quick Access Toolbar to show the Order 1 scenario results again. If you had several saved scenarios, you could view each one and then use the Undo and Redo buttons to switch between them.
Figure 8–64
Other Ways
BTW
1. Press ALT+A, W, S, double-click scenario name
Showing Scenarios You can add a list of scenarios to the Quick Access Toolbar by using the More Commands command on the Customize Quick Access Toolbar menu. Click the Customize Quick Access Toolbar button and then click More Commands. Add the Scenarios command in the ‘Choose commands from’ list and then close the Excel Options dialog box. You then can switch quickly between scenarios on your worksheet.
C6479_08_CTP.4c.indd 676
Summarizing Scenarios This section creates a Scenario Summary worksheet and a Scenario PivotTable worksheet. These concise reports allow you to view and manipulate several what-if situations to assist in decision-making. The Scenario Summary worksheet generated by the Scenario Manager actually is an outlined worksheet (Figure 8–65a) that you can print and manipulate just like any other worksheet. As you learned in Chapter 5, an outlined worksheet is one that contains symbols (buttons) that allow you to collapse and expand rows and columns. The Scenario PivotTable worksheet (Figure 8–65b) generated by the Scenario Manager also is a worksheet that you can print and manipulate like other worksheets. A PivotTable is a table that summarizes large amounts of information and can be manipulated to show the data from different points of view. The Scenario PivotTable worksheet allows you to compare the results of scenarios.
8/6/07 8:13:39 AM
Excel Chapter 8
Summarizing Scenarios EX 677
Scenario PivotTable worksheet summarizes results
(b) Scenario PivotTable Worksheet
Excel automatically outlines Scenario Summary worksheet
current values in worksheet
changing values in these columns yields results in rows 17 through 20
outline symbols
cell names appear
results of scenarios
(a) Scenario Summary Worksheet Figure 8–65
C6479_08_CTP.4c.indd 677
8/6/07 8:13:41 AM
EX 678 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
To Create a Scenario Summary Worksheet The Scenario Summary worksheet in Figure 8–65a shows the total hours for each machine and total cost for the current worksheet values and the Order 1 and 2 scenarios. The optimal number of bags to fill on each machine calculated by Solver is shown for both orders. The following steps create a Scenario Summary worksheet.
1 • Click the What-If
What-If Analysis button
Analysis button on the Ribbon (Figure 8–66).
What-If Analysis menu
Scenario Manager command
Figure 8–66
2 • Click Scenario Manager on the What-If Analysis menu to display the Scenario Manager dialog box.
Scenario Manager dialog box
• If necessary, in the Scenario Manager dialog box, select Order 1 (Figure 8–67). Excel will summarize all scenarios in Scenarios list
Summary button
Figure 8–67 Scenario Summary dialog box
3 • Click the Summary button to display the Scenario Summary dialog box (Figure 8–68).
Scenario summary option button selected
values in cells B12:D12 and E13 selected
OK button
Figure 8–68
C6479_08_CTP.4c.indd 678
8/6/07 8:13:44 AM
4 • Click the OK button. • When Excel displays the Scenario Summary, doubleclick the Scenario Summary tab, type Orders Scenario Summary as the new workshow detail sheet name, symbol and then press the ENTER key.
• Right-click
Excel Chapter 8
Summarizing Scenarios EX 679
row and column level symbols
Excel creates worksheet to summarize scenarios
hide
the Orders detail symbol Scenario Summary tab and then point to row level bars Tab Color on the shortcut menu.
• Click Black, Text 1, Lighter 50% (column 2, row 2).
• Drag the Orders
Q&A
Scenario Summary tab to the right of the Optimal Schedule Answer Report2 tab (Figure 8–69). What is shown in the Orders Scenario Summary worksheet?
sheet name changed to Orders Scenario Summary, tab moved, and tab color changed
Figure 8–69
Column D in the Scenario Summary worksheet in Figure 8–69 shows the results of the current values in the Order Optimization worksheet, which is the Order 1 scenario; columns E and F show the results of the two scenarios. The Scenario Summary worksheet makes it easier to compare the results of the scenarios. Other Ways
Working with an Outlined Worksheet As shown in Figure 8–69, Excel automatically outlines the Scenario Summary worksheet. The outline symbols appear above and to the left of the worksheet. As discussed in Chapter 5, you can click the outline symbols to expand or collapse the rows and columns in a worksheet. For example, if you click the show detail symbol, Excel displays additional rows or columns that are summarized on the displayed row or column.
C6479_08_CTP.4c.indd 679
BTW
1. Press ALT+A, W, S, ALT+U, press ENTER key
Outlined Worksheets You can outline any worksheet by using the Auto Outline command on the Group submenu that appears when you click the Group button arrow on the Data tab on the Ribbon.
8/6/07 8:13:47 AM
EX 680 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
If you click a hide detail symbol, Excel hides any detail rows that extend through the length of the corresponding row level bar or column level bar. You also can expand or collapse a worksheet by clicking the row level symbol or column level symbol above and to the left of row title 1. An outline is especially useful when working with large worksheets. To remove an outline, click the Ungroup button arrow on the Data tab on the Ribbon and then click Clear Outline.
To Create a Scenario PivotTable Worksheet Excel also can generate a Scenario PivotTable worksheet to help analyze and compare the results of multiple scenarios. A Scenario PivotTable worksheet gives you the ability to summarize the scenario data and then rotate the table’s row and column titles to obtain different views of the summarized data. The Scenario PivotTable worksheet to be created in this chapter is shown in Figure 8–65b on page EX 677. The table summarizes the Order 1 and Order 2 scenarios and shows the result cells for the two scenarios for easy comparison. PivotTables are powerful data analysis tools because they allow you to view the data in various ways by interchanging or pairing the row and column fields by dragging the buttons located on cells A4 and B1 as shown in Figure 8–65b. The process of rotating the field values around the data fields will be discussed in the next chapter. The following steps create the Scenario PivotTable worksheet shown in Figure 8–65b.
1 • Scroll to the Order Optimization tab and then click the Order Optimization tab at the bottom of the window.
Scenario Manager dialog box
• Click the What-If Analysis button on the Ribbon and then click Scenario Manager to display the Scenario Manager dialog box (Figure 8–70).
• If necessary, when Excel displays the Scenario Manager dialog box, select Order 1.
Summary button
Figure 8–70
C6479_08_CTP.4c.indd 680
8/6/07 8:13:49 AM
2 • Click the Summary button to display the Scenario Summary dialog box.
• In the Scenario
Excel Chapter 8
Summarizing Scenarios EX 681
Scenario Summary dialog box
Summary dialog box, click Scenario PivotTable report in the Report type area (Figure 8–71). Scenario PivotTable report option button selected
these cells used in PivotTable selected because specified last time dialog box was displayed
OK button
Figure 8–71
3 • Click the OK button
changing cell references in column A
Q&A
(Figure 8–72). What if my worksheet appears differently than that shown in Figure 8–72? Excel displays the Scenario PivotTable worksheet with the cell references of the changing values in column A (Figure 8–72). Excel may display the worksheet differently; you also may have to resize the column width of column A if it appears too large. In addition, the worksheet may have cell names instead of cell references in cell A1.
both scenarios are compared
Figure 8–72
C6479_08_CTP.4c.indd 681
8/6/07 8:13:51 AM
EX 682 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
4 • Double-click the
Save button
Scenario PivotTable tab and type Order Scenario PivotTable as the worksheet name.
• Click cell A8. • Right-click the Order Scenario PivotTable tab and then point to Tab Color on the shortcut menu.
results summarized
• Click Lime, Accent 6 (column 10, row 1).
• Drag the tab to the
Q&A
right of the Orders Scenario Summary tab (Figure 8–73). How can I use the PivotTable?
sheet name changed to Order Scenario PivotTable, tab moved, and tab color changed
After the PivotTable is created, you can treat it like any other worksheet. Thus, you can print or chart a PivotTable. If you update the data in Figure 8–73 one of the scenarios, click the Refresh All button on the Data tab on the Ribbon to update the PivotTable. If you show a scenario and merely change values on the scenario worksheet, it is not the same as changing the scenario. If you want to change the data in a scenario, you must use Scenario Manager.
5 • Click the Save button on the Quick Access Toolbar to save the workbook using the file name, Perfected Packaging2. Other Ways 1. Press ALT+A, W, S, ALT+U, ALT+P, press ENTER key
Preparing a Workbook for Distribution
BTW
Excel provides several methods to protect your privacy and/or data that you may not want to share with others. Before distributing your workbook to others, you should consider what type of hidden information may be in your document. In previous chapters, you have learned to hide rows and columns, protect cells, protect worksheets, and protect workbooks. Other types of information may be hidden in a workbook. Excel provides a tool, the Document Inspector, to inspect and report such information. You then easily can remove the hidden information or choose to leave the information in the document. Scenario PivotTables A Scenario PivotTable is a powerful analysis tool for comparing the results of scenarios when the differences and causes of the differences among scenarios are not completely obvious. You can compare scenarios side by side, perform sorts and filters on the values of the result cells, and rotate rows and columns of the table to gain a different perspective on the results.
C6479_08_CTP.4c.indd 682
8/6/07 8:13:53 AM
To Inspect a Document for Hidden and Personal Information
Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
Excel Chapter 8
When distributing a workbook, you also should consider whether the intended recipients have the most recent version of Excel. If this is not the case, Excel allows you to save a workbook for use in previous versions of Excel, such as Excel 97-2003. When you save a workbook in the Excel 97-2003 Workbook file format, Excel will invoke the Compatibility Checker, which notifies you if any of the content of your workbook cannot be saved in that format. Additionally, the Compatibility Checker will inform you if any content will not appear the same, such as cell or chart formatting.
BTW
Preparing a Workbook for Distribution EX 683
The Document Inspector should be used before sharing a workbook publicly or when you believe that you may have left extraneous information in hidden rows and columns, hidden worksheets, document properties, headers and footers, or worksheet comments. The following steps inspect the Perfected Packaging2 workbook for hidden and personal information.
1 • Click the Order
Office Button
Optimization tab at the bottom of the Excel window.
• Click the Office Button and then point to the Prepare command on the Office Button menu (Figure 8–74).
Inspect Document command
Prepare submenu
Prepare command
Figure 8–74
C6479_08_CTP.4c.indd 683
8/6/07 8:13:55 AM
EX 684 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
2 • Click Inspect
Q&A
Document on the Prepare submenu to display the Document Inspector dialog box (Figure 8–75).
Document Inspector dialog box
What is shown in the Document Inspector dialog box? The Document Inspector dialog box allows you to choose which types of content to inspect. content to inspect in workbook Unless you are comfortable with some items not being checked, you typically should leave all of the items selected. In Figure 8–75, the Document Inspector will search the document properties, which may contain your name. You purposefully want your name or other personal information in the document properties, so you may remove the check mark from the Document Properties and Personal Information check box.
C6479_08_CTP.4c.indd 684
Inspect button
Figure 8–75
8/6/07 8:13:57 AM
3 • Click the Inspect
Q&A
button in the Document Inspector dialog box to run the Document Inspector (Figure 8–76).
Document Inspector dialog box
What did the Document Inspector find?
Excel Chapter 8
Preparing a Workbook for Distribution EX 685
Remove All buttons
The Document Inspector found document properties, comments in the scenarios created in this issues found during document inspection chapter, a hidden row in the Scenario PivotTable, and two hidden worksheets. The Remove All button in the dialog box allows you quickly to remove the items found. In many instances, you may Close button want to take notes Figure 8–76 of the results and then investigate and remedy each one separately. In the Perfected Packaging2 workbook, all of these items found by the Document Inspector are expected and do not need to be remedied.
4 • Click the Close button in the Document Inspector dialog box. Other Ways
Information Rights Management Information Rights Management (IRM) is a feature of Excel that allows you to restrict access to workbooks. IRM allows you to restrict who can view, modify, print, forward, and copy a workbook. The types of restrictions include a variety of options. For example, expiration dates for reading or modifying a workbook are available. Before using IRM, your computer first must be configured with IRM, as should the computers of anyone attempting to use a document that includes IRM features. When IRM is installed properly on your computer, the Prepare submenu on the Office Button menu includes the Restrict Permission command. When you click the Restrict Permission command, the Permission dialog box is displayed. The Permission dialog box allows you to set the level of access to your workbook. You can determine who can read and who can change your workbook by selecting users from your address book. You also can select specific users and assign varying levels of permissions to different users of your workbook. For more information about IRM, search Excel Help for Information Rights Management.
C6479_08_CTP.4c.indd 685
BTW
1. Press ALT+F, E, I
Excel Help The best way to become familiar with Excel Help is to use it. Appendix C includes detailed information about Excel Help and exercises that will help you gain confidence in using it.
8/6/07 8:13:58 AM
EX 686 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
To Check Compatibility and Save a Workbook Using the Excel 97-2003 Workbook File Format and Mark a Workbook as Final Often, you will need to save a workbook for use in previous versions of Excel. Because each version of Excel includes varying features, you should determine if the features you use in your workbook are compatible with earlier versions of Excel. Before sharing a workbook with others, you can mark the workbook as being final. By doing so, the workbook becomes read-only. Also, when another user of your workbook opens the workbook, he or she will be notified that you have marked the workbook as final. The following steps check the compatibility of the workbook while saving the workbook in the Excel 97-2003 Workbook file format.
1 • Click the Office
Save As dialog box
Button and then click the Save As button arrow on the Office Button menu to display the Save As submenu.
• Click Excel 97-2003 Workbook on the Save As submenu to display the Save As dialog box (Figure 8–77). Excel 97-2003 Workbook file type automatically selected
Save button
Figure 8–77
2 • Click the Save
Q&A
button in the Save As dialog box to display the Microsoft Office Excel dialog box (Figure 8–78). What is the meaning of the message in the Microsoft Office Excel dialog box?
Microsoft Office Excel dialog box
The message notifies you that a better choice of file No button format may be the Figure 8–78 Office Open XML file format. Because this format is not compatible with Excel 2003, it is not a good choice of file format for the Perfected Packaging2 workbook.
C6479_08_CTP.4c.indd 686
8/6/07 8:14:00 AM
3 • Click the No
Q&A
button in the Microsoft Office Excel dialog box to display the Microsoft Office Excel - Compatibility Checker dialog box (Figure 8–79).
Excel Chapter 8
Preparing a Workbook for Distribution EX 687
Microsoft Office Excel - Compatibility Checker dialog box
What is shown in the Microsoft Office Excel - Compatibility Checker dialog box? The Summary category of issue column of the list of issues shows that specific both the PivotTable issues and the style used to format the PivotTable are not compatible with previous versions of Excel. While the workbook still will Figure 8–79 be saved in the Excel 97-2003 file format, the Orders Scenario PivotTable will not be available.
4 • Click the Continue
Office Button
button in the Microsoft Office Excel - Compatibility Checker dialog box to save the workbook in the Excel 97-2003 Workbook file format.
Prepare submenu
5 • Click the Office Button, point to the Prepare command on the Office Button menu, and then point to the Mark as Final command on the Prepare submenu (Figure 8–80).
Continue button
Mark as Final command
Prepare command
Figure 8–80
C6479_08_CTP.4c.indd 687
8/6/07 8:14:02 AM
EX 688 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
6 • Click Mark as Final to display the Microsoft Excel dialog box (Figure 8–81).
Microsoft Excel dialog box
OK button
message indicates that workbook will be marked as final
Figure 8–81
7 • Click the OK button and then click the OK button if the Compatibility Checker dialog box is displayed to display the Microsoft Office Excel dialog box (Figure 8–82).
8 • Click the OK
Microsoft Office Excel dialog box
button to close the Microsoft Office Excel dialog box.
OK button
Figure 8–82 Other Ways 1. Press ALT+F, A, A, select type in ‘Save as type‘ box, ALT+S
C6479_08_CTP.4c.indd 688
8/6/07 8:14:05 AM
BTW
To Quit Excel The following steps quit Excel.
1
Click the Close button on the right side of the title bar.
2
If Excel displays a Microsoft Office Excel dialog box, click the No button.
Chapter Summary
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential – proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
Excel Chapter 8
Chapter Summary EX 689
In this chapter, you learned how to use a number of techniques to solve problems using Excel, including using trial and error, goal seeking, and Solver; analyze a worksheet using formula auditing techniques; use data validation on cells and inform a user about the validation rules; manage different problems on the same worksheet using Scenario Manager and then summarize the results of the scenarios with a Scenario Summary worksheet and a Scenario PivotTable worksheet; save a workbook file with passwords; prepare a workbook for distribution; and save a workbook for use in a previous version of Excel. The items listed below include all the new Excel skills you have learned in this chapter. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.
Trace Precedents (EX 633) Remove the Precedent Arrows (EX 635) Trace Dependents (EX 636) Remove the Dependent Arrows (EX 637) Add Data Validation to Cells (EX 639) Open the Watch Window and Add Cell Watches (EX 641) Use Trial and Error to Attempt to Solve a Complex Problem (EX 643) Use the Goal Seek Command to Attempt to Solve a Complex Problem (EX 645) Circle Invalid Data and Clear Validation Circles (EX 647) Use Solver to Find the Optimal Solution to a Complex Problem (EX 651) View the Solver Answer Report for Order 1 (EX 658)
12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22.
Save the Workbook with Passwords (EX 660) Save the Current Data as a Scenario (EX 663) Add the Data for a New Scenario (EX 666) Use Solver to Find a New Solution (EX 669) View the Solver Answer Report for Order 2 (EX 671) Save the Second Solver Solution as a Scenario (EX 672) Show a Saved Scenario (EX 675) Create a Scenario Summary Worksheet (EX 678) Create a Scenario PivotTable Worksheet (EX 680) Inspect a Document for Hidden and Personal Information (EX 683) Check Compatibility and Save a Workbook Using the Excel 97-2003 Workbook File Format and Mark a Workbook as Final (EX 686)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this chapter.
C6479_08_CTP.4c.indd 689
8/6/07 8:14:08 AM
EX 690 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
Learn It Online
Instructions: To complete the Learn It Online exercises, start your browser, click the Address bar, and then enter the Web address scsite.com/ex2007/learn. When the Excel 2007 Learn It Online page is displayed, click the link for the exercise you want to complete and then read the instructions.
Chapter Reinforcement TF, MC, and SA A series of true/false, multiple choice, and short answer questions that test your knowledge of the chapter content.
Who Wants To Be a Computer Genius? An interactive game that challenges your knowledge of chapter content in the style of a television quiz show.
Flash Cards An interactive learning environment where you identify chapter key terms associated with displayed definitions.
Wheel of Terms An interactive game that challenges your knowledge of chapter key terms in the style of the television show Wheel of Fortune.
Practice Test A series of multiple choice questions that test your knowledge of chapter content and key terms.
Crossword Puzzle Challenge A crossword puzzle that challenges your knowledge of key terms presented in the chapter.
Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter.
Determining the Product Mix for a Shipment Instructions: LaCrosse Nurseries ships truck loads of shrubs and trees to landscape companies. Follow the steps below to use trial and error and then Solver to find the optimal product mix that should be shipped on a truck that can hold 144 square feet of shrubs and trees based on current product costs and prices. The products available for shipment include shrubs, small trees, and shade trees. The company has up to 32 shrubs, 24 small trees, and 12 shade trees available for delivery at one time. Total profit must be maximized for the shipment. 1. Start Excel, open the workbook Apply 8–1 LaCrosse Nurseries from the Data Files for Students, and then save the workbook using the file name, Apply 8–1 LaCrosse Nurseries Complete. 2. Using trial and error, enter values in cells B8, C8, and D8 to try to solve the problem. 3. Use Solver to find a solution to the problem so that the total profit on the shipment (cell E11) is maximized. Allow Solver to change cells B8, C8, and D8. The total square feet of the items should not exceed 144 square feet. The results in B8, C8, and D8 should be integer values. Add constraints to Solver to constrain the number of shrubs, small trees, and shade trees as noted above. Use the Assume Linear Model option in Solver. 4. Instruct Solver to create the Answer Report for your solution. Solver should find the answer as shown in Figure 8–83.
C6479_08_CTP.4c.indd 690
8 Chapter Excel (1st) 41173 Page 690 06/14/07—ALL
STUDENT ASSIGNMENTS
Learn It Online is a series of online student exercises that test your knowledge of chapter content and key terms.
8/6/07 8:14:09 AM
STUDENT ASSIGNMENTS
5. Trace precedents for cell E12 by clicking the Trace Precedents button on the Formulas tab on the Ribbon three times. Remove the precedent arrows. Trace dependents for cell B8 by clicking the Trace Dependents button on the Formulas tab on the Ribbon three times. Remove the dependent arrows.
Excel Chapter 8
Apply Your Knowledge EX 691
Figure 8–83
6. Use the Watch Window to monitor cells E10:E12. Change values in the range B8:D8 and view changes in the Watch Window. Close the Watch Window. Use the Undo button on the Quick Access Toolbar to change the values in the range B8:D8 to their original values. 7. Change the document properties as specified by your instructor. Add a worksheet header to the original worksheet with your name, course number, and other information requested by your instructor. 8. Save the workbook. Print the worksheet and the Answer Report 1 worksheet. Submit the assignment as specified by your instructor.
C6479_08_CTP.4c.indd 691
8/6/07 8:14:10 AM
EX 692 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
Extend Your Knowledge
STUDENT ASSIGNMENTS
Extend the skills you learned in this chapter and experiment with new skills. You may need to use Help to complete the assignment.
Creating Data Validation Rules Instructions: Start Excel. Open the workbook Extend 8–1 Coastal Rentals Calculator from the Data Files for Students and then save the workbook using the file name Extend 8–1 Coastal Rentals Calculator Complete (Figure 8–84). You have been asked to create data validation rules in an Excel worksheet that calculates rental charges for Coastal Rentals, a company that manages vacation rental properties in Florida and the south Atlantic coast of the United States. Coastal Rentals offers four types of rental properties and rents each type at a different daily rate for a maximum of one week. They also provide services such as child care for an additional daily rate and offer a 10% discount for customers who rent properties in the summer. Perform the following tasks. 1. In cell B4 on the Bill Calculator worksheet, enter a data validation rule that allows users to enter any value. Use Customer Name as the input message title and Enter the customer’s first name. as the input message. Because entering the first name is not required, an error alert is not necessary. Remove the check mark from the ‘Show error alert after invalid data is entered’ check box. 2. In cell B5, enter a data validation rule that requires users to select a property type from a list. Allow users to select the data from a list of property types, which is contained in the range A13:A16. Do not allow users to leave cell B5 blank. Use Property Type as the input message title and Select the type of property the customer rented. as the input message. Because entering the property type is required, choose a Stop style of error alert. Use Invalid Property Type as the error alert title and Select Apartment, Beach House, Condo, or Villa from the list. as the error message. 3. In cell B6, enter a data validation rule that requires users to enter a whole number from 1 to 7 for the number of days the customer rented a property. Do not allow users to leave cell B6 blank. Use Days Rented as the input message title and enter an input message that reminds users to enter the number of nights the customer stayed at the property. Choose an appropriate style of error alert. Use Invalid Entry as the error alert title and enter an error message that instructs users to enter a number from 1 to 7. 4. In cell B7, enter another data validation rule that allows users to select a valid entry from a list of additional services, which are included in cells A20:A22. These are optional services, so you can allow users to leave cell B7 blank. For the input message, use an appropriate title and display text that reminds users to enter the first additional service the customer used. Choose a style of error alert considering that if users enter a service, they must select one of the three services in the list. Enter an appropriate error alert title and an error message that instructs users to select a service from the list. 5. In cell B8, enter a data validation rule that uses the custom formula =AND(B8<>B7,B8<>B9) as its validation criteria to verify that the value entered in cell B8 is not the same as the value in cell B7 or B9. For the input message, use an appropriate title and display text that reminds users to enter the second service the customer used. Choose a style of error alert considering that if users enter a second service, they must enter one of the three services not already entered. Enter an appropriate error alert title and an error message.
C6479_08_CTP.4c.indd 692
8/6/07 8:14:12 AM
7. In cell E14, enter a data validation rule that displays an informational message when users enter a date between 5/28/2010 and 9/2/2010. For the input message, use an appropriate title and display text that reminds users to enter the date the customer arrived. Choose the appropriate style of error alert, error alert title, and error message that reminds users the summer discount applies only from 5/28/10 to 9/2/10. 8. Test the data validation rules by entering the following values in the specified cells. If an error message appears, click the Retry button or the Cancel button and then enter valid data. B4: Darrell B5: Room B6: 24 B7: Child Care
Excel Chapter 8
6. In cell B9, enter a data validation rule that uses a custom formula similar to the one you entered for cell B8. This formula, however, should verify that the value entered in cell B9 is not the same as the value in cell B7 or B8. For the input message, use an appropriate title and display text that reminds users to enter the third service the customer used. Choose an appropriate style of error, error alert title, and error message.
STUDENT ASSIGNMENTS
Extend Your Knowledge EX 693
B8: Tour Coordinator B9: Maid Service E14: 10/1/2010 9. Change the document properties as specified by your instructor. Change the worksheet header with your name, course number, and other information requested by your instructor. 10. Submit the assignment as specified by your instructor.
custom input list input message
Figure 8–84
C6479_08_CTP.4c.indd 693
8/6/07 8:14:12 AM
EX 694 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
Make It Right
STUDENT ASSIGNMENTS
Analyze a workbook and correct all errors and/or improve the design.
C6479_08_CTP.4c.indd 694
1 Correcting Solver Parameters and Options Instructions: Start Excel. Open the workbook Make It Right 8–1 H&D Financial and then save the workbook using the file name, Make It Right 8–1 H&D Financial Complete. The workbook is used to forecast retirement savings over 30 years. In the situation shown in Figure 8–85, suppose a client has $24,500 to start saving for retirement, and that she wants to contribute to a retirement account for 30 years. She estimates that from year 1 to year 20, she will earn 10% interest on the money in the account. After that, she will earn 5%. After her initial deposit in year 1, she will deposit $500 in year 2. Each subsequent year she plans to increase her contribution by $500. Starting in year 26, she will withdraw $100,000 per year. The workbook uses Solver to determine how much she must save each year, starting with year 1. Correct the following problems with formulas, solver parameters, and solver options as shown in Figure 8–85. 1. The formula for the ending balance in column F does not properly include the annual return on investment listed in column E or any withdrawals. Update the formula in the column to correctly include the return and the withdrawals. 2. Click the Solver button on the Data tab on the Ribbon to view the solver parameters for the worksheet. 3. The solver target is set to maximize the first annual contribution in cell C3. The value should be minimized rather than maximized. The changing cells should be set to change cell C3, rather than F3. 4. The constraints set for Solver include two constraints that are not necessary for cells A32 and E32. Delete these two constraints. 5. The constraint on cell F32 is incorrect. The value in this cell should be greater than or equal to $1,000,000. 6. Click the Options button in the Solver Parameters dialog box to display the Solver Options dialog box. Make sure that the Assume Linear Model check box is selected. Click the OK button to close the Solver Options dialog box. Click the Solve button in the Solver Parameters dialog box to run Solver. Create an answer report. 7. Change the document properties as specified by your instructor. Add a worksheet header with your name, course number, and other information requested by your instructor. 8. Print the worksheet, save the workbook, and then quit Excel. 9. Submit the assignment as specified by your instructor.
8/6/07 8:14:14 AM
Excel Chapter 8 STUDENT ASSIGNMENTS
Make It Right EX 695
Figure 8–85
Continued >
C6479_08_CTP.4c.indd 695
8/6/07 8:14:14 AM
EX 696 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
In the Lab
STUDENT ASSIGNMENTS
Create a workbook using the guidelines, concepts, and skills presented in this chapter. Labs are listed in order of increasing difficulty.
Lab 1: Using Goal Seek to Determine Sales Goals Problem: You have been given the task of determining how your small business can make $500 on each of three types of sports caps that the company sells. The workbook is to be distributed to others, including some managers who have an older version of Excel. Instructions: Start Excel and perform the following tasks. 1. Open the Lab 8–1 Forrest Specialty Sports Caps workbook from the Data Files for Students and then save the workbook using the file name, Lab 8–1 Forrest Specialty Sports Complete. 2. Select cell B5 and then click the What-If Analysis button on the Data tab on the Ribbon. Click Goal Seek on the What-If Analysis menu. Set cell B5 to the value 500 by changing cell B4.
Figure 8–86
3. Use Goal Seek on cells B10 and B15 to seek a sales goal of 500 for each of the other types of caps by changing cell B9 and B14 respectively as shown in Figure 8–86.
C6479_08_CTP.4c.indd 696
8/6/07 8:14:16 AM
5. Use the Compatibility Checker command on the Prepare submenu of the Office Button menu and note any potential problems that the workbook may have if it is saved using an earlier file format. Save the workbook with the file name, Lab 8–1 Forrest Specialty Sports Caps Complete, using the Excel 97 - 2003 Workbook format. 6. Change the document properties as specified by your instructor. Add a worksheet header with your name, course number, and other information requested by your instructor. 7. Use the Mark as Final command on the Prepare menu of the Office Button menu to mark the document as final and save it. 8. Quit Excel. Submit the assignment as specified by your instructor.
Excel Chapter 8
4. Use the Inspect Document command on the Prepare submenu of the Office Button menu to find any personal data or hidden columns or rows that are included with the workbook. Note that columns D and E are hidden. Use the Remove All buttons in the Document Inspector dialog box to remove the items.
STUDENT ASSIGNMENTS
In the Lab EX 697
In the Lab Lab 2: Finding the Optimal Production Mix Problem: Witte Lawn Equipment produces four types of lawn mowers in its factory. Each type of mower requires a different amount of labor input and a different amount of materials to produce a single mower. As the production manager, your job is to determine the best mix of mowers to produce based on the amount of available labor and materials for a given week. The company should produce no more than 20 electric and power lawn mowers in a week due to a high level of inventory. Due to contractual obligations with a distributor, the company must produce at least 16 self-propelled mowers each week. Overall, the company does not want to produce more than 65 of any type of mower in a week. Instructions: Start Excel and perform the following tasks. 1. Open the workbook Lab 8–2 Witte Lawn Equipment from the Data Files for Students and then save the workbook using the file name, Lab 8–2 Witte Lawn Equipment Complete. 2. Use Solver to determine the mix of products that maximizes the number of units produced in the week. The total amount of labor hours available in the first week of March is 6,200 hours, and $75,000 worth of materials is available. Use the Assume Linear Model option in Solver. Instruct Solver to create an Answer Report if it can find a solution to the problem. Figure 8–87a shows the values Solver should find. 3. Save the scenario as March Week 1. The changing cells are B8:E8. Rename the Answer Report containing the scenario as March Week 1. 4. Change the worksheet header to include your name, course number, and other information requested by your instructor. Print the Mower Production Planning worksheet and the March Week 1 worksheet. 5. The company president thinks the assumptions about the number of labor hours needed to produce the mowers is not correct. The new assumptions are that Electric Lawn Mowers take 32 labor hours to produce, Power Lawn Mowers take 40 labor hours to produce, Riding Garden Tractors take 55 labor hours to produce, and Riding Lawn Tractors take 68 labor hours to produce. Enter these new values in the Mower Production Planning worksheet. 6. Use Solver to find a solution to the problem of maximizing the number of units produced in one week, based on the new labor assumptions. Instruct Solver to create an Answer Report if it can find a solution to the problem. Solver should report that the optimal number of units of Continued >
C6479_08_CTP.4c.indd 697
8/6/07 8:14:18 AM
EX 698 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
In the Lab
continued
Electric Lawn Mowers is 20, of Power Lawn Tractors is 20, of Riding Garden Tractors is 65, and of Riding Lawn Tractors is 17. 7. Save the scenario as March Week 2. Rename the worksheet containing the second scenario as March Week 2. STUDENT ASSIGNMENTS
8. Change the March Week 2 worksheet header to include your name, course number, and other information requested by your instructor. Print the Mower Production Planning worksheet and the March Week 2 worksheet. 9. Create a Scenario Summary (Figure 8–87b) showing the two scenarios you saved in Scenario Manager. Change the Scenario Summary worksheet header to include your name, course number, and other information requested by your instructor. Print the Scenario Summary worksheet. Delete Sheet2 and Sheet3. 10. Change the document properties as specified by your instructor. Save the workbook. 11. Submit the assignment as specified by your instructor. (a) Answer Report
Figure 8–87
C6479_08_CTP.4c.indd 698
8/6/07 8:14:19 AM
Excel Chapter 8 STUDENT ASSIGNMENTS
In the Lab EX 699
(b) Scenario Summary Figure 8–87 (continued)
In the Lab Lab 3: Creating and Comparing Scenarios Problem: The owners of Upside Recreation, a retailer of bicycles, would like to determine the impact of a request by the sales team that their commissions be raised from 4% to 6%. To accommodate the potential increase, the owners need to increase the markup at which they sell bicycles. Currently, the markup is 10%. When the owners increase price, they feel that they will sell fewer bicycles. Create and compare three scenarios for the new commission rate and projected bicycle sales based on three different potential price markups. Instructions: Start Excel and perform the following tasks. 1. Open the Lab 8–3 Upside Recreation workbook from the Data Files for Students and then save the workbook using the file name, Lab 8–3 Upside Recreation Complete. 2. Create three new scenarios with the changing cells as cells B3, B5, and B8. The first scenario, Markup 11, Bikes 78 should include bicycles sold as 78, markup as 11%, and the proposed commission rate of 6%. The second scenario, Markup 12, Bikes 75 should include bicycles sold as 75, markup as 12%, and the proposed commission rate of 6%. The third scenario, Markup 13, Bikes 70 should include bicycles sold as 70, markup as 13%, and the proposed commission rate of 6%. 3. Create a Scenario PivotTable report (Figure 8–88a) showing the three scenarios that you have saved in Scenario Manager. The result cells are B6, B7, and B9. Continued >
C6479_08_CTP.4c.indd 699
8/6/07 8:14:20 AM
EX 700 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
In the Lab
continued
4. Create a Scenario Summary (Figure 8–88b) showing the three scenarios that you have saved in Scenario Manager. The result cells are B6, B7, and B9. 5. Change the document properties as specified by your instructor. Add a worksheet header with your name, course number, and other information requested by your instructor. STUDENT ASSIGNMENTS
6. Save the workbook with the password, lab8–3. Print the Scenario Summary and Scenario PivotTable report. Quit Excel. Submit the assignment as specified by your instructor.
(a) Scenario PivotTable Figure 8–88
C6479_08_CTP.4c.indd 700
8/6/07 8:14:22 AM
Excel Chapter 8 STUDENT ASSIGNMENTS
In the Lab EX 701
(b) Scenario Summary Figure 8–88 (continued)
C6479_08_CTP.4c.indd 701
8/6/07 8:14:24 AM
EX 702 Excel Chapter 8 Formula Auditing, Data Validation, and Complex Problem Solving
Cases and Places
STUDENT ASSIGNMENTS
The difficulty of these case studies varies: • are the least difficult and •• are more difficult. The last exercise is a group exercise.
• 1: Using Solver to Find the Most Profitable Product Mix Island Beverages sells beverages in single cans, 6-packs, and 12-packs. They are expanding to a new grocery store chain where they have purchased 46 feet of shelf space, and they want to be certain the most profitable combination of products is placed on the shelves. They want no more than 45 single cans, 25 6-packs, and 25 12-packs. Table 8–4 shows the three types of items, their profitability per item, and how much shelf space each item requires. Create a worksheet with the necessary information and use Solver to determine the most profitable combination of items to place on the shelves. Create an Answer Report that shows that the constraints have been met. Print the worksheet and Answer Report. Table 8–4 Island Beverages Item Information Item Type
Profit per Item
Square Feet per Item
Single cans
$0.06
0.1
6-packs
$0.46
1
12-packs
$0.84
2
• 2: Using Formula Auditing and Goal Seeking Open the workbook Case 8–2 Northwest Storage from the Data Files for Students and then save the workbook using the file name, Case 8–2 Northwest Storage Complete. Use formula auditing to learn about the worksheet. Trace two levels of precedents for cell B22, the Total Rental Revenue. Print the worksheet with the arrows and submit it to your instructor. Use goal seeking to determine the number of rental units the company needs to meet their sales goal for each building. The company wants to generate $2,000 per month for the two types of small units and $2,500 per month for the two types of large units. Save the workbook. Note that the number of units for each unit type is not an integer value. Prepare an explanation of this fact and submit the explanation to your instructor. •• 3: Creating Scenarios for a Car Loan Open the workbook Case 8–3 Car Loan from the Data Files for Students and then save the workbook using the file name, Case 8–3 Car Loan Complete. Create three scenarios based on three different loan assumptions outlined in Table 8–5. Create a Scenario Summary that summarizes the cells C9, C10, F5, G5, and H5. Print the Scenario Summary worksheet. Table 8–5 Personal Car Loan Scenarios
C6479_08_CTP.4c.indd 702
Assumption
Scenario 1
Scenario 2
Scenario 3
Car
Toyota Corolla
Volkswagon Jetta
Honda Civic
Price
$20,600
$21,750
$18,459
Down payment
$1,100
$1,250
$800
Interest rate
9.00%
9.85%
8.15%
Years
4
5
5
8/6/07 8:14:25 AM
Make It Personal
Consider a personal situation for which you want to save money. For example, you might want a vacation, new car, or a semester abroad. Create a monthly budget to track your expenses and remaining balance. Then develop scenarios to answer questions such as “What if I increase the amount that I save each month? Can I afford to take a trip this summer?” or “If I cut my fuel costs by biking to class, can I upgrade my car when I graduate?” Create a worksheet that lists your monthly expenses, such as rent, food, phone bill, credit cards, fuel, and clothes. Calculate your total expenses, and subtract them from your monthly income to determine how much you have to save at the end of each month. Determine the amount you need to save each month to reach your goal, and then develop at least three scenarios. For example, in one scenario you could reduce the amount of money you spend on fuel, clothes, and food each month. In another scenario, you could increase your monthly income, such as by working more hours at a part-time job. A third scenario could combine assumptions by reducing one or two expenses and increasing income slightly. Create the scenarios, and then produce a Scenario Summary report to examine the results.
Excel Chapter 8
•• 4: Meeting a Personal Financial Goal
STUDENT ASSIGNMENTS
Cases and Places EX 703
•• 5: Optimizing the Nutritional Value of a Meal Working Together
As a group, use Excel to help you create a menu for people who visit the Meals To Go location and create nutritious meals from scratch. Your challenge is to maximize the profile for the customers, while basing the menu on certain nutritional requirements. Open the workbook Case 8–5 Meals on the Go from the Data Files for Students and then save the workbook using the file name, Case 8–5 Meals on the Go Complete. Use Excel to find the optimal servings mix to comprise a meal with no more than 1,800 calories and 45 grams of fat. The meal must include at least one serving of each item and not more than four. Maximize profit for the Meals to Go business based on product costs and selling prices, while meeting the meal constraints. Use three methods to attempt to solve the problem: trial and error, goal seeking, and Solver. Discuss how each approach went about finding an optimal solution and present your findings.
C6479_08_CTP.4c.indd 703
8/6/07 8:14:26 AM
This page intentionally left blank
C6394_FM_CTP.4c.indd xvi
8/8/07 3:59:57 PM
Microsoft Office Excel 2007
9
Importing Data, Working with PivotCharts, PivotTables, and Trendlines
Objectives You will have mastered the material in this chapter when you can: • Import data from a text file, an Access database, a Web page, and a Word Document • Transpose data while pasting it • Convert text to columns • Replicate formulas • Explain sharing and collaboration techniques • Insert, edit, and delete a comment
• Accept and reject tracked changes made to a workbook • Analyze worksheet data using a PivotTable and a PivotChart • Compare and merge shared workbooks • Analyze worksheet data using a trendline • Save a custom view of a worksheet and format a worksheet background
• Track changes and share a workbook
C6480_9_CTP.4c.indd 705
8/8/07 3:21:37 PM
Microsoft 2003 Microsoft Offi Office ce Word Excel 2007
9
Importing Data, Working with PivotCharts, PivotTables, and Trendlines Introduction In today’s diverse business environment, the ability to use and analyze data from a wide variety of sources is a necessity. In this chapter, you will learn how to import, or bring, data from various external sources into an Excel worksheet and then analyze that data. Excel allows you to import data from a number of types of sources, including text files, Web pages, tables in databases, data stored in Word documents, and XML files. In this chapter, you also will learn how to create new types of tables and charts, such as PivotTables, PivotCharts, and trendlines, which allow you to represent and analyze data visually. Other techniques introduced in this chapter apply to issues of multiple users of the same workbook, including sharing, tracking changes, and comments. To allow several people to view and make changes to a workbook at the same time, a user can share the workbook. Excel also has the capability to track changes to a workbook by marking who changed what data, in which cell, and when. Comments, or descriptions, which do not regularly appear as part of the worksheet data, can be added to the workbook to alert the recipients to special instructions and then later can be edited or deleted. Workbooks that have been saved and copied to others also can be compared and merged. Comparing workbooks allows users to view and scroll worksheets side by side and visually search the worksheets for differences. Merging allows users to bring together copies of workbooks that others have worked on independently. You also will learn how to save a custom view of a worksheet, which enables each user to view the worksheet in a familiar manner, even if other users alter the appearance or layout of a worksheet.
EX 706
C6480_9_CTP.4c.indd 706
8/8/07 3:21:40 PM
Microsoft Office Excel 2007
BTW
FasToast Ovens provides sandwich-toasting ovens to fast food restaurants. The company provides repair services in four states. Each state includes a central office and several locations from which repair technicians are dispatched. The repair locations are either company-owned or contracted to other companies. The company owner has requested that the repair revenue for the last two years be compared among the four states. One of the states provides the requested data in text format (Figure 9–1a on page EX 708) rather than in an Excel workbook. To make use of that data in Excel, the data must be imported, before it can be formatted and manipulated. The same is true of other formats in which the offices in various states store data, such as Microsoft Access tables (Figure 9–1b on page EX 708), Web pages (Figure 9–1c on page EX 708), or Word documents (Figure 9–1d on page EX 708). Excel provides the tools necessary to import and manipulate the data from these sources into a worksheet (Figure 9–1f on page EX 709). PivotTables, PivotCharts, and trendlines provide additional methods to manipulate and visualize data. A PivotTable (Figure 9–1g on page EX 709) is an interactive view of worksheet data that gives users the ability to summarize the data and then rotate the table’s row and column titles to show different views of the summarized data. A PivotChart (Figure 9–1h on page EX 709) is an interactive chart that provides the user with ways to analyze data visually by varying the fields and categories to present different graphical views. For example, if FasToast Ovens wanted to view a pie chart showing percentages of repair revenue from each state, a PivotChart could show that percentage using any field, such as total revenue for a year or total revenue for offices that stock parts. Excel creates and associates a PivotTable with every PivotChart. A trendline (Figure 9–1i on page EX 709) is a visual way to show how some particular data is changing over time. Excel can overlay a trendline on any chart, including a PivotChart. Using PivotTables, PivotCharts, and trendlines, an inexperienced user with little knowledge of formulas, functions, and ranges can complete powerful what-if analyses of a set of data.
External Data Imported data that maintains a refreshable link to its external source is called external data. When you use external data, your worksheet will update whenever a change is made to the original file and the data in the worksheet is refreshed. You can choose when and how the data is refreshed.
BTW
Project — FasToast Ovens Repairs Revenue Analysis
Importing Data If your system contains only a minimum installation of Excel, the first time you use one of the import features, Excel may attempt to install MSQuery. MSQuery is the supplemental application included in Microsoft Office 2007 that is used to retrieve data from external data sources. If Excel attempts to install MSQuery, follow the prompts to complete the installation.
EX 707
C6480_9_CTP.4c.indd 707
8/8/07 3:21:40 PM
EX 708 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
(a) Text File (b) Access Table
IMPORT
(c) Web Page
(e) Worksheet Has No Data (d) Table in Word Document Figure 9–1
C6480_9_CTP.4c.indd 708
8/8/07 3:21:41 PM
Excel Chapter 9
Project — FasToast Ovens Repairs Revenue Analysis EX 709
(g) PivotChart
(h) PivotTable
(f) Data Imported into Worksheet
(i) Trendline on Chart
C6480_9_CTP.4c.indd 709
8/8/07 3:21:45 PM
EX 710 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
Figure 9–2 illustrates the requirements document for the FasToast Ovens Repair Revenue Analysis worksheet. It includes the needs, source of data, calculations, and other facts about the worksheet’s development.
Figure 9–2
Overview As you read this chapter, you will learn how to modify the existing workbook as shown in Figure 9–1 by performing these general tasks: • Import data to an Excel worksheet from a text file, an Access database, a Web page, and a Word document • Insert, edit, and delete comments
C6480_9_CTP.4c.indd 710
8/8/07 3:21:49 PM
• Track changes and share a workbook • Analyze worksheet data using a PivotTable and a PivotChart • Analyze worksheet data using a trendline • Compare and merge shared workbooks General Project Decisions While working with an Excel worksheet, you need to make several decisions that will determine the appearance and characteristics of the finished worksheet. As you update an existing worksheet to meet the requirements shown in Figure 9–2, you should follow these general guidelines:
Excel Chapter 9
Project — FasToast Ovens Repairs Revenue Analysis EX 711
Plan Ahead
1. Analyze the existing workbook and the formats of the data to be imported. You should have a good understanding of the layout of the data you want to import and how each data element will be arranged in the worksheet. In some cases, the data will need to be transposed, meaning that the rows and columns need to be switched. In other cases, you may need to further manipulate the data once it is in Excel. 2. Evaluate the various options Excel provides for collaboration. Excel provides several methods to work with others on a workbook. In some cases, you may send the workbook to a group of people all at once and then consolidate their changes and suggestions. In other cases, you may want to send a workbook to one person at a time and allow each person to add to the changes and suggestions that others have made. 3. Visualize your workbook in various PivotTable and PivotChart layouts. PivotTables and PivotCharts provide a great deal of flexibility in how data is summarized. You should consider the types of comparisons and summary functions that you may want to make. Often, sketches of a few ideas will help you in planning effective PivotTables and PivotCharts. 4. Identify the trend or trends to analyze with a trendline. Consider what trend you are looking to analyze. You typically analyze a trend in data over a period of time. Consider which data to analyze and which time frame to consider. You also should consider if the trendline should forecast the trend into the future and how far into the future the forecast would be reasonable. 5. Gather workbooks to be merged and then assess any differences in the workbooks that are in disagreement. In the case of the FasToast Ovens expense worksheets noted in the requirements document (Figure 9–2 on page EX 710), several people will be sending changes to a workbook. Before merging the workbooks, ensure that you have all of the workbooks from the individuals. When merging the workbooks, conflicts in changes to cells may arise, at which point you must make decisions to resolve the conflicts. When necessary, more specific details concerning the above guidelines are presented at appropriate points in the chapter. The chapter also will identify the actions you perform and decisions made regarding these guidelines during the modification of the worksheet shown in Figure 9–1 on pages EX 708–709.
C6480_9_CTP.4c.indd 711
8/8/07 3:21:50 PM
BTW
EX 712 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
Importing External Data Excel assigns a name to each external data range. You can view these names by clicking the Name box arrow in the formula bar. External data ranges from text files are named with the text file name. External data ranges from databases are named with the name of the query. External data ranges from Web queries are named with the name of the Web page from which the data was retrieved.
With a good understanding of the requirements document and an understanding of the necessary decisions, the next step is to use Excel to learn about the existing worksheet and solve the problem.
To Start Excel and Open a Workbook If you are using a computer to step through the project in this chapter and you want your screen to match the figures in this book, you should change your computer’s resolution to 1024 ⫻ 768. For information about how to change a computer’s resolution, see page 21 in Appendix E. The following steps start Excel and open the workbook FasToast Ovens Analysis from the Data Files for Students.
1
Start Excel.
2
Open the file FasToast Ovens Analysis from the Data Files for Students and then save the workbook using the file name, FasToast Ovens Analysis1. h
3
If the Excel window is not maximized, double-click its title bar to maximize it.
4
If the worksheet window in Excel is not maximized, click the Maximize button next to the Close button on its title bar to maximize the worksheet within Excel (Figure 9–3).
formulas show a zero (0) because row 3 contains no data
Figure 9–3
C6480_9_CTP.4c.indd 712
8/8/07 3:21:51 PM
Opening a Text File in Excel If you open a text file, such as FasToast Ovens North Dakota Revenue 2008.txt, in Excel, the Text Import Wizard will start automatically. You then can make the same choices shown in the following set of steps to import the data from the text file. To open a text file in Excel, you must choose Text Files or All Files in the ‘Files of type’ box in the Open dialog box.
Dragging and Dropping a Text File You also can drag a text file to Excel. Simply drag the file name or the icon from its location to a blank worksheet. You then can format the data easily using the Text to Columns button on the Data tab on the Ribbon. The data does not maintain a refreshable link to the text file.
As shown in Figure 9–3, columns A through I have been resized and formatted so the imported data will be readable. Table 9–1 shows a description of each data field in the FasToast Ovens Repair Revenue Analysis workbook. Table 9–1 FasToast Ovens Repair Revenue Analysis Data Fields Name Of Field
Data Description
State
Name of the state in which office is located
Shop Type
Indicates whether the sales location is an In-House location or Contracted (outside) location
Stock Parts?
Indicates whether the location keeps replacement parts in stock
Years In Business
Number of years the sales office has been in operation
Repair Persons
Number of repair persons based in the office
Repair Revenue 2007
Total revenue from warranties and repairs for this office in 2007
Repair Revenue 2008
Total revenue from warranties and repairs for this office in 2008
Revenue per Repair Person 2007
Average total revenue per repair person for this office in 2007 (2007 Revenue / Repair Persons)
Revenue per Repair Person 2008
Average total revenue per repair person for this office in 2008 (2008 Revenue / Repair Persons)
Excel Chapter 9
BTW
About the FasToast Ovens Repair Revenue Analysis Worksheet
EX 713
BTW
Importing Files
When data is imported into a formatted worksheet, Excel formats the incoming data using the formats assigned to the cells as best it can.
Importing Files Data may be sent from a variety of sources and in a range of formats. Even though many users keep data in databases such as Microsoft Access, it is common to receive text files with fields of data separated by commas, especially from mainframe computer users. In addition, with the increasing popularity of the World Wide Web, more companies are creating HTML files and posting data on the Web as a Web page. Word documents, especially those including tables of data, often are used in business as a source of data for workbooks. XML also is a very popular format for data exchange. Excel allows you to import data made available in many formats, including text files, Access tables, Web pages, Word documents, and XML files. Importing data into Excel can create a refreshable link that can be used to update data whenever the original file changes.
To Import Data from a Text File into a Worksheet A text file contains electronic data created with little or no formatting. Many software applications, including Excel, offer an option to import data from a text file, also called an ASCII text file. ASCII stands for the American Standard Code for Information Interchange. In text files, commas, tabs, or other characters often separate the fields. Alternately, the text file may have fields of equal length in columnar format. Each record usually exists on a separate line. A delimited file contains data fields separated by a selected character, such as a comma. A fixed width file contains data fields of equal length with spaces between the fields. In the case of a fixed width file, a special character need not separate the data fields. During the import process, Excel provides a preview to help identify the type of text file being imported.
C6480_9_CTP.4c.indd 713
8/8/07 3:21:53 PM
EX 714 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
The following steps import a comma-delimited text file into the FasToast Ovens Analysis1 workbook using the Text Import Wizard. The text file on the Data Files for Students contains data about repair revenue for North Dakota for 2007 and 2008 (Figure 9–1a on page EX 708).
1 • With the Repair Revenue Analysis worksheet active, if necessary, select cell A3.
Data tab
From Text button
• Click the Data tab on the Ribbon (Figure 9–4).
cell A3 selected
Figure 9–4
2 • Click the From Text button on the Ribbon to display the Import Text File dialog box. If you have more than one Excel add-in installed, such as Solver, the From Text button may appear on a submenu that is displayed when you click the Get External Data button. The Get External Data group on the Ribbon may be collapsed to a single Get External Data button.
Import Text File dialog box
FasToast Ovens North Dakota Revenue 2008 text file
• When Excel displays the Import Text File dialog box, select UDISK 2.0 (E:) in the Address bar to display the text files on drive E (Figure 9–5).
Figure 9–5
C6480_9_CTP.4c.indd 714
8/8/07 3:21:54 PM
3 • Double-click the
Q&A
file name, FasToast Ovens North Dakota Revenue 2008, to display the Text Import Wizard - Step 1 of 3 dialog box (Figure 9–6). What is the purpose of the Text Import Wizard? The Text Import Wizard provides step-by-step instruction on importing data from a text file into an Excel worksheet. The Preview box shows that the text file contains one record per line and the fields are separated by commas. The Delimited option button is selected in the ‘Original data type‘ area.
Excel Chapter 9
Importing Files EX 715
Text Import Wizard - Step 1 of 3 dialog box
Delimited option button selected
preview of contents of FasToast Ovens North Dakota Revenue 2008.csv
Next button
Figure 9–6
4 • Click the Next button to display the Text Import Wizard - Step 2 of 3 dialog box.
Text Import Wizard - Step 2 of 3 dialog box
• When Excel displays the Text Import Wizard - Step 2 of 3 dialog box, click Comma in the Delimiters area to display the data fields correctly in the Data preview area.
Tab check box cleared Comma check box selected fields separated into columns
quotation marks surround data fields containing delimiter (comma)
• Click Tab in the Delimiters area to clear the check box (Figure 9–7).
Data preview area
Figure 9–7
C6480_9_CTP.4c.indd 715
8/8/07 3:21:57 PM
EX 716 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
5 • Click the Next button
Q&A
to display the Text Import Wizard Step 3 of 3 dialog box (Figure 9–8).
Text Import Wizard - Step 3 of 3 dialog box
What is shown in the Text Import Wizard - Step 3 of 3 dialog box? General option Step 3 allows the button selected format of each column of data to be selected. General is the default selection. The Data preview area shows the data separated based on the comma delimiter. The commas in the last two columns of numbers in the Data preview area (Figure 9–8) are not considered to be delimiters because each of these data values was surrounded by quotation marks in the text file.
description of the General option
all fields set to General format by default
Finish button
Figure 9–8
6 • Click the Finish button to
Q&A
display the Import Data dialog box (Figure 9–9). What is the purpose of the Import Data dialog box? The Import Data dialog box provides options to define where the data is placed on the worksheet, and also provides a way to tailor the data before importing it. Data will be imported beginning at cell A3 of the existing worksheet. A marquee surrounds cell A3. By default, the cell that is active when the text import is performed will become the upper-left cell of the imported range. To import the data to a different location, change the location in the Import Data dialog box.
marquee surrounds selected cell A3 Import Data dialog box
Existing worksheet option button selected
data import to begin at this cell location
Properties button
Figure 9–9
C6480_9_CTP.4c.indd 716
8/8/07 3:22:00 PM
7 • Click the Properties button. External Data Range Properties dialog box
• When Excel displays the External Data Range Properties dialog box, click ‘Adjust column width‘ in the ‘Data formatting and layout’ area to clear the check box (Figure 9–10).
Excel Chapter 9
Importing Files EX 717
check mark removed
OK button
Figure 9–10
8 • Click the OK button. • When Excel displays
Q&A
the Import Data dialog box, click the OK button to import the data from the text file into the worksheet beginning at cell A3 (Figure 9–11). What if the data in the text file is changed? After the text file is imported, Excel can refresh, or update, the data whenever the original text file changes, using the Refresh All button on the Data tab on the Ribbon.
formulas show nonzero results because row 3 contains data text file data imported
Figure 9–11
Other Ways 1. Press ALT+A, F, T
C6480_9_CTP.4c.indd 717
8/8/07 3:22:02 PM
EX 718 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
To Import Data from an Access Table into a Worksheet To import data from an Access database, the first step is to make a query of the data. A query is a way to qualify the data to import by specifying a matching condition or asking a question of a database. For example, a query can identify only those records that pass a certain test, such as records containing numeric fields greater than a specific amount or records containing text fields matching a specific value. When Excel imports a database table, the data is placed in a table. A table format is not desirable for the Repair Revenue Analysis worksheet, so the table must be converted to a range and the cells reformatted after Excel imports the data. The following steps import an entire table from an Access database into a table and then reformat the data to match the existing worksheet. The table in the Access database on the Data Files for Students contains data about repair revenue in South Dakota for 2007 and 2008 (Figure 9–1b on page EX 708).
1 • Select cell A8.
From Access button
• With the Data tab
Select Data Source dialog box
drive E selected
active, click the From Access button on the Ribbon to display the Select Data Source dialog box.
• When Excel displays the Select Data Source dialog box, select UDISK 2.0 (E:) in the Address bar to display the Access database files on drive E (Figure 9–12).
FasToast Ovens South Dakota Revenue 2008 database file
Figure 9–12
2 • Double-click the file name,
Q&A
FasToast Ovens South Dakota Revenue 2008 in the Name list to display the Import Data dialog box (Figure 9–13).
Import Data dialog box
What is shown in the Import Data dialog box?
Table selected
Q&A
The Import Data dialog box allows you to choose whether to import the data into a table, a PivotTable Report, or a PivotChart and associated PivotTable Report. You also can choose to import the data to an existing worksheet or a new worksheet. What if the database contained more than one table?
OK button
Figure 9–13
If more than one table is in the database, then Excel allows you to choose which table to import.
C6480_9_CTP.4c.indd 718
8/8/07 3:22:05 PM
3 • Click the OK button
Q&A
to import the data in the database to a table in the range A8:G13 (Figure 9–14). What happened to the layout of the worksheet when Excel imported the data?
cell A8 selected
Excel created a table with the data in the only table in the database. The names of the fields in the Access database show in row 8. The table is formatted with the default table style for the worksheet’s theme. Excel also changed the widths of the columns in the worksheet. Q&A
columns resized automatically
Excel Chapter 9
Importing Files EX 719
table created with data from Access database table
Figure 9–14
What should be done to format the worksheet? The table in the range A8:G13 must be converted to a range. When the table is converted to a range, the cells in each column in the converted range should be formatted to match the data in the cells that were imported for North Dakota. The column widths must be adjusted to best fit. The table headers in row 8 should be deleted by deleting the entire row.
4 • Right-click cell A8 and then point to the Table on the shortcut menu.
• Click Convert to Range.
• When Excel
row 8 row header
displays the Microsoft Office Excel dialog box, click the OK button to convert the table to a range (Figure 9–15).
table converted to range
Figure 9–15
C6480_9_CTP.4c.indd 719
8/8/07 3:22:08 PM
EX 720 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
5 • Right-click the row heading for row 8 to display the shortcut menu.
• Click Delete on the shortcut menu to delete row 8 (Figure 9–16).
table column headings deleted
Figure 9–16
6 • Drag through the column headings of column A through G in the column heading area to select the columns.
• Double-click the column separator in the column headings area between columns A and B to change the widths of each column to best fit (Figure 9–17).
column separator
columns resized to best fit
Figure 9–17
C6480_9_CTP.4c.indd 720
8/8/07 3:22:11 PM
7 • If necessary, click the Home tab on the Ribbon and then select the range A7:G7.
Format Painter button
Excel Chapter 9
Importing Files EX 721
• Click the Format Painter button on the Ribbon and then drag though the range A8:G12 to copy the formats of the selected range to the range A8:G12.
• Select cell A13 (Figure 9–18).
cell A13 selected
format of South Dakota data matches format of North Dakota data
Figure 9–18 Other Ways 1. Press ALT+A, F, A
To Import Data from a Web Page into a Worksheet A Web page uses a file format called HTML. HTML stands for Hypertext Markup Language, which is a language that Web browsers can interpret. Excel can import data from a Web page into preformatted areas of the worksheet using a Web query. The Web Query dialog box includes options to specify which parts of the Web page to import and how much of the HTML formatting to keep. The following steps create a new Web query and import data from a Web page into a worksheet. Performing these steps does not require being connected to the Internet, because the Web page (Figure 9–1c on page EX 708) is available on the Data Files for Students.
C6480_9_CTP.4c.indd 721
8/8/07 3:22:14 PM
EX 722 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
1 • With cell A13 selected, click the Data tab on the Ribbon.
• Click the From
Data tab From Web button
New Web Query dialog box
Web button on the Ribbon to display the New Web Query dialog box.
Address bar
Go button Web page formatted in preview area
• When Excel displays
Q&A
the New Web Query dialog box, type e:\ FasToastOvensNebr askaRevenue2008. htm in the Address bar and then click the Go button to display the Web page in the preview area (Figure 9–19).
Click to select this table arrow
Why does file:/// appear at the beginning of the address in the Address bar? Excel appends file:/// to the beginning of the address to indicate that the address points to a file saved on disk.
Figure 9–19
2 • Click the ‘Click to select this table’ arrow to select the HTML table containing the Nebraska repair revenue report (Figure 9–20).
table selected
Click to select this table arrow changed to check mark
Import button
Figure 9–20
C6480_9_CTP.4c.indd 722
8/8/07 3:22:16 PM
3 • Click the Import button to display the Import Data dialog box and display a marquee around cell A13 (Figure 9–21).
Excel Chapter 9
Importing Files EX 723
Import Data dialog box
Existing worksheet option button selected
marquee surrounds selected cell A13
Properties button
Figure 9–21
4 • Click the Properties button to display the External Data Range Properties dialog box.
External Data Range Properties dialog box
• When Excel displays the External Data Range Properties dialog box, click ‘Adjust column width‘ in the ‘Data formatting and layout’ area to clear the check box (Figure 9–22).
check mark cleared from check box
OK button
Figure 9–22
C6480_9_CTP.4c.indd 723
8/8/07 3:22:19 PM
EX 724 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
5 • Click the OK button. • When Excel displays the Import
Q&A
Data dialog box, click the OK button to import the data from the Web page into the worksheet beginning at cell A13 (Figure 9–23). Why is the data imported starting at cell A13?
Web page table column headings imported along with data
By default, the cell that is active when the Web query is performed will become the upper-left cell of the imported range. To import the data to a different location, change the location in the Import Data dialog box.
data from Web page imported
Figure 9–23
6 • Drag through the row 13 and
Q&A
14 row headings and then rightclick to display the shortcut menu (Figure 9–24). Why are the column headings repeated in row 13? Because the column headings appeared in the Web page, they are imported with the other data and are displayed in rows 13 and 14. The extra column headings must be deleted from the imported Web page table.
shortcut menu
Delete command rows 13 and 14 selected
Figure 9–24
C6480_9_CTP.4c.indd 724
8/8/07 3:22:22 PM
7 • Click Delete on the shortcut menu
Q&A
to delete rows 13 and 14, which contained the column headings from the Web Page (Figure 9–25).
Excel Chapter 9
Importing Files EX 725
Why should I use a Web query instead of copying and pasting from a Web page? Using a Web query has advantages over other methods of importing data from a Web page. For example, copying data from Web pages to the Office Clipboard and then pasting it into Excel does not maintain all of the Web page formatting. In addition, copying just the desired data from a Web page can be tedious. Finally, copying and pasting does not create a link to the Web page for future updating.
column headings in rows 13 and 14 deleted and all rows moved up
Figure 9–25 Other Ways 1. Press ALT+A, F, W
To Copy and Transpose Data from a Word Document to a Worksheet A Word document often contains data stored in a table. You can use the Office Clipboard and copy and paste commands to copy the data in the table to an Excel worksheet. On some occasions, imported data requires a great deal of manipulation once you import the data into Excel. For example, the imported data may be easier to work with if the rows and columns were switched, or transposed. In other situations, you may find that an imported column of data should be split into two columns. The Word document that contains the Kansas repair revenue analysis data (Figure 9–1d on page EX 708) includes a table in which the rows and columns are switched when compared with the Repair Revenue Analysis worksheet. The second column of data also includes data for both the state name and the shop type. The steps on the next page copy and transpose the data from the Word document to the Repair Revenue Analysis worksheet.
C6480_9_CTP.4c.indd 725
8/8/07 3:22:26 PM
EX 726 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines FasToast Ovens Kansas Revenue 2008 document open in Word
1 • Click the Home tab on the Ribbon and then select cell A24.
Copy button
• Start Word and then open the Word document named, FasToast Ovens Kansas Revenue 2008, from the Data Files for Students.
five columns selected
• In Word, if necessary, click the Home tab on the Ribbon.
• Drag through all of the cells in the second through last columns in the table in the Word document and then click the Copy button on the Ribbon to copy the contents of the table to the Office Clipboard (Figure 9–26). Figure 9–26
2 • Quit Word and, if necessary, click the FasToast Ovens Analysis1 workbook taskbar button to make it active.
Paste button arrow
• Click the Paste button arrow on the Ribbon to display the Paste menu (Figure 9–27).
Paste menu
Paste Special command
cell A24 selected
Figure 9–27
C6480_9_CTP.4c.indd 726
8/8/07 3:22:27 PM
3 • Click Paste Special on the Paste menu to display the Paste Special dialog box.
• When the Paste
Excel Chapter 9
Importing Files EX 727
Paste Special dialog box
Special dialog box appears, click Text in the As list (Figure 9–28).
Text selected in As list
OK button
Figure 9–28
4 • Click the OK button in the Paste Special dialog box to paste the contents of the Office Clipboard to the range A24:E29 (Figure 9–29).
Q&A
Why is the data pasted to the range A24:E29? Excel’s Transpose command requires that the source of the transposed data be different from the destination. In this case the source is the range A24:E29 and the destination will be the range A18:E22.
contents of Office Clipboard pasted in worksheet
Figure 9–29
C6480_9_CTP.4c.indd 727
8/8/07 3:22:32 PM
EX 728 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
5 • Select the range A24:E29 and then click the Copy button on the Ribbon.
• Select cell A18. • Click the Paste button arrow on the Ribbon and then point to Transpose on the Paste menu (Figure 9–30).
Copy button
Paste button arrow
Transpose command
Paste menu
cell A18 selected
marquee surrounds copied range
Figure 9–30
6 • Click Transpose on the Paste menu
Q&A
to transpose and paste the copied cells to a range beginning with cell A18 (Figure 9–31). What happens when the range is copied and transposed? When the range is transposed, the first row of the selected range becomes the first column of the destination range, and so on. For example, row 14 (A24:E24) in the source range becomes column A (A18:A22) in the destination range.
range A24:E29 copied and transposed to range A18:F22
marquee still surrounds range A24:E29 indicating range copied to Office Clipboard
Figure 9–31 Other Ways 1. Press ALT+H, V, T
C6480_9_CTP.4c.indd 728
8/8/07 3:22:36 PM
To Convert Text to Columns As stated earlier and shown in Figure 9–31, column A of the imported Kansas data includes both the state and shop type. The data must be separated using Excel’s Convert Text to Columns command so that the shop type information is in column B. Before doing so, the source range for the data (A24:E29) should be deleted because it no longer is needed. Also, the cells in the range B18:F22 must be shifted one column to the right to accommodate the shop type data. The following steps clear the range A24:E29, move the range B18:F22 one column to the right, and move the shop type data in column A to column B.
1 • If necessary, click the Home tab on the Ribbon.
Excel Chapter 9
Importing Files EX 729
Cut button
• Select the range A24:E29 and press the DELETE key to delete the range.
• Select the range B18:F22 and then click the Cut button on the Ribbon to copy the range to the Office Clipboard (Figure 9–32).
B18:F22 selected
original pasted range deleted
Figure 9–32
C6480_9_CTP.4c.indd 729
8/8/07 3:22:42 PM
EX 730 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
2 • Select cell C18 and then click
Q&A
the Paste button on the Ribbon (Figure 9–33).
Paste button
Why does the range B18:F22 need to be cut and pasted to the new range? The data in the range A18:A22 contains the shop type information that needs to be placed in the range B18:B22. Moving the range B18:F22 one column to the right will accommodate the shop type information. range moved one column to right
cell C18
Figure 9–33
3 • Select the range C17:G17 and then click the Format Painter button on the Ribbon.
Q&A
• Select the range C18:G22 to copy the formats in range C17:G17 down to the corresponding columns of range C18:G22 (Figure 9–34).
Format Painter button
What other tasks can be accomplished using the Convert Text to Columns Wizard? The wizard can be used only when a range that includes a single column is selected. The Convert Text to Columns Wizard is a powerful tool for manipulating text data in columns, such as splitting first and last names into separate columns. Most often, however, you will use the wizard to manipulate imported data. For example, survey data may be imported in one column as a series of Y and N characters, indicating answers to questions on the survey (e.g., YNNYYN). You can split the answers into separate columns by specifying fixed width fields of one character each.
C6480_9_CTP.4c.indd 730
formats in range C17:G17 copied down to corresponding columns of range C18:G22
Figure 9–34
8/8/07 3:22:44 PM
4 • Select the range
Data tab
A18:A22 and then click the Data tab on the Ribbon. Convert Text to Columns Wizard - Step 1 of 3 dialog box
• Click the Text to Columns button on the Ribbon to display the Convert Text to Columns Wizard - Step 1 of 3 dialog box (Figure 9–35).
Text to Columns button
Excel Chapter 9
Importing Files EX 731
Delimited file type selected by default
Preview of selected data area
Next button
Figure 9–35
5 • Click the Next button to display the Convert Text to Columns Wizard - Step 2 of 3 dialog box.
Convert Text to Columns Wizard Step 2 of 3 dialog box
• When Excel displays the Convert Text to Columns Wizard - Step 2 of 3 dialog box, click Comma in the Delimiters area to display the data fields correctly in the Data preview area.
• Click Tab in the Delimiters area to clear the check box (Figure 9–36).
Tab check box cleared Comma check box selected fields separated into columns
Data preview area Finish button
Figure 9–36
C6480_9_CTP.4c.indd 731
8/8/07 3:22:47 PM
EX 732 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
6 • Click the Finish button to close the Convert Text to Columns Wizard Step 2 of 3 dialog box and separate the data in column A to two columns (Figure 9–37).
column A data separated to two columns
Figure 9–37 Other Ways 1. Press ALT+A, E
BTW
Importing XML Data Dragging and Dropping an Access File If you have both Excel and Access open on your desktop, you can drag and drop an entire table or query from Access to Excel. Select the table or query you want to transfer in the database window and drag it to the desired location in the worksheet.
C6480_9_CTP.4c.indd 732
XML is an increasingly popular format for sharing data. XML stands for Extensible Markup Language, which is a language that is used to encapsulate data and a description of the data in a single text file, or XML file. Tags are used in XML files to describe data items, which are called elements. XML files typically have a file extension of xml. Industry organizations and companies create standard XML file layouts and tags to describe commonly used types of data. Excel is capable of importing and exporting XML in a variety of layouts, as long as the XML file is described by a schema. A schema is a special type of XML file used to describe the layout of data in other XML files. A schema describes what information an XML file should contain, the order in which the elements should appear, the values allowed for each element, and a variety of other information. A schema file typically is sent from a technical source, such as a programmer or a person in a company’s information technology department.
8/8/07 3:23:00 PM
XML XML can describe any type of data. Banks use it to transfer financial information among various systems, and graphic artists use it to share multimedia data. The versatility of XML is matched by its simplicity. XML also is being used to make queries over the Web using a common set of rules available to any user. For example, a user can send an XML query to a travel Web site and receive the current information for a specific flight in XML format.
Excel Chapter 9
Before importing XML data into a worksheet or exporting XML data from a worksheet, the schema file that describes the format of the XML file to import must be added to a workbook. When a schema is added to a workbook, the schema is called an XML map in Excel. With an XML map, an import area can be created on a worksheet by dragging elements from the XML map to cells in a worksheet. When the XML data is imported, it is imported as a table. To attach an XML map to a workbook, you first must display the Developer tab on the Ribbon as described in Chapter 7 on page EX 540. The XML group displays on the Developer tab on the Ribbon. Click the Source button on the Ribbon to display the XML Source task pane. Click the XML Maps button and then click the Add button. You then can navigate to the location of the schema file that was provided to you and drag and drop XML elements to your worksheet to create the XML map. When your XML map is complete, click the Import button on the Developer tab to begin the process of importing an XML file. After importing the XML data, you often may need to convert the table to a range because, as stated earlier, XML data always is imported as a table.
BTW
Importing Files EX 733
To Replicate Formulas The workbook opened at the beginning of this project contained a worksheet title, headings for each column, and formulas in cells H3 and I3 to calculate the revenue per repair person for 2007 and 2008. The formulas must be copied, or replicated, through row 22 to complete the calculations for the remaining rows in the worksheet. Some spreadsheet specialists refer to copying formulas as replication. This technique of replicating the formulas after completing the import is necessary because the total number of records to be imported usually is unknown. The following steps use the fill handle to replicate the formulas.
1 • Select the range H3:I3 (Figure 9–38).
range H3:I3 selected
Figure 9–38
C6480_9_CTP.4c.indd 733
8/8/07 3:23:02 PM
EX 734 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
2 • Drag the fill handle
Q&A
down through row 22 to copy the two formulas to the range H4:I22 and display the new values for the Revenue per Repair Person 2007 and Revenue per Repair Person 2008 columns (Figure 9–39). What if I just want to copy formulas rather than replicating?
formulas in range H3:I3 copied to range H4:I22
Recall that copying, or replicating, a formula, causes Excel to adjust the cell references so the new formulas contain references corresponding to the new locations. Excel then performs calculations using the appropriate values. To create an exact copy Figure 9–39 without replication, hold down the CTRL key while dragging the fill handle. Holding down the SHIFT key while dragging the fill handle inserts new cells, rather than overwriting existing data.
3 • Click the Save button on the Quick Access Toolbar to save the workbook using the file name, FasToast Ovens Analysis1. Other Ways 1. Click Copy button on Quick Access Toolbar, click Paste button on Quick Access Toolbar 2. Press CTRL+C, press CTRL+V
BTW
3. Click Copy on shortcut menu, click Paste on shortcut menu
Replicating Formulas You automatically can replicate a formula when you import data. The External Data Range Properties dialog box includes a check box labeled ‘Fill down formulas in column adjacent to data‘ that you can use to automatically replicate formulas when importing data.
C6480_9_CTP.4c.indd 734
Collaborating and Tracking Changes on a Workbook The next steps are to share the workbook, insert a comment, and then turn on features to track changes. If others need to edit a workbook or suggest changes, Excel provides four ways to collaborate. Collaborating means working together in cooperation on a document with other Excel users. The first option is to distribute the workbook to others, physically on a disk or through e-mail using the Send command on the Office Button menu. With the Send command, the document can be embedded as part of the e-mail message or the file can be sent as an e-mail attachment, which allows recipients of the e-mail message to open the file if the application is installed on their system.
8/8/07 3:23:03 PM
To Share a Workbook and Collaborate on a Workbook
Removing Duplicate Rows After importing data, you often may want to remove duplicate rows of data. If your data is formatted as an Excel table, click anywhere on the table and then click the Remove Duplicates button on the Data tab. You then can select the columns in the table that contain duplicate values that you want to eliminate, such as duplicate names.
Excel Chapter 9
A second option is to collaborate interactively with other people through discussion threads or online meetings. The integration of SharePoint with Microsoft Office 2007 allows people at different sites to share and exchange files. A third option is to collaborate by sharing the workbook. Sharing involves more than simply giving another user a copy of a file; it allows multiple people to work independently on the same workbook at the same time, if they are in a networked environment.
BTW
Collaborating and Tracking Changes on a Workbook EX 735
Sharing can be turned on for a workbook using the Share Workbook button on the Review tab on the Ribbon. When workbook sharing is enabled, a number of Excel features — merging cells, deleting worksheets, changing or removing passwords, using scenarios, creating data tables, modifying macros, using data validation, and creating PivotTables — are disabled for the workbook. See Excel Help for a complete list of features disabled by Excel while a workbook is shared. For this reason, the time when a workbook is shared should be limited; further, sharing should be used only for the purpose of reviewing and modifying the contents of worksheet data. When a workbook is shared with another user, changes made and saved by the other user are visible only when you attempt to save changes. When Excel recognizes that another user has modified a shared workbook, Excel displays a dialog box indicating that the workbook has been updated with changes saved by other users; you then can review and accept or reject the other user’s work. If both you and the other user change the same cell, then Excel displays a Resolve Conflicts dialog box when the workbook is saved. The dialog box lists the conflicting changes and provides options to choose which change to accept in the workbook. The following steps turn on sharing for the FasToast Ovens Analysis1 workbook and then show collaboration with another user to make changes to the workbook.
1 • Click the Review
Review tab
tab on the Ribbon (Figure 9–40).
Share Workbook button
Figure 9–40
C6480_9_CTP.4c.indd 735
8/8/07 3:23:06 PM
EX 736 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
2 • Click the Share Workbook button on the Ribbon to display the Share Workbook dialog box.
Share Workbook dialog box
• When Excel displays
Q&A
the Share Workbook dialog box, click ‘Allow changes by more than one user at the same time’ (Figure 9–41). What is shown in the Share Workbook dialog box? The ‘Allow changes by more than one user at the same time’ check box is selected, indicating that the workbook should be shared. The ‘Who has this workbook open now’ list in the Share Workbook dialog box lists all users who currently have a copy of the workbook open.
Allow changes by more than one user at the same time check box selected
list of users currently working in the workbook
OK button
Figure 9–41
workbook is shared
3 • Click the OK button. • When Excel displays the Microsoft Office Excel dialog box, click the OK button to place the workbook in share mode (Figure 9–42).
Figure 9–42
C6480_9_CTP.4c.indd 736
8/8/07 3:23:08 PM
4 • If possible, have a
Share Workbook dialog box
classmate open a second copy of the workbook.
Excel Chapter 9
Collaborating and Tracking Changes on a Workbook EX 737
• With a second copy of the workbook open, click the Share Workbook button on the Review tab on the Ribbon to display the Share Workbook dialog box, which lists all users who currently have the workbook open (Figure 9–43).
two users have the workbook open
Remove User button
OK button
Figure 9–43
5 • Click the OK button. • Ask the second workbook user to select G13, enter 183,540 as the new value, and then save the workbook.
• Click the Save
Q&A
button on the Quick Access Toolbar to display the Microsoft Office Excel dialog box indicating that the workbook has been updated with changes saved by another user (Figure 9–44). Must I save the workbook before I am notified of another user’s changes?
Microsoft Office Excel dialog box
OK button
Figure 9–44
Yes. As shown in Figure 9–44, until the workbook is saved, Excel provides no indication that another user has changed the shared workbook. To prohibit another user from saving additional updates to the workbook, click the user name in the Share Workbook dialog box and then click the Remove User button.
C6480_9_CTP.4c.indd 737
8/8/07 3:23:12 PM
EX 738 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
6 • Click the OK button. • Point to the blue triangle in cell G13 to display the comment indicating the other user’s changes (Figure 9–45).
blue triangle indicates change was made to cell
pointing to cell with blue triangle shows information about change in comment box
Figure 9–45
7 • Ask the second user
Share Workbook dialog box
of the workbook to close the workbook.
• Click the Review tab on the Ribbon and then click the Share Workbook button on the Ribbon to display the Share Workbook dialog box.
Allow changes by more than one user at the same time check box cleared
• When Excel displays the Share Workbook dialog box, click ‘Allow changes by more than one user at the same time’ to clear the check box (Figure 9–46).
OK button
Figure 9–46
C6480_9_CTP.4c.indd 738
8/8/07 3:23:15 PM
workbook no longer shared
8 • Click the OK button to stop sharing the workbook (Figure 9–47).
Excel Chapter 9
Collaborating and Tracking Changes on a Workbook EX 739
• If Excel displays the Microsoft Office Excel dialog box, click the Yes button.
Figure 9–47 Other Ways 1. Press ALT+R, W
To Insert a Comment Comments are used to describe the function of a cell, a range, a sheet, or an entire workbook or to clarify entries that otherwise might be difficult to understand. Multiple users reviewing the workbook often use comments to communicate suggestions, tips, and other messages. The following steps insert a comment to indicate that the worksheet may contain an incorrect number of repair persons for one of the Nebraska offices.
1 • Right-click cell E13 to display the shortcut menu (Figure 9–48).
shortcut menu
Insert Comment command
cell E13 selected
Figure 9–48
C6480_9_CTP.4c.indd 739
8/8/07 3:23:19 PM
EX 740 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
2 • Click Insert Comment on the shortcut menu to open a comment box next to the selected cell and display a comment indicator in the cell.
• When Excel displays the comment box, enter the comment as shown in Figure 9–49.
3 • Click anywhere outside the
comment box
comment box to close the comment box and display a red comment indicator in cell E13.
comment indicator
• Click the Save button on the Quick Q&A
Access Toolbar. Can I print comments? Yes. To print the comments where they appear on the worksheet, click Show All Comments on the Review tab on the Ribbon, move and resize the comments as necessary, and then print the worksheet. To print the comments at the end Figure 9–49 of the worksheet, click the Page Setup Dialog Box Launcher on the Page Layout tab on the Ribbon. When Excel displays the Page Setup dialog box, click the Sheet tab, click the Comments box arrow, and then click ‘At end of sheet’ in the Comments list. Click the OK button and then print the worksheet. Other Ways 1. On Review tab on Ribbon, click New Comment button
2. Press ALT+R, C
To Turn On Track Changes With the first two types of collaboration in particular, distributing and using SharePoint to keep track of the changes that others make to a workbook is important. Tracking changes means that Excel, through the Track Changes command, will display the edited cells with a comment indicating who made the change, when the change was made, and what the original value was of the cell that was changed. Tracking and sharing work together. If either tracking or sharing is enabled, Excel enables the other by default. The following steps turn on track changes.
1 • If necessary, click the Review tab on the Ribbon and then click the Track Changes button on the Ribbon to display the Track Changes menu (Figure 9–50).
Review tab Track Changes button
Track Changes menu
Highlight Changes command
Figure 9–50
C6480_9_CTP.4c.indd 740
8/8/07 3:23:22 PM
2 • Click Highlight Changes on the Track Changes menu to display the Highlight Changes dialog box.
Excel Chapter 9
Collaborating and Tracking Changes on a Workbook EX 741
• When Excel displays the Highlight Changes dialog box, click ‘Track changes while editing’.
• If necessary, click all of the check
Highlight Changes dialog box
Q&A
boxes in the ‘Highlight which changes’ area to clear them (Figure 9–51). What is the purpose of clearing the check marks? Clicking the ‘Track changes while editing’ check box enables track changes and shares the workbook. The When, Who, and Where check boxes and list boxes play no role when track changes first is enabled.
Track changes while editing check box selected
check boxes cleared
OK button
3 • Click the OK button. • When Excel displays the Microsoft Office Excel dialog box, click the OK button to save the workbook (Figure 9–52).
Figure 9–51
4 Q&A
• Close the workbook. What is the change history and how can it be protected?
workbook is shared because track changes is enabled
Excel keeps a change history with each shared workbook. In the case of a shared workbook in which changes should be tracked, Excel provides a way for users to make data entry changes, but does not allow them to modify the change history. To protect the change history associated with a shared workbook, click the Review tab on the Ribbon and then click the Protect Shared Workbook button on the Ribbon. When Excel displays the Protect Shared Workbook dialog box, click ‘Sharing with track changes’ to Figure 9–52 select it and then click the OK button. After a shared workbook is protected, no one can unprotect or change it, except the owner. Other Ways 1. Press ALT+R, G, H
C6480_9_CTP.4c.indd 741
8/8/07 3:23:25 PM
BTW
EX 742 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
Selecting External Data If you want to view which part of your spreadsheet is imported, or if you want to format or delete an external data range, click the arrow next to the Name box in the formula bar, and then click the external data range name.
Reviewing Tracked Changes Instead of writing suggestions and changes on a printed draft copy and sending it to the person in charge of a workbook, Excel’s track changes feature allows users to enter suggested changes directly in the workbook. The owner of the workbook then looks through each change and makes a decision about whether or not to accept it.
To Open a Workbook and Review Tracked Changes After a workbook has been reviewed by others, it usually is returned to the owner. Because track changes was enabled for the FasToast Ovens Analysis1 workbook, the file will be returned with other users’ changes, corrections, and comments. The owner of the workbook then can review those changes and make decisions about whether or not to accept the changes. A workbook named FasToast Ovens Analysis2 is saved on the Data Files for Students, and it includes tracked changes from other users. The following steps use this workbook to illustrate reviewing tracked changes.
1 • With Excel active,
Review tab
FasToast Ovens Analysis2 workbook is shared
Track Changes button
open the file, FasToast Ovens Analysis2, from the Data Files for Students.
Track Changes menu
Highlight Changes command
• Click the Review Tab on the Ribbon and then click the Track Changes button on the Ribbon to display the Track Changes menu (Figure 9–53).
Figure 9–53
2 • Click Highlight
Highlight Changes dialog box
Changes on the Track Changes menu.
• When Excel displays the Highlight Changes dialog box, click When to clear the check box (Figure 9–54).
clearing all three check boxes indicates Excel should highlight all changes
OK button
option to list changes on new sheet
Figure 9–54
C6480_9_CTP.4c.indd 742
8/8/07 3:23:29 PM
3 • Click the OK button.
Show All Comments button
• Click the Show All Comments button on the Ribbon to display all comments.
• Point to the blue
Excel Chapter 9
Reviewing Tracked Changes EX 743
pointing to cell with blue triangle shows comment box with information about change
triangle in cell G5 to display the comment box with information about the change made to the cell G5 (Figure 9–55).
original comment sent in workbook
comment added by Jeff Quasney
indicates a change was made
Figure 9–55
4 • Click the Track Changes button on the Ribbon to display the Track Changes menu (Figure 9–56).
Track Changes button
Track Changes menu
Accept/Reject Changes command
Figure 9–56
C6480_9_CTP.4c.indd 743
8/8/07 3:23:32 PM
EX 744 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
5 • Click Accept/Reject Changes on the Track Changes menu.
• If necessary, when Excel displays
Q&A
the Select Changes to Accept or Reject dialog box, click all check boxes to clear them, indicating that all changes in the change history file should be reviewed (Figure 9–57).
Select Changes to Accept or Reject dialog box
What is the purpose of clearing the check mark? Clearing the check mark from the When check box indicates that all changes in the change history should be available for review. Excel can track three categories of changes in the change history. The When check box allows you to specify the time from which you wish to review changes. The Who check box allows you to specify individual users from whom to review changes. The Where check box allows you to specify a range of cells to check for changes.
clearing all three check boxes causes changes in change history file to be reviewed
OK button
Figure 9–57
6 • Click the OK button to display the first tracked change (Figure 9–58).
7 • Click the Accept button. • As Excel displays each change in the
Accept or Reject Changes dialog box
Accept or Reject Changes dialog box, click the Accept button.
• Right-click cell A18 and then
change information
click Delete Comment on the shortcut menu.
• Right-click cell E13 and then click Delete Comment on the shortcut menu. Accept button
Figure 9–58 Other Ways 1. Press ALT+R, G, C
C6480_9_CTP.4c.indd 744
8/8/07 3:23:37 PM
1
Click the Office Button then click Save As on the Office Button menu.
2
When Excel displays the Save As dialog box, type FasToast Ovens Analysis3 in the File name text box.
3
Click the Save button in the Save As dialog box to save the workbook with the new file name.
BTW
To Save the Workbook with a New File Name
To Turn Off Track Changes
Click the Track Changes button on the Ribbon, and then click Highlight Changes on the Track Changes menu.
2
When Excel displays the Highlight Changes dialog box, click Track Changes while editing to clear the check box.
3
Click the OK button.
4
When Excel displays the Microsoft Office Excel dialog box asking if the workbook should be made exclusive, click the Yes button. What happens when track changes is disabled?
BTW
1
Q&A
As previously discussed, when workbook sharing is enabled, Excel denies access to a number of features, including creating PivotTables. The following steps turn off track changes, which also automatically turns off sharing and saves the workbook as an exclusive workbook. An exclusive workbook is a workbook that is not shared and can be opened only by a single user.
When track changes is disabled, sharing is disabled as well. At the same time, Excel erases the change history. The workbook automatically is resaved as an exclusive workbook, which is not shared and can be opened only by a single user.
A PivotTable is an interactive view of worksheet data that gives users the ability to summarize data in the database and then rotate the table’s row and column titles to show different views of the summarized data. After a PivotTable is created, it can be used to view different levels of detail, reorganize the layout of the chart by dragging its fields, or show and hide items in lists. While a PivotTable usually is created on a separate worksheet in the workbook containing the data to be analyzed, a PivotTable also can be created on the same worksheet as the data. A PivotChart is an interactive chart used to analyze data graphically by varying the fields and categories to present different views. When a PivotChart is created, Excel automatically creates and associates a PivotTable with the PivotChart.
C6480_9_CTP.4c.indd 745
BTW
Creating and Formatting PivotTables and PivotCharts
Resolving Shared Workbook Conflicts When you save a shared workbook, Excel may notify you that one or more of your changes conflict with changes made by another user. The Resolve Conflicts dialog box displays the conflicting information and allows you to click the Accept Mine button or the Accept Other button to resolve the conflict. You also can choose to accept all of your changes or all of the other user’s changes. Finally, you can choose to always accept your changes and never see the Resolve Conflicts dialog box.
Excel Chapter 9
Creating and Formatting PivotTables and PivotCharts EX 745
Shared Workbook Change History Shared workbooks usually are current, active spreadsheets. Excel maintains a preset change history of 30 days. If you want more time to keep track of changes, you may change the number of days. For example, when you turn on the change history but are not sure exactly when the merge will take place, you can preserve the change history by setting a large number of days to maintain the change history, up to the maximum of 32,767 days. Tracking Changes with Passwords If you want to make sure others will not turn off the change history or reduce the number of days in the history, you can protect a shared workbook with a password. On the Review tab on the Ribbon, click the Protect and Share Workbook button. Passwords may be added only if the workbook is unshared at the time of protection.
8/8/07 3:23:41 PM
EX 746 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
The PivotTable required for this project is shown in Figure 9–59. It summarizes the data in the Repair Revenue Analysis worksheet to show the average of revenue per repair person in 2007 and 2008 for each state by shop type (Contracted or In-House). The interactive button in cell A4 allows the user to filter the table by shop type. Columns B and C show the values for the average of revenue per repair person in 2007 and 2008.
data categorized by state within shop type average revenue per repair person for each year
PivotTable report
Contracted subtotaled and then detailed by state
interactive field categories buttons
In-House subtotaled and then detailed by state Grand Total row
Figure 9–59
To Create a PivotTable The following steps begin to create the PivotTable shown in Figure 9–59 using the Create PivotTable dialog box.
1 • Select cell A3 and then click the Insert tab on the Ribbon.
PivotTable button arrow
Insert tab
• Click the PivotTable button arrow on the Ribbon to display the PivotTable menu (Figure 9–60). PivotTable command
PivotTable menu
cell A3 selected
Figure 9–60
C6480_9_CTP.4c.indd 746
8/8/07 3:23:42 PM
2 • Click PivotTable to display the Create PivotTable dialog box (Figure 9–61).
marquee surrounds list (database) that includes active cell
Create PivotTable dialog box
Excel Chapter 9
Creating and Formatting PivotTables and PivotCharts EX 747
range automatically selected
New Worksheet automatically selected
OK button
Figure 9–61
3 • Click the OK button to create the PivotTable on a new worksheet and display the PivotTable Field List pane (Figure 9–62).
PivotTable Field List pane
list of fields that can be dragged to drop areas below
PivotTable area
drag buttons to Column Labels drop area to create columns
drag fields to Values drop area to create value items which are summarized drag fields to Row Labels drop area to create rows
Other Ways
Figure 9–62
1. Press ALT+N, V, T
C6480_9_CTP.4c.indd 747
8/8/07 3:23:49 PM
EX 748 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
To Add Data to the PivotTable The next step in creating the PivotTable as shown in Figure 9–59 on page EX 746 is to add data by dragging four fields from the ‘Choose fields to add to report’ list to the ‘Drag fields between area below’ areas: two for the table columns and two for the table rows. As shown in Figure 9–59, the rows show states within shop types. The columns include the two data fields, Revenue per Repair Person 2007 and Revenue per Repair Person 2008. The following step adds data to the PivotTable.
1 • Drag the Shop
Refresh button
Type field from the ‘Choose fields to add to report’ list to the Row Labels area to add the Shop Type field to the PivotTable.
• Drag the
Sum of Revenue per Repair Person 2007 and Sum of Revenue per Repair Person 2008 listed in separate columns
PivotTable
bold and check mark indicate fields used in PivotTable
report State field from the ‘Choose fields to add to report’ list below the Shop Type button in the Row Labels area to add the State field to the PivotTable.
state within shop type
Sum of Revenue per Repair Person 2007 and Sum of Revenue per Repair Person 2008 added as Values fields
• Drag the Revenue per Repair Person 2007 field to the Values area to add the field to column B of the PivotTable.
State and Shop Type added as Row Labels fields
• Drag the Revenue
Q&A
Figure 9–63 per Repair Person 2008 field to the Values area to add the field to column C of the PivotTable (Figure 9–63). What is shown by the PivotTable? Excel displays the Shop Type and State fields as Row Labels in the PivotTable. Revenue per Repair Person 2007 and 2008 are totaled for each state within shop type.
More About PivotTables The information in PivotTables is not linked directly to worksheet cells, which means that when data changes in the worksheet cell, the table is not updated automatically. The PivotTable Tools Options contextual tab on the Ribbon contains a Refresh button (Figure 9–63) to update data when it changes on the worksheet. PivotTables can be based on several different types of data, including Excel lists and databases, multiple data ranges to be consolidated, and external sources, such as Microsoft Access databases.
C6480_9_CTP.4c.indd 748
8/8/07 3:23:53 PM
To Change the View of a PivotTable With regular tables or lists, one table or list must be created for each view of the data summary. With a PivotTable, a single table can be created and summaries can be viewed several ways just by using the mouse. The PivotTable provides a powerful interactive summarization of data with the visual appeal and benefits of a table. The FasToast Ovens Analysis PivotTable currently shows the sum of revenue per repair person for each year within state within shop type (Figure 9–63). The data can be viewed in many other ways, however, such as just looking at one year’s worth of information. To compare the data in different combinations, use the interactive buttons in the Row Labels area and Value area in the PivotTable Field List pane. Because the Nebraska and South Dakota shops have similar marketing strategies, viewing the data and comparing only these two states, rather than all four, might be beneficial. While moving the two data ranges next to each other in the worksheet would be tedious, using the interactive AutoFilter button in cell A4 makes it easy to choose which categories to show. The following steps interact with the PivotTable categories and series of data to change the view of the PivotTable.
Excel Chapter 9
Creating and Formatting PivotTables and PivotCharts EX 749
1 • Drag the Shop Type button in the Row Labels area below the State button to group revenue by shop type, rather than by state (Figure 9–64).
revenue summed by shop type within state
Shop Type button moved below State button
Figure 9–64
C6480_9_CTP.4c.indd 749
8/8/07 3:23:55 PM
EX 750 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
2 • Click the Sum of Revenue per Repair Person 2007 button arrow in the Values area to display the shortcut menu (Figure 9–65).
shortcut menu
Remove Field command
Sum of Revenue per Repair Person 2007 button arrow
Figure 9–65
3 • Click Remove Field on the shortcut menu to remove Sum of Revenue per Repair Person 2007 from the PivotTable (Figure 9–66).
only 2008 data is displayed
Figure 9–66
C6480_9_CTP.4c.indd 750
8/8/07 3:23:57 PM
4 • Click the Undo button on the Quick Access Toolbar to undo the removal of Sum of Revenue per Repair Person 2007 column from the PivotTable.
• Click the Row Labels AutoFilter button in cell A4 to display the Row Labels AutoFilter menu.
Excel Chapter 9
Creating and Formatting PivotTables and PivotCharts EX 751
Sum of Revenue per Repair Person 2007 column added back to table
Row Labels AutoFilter button
• When Excel displays the Row Labels AutoFilter menu, click the check boxes for Kansas and North Dakota to clear them (Figure 9–67). check marks cleared from Kansas and North Dakota check boxes so that only Nebraska and South Dakota data will be used in table
OK button
Figure 9–67
5 • Click the OK button to display
Undo button
only the Nebraska and South Dakota data in the PivotTable (Figure 9–68).
6 • Click the Undo button on the Quick Access Toolbar to display the data for all states.
only Nebraska and South Dakota data is displayed
Other Ways 1. To remove data, click check box next to checked fields in PivotTable Field List
C6480_9_CTP.4c.indd 751
Figure 9–68
8/8/07 3:24:05 PM
EX 752 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
To Filter a PivotTable Using a Page Field In a PivotTable, row and column fields can be rotated around the data fields by dragging the buttons to different areas at the bottom of the PivotTable Field List pane. For example, if you drag the State button to the Report Filter area, the view of the PivotTable changes. The State button then can be used to select specific states for which to view total sales. The use of this technique is known as filtering. The following steps add a page field to change the view of the PivotTable and then filter the PivotTable using the page field.
1 • Drag the State button in the Row Labels area to the Report Filter area in the PivotTable Field List pane to create a new page field in the PivotTable (Figure 9–69).
dragging State button to Report Filter area creates page field with AutoFilter button
different view of total for sales in all regions
data for all states is displayed
State button dragged to Report Filter area
Figure 9–69
2 • Click the State AutoFilter button in cell B1, click South Dakota on the AutoFilter menu, and then click the OK button to display totals for South Dakota (Figure 9–70).
South Dakota selected
sum of sales for South Dakota only
Figure 9–70
C6480_9_CTP.4c.indd 752
8/8/07 3:24:09 PM
To Format a PivotTable Once created, a PivotTable should be formatted to use colors and borders that enhance the data. To assist in formatting a PivotTable, Excel includes PivotTable styles that are used and appear similarly to Table styles. Different colors, patterns, alignments, fonts, and borders can be selected to apply to the entire PivotTable. Any of the wide range of Excel’s normal formats to individual cells also can be applied. You also can format the numeric values in a PivotTable by specifying a format for an entire column. For the FasToast Ovens Analysis PivotTable, the values should be formatted with the Currency style and no decimal places. The following steps format a PivotTable.
Excel Chapter 9
Creating and Formatting PivotTables and PivotCharts EX 753
1 • Double-click the Sheet1 tab.
Design Tab
• Type PivotTable and then press the ENTER key.
• Select cell A4, rightclick the PivotTable tab, and then point to Tab Color on the shortcut menu.
• Click Olive Green, Accent 3 (column 7, row 1) in the Theme Color area.
Pivot Style Medium 11 PivotTable style Pivot Style Medium 11 style previewed in PivotTable
PivotTable Styles gallery
2 • If necessary, select a cell in the PivotTable and then click the Design tab on the Ribbon.
Figure 9–71
• Click the PivotTable Styles More button to display the PivotTable Styles gallery.
• Point to the Pivot Style Medium 11 PivotTable style in the PivotTable Styles gallery to view a preview of the style in the PivotTable (Figure 9–71).
3 • Click the Pivot Style Medium 11 PivotTable style to apply the style to the PivotTable (Figure 9–72). style applied to PivotTable
Figure 9–72
C6480_9_CTP.4c.indd 753
8/8/07 3:24:13 PM
EX 754 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
4 • Right-click anywhere in cell B4 to display the shortcut menu (Figure 9–73).
cell B4
Number Format command
shortcut menu
Figure 9–73
5 • Click Number Format on the shortcut menu to display the Format Cells dialog box.
• When Excel displays the Format Cells dialog box, if necessary, click Currency in the Category list, type 0 in the Decimal places box, and then click the OK button.
• Right-click anywhere in cell C4 to display the shortcut menu.
• Click Number Format on the shortcut menu to display the Format Cells dialog box.
• When Excel displays the Format Cells dialog box, click Currency in the Category list, type 0 in the Decimal places box, and then click the OK button to format the numeric values in the PivotTable with the Currency style (Figure 9–74).
numbers formatted to Currency style with no decimal places
6 • Select cell A9 to deselect the worksheet.
• Click the Save button on the Quick Access toolbar to save the workbook. Figure 9–74 Other Ways 1. Press ALT+JY, S
C6480_9_CTP.4c.indd 754
8/8/07 3:24:17 PM
To Switch Summary Functions in a PivotTable Excel allows users to change the way the data fields are summarized on a PivotTable, add new fields to the analysis, or rotate the row and column fields. The PivotTable in the FasToast Ovens Analysis3 workbook illustrates the sum of the revenue per repair persons. The results, however, may be skewed because different offices in each state have a different mix of in-house and contracted shops. An average might be a better way to compare the revenue. The following steps show how to switch summary functions in a PivotTable.
Excel Chapter 9
Creating and Formatting PivotTables and PivotCharts EX 755
1 • Select cell B4 and then drag the State button in the Report Filter area above the Shop Type button in the Row Labels area.
• Right-click cell B4 to display the shortcut menu.
shortcut menu
Summarize Data By command
Summarize Data By submenu Average command
• Point to Summarize Data By on the shortcut menu (Figure 9–75). State field moved above Shop Type Field
Figure 9–75
2 • Click Average on the Summarize
data fields show averages instead of sums
Data By submenu to change the numbers in column B from sums to averages.
• Right-click cell C4 to display the shortcut menu.
• Point to Summarize Data By on the shortcut menu.
• Click Average on the Summarize Data By submenu to change the numbers in column C from sums to averages.
• Click cell A19 to deselect the PivotTable and close the PivotTable Field List (Figure 9–76). Figure 9–76
C6480_9_CTP.4c.indd 755
8/8/07 3:24:23 PM
BTW
EX 756 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
PivotTables The PivotTable is one of the most powerful analytical tools available in Excel. PivotTables are used to show the relationships among the data in a list or a database. These tables allow you to use drag and drop to examine the data from different views.
Summary Functions for PivotCharts and PivotTables Table 9–2 lists the summary functions Excel provides for analysis of data in PivotCharts and PivotTables. As shown in the previous steps, these functions can be selected by pointing to the Summarize Data By command on the shortcut menu and then clicking the function on the submenu. The last five summary functions can be accessed by clicking More options on the Summarize Data By submenu. Table 9–2 Summary Functions for PivotChart and PivotTable Data Analysis Summary Function
Description
Sum
Sum values; this is the default function for numeric source data
Count
The number of items
Average
The average of the values
Max
The largest value
Min
The smallest value
Product
The product of the values
Count Nums
The number of rows that contain numeric data
StdDev
An estimate of the standard deviation of all of the data to be summarized
StdDevp
The standard deviation of all of the data to be summarized
Var
An estimate of the variance of all of the data to be summarized
Varp
The variance of the data to be summarized
To Create a PivotChart, Change the PivotChart Type, and Format the Chart Excel provides two ways to create a PivotChart: (1) selecting the PivotChart command on the PivotTable menu as shown in Figure 9–60 on page EX 746 or (2) clicking the PivotChart button on the Options tab on the Ribbon while viewing a PivotTable. Excel provides many ways to format PivotCharts. Most of the steps in formatting a PivotChart, such as choosing a chart type, showing category or axis labels, and inserting titles, are performed in the same way as for regular charts. The default chart type for a PivotChart is a Clustered Column chart. PivotCharts can be any chart type except XY (Scatter), Stock, or Bubble. The following steps create the FasToast Ovens Repair Revenue Analysis PivotChart as a Clustered Cylinder chart that shows the two-year data side by side. A title also is added to the chart.
C6480_9_CTP.4c.indd 756
8/8/07 3:24:26 PM
1 • Select cell A4.
Options tab
• Click the Options
PivotChart button
Insert Chart dialog box
tab on the Ribbon and then click the PivotChart button on the Ribbon to display the Insert Chart dialog box.
Excel Chapter 9
Creating and Formatting PivotTables and PivotCharts EX 757
Clustered Cylinder chart type selected
• Click Clustered Cylinder (column 1, row 2) in the ‘Column chart type’ gallery (Figure 9–77).
cell A4 selected
OK button
Figure 9–77
2 • Click the OK button
Move Chart button
to add the chart to the PivotTable worksheet.
• With the chart selected, click the Move Chart button on the Ribbon to display the Move Chart dialog box.
Move Chart dialog box
New sheet option button selected
PivotChart new sheet name
• When Excel displays the Move chart dialog box, click New sheet to select it and then type PivotChart in the New sheet text box (Figure 9–78).
OK button
Figure 9–78
C6480_9_CTP.4c.indd 757
8/8/07 3:24:26 PM
EX 758 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
3 • Click the OK button.
Layout tab Chart Title button
• Right-click the PivotChart tab and then point to Tab Color on the shortcut menu.
Chart Title menu
PivotChart
• Click Purple, Accent 4 (column 8, row1) to change the color of the PivotChart sheet tab.
Above Chart command
• Click the Layout tab on the Ribbon and then click the Chart Title button on the Ribbon to display the Chart Title menu.
• Point to Above Chart on the Chart Title menu (Figure 9–79).
PivotChart sheet added and tab color changed
Figure 9–79
4 • Click Above Chart on the Chart Title menu.
chart title
• When the title is placed above the chart, select the title text. Type FasToast Ovens Analysis and then click anywhere on the chart to add the title to the chart (Figure 9–80).
data grouped by shop type within state
Figure 9–80
C6480_9_CTP.4c.indd 758
8/8/07 3:24:30 PM
To Change the View of a PivotChart When the PivotTable was created, the PivotTable and PivotChart Wizard also provided the option of creating a PivotChart with a PivotTable. A PivotChart cannot exist in Excel without an associated PivotTable. Excel automatically keeps a PivotTable and its associated PivotChart in synchronization, so that changes made to one are reflected in the other. The following steps change the view of the PivotChart and then show how the change in the PivotChart causes a corresponding change in the view of the associated PivotTable.
Excel Chapter 9
Creating and Formatting PivotTables and PivotCharts EX 759
1 • Drag the Shop Type button in the Row Labels above the State button to group the data by state within shop type (Figure 9–81).
2 • Click the PivotTable
data grouped by state within shop type
Q&A
sheet tab (Figure 9–82). What happens when the view of the PivotChart changes? When the position of a field in a PivotChart or PivotTable is changed, the corresponding field in the other changes automatically. Row fields in a PivotTable correspond to category (x-axis) fields in a PivotChart, while column fields in a PivotTable correspond to series (y-axis) fields in charts. Further, if the data on the Repair Revenue Analysis worksheet is updated, clicking the Refresh button on the Options tab on the Ribbon updates the corresponding PivotTable and PivotChart.
Shop Type button moved above State button
Figure 9–81
PivotTable automatically reflects PivotChart changes
totals updated to match PivotChart
Figure 9–82
C6480_9_CTP.4c.indd 759
8/8/07 3:24:33 PM
EX 760 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
To Close the Workbook The FasToast Ovens Analysis3 workbook is complete. The following steps close the FasToast Ovens Analysis3 workbook.
1
Click the workbook Close button.
2
When Excel displays the Microsoft Office Excel dialog box, click the Yes button.
BTW
Comparing and Merging Workbooks
Sorting PivotTable and PivotChart Data You can sort the data in a PivotTable or PivotChart in a number of ways. Excel allows items to be sorted in ascending or descending order, to be sorted by a particular data value, or to be sorted in a custom order. You also can turn off sorting. After Excel sorts a PivotTable or PivotChart, some formatting on the PivotChart may be lost. See Excel Help for more information about sorting PivotTables and PivotCharts.
Excel includes two useful commands for working with multiple versions of a workbook, including comparing two or more versions of the same workbook. Excel provides the capability to open multiple copies of the same workbook and move through the workbooks in a synchronized manner so that the same area of each workbook is always in view. For example, as a user scrolls down a worksheet, Excel automatically updates the view of the second worksheet to show the same rows as the first worksheet. This functionality allows for a side-by-side, visual comparison of two workbooks. Instead of tracking all of the changes to a single copy of a workbook, copies of the same workbook can be merged. This may be necessary because multiple users are entering data or because new data has come from a different source. To merge the changes from one workbook into another, both workbooks must satisfy the following requirements: • The original workbook must be shared, before making copies, and each workbook must be a copy of the same workbook. • When copies of the workbook are made, track changes or sharing must be enabled, so that the change history of the workbook is kept. • The Share Workbook button on the Review tab on the Ribbon displays a dialog box with a tab for recording the number of days to record the change history. Shared workbooks must be merged within that time period. • If the workbooks have been assigned passwords, all workbooks involved in the merge must have the same password.
BTW
• Each copy of the workbook must have a different file name.
Merging If you are not sure of the time period that will elapse before you merge workbooks that you send out for changes, set a large number of days for keeping the change history. You can set the number of days to be as large as 32,767 days.
C6480_9_CTP.4c.indd 760
When all of the copies of the workbook are available on your hard disk or USB drive, open the copy of the shared workbook into which to merge changes from another workbook file. Next, add the Compare and Merge Workbooks button to the Quick Access Toolbar and then click the button. When Excel displays the Select Files to Merge Into Current Workbook dialog box, select a workbook or workbooks to merge. When Excel merges the workbooks, both data and comments are merged, so that if comments are recorded, they appear one after another in a given cell’s comment box. If Excel cannot merge the two workbooks, information from one workbook still can be incorporated into the other by copying and pasting the information from one workbook to another.
8/8/07 3:24:37 PM
To Compare Workbooks FasToast Ovens maintains historical travel expense information in a workbook that has been shared and copied to two other members of the staff for review. The FasToast Ovens Travel Expenses workbook also contains a chart that shows total expenses over the past five years. Because two different users — Maura and Stanley — modified the separate workbooks, the workbooks must be merged. Before merging the workbooks, the workbooks should be compared visually to note the changes. The following steps open the FasToast Ovens Travel Expenses and FasToast Ovens Travel Expenses Maura workbooks and compare the workbooks side by side.
1 • Open the file, FasToast Ovens Travel Expenses, from the Data Files for Students.
• Open the file,
View tab
FasToast Ovens Travel Expenses workbook
Excel Chapter 9
Comparing and Merging Workbooks EX 761
View Side by Side button
workbook is shared
FasToast Ovens Travel Expenses Maura, from the Data Files for Students.
2 • Click the View tab expense data
on the Ribbon (Figure 9–83).
Travel Expenses chart
FasToast Ovens Travel Expenses Maura workbook workbook is shared
Figure 9–83
C6480_9_CTP.4c.indd 761
8/8/07 3:24:37 PM
EX 762 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
3 • Click the View Side by Side button on the Ribbon to display the workbooks side by side. Depending on how previous Excel windows were arranged on your computer, the workbooks may appear next to each other left-to-right.
Synchronous Scrolling button Excel automatically resizes workbook windows
Close Side by Side button
Reset Window Position button
FasToast Ovens Travel Expenses Maura window scroll bar
• Use the scroll bar in the top window to scroll the FasToast Ovens Travel Expenses Maura worksheet (Figure 9–84).
4 • Click the View Side by Side button on the Ribbon again.
• Click the workbook Close Window button to close the FasToast Ovens Travel Expenses Maura workbook.
Figure 9–84
• If Excel displays the Microsoft Office Excel dialog box, click the No button. Q&A
• If necessary, click the Maximize button in the FasToast Ovens Travel Expenses window. What happens when I scroll the workbook? Because the Synchronous Scrolling button is selected, both workbooks scroll at the same time so that you can make a visual comparison of the workbooks. Other Ways 1. Press ALT+W, B
C6480_9_CTP.4c.indd 762
8/8/07 3:24:40 PM
To Merge Workbooks The next step is to merge the two workbooks changed by Maura and Stanley into the original FasToast Ovens Travel Expenses workbook. All three of the workbooks are shared. The following steps merge the workbooks containing changes from the other members of the staff with the original workbook, FasToast Ovens Travel Expenses.
1 • Click the Customize
Excel Options dialog box
Quick Access Toolbar button arrow next to the Quick Access Toolbar and then click More Commands on the Customize Quick Access Toolbar menu.
• When the Excel
Excel Chapter 9
Comparing and Merging Workbooks EX 763
Customize Quick Access Toolbar button
All Commands selected
Compare and Merge Workbooks command
Compare and Merge Workbooks button to be added to Quick Access Toolbar
Add button
Options dialog box appears, select All Commands in the ‘Choose commands from’ list.
• Scroll to the Compare and Merge Workbooks command in the list on the left and then select it.
OK button
• Click the Add button to add the Compare and Merge Workbooks button to the list on the right side of the dialog box (Figure 9–85).
Figure 9–85
• Click the OK button to add the Compare and Merge Workbooks button to the Quick Access Toolbar.
C6480_9_CTP.4c.indd 763
8/8/07 3:24:42 PM
EX 764 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines Select Files to Merge Into Current Workbook dialog box
2 • Click the Compare and Merge Workbooks button on the Quick Access Toolbar to display the Select Files to Merge Into Current Workbook dialog box.
• Select UDISK 2.0 (E:) in the Address bar.
• Click FasToast Ovens Travel Expenses Stanley, hold down the SHIFT key, and then click FasToast Ovens Travel Expenses Maura to select both files (Figure 9–86).
workbooks to be merged are selected
OK button
Figure 9–86
3 • Click the OK button to merge the Q&A
workbooks (Figure 9–87). What is result of the merge? The workbooks have been merged, and the FasToast Ovens Travel Expenses worksheet reflects the changes from Maura and Stanley. Excel also updated the Total Expenses historical chart. If Stanley and Maura had changed a common cell with different values, Excel would have displayed a prompt, asking which change to keep in the merged workbook. cells updated from other workbooks
cells updated from other workbooks
Figure 9–87
To Turn Off Workbook Sharing and Save the Workbook The next step is to turn off workbook sharing so that the chart can be manipulated.
C6480_9_CTP.4c.indd 764
1
Click the Review tab on the Ribbon and then click the Share Workbook button on the Ribbon.
2
When Excel displays the Share Workbook dialog box, click ‘Allow changes by more than one user at the same time’ to clear the check box.
8/8/07 3:24:45 PM
4
If Excel displays the Microsoft Office Excel dialog box, click the Yes button.
5
Click the Save button on the Quick Access Toolbar.
Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr). The R-squared Value The R-squared value of a trendline can tell you how accurate the projection may be. Trendlines are most reliable when their R-squared values are at or near 1. When you create a trendline, Excel automatically calculates the R-squared value. You then can display this value on your chart.
Adding a Trendline to a Chart A trendline is used on certain Excel charts to show the general tendency of how data in a chart is changing. Trendlines are calculated automatically and overlaid onto charts using the Trendline menu. Excel allows trendlines to be added to several types of charts, including Unstacked 2-D Area, Bar, Column, Line, Stock, XY (Scatter), and Bubble charts. Trendlines become valuable when they are used to project data beyond the values of a data set. This process is called forecasting. Forecasting helps predict data values that are outside of a data set. For example, if a data set is for a 10-year period and the data shows a trend in that 10-year period, Excel can predict values beyond that period or estimate what the values may have been before that period.
Excel Chapter 9
Click the OK button.
BTW
3
BTW
Adding a Trendline to a Chart EX 765
To Add a Trendline to a Chart The following steps add a trendline to the Total Expenses chart and predict the total expenses two years beyond the data set in the FasToast Ovens Travel Expenses worksheet.
1 • Select the chart by clicking the shaded area within the chart.
Design tab Change Chart Type button Change Chart Type dialog box
• Click the Design tab on the Ribbon.
• Click the Change Chart Type button on the Ribbon to display the Change Chart Type dialog box. Line with Markers chart type
• Click the Line with Markers chart type in the Change Chart Type dialog box (Figure 9–88).
OK button
Figure 9–88
C6480_9_CTP.4c.indd 765
8/8/07 3:24:53 PM
EX 766 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
2 • Click the OK button
Layout tab
Trendline button
to change the Travel Expenses chart to a line with markers chart.
• With the chart
Trendline menu
selected, click the Layout tab on the Ribbon.
Linear Forecast Trendline command
• Click the Trendline button on the Ribbon to display the Trendline menu (Figure 9–89).
chart changed to 2-D line chart with markers
Figure 9–89
3 • Click Linear Forecast Trendline to add a trendline to the chart with a 2-period forecast (Figure 9–90).
trendline added in different color
year 2009 forecast
year 2010 forecast
Figure 9–90 Other Ways
BTW
1. ALT+JA, N
Excel Help The best way to become familiar with Excel Help is to use it. Appendix C includes detailed information about Excel Help and exercises that will help you gain confidence in using it.
C6480_9_CTP.4c.indd 766
Saving Custom Views and Formatting a Worksheet Background After a workbook functions in the manner in which it was designed, final touches can be added to the worksheets in the workbook to make them more attractive and usable to users of the workbook. Custom views allow certain layout and printing characteristics of a workbook to be saved and then used later. Worksheet backgrounds allow an image to be specified for use as a watermark behind the data in cells of a worksheet.
8/8/07 3:24:55 PM
To Save a Custom View of a Workbook When a custom view of a workbook is saved, Excel stores information about the window size of the workbook and print settings that have been applied to the workbook at the time it is saved. Because of this, the workbook thus should be changed to have the desired layout and print settings before saving a custom view of a workbook. Each custom view that is created includes a name. The Custom Views button on the View tab on the Ribbon is used to save, delete, and show custom views. When a user saves a view, Excel also stores the name of the current worksheet. When a user shows a view by clicking the Show button in the Custom Views dialog box, Excel switches to the worksheet that was active in the workbook when the workbook view was saved. The following steps create and save a custom view of the FasToast Ovens Travel Expenses workbook.
1 • Resize the FasToast Ovens Travel Expenses workbook window as shown in Figure 9–91.
Excel Chapter 9
Saving Custom Views and Formatting a Worksheet Background EX 767
View tab Custom Views button
• Click the View tab on the Ribbon (Figure 9–91).
workbook window resized
Figure 9–91
2 • Click the Custom Views button on
Maximize button
the Ribbon to display the Custom Views dialog box (Figure 9–92).
Custom Views dialog box default view
Show button Views list box Add button
Delete button
Figure 9–92
C6480_9_CTP.4c.indd 767
8/8/07 3:24:59 PM
EX 768 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
3 • Click the Add button to display the Add View dialog box.
• Type Expenses in the Name text box (Figure 9–93).
4 • Click the OK button. Add View dialog box
• Click the Maximize button on the FasToast Ovens Travel Expenses workbook title bar.
new view named Expenses
• Click the Custom Views button on the Ribbon to display the Custom Views dialog box.
settings to be included in view
• Click Expenses in the Views list
Q&A
and then click the Show button to resize the workbook to the size saved in the Expenses view.
OK button
Can I delete a view? Yes. To delete views, use the Delete button in the Custom Views dialog box as shown in Figure 9–92 on the previous page.
Figure 9–93
Other Ways 1. Press ALT+W, C
To Format a Worksheet Background In addition to adding color to the background of cells or ranges, Excel also allows an image to be used as a worksheet background. Worksheet backgrounds provide a more interesting look to a worksheet, allowing for a corporate logo or other identifying image to serve as the background for an entire worksheet. The following steps add an image as a worksheet background to the FasToast Ovens Travel Expenses worksheet.
1 • Click the Maximize button on the
Page Layout tab Background button
FasToast Ovens Travel Expenses workbook title bar.
• Click the Page Layout tab on the Ribbon (Figure 9–94).
Figure 9–94
C6480_9_CTP.4c.indd 768
8/8/07 3:25:02 PM
2 • Click the Background button on
Sheet Background dialog box
View Gridlines check box
the Ribbon to display the Sheet Background dialog box.
Excel Chapter 9
Saving Custom Views and Formatting a Worksheet Background EX 769
• If necessary, select UDISK 2.0 (E:) in the Address bar.
• Click the file name, FasToast Travel (Figure 9–95).
FasToast Travel image selected
Insert button
Figure 9–95
3 • Click the Insert button to display the image as the worksheet background.
• Click the View Gridlines check box
Q&A
on the Ribbon to turn off gridlines (Figure 9–96). Why does the image repeat? When a background is added, the image is tiled, or repeated, over the length and width of the worksheet. Figure 9–96 demonstrates that image backgrounds sometimes make the worksheet less readable; this fact should be taken into account. Finally, worksheet backgrounds do not print when all or a portion of the worksheet is printed.
image added as worksheet background
Figure 9–96 Other Ways 1. Press ALT+P, G
C6480_9_CTP.4c.indd 769
8/8/07 3:25:05 PM
BTW
EX 770 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential – proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ ex2007/cert).
To Quit Excel The following steps quit Excel.
1
Remove the Compare and Merge Workbooks button from the Quick Access Toolbar.
2
Click the Close button on the right side of the title bar.
3
If Excel displays the Microsoft Office Excel dialog box, click the No button.
Chapter Summary In this chapter, you learned how to import data in different formats into a worksheet, track changes, create visual representations of the data in a worksheet, share a workbook and track changes, create interactive PivotTables and PivotCharts, compare and merge workbooks and how to create a trendline on a chart. The items listed below include all the new Excel skills you have learned in this chapter. 1. Import Data from a Text File into a Worksheet (EX 713) 2. Import Data from an Access Table into a Worksheet (EX 718) 3. Import Data from a Web Page into a Worksheet (EX 721) 4. Copy and Transpose Data from a Word Document to a Worksheet (EX 725) 5. Convert Text to Columns (EX 729) 6. Replicate Formulas (EX 733) 7. Share a Workbook and Collaborate on a Workbook (EX 735) 8. Insert a Comment (EX 739) 9. Turn On Track Changes (EX 740) 10. Open a Workbook and Review Tracked Changes (EX 742) 11. Turn Off Track Changes (EX 745)
12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25.
Create a PivotTable (EX 746) Add Data to the PivotTable (EX 748) Change the View of a PivotTable (EX 749) Filter a PivotTable Using a Page Field (EX 752) Format a PivotTable (EX 753) Switch Summary Functions in a PivotTable (EX 755) Create a PivotChart, Change the PivotChart Type, and Format the Chart (EX 756) Change the View of a PivotChart (EX 759) Compare Workbooks (EX 761) Merge Workbooks (EX 763) Turn Off Workbook Sharing and Save the Workbook (EX 764) Add a Trendline to a Chart (EX 765) Save a Custom View of a Workbook (EX 767) Format a Worksheet Background (EX 768)
If you have a SAM user profile, you may have access to hands-on instruction, practice, and assessment. Log in to your SAM account (http://sam2007.course.com) to launch any assigned training activities or exams that relate to the skills covered in this chapter.
C6480_9_CTP.4c.indd 770
8/8/07 3:25:09 PM
Learn It Online is a series of online student exercises that test your knowledge of chapter content and key terms. Instructions: To complete the Learn It Online exercises, start your browser, click the Address bar, and then enter the Web address scsite.com/ex2007/learn. When the Excel 2007 Learn It Online page is displayed, click the link for the exercise you want to complete and then read the instructions.
Chapter Reinforcement TF, MC, and SA A series of true/false, multiple choice, and short answer questions that test your knowledge of the chapter content.
Who Wants To Be a Computer Genius? An interactive game that challenges your knowledge of chapter content in the style of a television quiz show.
Flash Cards An interactive learning environment where you identify chapter key terms associated with displayed definitions.
Wheel of Terms An interactive game that challenges your knowledge of chapter key terms in the style of the television show Wheel of Fortune.
Practice Test A series of multiple choice questions that test your knowledge of chapter content and key terms.
Crossword Puzzle Challenge A crossword puzzle that challenges your knowledge of key terms presented in the chapter.
Excel Chapter 9
Learn It Online
STUDENT ASSIGNMENTS
Apply Your Knowledge EX 771
Apply Your Knowledge Reinforce the skills and apply the concepts you learned in this chapter.
Merging Workbooks and Creating a Trendline Instructions: Start Excel. Open the workbook Apply 9-1 Purity Systems from the Data Files for Students and then save the workbook using the file name, Apply 9-1 Purity Systems Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Perform the following tasks. 1. Review the FilterPro Room Air Purifier worksheet, which contains expense information for manufacturing one of Purity Systems’ products (Figure 9–97 on the next page), as well as a graph of the total expenses from each month. The workbook is shared. 2. If necessary, add the Compare and Merge Workbooks button to the Quick Access Toolbar. Use the Compare and Merge Workbooks command to merge the workbooks Apply 9-1 Purity Systems South and Apply 9-1 Purity Systems West into the Apply 9-1 Purity Systems Complete workbook. The values in the range B3:G12 should appear as shown in Figure 9–97.
Continued >
C6480_9_CTP.4c.indd 771
8/8/07 3:25:10 PM
EX 772 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
continued
STUDENT ASSIGNMENTS
Apply Your Knowledge
Figure 9–97
3. Turn off sharing so that the workbook is exclusive. 4. Click the Page Layout tab on the Ribbon and then click the Fonts button in the Themes group. Select the Office font style in the Fonts gallery. Save the style changes as a new theme named Purity. 5. On the Page Layout tab, click the Margins button in the Page Setup group, and then click Narrow to change the margin setting to Narrow. 6. Change the document properties as specified by your instructor. Change the worksheet header to include your name, course number, and other information requested by your instructor. 7. Print the FilterPro Room Air Purifier worksheet in landscape orientation. 8. Add a linear trendline to the chart on the worksheet. Forecast the total expenses two months forward. Print the worksheet. 9. Display the Format Trendline dialog box by right-clicking the trendline and then clicking Format Trendline on the shortcut menu. You also can click the Chart Tools Layout tab on the Ribbon, click the Trendline button in the Analysis group, and then click More Trendline Options to display the Format Trendline dialog box. Click Trendline Options in the Format Trendline dialog box and forecast five months forward. Print the worksheet.
C6480_9_CTP.4c.indd 772
8/8/07 3:25:12 PM
11. Resize the worksheet window so that the chart with the trendline is the only part of the worksheet that appears. Save this view of the worksheet as a view named Trendline View. Maximize the Excel worksheet window, and then add a background image to the worksheet, using the file Apply 9-1 Purity Systems.jpg from the Data Files for Students as the background image. 12. Save the workbook and then print the worksheet. 13. Submit the assignment as specified by your instructor.
Extend Your Knowledge Extend the skills you learned in this chapter and experiment with new skills. You may need to use Help to complete the assignment.
Excel Chapter 9
10. Display the Format Trendline dialog box again. Click Trendline Options and use a custom trendline name of Forecasted Expenses. Forecast six months forward. Resize the chart if necessary so all the dates on the horizontal axis appear on two lines.
STUDENT ASSIGNMENTS
Extend Your Knowledge EX 773
Setting Criteria to Analyze Data Instructions: Start Excel. Open the workbook Extend 9-1 Mariner Cruises from the Data Files for Students and then save the workbook using the file name, Extend 9-1 Mariner Cruises Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. You have been asked to analyze the March sales for Mariner Cruises, who record the cruises they sell each month in an Excel worksheet (Figure 9–98).
Figure 9–98
C6480_9_CTP.4c.indd 773
Continued >
8/8/07 3:25:15 PM
EX 774 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
STUDENT ASSIGNMENTS
Extend Your Knowledge
continued
Mariner Cruises offers five types of cruises, and the price of each cruise varies by the week. For this reason, the March Summary worksheet lists the five cruises sold each week, the price of the cruise that week, the quantity of cruises sold, and the total revenue generated by each cruise that week. The Sales by Rep worksheet lists each cruise sold and the code for the sales rep who handled the sales (Figure 9–99). To complete the summary information on the March Summary worksheet, you need to use two types of functions: conditional functions (AVERAGEIF, COUNTIF, and SUMIF) and text functions (LOWER, PROPER, SUBSTITUTE, and UPPER). You use the three conditional functions — AVERAGEIF, COUNTIF, and SUMIF — in similar ways to average, count, or sum values in a range based on a single criteria. For example, in a product list that contains the name of each product your company sells and the corresponding price, you can use the COUNTIF function to calculate how many products sell for more than $100. In a sales list, you can use the SUMIF function to total the sales of a particular product, or use the AVERAGEIF function to calculate the average sale for products sold to a particular customer. The UPPER, LOWER, and PROPER text functions let you change the case of text, such as from uppercase to lowercase, to make the text easier to read. The SUBSTITUTE function substitutes new text for old, such as substituting “Price” for “Cost.” Perform the following tasks. 1. Review the March Summary and Sales by Rep worksheets by clicking the appropriate tabs. 2. Select cell F3 on the Sales by Rep worksheet, and then import the tab-delimited text file, Extend 9-1 Mariner Cruises.txt, from the Data Files for Students. Resize columns as necessary to display all the data. 3. In cell I3 of the March Summary worksheet, enter =COUNTIF('Sales by Rep'!B$3: B$216,'March Summary'!H3) to determine the number of Caribbean cruises (cruise code 101-25) sold in March. Copy the formula in cell I3 to cells I4:I7 (Figure 9–98 on the previous page).
Figure 9–99
C6480_9_CTP.4c.indd 774
8/8/07 3:25:17 PM
5. In cell K3, insert a formula that uses the AVERAGEIF function to determine the average unit price of Caribbean cruises in March. All of the data you need is contained on the March Summary worksheet. Use absolute or relative cell references as necessary so you can copy the formula to other cells in column K. Copy the formula in cell K3 to cells K4:K7. Format as necessary to preserve the appearance of the worksheet (Figure 9–98 on page EX 773). 6. In cell H10, insert a formula that uses a text function to display the names of the sales reps using the appropriate case for proper names. The names of the sales reps are listed on the Sales by Rep worksheet. Use absolute or relative cell references as necessary so you can copy the formula to other cells in column H. Copy the formula in cell H10 to cells H11:H18. 7. In cell I10, insert a formula that uses the COUNTIF function to determine the total number of cruises sold by each sales rep. All of the data you need is included on the Sales by Rep worksheet. (Hint: In the formula, refer to each sales rep by their number.) Use absolute or relative cell references as necessary so you can copy the formula to other cells in column I. Copy the formula in cell I10 to cells I11:I18. Format as necessary to preserve the appearance of the worksheet.
Excel Chapter 9
4. In cell J3, insert a formula that uses the SUMIF function to determine the total sales of Caribbean cruises in March. All of the data you need is contained on the March Summary worksheet. Use absolute or relative cell references as necessary so you can copy the formula to other cells in column J. Copy the formula in cell J3 to cells J4:J7.
STUDENT ASSIGNMENTS
Make It Right EX 775
8. In cell E23, insert a formula that calculates the total number of cruises sold. 9. Type Total in cell H19. In cell I19, insert a formula that calculates the total number of cruises sold. Verify that the result in cell I19 is the same as in cell E23. Format cells H19:I19 to match the format of cell E23. 10. Change the document properties as specified by your instructor. Change the worksheet header to include your name, course number, and other information requested by your instructor. 11. Change the print orientation to landscape and then print the worksheet. Print the formulas version of the worksheet. Save the workbook. 12. Submit the assignment as specified by your instructor.
Make It Right Analyze a workbook and correct all errors and/or improve the design.
PivotTables and PivotCharts Instructions: Start Excel. Open the workbook Make It Right 9-1 Pacific Restaurant Supply from the Data Files for Students and then save the workbook using the file name, Make It Right 9-1 Pacific Restaurant Supply Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Click the PivotTable and PivotChart tab. Correct the PivotTable and PivotChart so that they appear as shown in Figure 9–100 on the next page.
Continued >
C6480_9_CTP.4c.indd 775
8/8/07 3:25:19 PM
EX 776 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
continued
STUDENT ASSIGNMENTS
Make It Right
Figure 9–100
1. On the PivotTable and PivotChart worksheet, add all of the fields to the PivotTable. Use the Quarter field as the Report Filter. Use the Category field as the Column Labels, the Product field as the Row Labels, and the Sum of Sales as the Values. 2. Apply the Pivot Style Light 16 style to the PivotTable. 3. Change the contents of cell A5 to Products and change the contents of cell B4 to Categories. 4. Filter the PivotTable to show bar and tabletop product sales data for the first quarter only. 5. Move and resize the PivotChart so it covers cells F1:K13. 6. Change the background color of the range A6:D22 to the Orange, Accent 2, Lighter 80% fill color. 7. Format all the sales values, including the grand totals, as Currency values with a dollar sign and two decimal places. 8. Change the chart style of the PivotChart to Style 18. 9. Format the values in the vertical axis so they appear as Currency values with a dollar sign and no decimal places. Format the background of the plot area to display a solid fill in Dark Green, Text 2, Lighter 80% fill. Display the legend at the top of the chart. 10. Resize the chart as shown in Figure 9–100. 11. Change the document properties as specified by your instructor. Change the PivotTable and PivotChart worksheet header to include your name, course number, and other information requested by your instructor.
C6480_9_CTP.4c.indd 776
8/8/07 3:25:20 PM
12. Change the print orientation to landscape, and then print the PivotTable and PivotChart worksheet. Save the workbook. 13. Submit the assignment as specified by your instructor.
Excel Chapter 9
In the Lab EX 777
Create a workbook using the guidelines, concepts, and skills presented in this chapter. Labs are listed in order of increasing difficulty.
Lab 1: Importing Data into an Excel Worksheet Problem: You work as an assistant to a building contractor that has offices in three parts of the state. You are starting to consolidate information about the clients, projects, billable hours, and other hours employees work at each office. You asked each office manager to send you this billing information, but each data set is in a different format. The Center office manager sent a text file with fields separated by commas. The North office manager, who uses an Access database to maintain data, queried the database to create a table to send to you. The East office manager provided the data in a Word table.
STUDENT ASSIGNMENTS
In the Lab
Instructions: Create the worksheet shown in Figure 9–101 using the techniques learned in this chapter and following the instructions on the next page.
Figure 9–101
C6480_9_CTP.4c.indd 777
8/8/07 3:25:22 PM
EX 778 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
In the Lab
continued
STUDENT ASSIGNMENTS
1. Open the workbook Lab 9-1 Jansen Builders from the Data Files for Students and then save the workbook using the file name, Lab 9-1 Jansen Builders Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. 2. Select cell A4, and then enter the text Center. Select cell A9, and then enter the text North. Select cell A18, and then enter the text East. 3. Select cell B4. Import the comma-delimited text file, Lab 9-1 Center, from the Data Files for Students. In the Text Import Wizard - Step 2 of 3 dialog box, click the Comma check box to select it and then click Tab to clear the check box; otherwise accept the default settings. In the Import Data dialog box, click the Properties button. In the External Data Range Properties dialog box, click ‘Adjust the column width’ to clear the check box. Import the text data to cell B4 of the existing worksheet. 4. Select cell B9. Import the Access database file, Lab 9-1 North, from the Data Files for Students. Choose to view the data as a table, and insert the data starting in cell B9 in the existing workbook. Accept all of the default settings to import the data. Right-click any cell in the table, point to Table, and then click Convert to Range. Click the OK button to permanently remove the connection to the query. Delete row 9. 5. Start Microsoft Office Word, and then open the Word file, Lab 9-1 East, from the Data Files for Students. Copy all of the data in the table. Switch to Excel. Select cell B18, and then using the Paste Special command, paste the data only into the Time Sheet Summary worksheet. Close Word. Adjust the column widths as necessary to display all of the data. 6. Select cell F4 and then enter the formula =D4+E4. Copy the formula to cells F5:F27. 7. In cells D28, E28, and F28, enter formulas to calculate the total billable hours, total other hours, and total hours. 8. Change the document properties as specified by your instructor. Change the worksheet header to include your name, course number, and other information requested by your instructor. 9. Print the worksheet, and then save the workbook. 10. Delete Sheet2 and Sheet3. 11. Export the Time Sheet Summary worksheet to a tab-delimited text file by clicking the Office Button, pointing to Save As, and then clicking Other Formats. When Excel displays the Save As dialog box, select Text (Tab delimited) in the ‘Save as type’ list and then click the Save button. If Excel displays one or more Microsoft Office Excel dialog boxes, click the Yes button. Open the text file using Notepad and then print the text file. Quit Notepad. 12. Submit the assignment as specified by your instructor.
C6480_9_CTP.4c.indd 778
8/8/07 3:25:24 PM
Lab 2: Routing Workbooks, Tracking Changes, and Inserting Comments Problem: This problem requires collaboration with two other classmates. Make sure that you can send e-mail to other classmates before completing this exercise. You work as an assistant for a professor who is in charge of several sections of the school’s Economics 101 class. The professor has asked you to verify the grades for students before she submits them to the registrar. To do so, you must ask the graduate students who teach each section to review the grades that are in the current Economics 101 Fall 2010 worksheet (Figure 9–102). Instructions: Start Excel and perform the following tasks. 1. Open the workbook Lab 9-2 Economics 101 from the Data Files for Students and then save the workbook using the file name, Lab 9-2 Economics 101 Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book.
Excel Chapter 9
In the Lab
STUDENT ASSIGNMENTS
In the Lab EX 779
2. Add a comment to cell E10 as shown in Figure 9–102.
Figure 9–102
3. Track changes to the workbook. Click the Review tab on the Ribbon, click Track Changes in the Changes group, and then click Highlight Changes on the Track Changes submenu. Click the ‘Track changes while editing’ check box and then clear the three check boxes in the ‘Highlight which changes’ area.
Continued >
C6480_9_CTP.4c.indd 779
8/8/07 3:25:25 PM
EX 780 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
In the Lab
continued
STUDENT ASSIGNMENTS
4. Send the workbook to two classmates by clicking the Office Button, pointing to Send, and then clicking E-mail on the Send submenu. Select the e-mail addresses of two classmates and enter Economics 101 Grade Verification in the Subject text box. Enter appropriate message text in the Message text box, requesting that each classmate add comments to at least one cell and change the contents of two cells. Click the Send button. 5. Ask a classmate to send the workbook to you as well. When you receive the e-mail, print it. Add a comment to at least one cell and change the contents of at least two cells before sending the workbook to the next recipient. 6. When you receive your workbook back after it has been sent to all recipients, click the Review tab on the Ribbon, click the Track Changes button on the Ribbon, and then click Accept/Reject Changes on the Track Changes menu. Reject one change and accept all the others. 7. In the Comments group on the Review tab, click the Show All Comments button. 8. Change the document properties as specified by your instructor. Change the worksheet header to include your name, course number, and other information requested by your instructor. Print the worksheet in landscape orientation. Save the workbook. 9. Submit the assignment as specified by your instructor.
In the Lab Lab 3: Creating a PivotTable Report and PivotChart Report for an Annual Sales Workbook Problem: You work for the Farmers Wholesale Cooperative and help the financial director prepare and analyze revenue and expenses. He has asked you to create two PivotTables and corresponding PivotCharts from the annual sales worksheet for the Farmers Wholesale Cooperative (Figure 9–103a). One PivotTable and PivotChart summarize the sales by farm (Figure 9–103b). The other PivotTable and PivotChart summarize the dairy sales by month for the top dairy producer (Figure 9–103c).
C6480_9_CTP.4c.indd 780
8/8/07 3:25:27 PM
Excel Chapter 9 STUDENT ASSIGNMENTS
In the Lab EX 781
(a) Worksheet Database
(b) Sales by Farm PivotTable and PivotChart
(c) Dairy Sales by Month PivotTable and PivotChart Figure 9–103
C6480_9_CTP.4c.indd 781
Continued >
8/8/07 3:25:28 PM
EX 782 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
In the Lab
continued
STUDENT ASSIGNMENTS
Instructions: Perform the following tasks to create the PivotTables and PivotCharts shown in Figure 9–103b and 9–103c. 1. Open the workbook Lab 9-3 Farmers Wholesale from the Data Files for Students and then save the workbook using the file name, Lab 9-3 Farmers Wholesale Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. 2. Create the PivotTable and associated PivotChart shown in Figure 9–103b in a separate sheet in the workbook. Name the worksheet Sales by Farm. 3. Change cell A4 to Farms and cell B3 to Stores. Apply the Pivot Style Light 16 style to the PivotTable. Format the values as Currency values with a dollar sign and no decimal places. Apply the Style 19 to the PivotChart. 4. Create a second PivotTable and associated PivotChart as shown in Figure 9–103c in a separate sheet in the workbook. Name the worksheet Dairy Sales by Month. 5. Change cell A4 to Month and cell B3 to Farm. Apply the Pivot Style Light 16 style to the PivotTable. Format the values as Currency values with a dollar sign and no decimal places. Turn off the legend for the chart. 6. Filter the product type by Dairy. Filter the farm to Red Earth. 7. Change the chart type to Line and then add a linear Trendline that forecasts the trend for two more months. 8. Change the document properties as specified by your instructor. Change the Dairy Sales by Month worksheet header to include your name, course number, and other information requested by your instructor. 9. Print the worksheet. Change the Sales by Farm worksheet header to include your name, course number, and other information requested by your instructor. Print the worksheet, and then save the workbook. 10. Submit the assignment as specified by your instructor.
C6480_9_CTP.4c.indd 782
8/8/07 3:25:33 PM
Cases and Places Apply your creative thinking and problem solving skills to design and implement a solution.
Excel Chapter 9
Cases and Places EX 783
• 1: Merging Workbooks and Reviewing Changes Northwest College has several targeted fundraising drives, in addition to their regular annual fundraising event. During one of these targeted fundraising drives at the college, a computer used for updating information had a hard drive failure. After reconstructing the latest donation records from paper receipts, you have been asked to compare the two worksheets containing reconstructed data against the master worksheet to ensure that all information has been updated. Open the workbook Case 9-1 Northwest College from the Data Files for Students and then save the workbook as Case 9-1 Northwest College Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Review the Donations worksheet, which lists donations made to the Friends of Northwest College fund. Merge the workbooks Case 9-1 Northwest College Fundraising and Case 9-1 Northwest College Director into the Case 9-1 Northwest College Complete workbook. Highlight and review the changes the Director and Fundraiser made to the workbook. Accept all the changes and then turn off sharing so that the workbook is exclusive. In cell D16, insert the label Subtotal. In cell E16, calculate the sum of the donations made to date. Format the label and results using the Total cell style. Use Print Preview to view the worksheet, and then click the Page Setup button to display the Page Setup dialog box. Click the Margins tab, and then click the Horizontally and Vertically check boxes to center the worksheet on the page. Print the worksheet and save the workbook. Submit the assignment as specified by your instructor.
STUDENT ASSIGNMENTS
• EASIER •• MORE DIFFICULT
• 2: Importing Data and Formatting and Filtering a Table Open the workbook Case 9-2 City Sports from the Data Files for Students and then save the workbook using the file name, Case 9-2 City Sports Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Import the Sales table in the Case 9-2 City Sports Sales Access database as a table starting in cell A2. Insert spaces in the column headings of the imported table to separate text into words. Copy the data (not the headings) from the table contained in the Case 9-2 City Sports Word document, and paste it in the table in the Sales Analysis worksheet, beginning in the row immediately following the data imported from Access. Extend the table to include the range G2:H27. Copy formulas as necessary to complete the calculations for Sales by Rep 2008 and Sales by Rep 2009. Format the entire table using the Table Style Light 2 style. Filter the table to show sales only from Ohio and Indiana. Format the background of the worksheet by adding the graphic Case 9-2 City Sports.jpg as the worksheet background. Print the worksheet in landscape orientation and save the workbook. Submit the assignment as specified by your instructor. •• 3: Creating a PivotTable, PivotChart, and Custom View Aspen Packaging has been tracking targeted vs. actual hours for two business years, in an effort to better understand and control their labor costs. They are particularly interested in whether or not there are patterns by position or shift. You have been asked to create a chart and table that will allow the managers at Aspen Packaging to better evaluate what is happening. Open the Case 9-3 Aspen Packaging workbook from the Data Files for Students and then save the workbook using the file name, Case 9-3 Aspen Packaging Complete. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Continued >
C6480_9_CTP.4c.indd 783
8/8/07 3:25:33 PM
EX 784 Excel Chapter 9 Importing Data, Working with PivotCharts, PivotTables, and Trendlines
STUDENT ASSIGNMENTS
Cases and Places
continued
Create a PivotTable that includes the fields in the areas shown in Table 9–3. Format the PivotTable. Apply the cell style 40% Accent5 to the report filter labels, the column headings, and the grand total row. Apply the cell style 20% Accent5 to the row labels and values. Change column and row labels as necessary to reflect field names. Create a PivotChart. Choose similar fill colors and styles for the chart elements. Change the sheet name containing the PivotTable and PivotChart to Employee Hours Evaluation. Create a custom view named Hours by Position Chart for the workbook that displays only the PivotChart. Print the worksheet in landscape orientation and save the workbook. Submit the assignment as specified by your instructor. Table 9–3 PivotTable Fields and Areas Report Filter
Column Labels
Row Labels
Values
Shift
Values
Position
Sum of Hours 2009 Sum of Target Hours 2009 Sum of Hours 2010 Sum of Target Hours 2010
•• 4: Collaborating on a Health Worksheet Make It Personal
Design a worksheet that tracks and analyzes an aspect of your health, such as an exercise tracker, fitness chart, nutrition log, or health record. Include at least five columns of information, such as date and various measurements (weight and height, for example). Include at least three calculations such as your body mass index (BMI), estimated body fat, and estimated lean body weight. Record at least one week (or seven rows) of data. Create a PivotTable and PivotChart that compares at least three pieces of data. Exchange your workbook with a partner. Review the workbook you receive and consider how to improve the workbook. Track changes as you revise the data or formulas, if necessary. Insert at least three comments to offer suggestions. Return the workbook to its author. When you receive your reviewed workbook, consider the suggestions your partner made and apply those changes that you feel will improve the workbook. Do not delete your partner’s comments. Print the worksheets and save the workbook. Submit the assignment as specified by your instructor.
•• 5: Importing and Analyzing Sales Data Working Together
Open a blank workbook and then save the workbook using the file name, Case 9-5 Edgeway Electronics. Import the data from the Sales table in the Case 9-5 Edgeway Electronics database to a table starting in cell A2 of a blank worksheet. See the inside back cover of this book for instructions for downloading the Data Files for Students or see your instructor for information on accessing the files required in this book. Work with your group to add a title to the worksheet, change the name on the sheet tab, and format the worksheet. Add at least one calculation to the worksheet. Continue working as a group to create a PivotTable and PivotChart that analyzes the sales data in a meaningful way. Save the workbook and then share it so that each person in the group has a shared copy. Be sure to allow changes by more than one user. Keep the original workbook separate from the ones distributed to members of the group. In the original copy of the workbook, change the document properties as specified by your instructor. Change the headers of all the worksheets to include your name, course number, and other information requested by your instructor. Each person in the group should make at least one change to the workbook. (Hint: as a group, you may decide to split up the table content for changes in a meaningful way, such as assigning each person a region, a year, or a product). Compare and merge the workbooks into the original workbook. Print the worksheets and save the workbook. Submit the assignment as specified by your instructor.
C6480_9_CTP.4c.indd 784
8/8/07 3:25:34 PM
Microsoft Office Excel 2007
Collaboration Feature
Using SharePoint and Excel Services
Objectives You will have mastered the material in this Collaboration feature when you can: • Save a workbook to an Office • Describe the relationships among SharePoint Services, Office SharePoint Server site SharePoint Server, and Excel Services • Open a workbook in a Web browser • Save an Excel table to a SharePoint from an Office SharePoint Server site Services list • Describe when and why Excel • Use a SharePoint Services list in an Services can benefit the users of a Excel worksheet workbook
C6480_SF3_CTP.4c.indd 785
8/6/07 8:10:03 AM
EX 786 Excel Collaboration Feature Using SharePoint and Excel Services
Collaboration Feature Introduction Excel allows you to share data with others using SharePoint Services. See page APP 7 in Appendix B for more information regarding collaboration and SharePoint Services. You can import, export, and link data to a SharePoint Services Web site. The data will reside as a workbook file or as a list on the Web site. When an Excel table is saved as a SharePoint Services list, then other applications can use the data. For example, an Access user can import the data from a SharePoint Services list into an Access database table. A SharePoint list is similar to an Excel table in that it includes column headings and users can add, delete, and modify rows of data.
Project — Using SharePoint and Office SharePoint Server with Excel Figure 1a shows the Annual Revenue Comparison worksheet for Kackne Landscaping. Kackne Landscaping provides residential landscaping services and has experienced growth over the past several years. The company owners wish to understand how the growing number of customers affects how much revenue each customer generates. The owners want to share this information on the company’s SharePoint Services Web site in two ways. First, they would like the table in the worksheet shared as a SharePoint list (Figure 1b) so that the data can be reused by other applications, such as Access. Second, they would like the entire workbook saved to the SharePoint Services Web site so that other users can open the workbook from the Web site. Office SharePoint Server is an add-on program for SharePoint Services. Office SharePoint Server includes Excel Services. When the Office SharePoint Server is used along with SharePoint Services, Excel users benefit from a number of additional features. For example, a workbook can be saved to an Office SharePoint Server Web site and then used in a Web browser (Figure 1c). Users of the workbook do not need to have Excel installed on their computers. Instead, they interact with the workbook through their Web browsers. This Collaboration feature discusses Office SharePoint Server, although the steps required to use Office SharePoint Server is beyond the scope of this book.
C6480_SF3_CTP.4c.indd 786
8/6/07 8:10:06 AM
table in SharePoint list
Excel Collaboration Feature
Project — Using SharePoint and Office Services with Excel EX 787
(b) Excel Table Saved as SharePoint Services List
table in Excel worksheet
(a) Worksheet in Excel
(c) Excel Worksheet in Web Browser Figure 1
C6480_SF3_CTP.4c.indd 787
8/6/07 8:10:07 AM
EX 788 Excel Collaboration Feature Using SharePoint and Excel Services
Overview As you read through this feature, you will learn how to create and work with SharePoint and Excel Services by performing the following tasks: • Save an Excel table as a SharePoint list • Use a SharePoint Services list in an Excel worksheet • Save a workbook to an Office SharePoint Server site • Open a workbook in a Web browser from an Office SharePoint Server site Plan Ahead
General Project Decisions 1. Choose workbooks and parts of worksheets to publish. At the worksheet, range, or cell level, you can decide which parts of a workbook will be visible to and which parts can be modified by other users. Just as when choosing which range or cells to protect, you always should err on the side of caution and start with publishing as little as possible.
BTW
2. Determine access rights for other users. SharePoint Services allows you to specify which users have specific rights to a published workbook. You can specify that groups of users, such as managers, can modify financial information, while only warehouse workers are allowed to modify information about inventory. Excel Services The features of Excel Services are only available for workbooks saved using the Office Excel 2007 document type. Excel Services is part of Microsoft Offices SharePoint Server 2007, which is an add-in product for Microsoft SharePoint Services.
3. Evaluate which calculations are better performed on a server. Excel Services allows you to have worksheet calculations performed on a server. For complex calculations, this often is the better choice. 4. Determine how tables, charts, PivotTables, PivotCharts, and other data will be used by other users. Excel Services allows you to publish objects such as tables and charts as individual items that can be reused by others. For example, another user can reuse a published PivotTable on a Web page, as opposed to an entire worksheet containing the PivotTable, and maintain the high level of interactivity that Excel users expect when working with PivotTables. When necessary, more specific details concerning the above guidelines are presented at appropriate points in the feature.
Note: To work with Excel Services, you need access to a SharePoint Web site that is running Office SharePoint Server 2007 and Excel Services.
SharePoint Services Excel allows you to share tables and workbooks with others using Windows SharePoint Services and Office SharePoint Server 2007. SharePoint Services is a program that runs on a Windows server and is accessed by users through a Web browser. SharePoint Services allows team members to share documents in a reliable, secure Web-based environment. Access rights can be strictly applied to shared documents. To access a SharePoint Services Web site, you need a user name and password, as well as a Web address (URL) for the Web site. Office SharePoint Server 2007 is a program that extends the capabilities of SharePoint Services to offer more tools for users of Office 2007 programs, such as Excel. Excel Services is a program that is included with Office SharePoint Server 2007 and provides additional capabilities for those using Excel with a SharePoint Services Web site.
C6480_SF3_CTP.4c.indd 788
8/6/07 8:10:10 AM
Creating a SharePoint List Any Excel table can be exported to a SharePoint list on a SharePoint Services Web site using the Export Table to SharePoint List command on the Export menu on the Design tab on the Ribbon (Figure 2). The table first must be selected. Design tab Export button
Excel Collaboration Feature
SharePoint Services EX 789
Export Table to SharePoint List command
Export menu
cell A4 selected
Figure 2
C6480_SF3_CTP.4c.indd 789
8/6/07 8:10:10 AM
EX 790 Excel Collaboration Feature Using SharePoint and Excel Services
You must know the Web address (URL) of the SharePoint Services Web site (Figure 3), your user name, and your password. After exporting the list, you then can use your Web browser to access the list, change access permissions for the list, and move or edit the list.
Export Table to SharePoint List Step 1 of 2 dialog box
Web address of SharePoint Services Web site name appears on SharePoint Services Web site
description appears on SharePoint Services Web site Next button
BTW
Figure 3 Exporting an Excel Table Once a table is exported to the SharePoint list, other users can update the list within the SharePoint site and their changes will be reflected in your Excel worksheet. If you do not wish to see other users’ changes in your Excel table, export the table without a connection to the SharePoint list.
C6480_SF3_CTP.4c.indd 790
TO CREATE A SHAREPOINT LIST BY EXPORTING AN EXCEL TABLE The following steps create a SharePoint list from the Kackne Landscaping workbook by exporting an Excel table. 1. With cell A4 selected, click the Design tab on the Ribbon and then click the Export button on the Ribbon to display the Export menu (Figure 2). 2. Click Export Table to SharePoint List to display the Export Table to SharePoint List – Step 1 of 2 dialog box. 3. Enter the Web address (URL) of the SharePoint Services Web site in the Address bar. Enter a name and description of the table in the Name text box and Description text box (Figure 3). 4. Click the Next button to display the Export Table to SharePoint List – Step 2 of 2 dialog box. Enter your user name and password and then click the OK button to export the table to a SharePoint list.
8/6/07 8:10:15 AM
After the SharePoint list is created, you can view the list in SharePoint (Figure 4) by selecting it from the list of available lists for your SharePoint team. Figure 4 shows that the numbers in the Year, AnnualRevenue, and Annual Revenue per Customer columns are not formatted as they were in the Excel table. SharePoint Services converts all of the numbers to a common number format when you export a table to a SharePoint list. Years, therefore, appear with thousand separators. You can modify the formatting, or data type, of each column in the list by clicking the Settings button and then clicking the List Settings command on the Settings menu.
Creating a SharePoint List by Importing an Excel Table You can create a SharePoint list by using the Import Spreadsheet command from within a SharePoint Web site. You will be prompted for the location of a workbook and then you can select a table, a named range, or enter a range of cell from which to create the list.
Excel Collaboration Feature
Viewing and Using a SharePoint List
BTW
SharePoint Services EX 791
address of list on SharePoint Services Web site
name of list entered in dialog box
Excel table exported to SharePoint List
cells lose number formatting when exported
Figure 4
C6480_SF3_CTP.4c.indd 791
8/6/07 8:10:16 AM
BTW
EX 792 Excel Collaboration Feature Using SharePoint and Excel Services
Unlinking an Excel Table from a SharePoint List To unlink a table from a SharePoint list, select the table in Excel and then click the Design tab on the Ribbon. Click Unlink in the External Data group on the Ribbon. Once the table is unlinked, the connection cannot be restored.
You can add new items to the list by clicking the New button and then clicking New Item on the New menu. You can click the button arrows next to each column heading in the list to sort and filter the list. For example, you could click the Year button arrow and then click Largest on Top to sort the list in descending order by Year. If you want to use a SharePoint list in an Excel worksheet, you first must export the list to an Excel worksheet by clicking the Export to Spreadsheet command on the Actions menu (Figure 5). SharePoint then prompts you for a location to save the exported worksheet and then opens a new workbook in Excel. You can choose to import the list into a Table, PivotTable, or PivotChart and PivotTable Report. You then can use the worksheet like any other worksheet or copy and paste the exported list to another worksheet.
Actions button
Actions menu
BTW
Export to Spreadsheet command
The Document Management Task Pane Depending on how your SharePoint Web site is configured, you may be able to use the Document Management task pane in Excel to obtain more information about a workbook stored on a SharePoint Web site. If the site is configured properly, click the Office Button, click Server, and then click Document Management Information to view the Document Management task pane.
C6480_SF3_CTP.4c.indd 792
Figure 5
Saving a Workbook to a SharePoint Services Web Site Any workbook can be saved to a SharePoint Services Web site. You save a workbook to a SharePoint Services Web site in order to share the workbook with colleagues. After a workbook is shared, you can use your Web browser to change access permissions for the workbook and move the workbook to another location on the SharePoint Services Web site. To share a workbook on a SharePoint Services Web site, you must have a user name and password and permissions to save workbooks to the site. To save a workbook to a SharePoint Services Web site, display the Save As dialog box and then type the Web address of the Web site in the Address bar (Figure 6).
8/6/07 8:10:18 AM
Save As dialog box
Web address of SharePoint Services Web site
Excel Collaboration Feature
SharePoint Services EX 793
Save button
Figure 6
After clicking the Save button in the Save As dialog box, Excel then prompts you for your user name and password for the Web site (Figure 7). After you click the OK button in the Connect to dialog box, Excel saves the workbook to the SharePoint Services Web site.
Connect to dialog box
user name entered in User name text box password entered in Password text box
OK button
Figure 7
C6480_SF3_CTP.4c.indd 793
8/6/07 8:10:19 AM
EX 794 Excel Collaboration Feature Using SharePoint and Excel Services
After you save the workbook to the Web site, a Web browser can be used to access the workbook on the Web site (Figure 8). In SharePoint, you can edit the workbook properties, such as the name and description, change permissions, and open the workbook in Excel. You also can set alerts so that you are notified by e-mail when another team member modifies the workbook.
workbook appears in Shared Documents area of SharePoint Services Web site
Figure 8
TO SAVE A WORKBOOK TO A SHAREPOINT SERVICES WEB SITE The following steps save a workbook to a SharePoint Services Web site. 1. With the workbook open, click the Office Button and then click Save As on the Office Button menu. 2. Type the SharePoint Services Web address in the Address bar (Figure 6 on the previous page) and then click the Save button in the Save As dialog box. 3. Enter your user name and password and then click the OK button in the Connect to dialog box to save the workbook to the Web site.
C6480_SF3_CTP.4c.indd 794
8/6/07 8:10:22 AM
Opening a Workbook from a SharePoint Services Web Site You can open a workbook saved on a SharePoint Services Web site from a Web browser (Figure 8) or from Excel by using the Open command on the Office Button menu. When you attempt to open a workbook stored on a SharePoint Services Web site using the Open dialog box, Excel prompts you for your user name and password (Figure 9).
Open dialog box
Excel Collaboration Feature
SharePoint Services EX 795
Connect to dialog box
user name entered in User name text box password entered in Password text box
OK button
Figure 9
C6480_SF3_CTP.4c.indd 795
8/6/07 8:10:23 AM
EX 796 Excel Collaboration Feature Using SharePoint and Excel Services
If you enter the correct user name and password, then Excel displays the shared documents in the SharePoint Services Web site in the Open dialog box as shown in Figure 10.
workbook appears in Shared Documents area of SharePoint Services Web site
Open button
BTW
Figure 10 Quick Reference For a table that lists how to complete the tasks covered in this book using the mouse, Ribbon, shortcut menu, and keyboard, see the Quick Reference Summary at the back of this book, or visit the Excel 2007 Quick Reference Web page (scsite.com/ex2007/qr).
C6480_SF3_CTP.4c.indd 796
TO OPEN A WORKBOOK FROM A SHAREPOINT SERVICES WEB SITE The following steps open a workbook from a SharePoint Services Web site. 1. With Excel running, click the Office Button and then click Open on the Office Button menu to display the Open dialog box. 2. Enter the Web address (URL) of the SharePoint Services Web site in the Address bar and then press the ENTER key to display the Connect to dialog box. 3. Enter your user name and password and then click the OK button in the Connect to dialog box to display the shared documents from the Web site in the Open dialog box. 4. Select the workbook and then click the Open button to open the workbook.
8/6/07 8:10:25 AM
Working with Excel Services Excel Services is a part of the Office SharePoint Server 2007 program and provides additional capabilities for users of Excel who use SharePoint Services Web sites. Using Excel Services, you can view and interact with workbooks using a Web browser instead of using Excel. A user does not need Excel installed on a personal computer in order to work with a workbook. You also can publish parts of worksheets or use others’ published worksheet parts in your own worksheet.
Excel Collaboration Feature
Working with Excel Services EX 797
BTW
You may choose to work with Excel Services for a variety of reasons. Three of the main reasons for choosing to work with Excel Services are listed below.
Excel Help The best way to become familiar with Excel Help is to use it. Appendix C includes detailed information about Excel Help and exercises that will help you gain confidence in using it.
BTW
Choosing to Work with Excel Services
Certification The Microsoft Certified Application Specialist (MCAS) program provides an opportunity for you to obtain a valuable industry credential — proof that you have the Excel 2007 skills required by employers. For more information, see Appendix G or visit the Excel 2007 Certification Web page (scsite.com/ex2007/cert).
1. Integrity and ease of use: Your organization takes a one-version-of-the-truth approach to workbook management. This means that within the organization, any critical workbook is stored and managed in exactly one location, such as a SharePoint Services Web site. Using Excel Services, all users can view and modify the workbook from exactly one location on the server using a common interface, a Web browser. Such a tightly controlled system results in everyone having confidence that they are working with the correct version of a workbook. 2. Performance: You may have a very large workbook that includes intensive calculations or requires complex business analysis. In such a case, Excel services allows you to separate your data from the calculations. You can store your workbook on your USB flash drive, yet have the intense calculations performed on a very fast server that is running Excel Services. A calculation that may take hours for a personal computer to perform sometimes can be performed in minutes on a high-end server running Excel Services. 3. Sharing: The combination of the above two reasons provides a good basis to allow Excel Services to manage all of your critical workbooks. Because Excel Services is part of SharePoint Services, an organization gains the capability to properly share workbooks. For example, when a workbook is properly shared, SharePoint Services does not allow two users to make changes to the workbook at the same time. Users check out workbooks, make changes, and then check in the workbooks.
Capabilities of Excel Services Three major capabilities of Excel Services are listed below: 1. Save as a Web page: The ability to work with a worksheet in a browser means that a worksheet user does not need to have Excel installed. Customers, mobile workers such as sales persons, and suppliers all can work with the same version of the worksheet in a common user environment. Figure 11 on the next page shows an Excel worksheet in a browser. The user has full control of the worksheet in the browser. 2. Sharing formulas and functions: Organizations often maintain complex Excel formulas and functions that are critical to the organization. For example, a sales department may have a complex formula for setting prices of their products and services each day. If the formula changes, then all of the workbooks that use the formula typically need to be updated as well. Using Excel Services, such a formula could reside in one location on the SharePoint Services server. All workbooks, even those stored on personal computers, would reference the centrally stored formula instead of including the formula itself in the workbook.
C6480_SF3_CTP.4c.indd 797
8/6/07 8:10:27 AM
EX 798 Excel Collaboration Feature Using SharePoint and Excel Services
3. Web Parts: Parts of worksheets, such as ranges, formulas, tables, charts, PivotTables, and PivotCharts, can be saved to Excel Services as a Web Part. Other users or developers of Web pages and other programs can then reuse these Web Parts to create new Web pages and programs. For example, the company’s current stock price can be charted and displayed automatically on the company’s Web page in real time.
Figure 11
When working with an Excel workbook in a browser, some capabilities and features are not available as they are in Excel. VBA and macros will not function with Excel Services. Inserted pictures, shapes, SmartArt, and WordArt also will not work with Excel Services. Some 3-D charting features will not display with Excel Services, and some 3-D chart types will not function, such as 3-D surface charts, wireframe 3-D surface charts, contour surface charts, and wireframe contour surface charts. See Excel Help for a complete list of supported and unsupported functionality when working with Excel Services.
C6480_SF3_CTP.4c.indd 798
8/6/07 8:10:27 AM
Feature Summary This Collaboration feature introduced you to publishing Excel tables and workbooks to SharePoint Services Web sites, working with SharePoint Services, and using Office SharePoint Server and Excel Services. The items listed below include all the new Office 2007 skills you have learned in this Collaboration feature. 1. Create a SharePoint List by Exporting an Excel Table (EX 790) 2. Save a Workbook to a SharePoint Services Web Site (EX 794)
3. Open a Workbook from a SharePoint Services Web Site (EX 796)
Excel Collaboration Feature
In the Lab EX 799
In the Lab Modify a workbook using the guidelines, concepts, and skills presented in this graphics feature. Labs are listed in order of increasing difficulty.
Lab 1: Saving a Worksheet to a SharePoint Services Web Site Problem: As an accounting intern for Maury’s Mobiles, a retailer of mobile devices and services, you have been asked to make the monthly sales report available on the company’s SharePoint Services Web site. Instructions: Start Excel and then open the file Lab CF-1 Maury’s Mobiles from the Data Files for Students. Perform the following tasks: 1. Save the workbook to a SharePoint Services Web site with the file name, Maurys Mobiles Monthly Sales. 2. Format the range A3:D12 as a table and then save the table as a SharePoint list to the same SharePoint Services Web site. 3. Display the SharePoint Web site in your browser, navigate to the list, and then view the list in your browser. Print the Web page. 4. Using the button arrow next to the Representative column header, select only those records in the list for the representative named Sun. Print the Web page. 5. Display the SharePoint Web site in your browser and navigate to the workbook in your Documents folder. Print the Web page. Open the workbook from the Web site in Excel. 6. Close the workbook. Submit the assignment as specified by your instructor.
In the Lab Lab 2: Saving a Table as a SharePoint List Problem: As the student assistant for the Technical Writing 203 course, you have been asked to make this quarter’s final student grades available on the department’s SharePoint Services Web site. Instructions: Start Excel and then open the file Lab CF-2 Technical Writing from the Data Files for Students. Perform the following tasks: 1. Save the workbook to a SharePoint Services Web site named, Technical Writing 203 - Final Student Grades. 2. Format the range A3:E11 as a table and then save the table as a SharePoint list to the same SharePoint Services Web site. 3. Display the SharePoint Web site in your browser, navigate to the list, and then view the list in your browser. Print the Web page. Continued >
C6480_SF3_CTP.4c.indd 799
8/6/07 8:10:28 AM
EX 800 Excel Collaboration Feature Using SharePoint and Excel Services
In the Lab
continued
4. Using the button arrow next to the Grade column header, select only those records in the list for those receiving a grade of C. Print the Web page. 5. Display the SharePoint Web site in your browser and navigate to the workbook in your Documents folder. Print the Web page. Open the workbook from the Web site in Excel. STUDENT ASSIGNMENTS
6. Close the workbook. Submit the assignment as specified by your instructor.
C6480_SF3_CTP.4c.indd 800
8/6/07 8:10:29 AM
Microsoft Office Excel 2007
Appendix A
Project Planning Guidelines Using Project Planning Guidelines The process of communicating specific information to others is a learned, rational skill. Computers and software, especially Microsoft Office 2007, can help you develop ideas and present detailed information to a particular audience. Using Microsoft Office 2007, you can create projects such as Word documents, Excel spreadsheets, Access databases, and PowerPoint presentations. Computer hardware and productivity software such as Microsoft Office 2007 minimizes much of the laborious work of drafting and revising projects. Some communicators handwrite ideas in notebooks, others compose directly on the computer, and others have developed unique strategies that work for their own particular thinking and writing styles. No matter what method you use to plan a project, follow specific guidelines to arrive at a final product that presents information correctly and effectively (Figure A–1). Use some aspects of these guidelines every time you undertake a project, and others as needed in specific instances. For example, in determining content for a project, you may decide that a bar chart communicates trends more effectively than a paragraph of text. If so, you would create this graphical element and insert it in an Excel spreadsheet, a Word document, or a PowerPoint slide.
Determine the Project’s Purpose Begin by clearly defining why you are undertaking this assignment. For example, you may want to track monetary donations collected for your club’s fundraising drive. Alternatively, you may be urging students to vote for a particular candidate in the next election. Once you clearly understand the purpose of your task, begin to draft ideas of how best to communicate this information.
Analyze your Audience Learn about the people who will read, analyze, or view your work. Where are they employed? What are their educational backgrounds? What are their expectations? What questions do they have?
C6390_AppA_CTP.4c.indd 1
PROJECT PLANNING GUIDELINES 1. DETERMINE THE PROJECT’S PURPOSE Why are you undertaking the project? 2. ANALYZE YOUR AUDIENCE Who are the people who will use your work? 3. GATHER POSSIBLE CONTENT What information exists, and in what forms? 4. DETERMINE WHAT CONTENT TO PRESENT TO YOUR AUDIENCE What information will best communicate the project’s purpose to your audience? Figure A–1
4/16/07 8:28:22 AM
APP 2 Appendix A Project Planning Guidelines
Design experts suggest drawing a mental picture of these people or finding photographs of people who fit this profile so that you can develop a project with the audience in mind. By knowing your audience members, you can tailor a project to meet their interests and needs. You will not present them with information they already possess, and you will not omit the information they need to know. Example: Your assignment is to raise the profile of your college’s nursing program in the community. How much do they know about your college and the nursing curriculum? What are the admission requirements? How many of the applicants admitted complete the program? What percent pass the state Boards?
Gather Possible Content Rarely are you in a position to develop all the material for a project. Typically, you would begin by gathering existing information that may reside in spreadsheets or databases. Web sites, pamphlets, magazine and newspaper articles, and books could provide insights of how others have approached your topic. Personal interviews often provide perspectives not available by any other means. Consider video and audio clips as potential sources for material that might complement or support the factual data you uncover.
Determine What Content to Present to your Audience Experienced designers recommend writing three or four major ideas you want an audience member to remember after reading or viewing your project. It also is helpful to envision your project’s endpoint, the key fact you wish to emphasize. All project elements should lead to this ending point. As you make content decisions, you also need to think about other factors. Presentation of the project content is an important consideration. For example, will your brochure be printed on thick, colored paper or transparencies? Will your PowerPoint presentation be viewed in a classroom with excellent lighting and a bright projector, or will it be viewed on a notebook computer monitor? Determine relevant time factors, such as the length of time to develop the project, how long readers will spend reviewing your project, or the amount of time allocated for your speaking engagement. Your project will need to accommodate all of these constraints. Decide whether a graph, photograph, or artistic element can express or emphasize a particular concept. The right hemisphere of the brain processes images by attaching an emotion to them, so audience members are more apt to recall these graphics long term rather than just reading text. As you select content, be mindful of the order in which you plan to present information. Readers and audience members generally remember the first and last pieces of information they see and hear, so you should put the most important information at the top or bottom of the page.
Summary When creating a project, it is beneficial to follow some basic guidelines from the outset. By taking some time at the beginning of the process to determine the project’s purpose, analyze the audience, gather possible content, and determine what content to present to the audience, you can produce a project that is informative, relevant, and effective.
C6390_AppA_CTP.4c.indd 2
4/16/07 8:28:24 AM
Microsoft Office Excel 2007
Appendix B
Introduction to Microsoft Office 2007 What Is Microsoft Office 2007? Microsoft Office 2007 is a collection of the more popular Microsoft application software. It is available in Basic, Home and Student, Standard, Small Business, Professional, Ultimate, Professional Plus, and Enterprise editions. Each edition consists of a group of programs, collectively called a suite. Table B-1 lists the suites and their components. Microsoft Office Professional Edition 2007 includes these six programs: Microsoft Office Word 2007, Microsoft Office Excel 2007, Microsoft Office Access 2007, Microsoft Office PowerPoint 2007, Microsoft Office Publisher 2007, and Microsoft Office Outlook 2007. The programs in the Office suite allow you to work efficiently, communicate effectively, and improve the appearance of the projects you create. Table B–1 Microsoft Office Basic 2007
Microsoft Office Home & Student 2007
Microsoft Office Standard 2007
Microsoft Office Small Business 2007
Microsoft Office Professional 2007
Microsoft Office Ultimate 2007
Microsoft Office Professional Plus 2007
Microsoft Office Enterprise 2007
Microsoft Office Word 2007
✓
✓
✓
✓
✓
✓
✓
✓
Microsoft Office Excel 2007
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
Microsoft Office Access 2007 Microsoft Office PowerPoint 2007
✓
✓
Microsoft Office Publisher 2007 Microsoft Office Outlook 2007 Microsoft Office OneNote 2007 Microsoft Office Outlook 2007 with Business Contact Manager
✓
✓ ✓
✓
✓
✓
✓
Microsoft Office InfoPath 2007
✓
✓
✓
Integrated Enterprise Content Management
✓
✓
✓
Electronic Forms
✓
✓
✓
Advanced Information Rights Management and Policy Capabilities
✓
✓
✓
✓
✓
Microsoft Office Communicator 2007 Microsoft Office Groove 2007
C6390_AppB_CTP.4c.indd 3
✓
✓
4/16/07 8:29:49 AM
APP 4 Appendix B Microsoft Office 2007
Microsoft has bundled additional programs in some versions of Office 2007, in addition to the main group of Office programs. Table B–1 on the previous page lists the components of the various Office suites. In addition to the Office 2007 programs noted previously, Office 2007 suites can contain other programs. Microsoft Office OneNote 2007 is a digital notebook program that allows you to gather and share various types of media, such as text, graphics, video, audio, and digital handwriting. Microsoft Office InfoPath 2007 is a program that allows you to create and use electronic forms to gather information. Microsoft Office Groove 2007 provides collaborative workspaces in real time. Additional services that are oriented toward the enterprise solution also are available.
Office 2007 and the Internet, World Wide Web, and Intranets Office 2007 allows you to take advantage of the Internet, the World Wide Web, and intranets. The Microsoft Windows operating system includes a browser, which is a program that allows you to locate and view a Web page. The Windows browser is called Internet Explorer. One method of viewing a Web page is to use the browser to enter the Web address for the Web page. Another method of viewing a Web page is clicking a hyperlink. A hyperlink is colored or underlined text or a graphic that, when clicked, connects to another Web page. Hyperlinks placed in Office 2007 documents allow for direct access to a Web site of interest. An intranet is a private network, such as a network used within a company or organization for internal communication. Like the Internet, hyperlinks are used within an intranet to access documents, pages, and other destinations on the intranet. Unlike the Internet, the materials on the network are available only for those who are part of the private network.
Online Collaboration Using Office Organizations that, in the past, were able to make important information available only to a select few, now can make their information accessible to a wider range of individuals who use programs such as Office 2007 and Internet Explorer. Office 2007 allows colleagues to use the Internet or an intranet as a central location to view documents, manage files, and work together. Each of the Office 2007 programs makes publishing documents on a Web server as simple as saving a file on a hard disk. Once placed on the Web server, users can view and edit the documents and conduct Web discussions and live online meetings.
Using Microsoft Office 2007 The various Microsoft Office 2007 programs each specialize in a particular task. This section describes the general functions of the more widely used Office 2007 programs, along with how they are used to access the Internet or an intranet.
Microsoft Office Word 2007 Microsoft Office Word 2007 is a full-featured word processing program that allows you to create many types of personal and business documents, including flyers, letters, resumes, business documents, and academic reports. Word’s AutoCorrect, spelling, and grammar features help you proofread documents for errors in spelling and grammar by identifying the errors and offering
C6390_AppB_CTP.4c.indd 4
4/16/07 8:29:51 AM
suggestions for corrections as you type. The live word count feature provides you with a constantly updating word count as you enter and edit text. To assist with creating specific documents, such as a business letter or resume, Word provides templates, which provide a formatted document before you type the text of the document. Quick Styles provide a live preview of styles from the Style gallery, allowing you to preview styles in the document before actually applying them. Word automates many often-used tasks and provides you with powerful desktop publishing tools to use as you create professional looking brochures, advertisements, and newsletters. SmartArt allows you to insert interpretive graphics based on document content. Word makes it easier for you to share documents for collaboration. The Send feature opens an e-mail window with the active document attached. The Compare Documents feature allows you easily to identify changes when comparing different document versions.
Appendix B
Using Microsoft Office 2007 APP 5
Word 2007 and the Internet Word makes it possible to design and publish Web pages on the Internet or an intranet, insert a hyperlink to a Web page in a word processing document, as well as access and search the content of other Web pages.
Microsoft Office Excel 2007 Microsoft Office Excel 2007 is a spreadsheet program that allows you to organize data, complete calculations, graph data, develop professional looking reports, publish organized data to the Web, and access real-time data from Web sites. In addition to its mathematical functionality, Excel 2007 provides tools for visually comparing data. For instance, when comparing a group of values in cells, you can set cell backgrounds with bars proportional to the value of the data in the cell. You can also set cell backgrounds with full-color backgrounds, or use a color scale to facilitate interpretation of data values. Excel 2007 provides strong formatting support for tables with the new Style Preview gallery. Excel 2007 and the Internet Using Excel 2007, you can create hyperlinks within a worksheet to access other Office documents on the network or on the Internet. Worksheets saved as static, or unchanging Web pages can be viewed using a browser. The person viewing static Web pages cannot change them. In addition, you can create and run queries that retrieve information from a Web page and insert the information directly into a worksheet.
Microsoft Office Access 2007 Microsoft Office Access 2007 is a comprehensive database management system (DBMS). A database is a collection of data organized in a manner that allows access, retrieval, and use of that data. Access 2007 allows you to create a database; add, change, and delete data in the database; sort data in the database; retrieve data from the database; and create forms and reports using the data in the database. Access 2007 and the Internet Access 2007 lets you generate reports, which are summaries that show only certain data from the database, based on user requirements.
C6390_AppB_CTP.4c.indd 5
4/16/07 8:29:51 AM
APP 6 Appendix B Microsoft Office 2007
Microsoft Office PowerPoint 2007 Microsoft Office PowerPoint 2007 is a complete presentation graphics program that allows you to produce professional looking presentations. With PowerPoint 2007, you can create informal presentations using overhead transparencies, electronic presentations using a projection device attached to a personal computer, formal presentations using 35mm slides or a CD, or you can run virtual presentations on the Internet. PowerPoint 2007 and the Internet PowerPoint 2007 allows you to publish presentations on the Internet or other networks.
Microsoft Office Publisher 2007 Microsoft Office Publisher 2007 is a desktop publishing program (DTP) that allows you to design and produce professional quality documents (newsletters, flyers, brochures, business cards, Web sites, and so on) that combine text, graphics, and photographs. Desktop publishing software provides a variety of tools, including design templates, graphic manipulation tools, color schemes or libraries, and various page wizards and templates. For large jobs, businesses use desktop publishing software to design publications that are camera ready, which means the files are suitable for production by outside commercial printers. Publisher 2007 also allows you to locate commercial printers, service bureaus, and copy shops willing to accept customer files created in Publisher. Publisher 2007 allows you to design a unique image, or logo, using one of more than 45 master design sets. This, in turn, permits you to use the same design for all your printed documents (letters, business cards, brochures, and advertisements) and Web pages. Publisher includes 70 coordinated color schemes; 30 font schemes; more than 10,000 high-quality clip art images; 1,500 photographs; 1,000 Web-art graphics; 340 animated graphics; and hundreds of unique Design Gallery elements (quotations, sidebars, and so on). If you wish, you also can download additional images from the Microsoft Office Online Web page on the Microsoft Web site. Publisher 2007 and the Internet Publisher 2007 allows you easily to create a multipage Web site with custom color schemes, photographic images, animated images, and sounds.
Microsoft Office Outlook 2007 Microsoft Office Outlook 2007 is a powerful communications and scheduling program that helps you communicate with others, keep track of your contacts, and organize your schedule. Outlook 2007 allows you to view a To-Do bar containing tasks and appointments from your Outlook calendar. Outlook 2007 allows you to send and receive electronic mail (e-mail) and permits you to engage in real-time communication with family, friends, or coworkers using instant messaging. Outlook 2007 also provides you with the means to organize your contacts, and you can track e-mail messages, meetings, and notes with a particular contact. Outlook’s Calendar, Contacts, Tasks, and Notes components aid in this organization. Contact information is available from the Outlook Calendar, Mail, Contacts, and Task components by accessing the Find a Contact feature. Personal information management (PIM) programs such as Outlook provide a way for individuals and workgroups to organize, find, view, and share information easily.
C6390_AppB_CTP.4c.indd 6
4/16/07 8:29:52 AM
Microsoft Office 2007 Help At any time while you are using one of the Office programs, you can interact with Microsoft Office 2007 Help for that program and display information about any topic associated with the program. Several categories of help are available. In all programs, you can access Help by pressing the F1 key on the keyboard. In Publisher 2007 and Outlook 2007, the Help window can be opened by clicking the Help menu and then selecting Microsoft Office Publisher or Outlook Help command, or by entering search text in the ‘Type a question for help’ text box in the upper-right corner of the program window. In the other Office programs, clicking the Microsoft Office Help button near the upper-right corner of the program window opens the program Help window. The Help window in all programs provides several methods for accessing help about a particular topic, and has tools for navigating around Help. Appendix C contains detailed instructions for using Help.
Appendix B
Collaboration and SharePoint APP 7
Collaboration and SharePoint While not part of the Microsoft Office 2007 suites, SharePoint is a Microsoft tool that allows Office 2007 users to share data using collaborative tools that are integrated into the main Office programs. SharePoint consists of Windows SharePoint Services, Office SharePoint Server 2007, and, optionally, Office SharePoint Designer 2007. Windows SharePoint Services provides the platform for collaboration programs and services. Office SharePoint Server 2007 is built on top of Windows SharePoint Services. The result of these two products is the ability to create SharePoint sites. A SharePoint site is a Web site that provides users with a virtual place for collaborating and communicating with their colleagues while working together on projects, documents, ideas, and information. Each member of a group with access to the SharePoint site has the ability to contribute to the material stored there. The basic building blocks of SharePoint sites are lists and libraries. Lists contain collections of information, such as calendar items, discussion points, contacts, and links. Lists can be edited to add or delete information. Libraries are similar to lists, but include both files and information about files. Types of libraries include document, picture, and forms libraries. The most basic type of SharePoint site is called a Workspace, which is used primarily for collaboration. Different types of Workspaces can be created using SharePoint to suit different needs. SharePoint provides templates, or outlines of these Workspaces, that can be filled in to create the Workspace. Each of the different types of Workspace templates contain a different collection of lists and libraries, reflecting the purpose of the Workspace. You can create a Document Workspace to facilitate collaboration on documents. A Document Workspace contains a document library for documents and supporting files, a Links list that allows you to maintain relevant resource links for the document, a Tasks list for listing and assigning To-Do items to team members, and other links as needed. Meeting Workspaces allow users to plan and organize a meeting, with components such as Attendees, Agenda, and a Document Library. Social Meeting Workspaces provide a place to plan social events, with lists and libraries such as Attendees, Directions, Image/Logo, Things To Bring, Discussions, and Picture Library. A Decision Meeting Workspace is a Meeting Workspace with a focus on review and decision-making, with lists and libraries such as Objectives, Attendees, Agenda, Document Library, Tasks, and Decisions. Users also can create a SharePoint site called a WebParts page, which is built from modules called WebParts. WebParts are modular units of information that contain a title bar and content that reflects the type of WebPart. For instance, an image WebPart would contain a title bar and an image. WebParts allow you quickly to create and modify
C6390_AppB_CTP.4c.indd 7
4/16/07 8:29:52 AM
APP 8 Appendix B Microsoft Office 2007
a SharePoint site, and allow for the creation of a unique site that can allow users to access and make changes to information stored on the site. Large SharePoint sites that include multiple pages can be created using templates as well. Groups needing more refined and targeted sharing options than those available with SharePoint Server 2007 and Windows SharePoint Services can add SharePoint Designer 2007 to create a site that meets their specific needs. Depending on which components have been selected for inclusion on the site, users can view a team calendar, view links, read announcements, and view and edit group documents and projects. SharePoint sites can be set up so that documents are checked in and out, much like a library, to prevent multiple users from making changes simultaneously. Once a SharePoint site is set up, Office programs are used to perform maintenance of the site. For example, changes in the team calendar are updated using Outlook 2007, and changes that users make in Outlook 2007 are reflected on the SharePoint site. Office 2007 programs include a Publish feature that allows users easily to save file updates to a SharePoint site. Team members can be notified about changes made to material on the site either by e-mail or by a news feed, meaning that users do not have to go to the site to check to see if anything has been updated since they last viewed or worked on it. The search feature in SharePoint allows users quickly to find information on a large site.
C6390_AppB_CTP.4c.indd 8
4/16/07 8:29:52 AM
Microsoft Office Excel 2007
Appendix C
Microsoft Office Excel 2007 Help Using Microsoft Office Excel 2007 Help This appendix shows how to use Microsoft Office Excel Help. At any time while you are using one of the Microsoft Office 2007 programs, you can use Office Help to display information about all topics associated with the program. This appendix uses Microsoft Office Excel 2007 to illustrate the use of Office Help. Help in other Office 2007 programs responds in a similar fashion. In Office 2007, Help is presented in a window that has Web browser-style navigation buttons. Each Office 2007 program has its own Help home page, which is the starting Help page that is displayed in the Help window. If your computer is connected to the Internet, the contents of the Help page reflect both the local help files installed on the computer and material from Microsoft’s Web site. As shown in Figure C–1, two methods for accessing Excel’s Help are available: 1. Microsoft Office Excel Help button near the upper-right corner of the Excel window 2. Function key F1 on the keyboard
Excel Help window
Microsoft Office Excel Help button
Figure C–1
C6390_AppC_CTP.4c.indd 9
4/16/07 8:31:06 AM
APP 10 Appendix C Microsoft Office Excel 2007 Help
To Open the Excel Help Window The following steps open the Excel Help window and maximize the window. Maximize button
1 • Start Microsoft Excel,
Microsoft Office Excel Help button
if necessary. Click the Microsoft Office Excel Help button near the upper-right corner of the Excel window to open the Excel Help window (Figure C–2).
Excel Help window
Figure C–2
toolbar buttons
2 • Click the Maximize button on the Help title bar to maximize the Help window (Figure C–3). Browse Excel Help area
Search features
links to major help categories
Connection Status button
Figure C–3
C6390_AppC_CTP.4c.indd 10
4/16/07 8:31:09 AM
The Excel Help Window The Excel Help window provides several methods for accessing help about a particular topic, and also has tools for navigating around Help. Methods for accessing Help include searching the help content installed with Excel, or searching the online Office content maintained by Microsoft. Figure C–3 shows the main Excel Help window. To navigate Help, the Excel Help window includes search features that allow you to search on a word or phrase about which you want help; the Connection Status button, which allows you to control where Excel Help searches for content; toolbar buttons; and links to major Help categories.
Appendix C
The Excel Help Window APP 11
Search Features You can perform Help searches on words or phrases to find information about any Excel feature using the ‘Type words to search for’ text box and the Search button (Figure C–4a). Click the ‘Type words to search for’ text box and then click the Search button or press the ENTER key to initiate a search of Excel Help. Search button
Search button arrow
Type words to search for text box
Connection Status menu Search menu
(a)
Connection Status button indicates online search to be performed
(b) Figure C–4
Excel Help offers the user the option of searching the online Help Web pages maintained by Microsoft or the offline Help files placed on your computer when you install Excel. You can specify whether Excel Help should search online or offline from two places: the Connection Status button on the status bar of the Excel Help window, or the Search button arrow on the toolbar. The Connection Status button indicates whether Help currently is set up to work with online or offline information sources. Clicking the Connection Status button provides a menu with commands for selecting online or offline searches (Figure C–4b). The Connection Status menu allows the user to select whether help searches will return content only from the computer (offline), or content from the computer and from Office Online (online). Clicking the Search button arrow also provides a menu with commands for an online or offline search (Figure C–4a). These commands determine the source of information that Help searches for during the current Help session only. For example, assume that your preferred search is an offline search because you often do not have Internet access. You would set Connection Status to ‘Show content only from this computer’. When you have Internet
C6390_AppC_CTP.4c.indd 11
4/16/07 8:31:12 AM
APP 12 Appendix C Microsoft Office Excel 2007 Help
access, you can select an online search from the Search menu to search Office Online for information for your current search session only. Your search will use the Office Online resources until you quit Help. The next time you start Help, the Connection Status once again will be offline. In addition to setting the source of information that Help searches for during the current Help session, you can use the Search menu to further target the current search to one of four subcategories of online Help: Excel Help, Excel Templates, Excel Training, and Developer Reference. The local search further can target one subcategory, Developer Reference. In addition to searching for a word or string of text, you can use the links provided on the Browse Excel Help area (Figure C–3) on page APP 10 to search for help on a topic. These links direct you to major help categories. From each major category, subcategories are available to further refine your search. Finally, you can use the Table of Contents for Excel Help to search for a topic the same way you would in a hard copy book. The Table of Contents is accessed via a toolbar button.
Toolbar Buttons You can use toolbar buttons to navigate through the results of your search. The toolbar buttons are located on the toolbar near the top of the Help Window (Figure C–5). The toolbar buttons contain navigation buttons as well as buttons that perform other useful and common tasks in Excel Help, such as printing.
Forward button
Refresh button
Print button
Show Table of Contents button Not On Top/Keep On Top button
Back Button
Stop button
Home button
Change Font Size button
Figure C–5
The Excel Help navigation buttons are the Back, Forward, Stop, Refresh, and Home buttons. These five buttons behave like the navigation buttons in a Web browser window. You can use the Back button to go back one window, the Forward button to go forward one window, the Stop button to stop loading the current page, and the Home button to redisplay the Help home page in the Help window. Use the Refresh button to reload the information requested into the Help window from its original source. When getting Help information online, this button provides the most current information from the Microsoft Help Web site. The buttons located to the right of the navigation buttons — Print, Change Font Size, Show Table of Contents, and Not on Top — provide you with access to useful and common commands. The Print button prints the contents of the open Help window. The Change Font Size button customizes the Help window by increasing or decreasing the
C6390_AppC_CTP.4c.indd 12
4/16/07 8:31:15 AM
size of its text. The Show Table of Contents button opens a pane on the left side of the Help window that shows the Table of Contents for Excel Help. You can use the Table of Contents for Excel Help to navigate through the contents of Excel Help much as you would use the Table of Contents in a book to search for a topic. The Not On Top button is an example of a toggle button, which is a button that can be switched back and forth between two states. It determines how the Excel Help window behaves relative to other windows. When clicked, the Not On Top button changes to Keep On Top. In this state, it does not allow other windows from Excel or other programs to cover the Excel Help window when those windows are the active windows. When in the Not On Top state, the button allows other windows to be opened or moved on top of the Excel Help window. You can customize the size and placement of the Help window. Resize the window using the Maximize and Restore buttons, or by dragging the window to a desired size. Relocate the Help window by dragging the title bar to a new location on the screen.
Appendix C
Searching Excel Help APP 13
Searching Excel Help Once the Excel Help window is open, several methods exist for navigating Excel Help. You can search for help by using any of the three following methods from the Help window: 1. Enter search text in the ‘Type words to search for’ text box 2. Click the links in the Help window 3. Use the Table of Contents
To Obtain Help Using the Type Words to Search for Text Box Assume for the following example that you want to know more about watermarks. The following steps use the ‘Type words to search for’ text box to obtain useful information about watermarks by entering the phrase, conditional formatting, as search text. The steps also navigate in the Excel Help window.
1 • Type conditional formatting in the ‘Type words to search for’ text box at the top of the Excel Help window.
search text entered in text box
Search button arrow
All Excel command selected
• Click the Search button arrow to display the Search menu.
• If it is not selected already, click Search menu
Q&A
All Excel on the Search menu to select the command. If All Excel is already selected, click the Search button arrow again to close the Search menu. Why select All Excel on the Search menu? Selecting All Excel on the Search menu ensures that Excel Help will search all possible sources for information on your search term. It will produce the most complete search results. Figure C–6
C6390_AppC_CTP.4c.indd 13
4/16/07 8:31:16 AM
APP 14 Appendix C Microsoft Office Excel 2007 Help
2 • Click the Search button to display
search results are displayed
Q&A
Q&A
the search results (Figure C–7). Why do my results differ? If you do not have an Internet connection, your results will reflect only the content of the Help files on your computer. When searching for help online, results also can change as material is added, deleted, and updated on the online Help Web pages maintained by Microsoft. Why were my search results not very helpful? When initiating a search, keep in mind to check the spelling of the search text; and to keep your search very specific, with fewer than seven words, to return the most accurate results.
icon indicates link to help file
help link to be selected
location of help document in Excel Help index
Figure C–7
3 • Click the ‘Add, change, or clear conditional formats’ link to open the Help document associated with the link in the Help window (Figure C–8).
selected Help document is displayed in Excel Help window
Figure C–8
C6390_AppC_CTP.4c.indd 14
4/16/07 8:31:18 AM
4 • Click the Home
Home button
button on the taskbar to clear the search results and redisplay the Excel Help home page (Figure C–9).
contents of Excel Help home page
Appendix C
Searching Excel Help APP 15
Browse Excel Help area subcategory to be clicked
Figure C–9
To Obtain Help Using the Help Links If your topic of interest is listed in the Browse Excel Help area, you can click the link to begin browsing Excel Help categories instead of entering search text. You browse Excel Help just like you would browse a Web site. If you know in which category to find your Help information, you may wish to use these links. The following steps find the Add, change, or clear conditional formats Help information using the category link from the Excel Help home page.
1 • Click the ‘Filtering, sorting, and conditionally formatting data’ link to open the Filtering, sorting, and conditionally formatting data page.
selected Help document displayed in Excel Help window
Show All link
• Click the ‘Add,
Q&A
change, or clear conditional formats’ link to open the Help document associated with the link (Figure C–10). What does the Show All link do?
Figure C–10
In many Help documents, additional information about terms and features is available by clicking a link in the document to display additional information in the Help document. Clicking the Show All link opens all the links in the Help document that expand to additional text.
C6390_AppC_CTP.4c.indd 15
4/16/07 8:31:21 AM
APP 16 Appendix C Microsoft Office Excel 2007 Help
To Obtain Help Using the Help Table of Contents A third way to find Help in Excel is through the Help Table of Contents. You can browse through the Table of Contents to display information about a particular topic or to familiarize yourself with Excel. The following steps access the Add, change, or clear conditional formats Help information by browsing through the Table of Contents.
1 • Click the Home
Table of Contents pane opened
Show Table of Contents button
button on the toolbar.
• Click the Show Table of Contents button on the toolbar to open the Table of Contents pane on the left side of the Help window. If necessary, click the Maximize button on the Help title bar to maximize the window (Figure C–11).
contents of Excel Help home page
window maximized
Working with graphics and charts topic
Figure C–11
2 • Click the ‘Filtering, sorting, and conditionally formatting data’ link in the Table of Contents pane to view a list of Help subtopics.
• Click the ‘Add,
Q&A
change, or clear conditional formats’ link in the Table of Contents pane to view the selected Help document in the right pane (Figure C–12).
selected Help document
How do I remove the Table of Contents pane when I am finished with it? The Show Table of Contents button acts Figure C–12 as a toggle switch. When the Table of Contents pane is visible, the button changes to Hide Table of Contents. Clicking it hides the Table of Contents pane and changes the button to Show Table of Contents.
C6390_AppC_CTP.4c.indd 16
4/16/07 8:31:24 AM
Obtaining Help while Working in Excel Often you may need help while working on a document without already having the Help window open. For example, you may be unsure about how a particular command works, or you may be presented with a dialog box that you are not sure how to use. Rather than opening the Help window and initiating a search, Excel Help provides you with the ability to search directly for help. Figure C–13 shows one option for obtaining help while working in Excel. If you want to learn more about a command, point to the command button and wait for the Enhanced ScreenTip to appear. If the Help icon appears in the Enhanced ScreenTip, press the F1 key while pointing to the command to open the Help window associated with that command.
Appendix C
Obtaining Help while Working in Excel APP 17
Help icon in Enhanced ScreenTip
Figure C–13
Figure C–14 shows a dialog box with a Get help button in it. Pressing the F1 key while the dialog box is displayed opens a Help window. The Help window contains help about that dialog box, if available. If no help file is available for that particular dialog box, then the main Help window opens.
Get Help button in dialog box
Figure C–14
C6390_AppC_CTP.4c.indd 17
4/16/07 8:31:27 AM
APP 18 Appendix C Microsoft Office Excel 2007 Help
STUDENT ASSIGNMENTS
Use Help 1 Obtaining Help Using Search Text Instructions: Perform the following tasks using Excel Help. 1. Use the ‘Type words to search for’ text box to obtain help about landscape printing. Use the Connection Status menu to search online help if you have an Internet connection. 2. Click ‘Print landscape or portrait’ in the list of links in the search results. Double-click the Microsoft Office Excel Help window title bar to maximize it. Read and print the information. At the top of the printout, write down the number of links Excel Help found. 3. Use the Search menu to search for help offline. Repeat the search from Step 1. At the top of the printout, write down the number of links that Excel Help found searching offline. Submit the printouts as specified by your instructor. 4. Use the ‘Type words to search for’ text box to search for information online about adjusting cell width. Click the ‘Change column width and row height’ link in the search results. If necessary, maximize the Microsoft Office 2007 Excel Help window. Read and print the contents of the window. Close the Microsoft Office Excel Help window. Submit the printouts as specified by your instructor. 5. For each of the following words and phrases, click one link in the search results, click the Show All link, and then print the page: pie charts; formulas; print preview; Ribbon; data sorting; and accounting format. Submit the printouts as specified by your instructor. 2 Expanding on Excel Help Basics Instructions: Use Excel Help to better understand its features and answer the questions listed below. Answer the questions on your own paper, or submit the printed Help information as specified by your instructor. 1. Use Help to find out how to customize the Help window. Change the font size to the smallest option and then print the contents of the Microsoft Office Excel Help window. Change the font size back to its original setting. Close the window. 2. Press the F1 key. Search for information about tables, restricting the search results to Excel Templates. Print the first page of the Search results. You must be working online to restrict the results to Excel templates. 3. Search for information about tables, restricting the search results to Excel Help files. Print the first page of the Search results. 4. Use Excel Help to find out what happened to the Office Assistant, a feature in the previous version of Excel. Print out the Help document that contains the answer.
C6390_AppC_CTP.4c.indd 18
4/16/07 8:31:30 AM
Microsoft Office Excel 2007
Appendix D
Publishing Office 2007 Web Pages to a Web Server With the Office 2007 programs, you use the Save As command on the Office Button menu to save a Web page to a Web server using one of two techniques: Web folders or File Transfer Protocol. A Web folder is an Office shortcut to a Web server. File Transfer Protocol (FTP) is an Internet standard that allows computers to exchange files with other computers on the Internet. You should contact your network system administrator or technical support staff at your Internet access provider to determine if their Web server supports Web folders, FTP, or both, and to obtain necessary permissions to access the Web server. If you decide to publish Web pages using a Web folder, you must have the Office Server Extensions (OSE) installed on your computer.
Using Web Folders to Publish Office 2007 Web Pages When publishing to a Web folder, someone first must create the Web folder before you can save to it. If you are granted permission to create a Web folder, you must obtain the Web address of the Web server, a user name, and possibly a password that allows you to access the Web server. You also must decide on a name for the Web folder. Table D–1 explains how to create a Web folder. Office 2007 adds the name of the Web folder to the list of current Web folders. You can save to this folder, open files in the folder, rename the folder, or perform any operations you would to a folder on your hard disk. You can use your Office 2007 program or Windows Explorer to access this folder. Table D–2 explains how to save to a Web folder. Table D–1 Creating a Web Folder
Table D–2 Saving to a Web Folder
1.
Click the Office Button and then click Save As or Open.
1.
Click the Office Button, click Save As.
2.
2.
When the Save As dialog box (or Open dialog box) appears, click the Tools button arrow, and then click Map Network Drive... When the Map Network Drive dialog box is displayed, click the ‘Connect to a Web site that you can use to store your documents and pictures’ link.
When the Save As dialog box is displayed, type the Web page file name in the File name text box. Do not press the ENTER key.
3.
Click the Save as type box arrow and then click Web Page to select the Web Page format.
4.
Click Computer in the Navigation pane.
5.
Double-click the Web folder name in the Network Location list.
6.
If the Enter Network Password dialog box appears, type the user name and password in the respective text boxes and then click the OK button.
7.
Click the Save button in the Save As dialog box.
3.
C6390_AppD_CTP.4c.indd 19
When the Add Network Location Wizard dialog box appears, click the Next button. If necessary, click Choose a custom network location. Click the Next button. Click the View examples link, type the Internet or network address, and then click the Next button. Click ‘Log on anonymously’ to deselect the check box, type your user name in the User name text box, and then click the Next button. Enter the name you want to call this network place and then click the Next button. Click to deselect the ‘Open this network location when I click Finish’ check box, and then click the Finish button.
4/16/07 8:32:04 AM
APP 20 Appendix D Publishing Office 2007 Web Pages to a Web Server
Using FTP to Publish Office 2007 Web Pages When publishing a Web page using FTP, you first must add the FTP location to your computer before you can save to it. An FTP location, also called an FTP site, is a collection of files that reside on an FTP server. In this case, the FTP server is the Web server. To add an FTP location, you must obtain the name of the FTP site, which usually is the address (URL) of the FTP server, and a user name and a password that allows you to access the FTP server. You save and open the Web pages on the FTP server using the name of the FTP site. Table D–3 explains how to add an FTP site. Office 2007 adds the name of the FTP site to the FTP locations list in the Save As and Open dialog boxes. You can open and save files using this list. Table D–4 explains how to save to an FTP location. Table D–3 Adding an FTP Location
Table D–4 Saving to an FTP Location
1.
1.
Click the Office Button and then click Save As.
2.
When the Save As dialog box is displayed, type the Web page file name in the File name text box. Do not press the ENTER key.
3.
Click the Save as type box arrow and then click Web Page to select the Web Page format.
4.
Click Computer in the Navigation pane.
5.
Double-click the name of the FTP site in the Network Location list.
6.
When the FTP Log On dialog box appears, enter your user name and password and then click the OK button.
7.
Click the Save button in the Save As dialog box.
2.
3.
4.
C6390_AppD_CTP.4c.indd 20
Click the Office Button and then click Save As or Open. When the Save As dialog box (or Open dialog box) appears, click the Tools button arrow, and then click Map Network Drive... When the Map Network Drive dialog box is displayed, click the ‘Connect to a Web site that you can use to store your documents and pictures’ link. When the Add Network Location Wizard dialog box appears, click the Next button. If necessary, click Choose a custom network location. Click the Next button. Click the View examples link, type the Internet or network address, and then click the Next button. If you have a user name for the site, click to deselect ‘Log on anonymously’ and type your user name in the User name text box, and then click Next. If the site allows anonymous logon, click Next. Type a name for the location, click Next, click to deselect the ‘Open this network location when I click Finish’ check box, and click Finish. Click the OK button. Close the Save As or the Open dialog box.
4/16/07 8:32:06 AM
Microsoft Office Excel 2007
Appendix E
Customizing Microsoft Office Excel 2007 This appendix explains how to change the screen resolution in Windows Vista to the resolution used in this book. It also describes how to customize the Excel window by changing the Ribbon, Quick Access Toolbar, and the color scheme.
Changing Screen Resolution Screen resolution indicates the number of pixels (dots) that the computer uses to display the letters, numbers, graphics, and background you see on the screen. When you increase the screen resolution, Windows displays more information on the screen, but the information decreases in size. The reverse also is true: as you decrease the screen resolution, Windows displays less information on the screen, but the information increases in size. The screen resolution usually is stated as the product of two numbers, such as 1024 ⫻ 768 (pronounced “ten twenty-four by seven sixty-eight”). A 1024 ⫻ 768 screen resolution results in a display of 1,024 distinct pixels on each of 768 lines, or about 786,432 pixels. The figures in this book were created using a screen resolution of 1024 ⫻ 768. The screen resolutions most commonly used today are 800 ⫻ 600 and 1024 ⫻ 768, although some Office specialists set their computers at a much higher screen resolution, such as 2048 ⫻ 1536.
To Change the Screen Resolution The following steps change the screen resolution from 1280 ⫻ 1024 to 1024 ⫻ 768. Your computer already may be set to 1024 ⫻ 768 or some other resolution.
1 • If necessary, minimize all programs so that the Windows Vista desktop appears.
• Right-click the Windows Vista desktop to display the Windows Vista desktop shortcut menu (Figure E–1).
Windows Vista desktop shortcut menu
Personalize command
Figure E–1
C6390_AppE_CTP.4c.indd 21
4/16/07 8:32:42 AM
APP 22 Appendix E Customizing Microsoft Office Excel 2007
2 • Click Personalize on the shortcut
Personalization window Display Settings dialog box
menu to open the Personalize window.
• Click Display Settings in the Personalization window to display the Display Settings dialog box (Figure E–2).
Resolution area slider
Display Settings link
Figure E–2
3 • Drag the slider in the Resolution area so that the screen resolution changes to 1024 ⫻ 768 (Figure E–3).
screen resolution set to 1024 ⫻ 768
OK button
Figure E–3
C6390_AppE_CTP.4c.indd 22
4/16/07 8:32:44 AM
4 • Click the OK button to change
the screen resolution from 1280 ⫻ 1024 to 1024 ⫻ 768 (Figure E–4).
Appendix E
Changing Screen Resolution APP 23
Close button
Display Settings dialog box
Yes button
Figure E–4
5 • Click the Yes button in the Display
Q&A
Settings dialog box to accept the new screen resolution (Figure E–5). What if I do not want to change the screen resolution after seeing it applied after I click the OK button? You either can click the No button in the inner Display Settings dialog box, or wait for the timer to run out, at which point Windows Vista will revert to the original screen resolution.
screen resolution changed to 1024 ⫻ 768
• Click the Close button to close the Personalization Window.
Figure E–5
C6390_AppE_CTP.4c.indd 23
4/16/07 8:32:48 AM
APP 24 Appendix E Customizing Microsoft Office Excel 2007
Screen Resolution and the Appearance of the Ribbon in Office 2007 Programs Changing the screen resolution affects how the Ribbon appears in Office 2007 programs. Figure E–6 shows the Word Ribbon at the screen resolutions of 800 ⫻ 600, 1024 ⫻ 768, and 1280 ⫻ 1024. All of the same commands are available regardless of screen resolution. Word, however, makes changes to the groups and the buttons within the groups to accommodate the various screen resolutions. The result is that certain commands may need to be accessed differently depending on the resolution chosen. A command that is visible on the Ribbon and available by clicking a button at one resolution may not be visible and may need to be accessed using its group button at a different resolution. Ribbon at 800 ⫻ 600 resolution
not all command names visible in Clipboard group
buttons organized in three rows in Font and Paragraph
Styles group commands vertical
Editing group commands must be accessed using the Editing button
(a)
Ribbon at 1024 ⫻ 768 resolution
not all command names visible in Clipboard group
Styles group commands horizontal
buttons organized in two rows in Font and Alignment groups
(b)
Ribbon at 1280 ⫻ 1024 resolution
buttons and command names visible in Clipboard group
Styles gallery visible in groups of six
buttons organized in two rows in Font and Alignment groups
all Editing group command names visible
(c) Figure E–6
C6390_AppE_CTP.4c.indd 24
4/16/07 8:32:50 AM
Comparing the three Ribbons, notice changes in content and layout of the groups and galleries. In some cases, the content of a group is the same in each resolution, but the layout of the group differs. For example, the same buttons appear in the Font and Paragraph groups in the three resolutions, but the layouts differ. The buttons are displayed in three rows at the 800 ⫻ 600 resolution, and in two rows in the 1024 ⫻ 768 and 1280 ⫻ 1024 resolutions. In other cases, the content and layout are the same across the resolution, but the level of detail differs with the resolution. In the Clipboard group, when the resolution increases to 1280 ⫻ 1024, the names of all the buttons in the group appear in addition to the buttons themselves. At the lower resolution, only the buttons appear. Changing resolutions also can result in fewer commands being visible in a group. Comparing the Editing groups, notice that the group at the 800 ⫻ 600 resolution consists of an Editing button, while at the higher resolutions, the group has three buttons visible. The commands that are available on the Ribbon at the higher resolutions must be accessed using the Editing button at the 800 ⫻ 600 resolution. Changing resolutions results in different amounts of detail being available at one time in the galleries on the Ribbon. The Styles gallery in the three resolutions presented show different numbers of styles. At 800 ⫻ 600, you can scroll through the gallery three styles at a time, at 1024 ⫻ 768, you can scroll through the gallery four styles at a time, and at 1280 ⫻ 1024, you can scroll through the gallery six styles at a time.
Appendix E
Customizing the Excel Window APP 25
Customizing the Excel Window When working in Excel, you may want to make your working area as large as possible. One option is to minimize the Ribbon. You also can modify the characteristics of the Quick Access Toolbar, customizing the toolbar’s commands and location to better suit your needs.
To Minimize the Ribbon in Excel The following steps minimize the Ribbon.
1 • Start Excel.
Customize Quick Access Toolbar button
• Maximize the Excel window, if necessary.
• Click the Customize Quick Access Toolbar button on the Quick Access Toolbar to display the Customize Quick Access Toolbar menu (Figure E–7).
Customize Quick Access Toolbar menu
Minimize the Ribbon command
Figure E–7
C6390_AppE_CTP.4c.indd 25
4/16/07 8:32:53 AM
APP 26 Appendix E Customizing Microsoft Office Excel 2007
2 • Click Minimize the
Quick Access Toolbar
Ribbon minimized to tabs only
Ribbon on the Quick Access Toolbar menu to cause the Ribbon to display just the tabs (Figure E–8).
Figure E–8 Other Ways 1. Double-click the active Ribbon tab 2. Press CTRL+F1
Customizing and Resetting the Quick Access Toolbar The Quick Access Toolbar, located to the right of the Office Button by default, provides easy access to some of the more frequently used commands in Excel (Figure E–7). By default, the Quick Access Toolbar contains buttons for the Save, Undo, and Redo commands. Customize the Quick Access Toolbar by changing its location in the window and by adding additional buttons to reflect which commands you would like to be able to access easily.
To Change the Location of the Quick Access Toolbar The following steps move the Quick Access Toolbar to below the Ribbon.
1 • Double-click the Home tab to redisplay the Ribbon.
• Click the Customize Quick Access Toolbar button on the Quick Access Toolbar to display the Customize Quick Access Toolbar menu (Figure E–9).
Customize Quick Access Toolbar button
Customize Quick Access Toolbar menu
Show Below the Ribbon command
Figure E–9
C6390_AppE_CTP.4c.indd 26
4/16/07 8:32:54 AM
2 • Click Show Below the Ribbon on the Quick Access Toolbar menu to move the Quick Access Toolbar below the Ribbon (Figure E–10).
Appendix E
Customizing the Excel Window APP 27
Quick Access Toolbar moved below Ribbon
Figure E–10
To Add Commands to the Quick Access Toolbar Using the Customize Quick Access Toolbar Menu Some of the more commonly added commands are available for selection from the Customize Quick Access Toolbar menu. The following steps add the Quick Print button to the Quick Access Toolbar.
1 • Click the Customize Quick Access Toolbar button to display the Customize Quick Access Toolbar menu (Figure E–11).
Customize Quick Access Toolbar button
Quick Print command
Customize Quick Access Toolbar menu
Figure E–11
C6390_AppE_CTP.4c.indd 27
4/16/07 8:32:57 AM
APP 28 Appendix E Customizing Microsoft Office Excel 2007
2 • Click Quick Print on the Quick Access Toolbar menu to add the Quick Print button to the Quick Access Toolbar (Figure E–12).
Quick Print button added to Quick Access Toolbar
Figure E–12
To Add Commands to the Quick Access Toolbar Using the Shortcut Menu Commands also can be added to the Quick Access Toolbar from the Ribbon. Adding an existing Ribbon command that you use often to the Quick Access Toolbar makes the command immediately available, regardless of which tab is active.
1 • Click the Review tab on the Ribbon to make it the active tab.
Review tab Spelling button
• Right-click the Spelling button on the Review tab to display a shortcut menu (Figure E–13).
Add to Quick Access Toolbar command shortcut menu
Figure E–13
C6390_AppE_CTP.4c.indd 28
4/16/07 8:32:59 AM
2 • Click Add to Quick Access Toolbar on the shortcut menu to add the Spelling button to the Quick Access Toolbar (Figure E–14).
Appendix E
Customizing the Excel Window APP 29
Spelling button added to Quick Access Toolbar
Figure E–14
To Add Commands to the Quick Access Toolbar Using Excel Options Some commands do not appear on the Ribbon. They can be added to the Quick Access Toolbar using the Excel Options dialog box.
1 • Click the Office Button to
Office Button
display the Office Button menu (Figure E–15).
Office Button menu
Excel Options button
Figure E–15
C6390_AppE_CTP.4c.indd 29
4/16/07 8:33:01 AM
APP 30 Appendix E Customizing Microsoft Office Excel 2007
2 • Click the Excel
Excel Options dialog box
Options button on the Office Button menu to display the Excel Options dialog box (Figure E–16). Customize command
Figure E–16
3 • Click Customize in
‘Choose commands from’ box arrow
the left pane.
• Click the ‘Choose commands from’ box arrow to display the ‘Choose commands from’ list.
• Click Commands Not
Commands Not in the Ribbon selected
in the Ribbon in the ‘Choose commands from’ list.
Add button
• Scroll to display the Web Page Preview command.
• Click Web Page
Web Page Preview command
Preview to select it (Figure E–17).
Figure E–17
C6390_AppE_CTP.4c.indd 30
4/16/07 8:33:04 AM
4 • Click the Add button to add the Web Page Preview button to the list of buttons on the Quick Access Toolbar (Figure E–18).
Appendix E
Customizing the Excel Window APP 31
Web Page Preview button added to list of buttons on the Quick Access Toolbar
OK button
Figure E–18
5 • Click the OK button to add the Web Page Preview button to the Quick Access Toolbar (Figure E–19).
Web Page Preview button added to Quick Access Toolbar
Figure E–19 Other Ways 1. Click Customize Quick Access Toolbar button, click More Commands, select commands to add, click Add button, click OK button
C6390_AppE_CTP.4c.indd 31
4/16/07 8:33:06 AM
APP 32 Appendix E Customizing Microsoft Office Excel 2007
To Remove a Command from the Quick Access Toolbar 1 • Right-click the Web Page Preview button on the Quick Access Toolbar to display a shortcut menu (Figure E–20).
Web Page Preview button
Remove from Quick Access Toolbar command shortcut menu
Figure E–20
2 • Click Remove from Quick Access Toolbar on the shortcut menu to remove the button from the Quick Access Toolbar (Figure E–21).
Web Page Preview button removed from Quick Access Toolbar
Figure E–21 Other Ways 1. Click Customize Quick Access Toolbar button, click More Commands, click the command you wish to remove in the Customize Quick Access Toolbar list, click Remove button, click OK button
C6390_AppE_CTP.4c.indd 32
2. If the command appears on the Customize Quick Access Toolbar menu, click the Customize Quick Access Toolbar button, click the command you wish to remove
4/16/07 8:33:08 AM
To Reset the Quick Access Toolbar Excel Options dialog box
1 • Click the Customize
Appendix E
Customizing the Excel Window APP 33
Quick Access Toolbar button on the Quick Access Toolbar.
• Click More Commands on the Quick Access Toolbar menu to display the Excel Options Dialog box.
• Click the ‘Show Quick Access Toolbar below the Ribbon’ check box to deselect it (Figure E–22).
Reset button
Show Quick Access Toolbar below the Ribbon check box
OK button
Figure E–22
• Click the Reset button, click the Yes button in the dialog box that appears, and then click the OK button in the Excel Options dialog box, to reset the Quick Access Toolbar to its original position to the right of the Office Button, with the original three buttons (Figure E–23).
Quick Access Toolbar reset to original location and contents
Figure E–23
C6390_AppE_CTP.4c.indd 33
4/16/07 8:33:11 AM
APP 34 Appendix E Customizing Microsoft Office Excel 2007
Changing the Excel Color Scheme The Microsoft Excel window can be customized by selecting a color scheme other than the default blue one. Three color schemes are available in Excel.
To Change the Excel Color Scheme The following steps change the color scheme.
1 • Click the Office
Office Button
Button to display the Office Button menu.
• Click the Excel Options button on the Office Button menu to display the Excel Options dialog box.
Popular command
Color scheme box arrow
Silver color scheme
• If necessary, click Popular in the left pane. Click the Color scheme box arrow to display a list of color schemes (Figure E–24).
OK button
Figure E–24
2 • Click Silver in the list. • Click the OK button to change
Silver color scheme selected
Q&A
the color scheme to silver (Figure E–25). How do I switch back to the default color scheme? Follow the steps for changing the Excel color scheme, and select Blue from the list of color schemes. Figure E–25
C6390_AppE_CTP.4c.indd 34
4/16/07 8:33:13 AM
Microsoft Office Excel 2007
Appendix F
Steps for the Windows XP User For the XP User of this Book For most tasks, no differences exist between using Excel under the Windows Vista operating system and using Excel under the Windows XP operating system. With some tasks, however, you will see some differences, or need to complete the tasks using different steps. This appendix shows how to Start Excel, Save a Workbook, Open a Workbook, and Insert a Picture while using Microsoft Office under Windows XP. The tasks can be accomplished in other Office programs in a similar fashion.
To Start Excel The following steps, which assume Windows is running, start Excel based on a typical installation. You may need to ask your instructor how to start Excel for your computer.
1 • Click the Start button on the Windows taskbar to display the Start menu.
• Point to All Programs on the Start menu to display the All Programs submenu.
• Point to Microsoft Office on the All
All Programs submenu
Programs submenu to display the Microsoft Office submenu (Figure F–1).
Microsoft Office submenu
Microsoft Office Excel 2007 command
Microsoft Office command Start button
Windows displays commands on the Start menu above the Start button
All Programs command
Windows taskbar
Figure F–1
C6390_AppF_CTP.4c.indd 35
4/16/07 8:33:43 AM
APP 36 Appendix F Steps for the Windows XP User
2 • Click Microsoft Office
title of blank document is Document1
Excel 2007 to start Word and display a new workbook in the Excel window (Figure F–2).
title bar
Maximize button changed to a Restore Down button because window is maximized
Close button
blank workbook
• If the Excel window is not maximized, click the Maximize button next to the Close button on its title bar to maximize the window.
Windows taskbar displays Excel program button, indicating Excel is running
Print Layout button is selected when you first install Word
3 • If the worksheet window in Excel is not maximized, Figure F–2 click the Maximize button next to the Close button on its title bar to maximize the worksheet window within Excel (Figure F-2). Other Ways 1. Double-click Excel icon on desktop, if one is present
2. Click Microsoft Office Excel 2007 on Start menu
To Save a Workbook After editing, you should save the document. The following steps save a document on a USB flash drive using the file name, Walk and Rock Music 1st Quarter Sales.
1 • With a USB flash
Q&A
drive connected to one of the computer’s USB ports, click the Save button on the Quick Access Toolbar to display the Save As dialog box (Figure F–3).
Save button
Save As dialog box
My Documents is default folder (your default folder may differ)
Do I have to save to a USB flash drive? No. You can save to any device or folder. A folder is a specific location on a storage medium. You can save to the default folder or a different folder. You also can create your own folders, which is explained later in this book.
default file name is displayed in File name text box
default file type is Excel workbook
Figure F–3
C6390_AppF_CTP.4c.indd 36
4/16/07 8:33:44 AM
2 • Type the name of your file (Walk
Q&A
and Rock Music 1st Quarter Sales in this example) in the File name text box to change the file name. Do not press the ENTER key after typing the file name (Figure F–4). What characters can I use in a file name? A file name can have a maximum of 255 characters, including spaces. The only invalid characters are the backslash (\), slash (/), colon (:), asterisk (*), question mark (?), quotation mark (“), less than symbol (<), greater than symbol (>), and vertical bar (|).
Appendix F
For the XP User of this Book APP 37
selected words in default file name automatically are replaced when you type the new file name
clicking Cancel button will close the Save As dialog box
Figure F–4
3 • Click the Save in box arrow to
Q&A
display a list of available drives and folders (Figure F–5). Why is my list of files, folders, and drives arranged and named differently from those shown in the figure? Your computer’s configuration determines how the list of files and folders is displayed and how drives are named. You can change the save location by clicking shortcuts on the My Places bar. Q&A
Save in box arrow
How do I save the file if I am not using a USB flash drive?
list of available drives and folders is displayed in Save in list
My Places bar allows you to change save location
project to be saved on USB flash drive
Use the same process, but be certain to select your device in the Save in list.
Figure F–5
C6390_AppF_CTP.4c.indd 37
4/16/07 8:33:47 AM
APP 38 Appendix F Steps for the Windows XP User
4 • Click UDISK 2.0 (E:) in the Save in list to select the USB flash drive, Drive E in this case, as the new save location (Figure F–6).
USB flash drive is new save location
• Click the Save button to save the workbook. Q&A
What if my USB flash drive has a different name or letter?
Excel files currently saved on USB flash drive (Data Files for Students) are displayed
It is very likely that your USB flash drive will have a different name and drive letter and be connected to a different port. Verify the device in your Save in list is correct.
Save button
Figure F–6
Other Ways 1. Click Office Button, click Save, type file name, select drive or folder, click Save button
2. Press CTRL+S or press SHIFT+F12, type file name, select drive or folder, click Save button
To Open a Workbook The following steps open the Walk and Rock Music 1st Quarter Sales file from the USB flash drive.
1 • With your USB flash drive connected
Open dialog box
to one of the computer’s USB ports, click the Office Button to display the Office Button menu.
USB flash drive is selected device
• Click Open on the Office Button menu to display the Open dialog box.
selected file
Look in box arrow
Open button
• If necessary, click the Look in box arrow and then click UDISK 2.0 (E:) to select the USB flash drive, Drive E in this case, in the Look in list as the new open location.
• Click Walk and Rock Music 1st Quarter
Figure F–7
Sales to select the file name (Figure F–7).
Q&A
• Click the Open button to open the workbook. How do I open the file if I am not using a USB flash drive? Use the same process, but be certain to select your device in the Look in list.
C6390_AppF_CTP.4c.indd 38
Other Ways 1. Click Office Button, double-click file name in Recent Documents list 2. Press CTRL+O, select file name, press ENTER
4/16/07 8:33:50 AM
To Insert a Picture The following steps insert a picture, which, in this example, is located on a USB flash drive.
1
Click Insert on the Ribbon to display the Insert tab.
2
Click the Insert Picture from File button on the Insert tab to display the Insert Picture dialog box.
3
With your USB flash drive connected to one of the computer’s USB ports, if necessary, click the Look in box arrow and then click UDISK 2.0 (E:) to select the USB flash drive, Drive E in this case, in the Look in list as the device that contains the picture.
4
Select the file name of the picture file.
5
Click the Insert button in the dialog box to insert the picture in the current worksheet.
C6390_AppF_CTP.4c.indd 39
Appendix F
For the XP User of this Book APP 39
4/16/07 8:33:53 AM
Microsoft Office Excel 2007
Appendix G
Microsoft Business Certification Program What Is the Microsoft Business Certification Program? The Microsoft Business Certification Program enables candidates to show that they have something exceptional to offer – proved expertise in Microsoft Office 2007 programs. The two certification tracks allow candidates to choose how they want to exhibit their skills, either through validating skills within a specific Microsoft product or taking their knowledge to the next level and combining Microsoft programs to show that they can apply multiple skill sets to complete more complex office tasks. Recognized by businesses and schools around the world, more than 3 million certifications have been obtained in more than 100 different countries. The Microsoft Business Certification Program is the only Microsoft-approved certification program of its kind.
What Is the Microsoft Certified Application Specialist Certification? The Microsoft Certified Application Specialist certification exams focus on validating specific skill sets within each of the Microsoft Office system programs. Candidates can choose which exam(s) they want to take according to which skills they want to validate. The available Application Specialist exams include: • Using Microsoft® Windows Vista™ • Using Microsoft® Office Word 2007 • Using Microsoft® Office Excel® 2007 • Using Microsoft® Office PowerPoint® 2007 • Using Microsoft® Office Access 2007 • Using Microsoft® Office Outlook® 2007
For more information and details on how Shelly Cashman Series textbooks map to Microsoft Certified Application Specialist certification, visit scsite.com/off2007/cert.
What Is the Microsoft Certified Application Professional Certification? The Microsoft Certified Application Professional certification exams focus on a candidate’s ability to use the 2007 Microsoft® Office system to accomplish industry-agnostic functions, for example Budget Analysis and Forecasting, or Content Management and Collaboration. The available Application Professional exams currently include: • Organizational Support • Creating and Managing Presentations • Content Management and Collaboration • Budget Analysis and Forecasting
C6390_AppG_CTP.4c.indd 40
4/16/07 8:34:27 AM
3-D clustered column worksheet, EX 49–54 3-D pie charts adding to workbooks, EX 204–216 displaying in browser, EX 255 3-D range, 3-D reference, EX 456 401(k) creating Personalization Center for data entry, EX 567–568 investment model worksheet, EX 530–534 plans, EX 536, EX 537
A absolute cell reference, EX 186 absolute cell references ($), EX 359 Access 2007 importing tables into worksheets, EX 718–721 introduction to, APP 5 window, customizing, APP 24–32 Accounting Number Format, EX 114–116 accounts, obtaining e-mail, EX 142 active tabs on Ribbon, EX 10 active worksheet cells, EX 8 Add Watch button, EX 641 adding See also inserting 3-D pie chart to workbook, EX 204–216 controls to user interface, EX 569–573 data to PivotTables, EX 748 data validation to cells, EX 639–640 headers to charts, EX 475 lookup tables, EX 356–358 new fields to tables, EX 355–356 pointers to data tables, EX 291–294 shapes to organization chart, EX 514–515 trendlines to charts, EX 765–766 worksheets to workbooks, EX 447–448 addressing, absolute vs. relative, EX 186–189 adjustable cells, EX 649 Advanced Filter dialog box, EX 386–387, EX 388–389 aligning centering tables horizontally, EX 345 images to cell borders, EX 524 amortization schedules, creating, EX 267, EX 294–307 ampersand (&), concatenation operator, EX 271 analysis with Scenario Summary, PivotTable worksheets, EX 676–682 what-if. See what-if analysis
analyzing data using Scenario Manager, EX 662–668 AND operator, EX 384 annotating worksheet, chart elements, EX 469 annuities, EX 298 Answer Reports, EX 627 applications described, EX 552 arguments database functions, EX 391 Function Arguments dialog box, EX 101 in functions, EX 98, EX 105 table, EX 357 arithmetic operations, EX 92 arranging workbooks in Excel window, EX 486–487 arrows, adding to charts, EX 469–471 ascending sequence, sort order, EX 369 ASCII (American Standard Code for Information Exchange), EX 713 assigning cell names, EX 278–279 Currency style, EX 436–437 macros to buttons, EX 549–550 audience, and project planning, APP 1–2 auditing formulas, EX 626, EX 633–637 Auto Fill Options, EX 28, EX 171–172, EX 286 auto fill series, EX 427 AutoCalculate, EX 62–63 AutoCorrect, using, EX 19, EX 96, EX 129 AutoFilter enabling, EX 389 querying table using, EX 380–384 automatic subtotals, EX 374–379 automatically updated properties, EX 54 averaging DAVERAGE function, EX 391 AVERAGE function, EX 98–100
B background colors on worksheets, EX 110–112 background formula checking, EX 319–320 backgrounds adding to amortization schedule, EX 304–305 worksheet, EX 766 best fit, worksheet column width, EX 122 bin operator, and Solver, EX 652–654
binding constraints, EX 659 bold type applying to entire worksheet, EX 270 using to increase readability, EX 351 worksheet cell entries, EX 38 book, steps for Windows XP users of, APP 34–39 borders adding custom, to worksheets, EX 272–274 applying to columns, EX 295 applying to worksheet titles, EX 110–112 braces ({}), adding to charts, EX 469–471 breaks, page, EX 478–480 browsers Internet Explorer, APP 4 viewing, manipulating Web pages using, EX 260–261 buttons See also specific button adding to Quick Access Toolbar, EX 252–254, EX 549–550 Formula Auditing group, EX 637–638 Help, APP 12–15
Index
Index
C calculated columns, EX 338 calculating sums, EX 24–26 using AutoCalculate, EX 62 calculations absolute vs. relative addressing, EX 186–189 automatic recalculations, EX 90 formula, EX 90–91 functions, EX 104 camera ready publications, APP 6 cell protection, EX 266 Cell Styles gallery, EX 440 cells, worksheet adding data validation to, EX 638–640, EX 639–640 applying styles to, EX 112 background colors, adding, EX 272–274 cell protection, EX 266 copying and pasting, EX 174–177 copying using fill handles, EX 26–28 correcting errors on, EX 63–66 dependent, tracing, EX 636 described, EX 8 entering column, row titles, EX 19–22 entering data in range of, EX 536–537 entering text into, EX 18–19 formatting, EX 34–47 formatting, and IF function, EX 300 formatting before adding values, EX 275 IND 1
C6396_Index_CTP.4c.indd 1
8/9/07 1:42:41 PM
IND 2 Index
hiding, EX 122 inserting and deleting, EX 177–179 moving vs. copying, EX 177 names, EX 276 nonadjacent, determining row totals in, EX 194 protected, unprotected, EX 313 referencing in other sheets, EX 456–460 rotating and shrinking entries in, EX 114 rotating text in, EX 168–171 selecting, EX 15, EX 47, EX 285 styles, affect on, EX 444 values, and charting, EX 49 Center Across Section alignment, EX 345 centering data in worksheet cells, EX 113 and merging across sections, EX 344–345 printouts, EX 472–474 worksheet cells, EX 40–41 certification, Microsoft Business Certification Program, APP 40 change histories, EX 741, EX 745 changes, tracking, EX 740–744 changing Excel color scheme, APP 33 screen resolution, APP 20–24 template color scheme, EX 434–435 workbook themes, EX 109 worksheet cells, EX 49 worksheet columns, EX 122–124 worksheet fonts, EX 36–37 worksheet names, EX 140–141 worksheet views, EX 220–223 changing cells, EX 649 charts adding 3-D clustered column, to worksheet, EX 48–54 adding 3-D pie chart to workbook, EX 204–216 adding headers, EX 475 adding trendlines to, EX 765–766 Clustered Cone charts, creating, EX 461–465 embedded, EX 49 inserting titles, data labels, EX 206–209 organization, EX 510–521 types of, formatting, EX 48 check box controls, EX 585, EX 594–595 checking formulas using formula checker, EX 318–320 Circle Invalid Data command, EX 647–648
C6396_Index_CTP.4c.indd 2
clearing worksheet cells, ranges of cells, EX 66–67 Clipboard, Office, EX 174–175 Clustered Cone charts, EX 461–465 code debugging VBA, EX 600 and procedures, EX 530 viewing Web page source, EX 258 codes, format, EX 438 collaboration described, EX 734 online, using Office 2007, APP 4 and SharePoint, APP 7–8, EX 735 color schemes, formatting template, EX 434–435 coloring worksheet tabs, EX 216–217 colors background, on worksheets, EX 110–112, EX 272–274 changing pie chart, EX 213–215 changing schemes, APP 33 conserving ink, toner, EX 57 Fill and Font Color buttons, EX 200 font, EX 34 themes, EX 107–108, EX 110–112 using in worksheets, workbooks, EX 108 column headings, EX 7 columns, table banded rows, EX 367 calculated columns, EX 338 sorting using heading list, EX 379 columns, worksheet adjusting, EX 46 applying borders to, EX 295 changing width, height, EX 122–126 converting text to, EX 729–732 deleting, EX 180 entering titles, EX 19–21, EX 285 entering titles into, EX 87–89 formatting, EX 114 freezing titles, EX 181–182 hiding, unhiding, changing width, EX 122–124 increasing width of, EX 173–174 inserting, EX 179 planning, EX 16 Comma Style format, EX 45, EX 114–115, EX 196 Command Button controls adding to worksheets, EX 554–555 described, EX 552–553 setting properties for, EX 575, EX 582 command-line, starting Excel using, EX 87 commands See also specific command adding, removing, on Quick Access Toolbar, APP 26–31, EX 254
obtaining Help about, APP 17 Ribbon, EX 10, EX 194 comments adding to procedures, EX 558 adding to workbooks, EX 706 adding VBA, EX 559 inserting into worksheets, workbooks, EX 739–740 comparing and merging workbooks, EX 706, EX 760–764 Compatibility Checker dialog box, EX 686–688 computational fields, adding to tables, EX 355–356 computer programming described, EX 530 computer viruses, EX 534, EX 545 concatenating cell contents, EX 271 Concourse theme, EX 109 conditional formatting adding pointers to data tables using, EX 291–294 adding rule with icon set, EX 362–364 described, EX 118, EX 361 operators, EX 121–124 Conditional Formatting Rules Manager dialog box, EX 361 conditions in conditional formatting, EX 118 consolidation of data by linking workbooks, EX 418, EX 485–490 constants, replacing formulas with, EX 191 constraints adding to Solver tool, EX 652 binding, EX 659 of problems, EX 626, EX 627 contextual tabs, EX 10 control fields and automatic subtotals, EX 374–379 controls adding to user interface, EX 569–573 creating, naming, EX 574–582 types available, EX 568 Convert Text to Columns Wizard, EX 730–732 converting tables to ranges, EX 375–376 text to worksheet columns, EX 729–732 copying formulas, EX 301–302 formulas using fill handles, EX 95–96, EX 192–193 formulas, vs. replicating, EX 734 ranges using fill handles, EX 304 Word document data into worksheets, EX 725–728 worksheet cell formats, EX 201–202
8/9/07 1:42:43 PM
worksheet cells, EX 26–28, EX 169–171, EX 174–177 worksheet contents to other worksheets, EX 449–450 correcting errors on worksheets, EX 63–67, EX 164 mistakes using AutoCorrect, EX 19, EX 19–21 spelling in worksheets, EX 127–129 COUNTIF function, using, EX 393–394 counting using DCOUNT function, EX 391 creating amortization schedules, EX 294–307 criteria range on worksheets, EX 385 data tables, EX 288–289 extract range, records, EX 388–389 integer series, EX 296–297 lists, EX 344 lookup tables, EX 357–358 organization charts, EX 510–521 percent series using fill handles, EX 286 PivotTables, EX 745–756 Scenario Summary, PivotTable worksheets, EX 678–682 SharePoint lists, EX 789–790 styles, EX 440–444 tables (databases), EX 361 templates, EX 423–433 Web pages using Excel, EX 250–261 workbooks from templates, EX 446 worksheet borders, EX 274 worksheets, EX 3–4 workspace files, EX 488–489 criteria area using for counting, averaging, EX 341 using on multiple rows, EX 390 criteria range on worksheets, EX 385, EX 390, EX 392 criterion, filter, EX 380 CSV (comma delimited) file format, EX 342, EX 396–398 Currency style, EX 117, EX 287, EX 303, EX 436–437, EX 440 Custom Filter command, EX 383–384 Custom Sort command, EX 372 custom views saving, EX 766–768 of worksheets, EX 706 Customize Quick Access Toolbar command, EX 550 customizing Excel window, APP 24–32 Office 2007, APP 20–31 Quick Access Toolbar, APP 25–32 table elements, EX 352 worksheet borders, EX 272–274
C6396_Index_CTP.4c.indd 3
D data adding to PivotTables, EX 748 adding to scenario, Scenario Manager, EX 666–668 analyzing using Scenario Manager, EX 662–668 analyzing worksheet, using data tables, EX 284–289 centering in worksheet cells, EX 113 circling invalid, EX 647–648 consolidating by linking workbooks, EX 485–490 dummy. See dummy data entering in range of cells, EX 536–537 external. See external data saving as scenario, EX 663–666 XML, importing into Excel, EX 732–734 data entry, automating, EX 552–561 data tables adding pointers using conditional formatting, EX 291–294 analyzing worksheet data using, EX 284–289 defining ranges as, EX 288–289 entering formulas in, EX 287 expanding, EX 285 formatting, EX 290–291 data validation adding to cells, EX 638–640 described, EX 626, EX 631 features described, EX 348–349 database functions, EX 391–393 databases See also Access 2007 described, EX 338 entering column headings for, EX 344–345 date series, EX 427 date stamp, EX 183 dates, formatting of, EX 183–185 DAVERAGE function, EX 340–341, EX 391 DCOUNT function, EX 340–341, EX 391–393 debugging described, EX 135–136 using Watch Window, EX 638 VBA code, EX 600 decimal places in Excel, EX 23 decisions making with IF function, EX 189–190 what-if analysis. See what-if analysis deleting buttons from Quick Access Toolbar, EX 550 controls from user interface, EX 570 embedded charts, EX 67
worksheet cells, EX 177–179 worksheet columns, rows, EX 180 delimited files described, EX 713 dependent cells, tracing, EX 636 dependent workbooks, EX 490 descending sequence, sort order, EX 369 deselecting, and selecting worksheets, EX 476–477 Design mode, EX 559, EX 561 designing templates, EX 423–424 worksheets, EX 270 desk checking procedures, EX 557 destination area, copying to, EX 27 Developer Tab on Ribbon, displaying, EX 540–541 Dialog Box Launcher, EX 11, EX 198 digital signatures adding to workbooks, EX 602–603 file, EX 603 disabling macro viruses, EX 534 macros with notification, EX 545 displaying automatic subtotals in tables, EX 374–379 Developer Tab, Ribbon, EX 540 page breaks, EX 479–480 records in tables, EX 382 system date on worksheets, EX 183–185 distributing workbooks, EX 682–685, EX 734 DMAX, DMIN functions, EX 393 Do-While statements, using, EX 592–593 Document Inspector, using, EX 683–685 document properties, changing, EX 54–57 documents requirements, described, EX 3–5 Word, working with, APP 35–37 dollar signs ($) entering absolute cell reference, EX 187 in Excel, EX 23 fixed and floating, EX 114, EX 117, EX 436 floating, EX 116–117 dragging with dropping to move worksheet cells, EX 177 worksheet cells, EX 179 drilling entries described, EX 451–452 DSUM function, EX 393 dummy data, entering into template, EX 424, EX 426–427
Index
Index IND 3
E e-mail accounts, obtaining, EX 142 e-mailing workbooks within Excel, EX 142–143
8/9/07 1:42:43 PM
IND 4 Index
Edit mode, EX 63–64 editing in-cell, on worksheets, EX 64–65 tracking changes while, EX 740–741 elements, XML, EX 732 embedded charts, EX 49, EX 67 End Sub statements of procedures, EX 558, EX 560 Enhanced Screen Tips, EX 11 entries, drilling, EX 451–452 equal sign (=) and formulas, EX 91, EX 92, EX 99 error checking, worksheets, EX 129 Error Checking command, EX 318–319, EX 320–321, EX 638 error messages. See specific error message errors correcting on worksheets, EX 63–67 data validation, and criteria, EX 350 rounding off, EX 304 and Trace Error command, EX 638 Evaluate Formula button, EX 638 event-driven programs, EX 557 Excel 2007 See also workbooks, worksheets adding to startup submenu, EX 167 Auto Fill Options, EX 28, EX 171–172 calculating sums, EX 24–26 charts, EX 48–53 creating Web pages using, EX 250–261 data validation features, EX 348–349 as database tool, EX 340 described, APP 5 e-mailing workbook within, EX 142–143 Edit mode, EX 63–64 exporting data from Web sites, EX 137–140 file management tools, EX 259–261 font type, style, size, color, EX 34–47 functions, EX 104 functions in, EX 82, EX 99–105 Help, EX 7, EX 67–68, EX 392 Help, obtaining, APP 9–18 numeric limitations of, EX 22 Office Button, EX 14 overview, EX 2–3 quitting, EX 59 running multiple instances of, EX 270 selecting cells, EX 15, EX 47 smart tags, option buttons, EX 96–97 spell checking worksheets, EX 127–129, EX 218 starting, EX 6–7, EX 87 using SmartArt and images, EX 508–521 what-if analysis, using, EX 162, EX 164, EX 223–227 workbooks, EX 7 worksheet window, using, EX 9–15
C6396_Index_CTP.4c.indd 4
Excel Services, working with, EX 797–798 Excel window, arranging workbooks in, EX 486–487 expanding data tables, EX 285 exploding (offsetting) pie charts, EX 213–215 exporting Excel tables to SharePoint lists, EX 789–790 extensions, file, EX 395 external data, selecting and importing, EX 707, EX 712, EX 742 extract range, EX 387, EX 389 extracting table records, EX 387–389
F fields, control, EX 374 fields, table, EX 355–356 file digital signatures, EX 603 file extensions, EX 395 file formats CSV (comma delimited), EX 342 saving workbooks in different, EX 395–397 saving workbooks in PDF, XPS, EX 480–481 file management tools, EX 259–261 file names, EX 29, EX 447 file protection, EX 659, EX 662 File Transfer Protocol (FTP), publishing Web pages via, APP 19 files importing into Excel, EX 713–717 inserting text from, APP 39 text, opening in Excel, EX 713 workspace, creating, EX 488–489 XML, EX 732 Fill and Font Color buttons, EX 200 fill handles copying formulas using, EX 95–96, EX 192–193 copying range of cells using, EX 104–105 copying worksheet cells using, EX 26–28, EX 169–171 creating percent series using, EX 286 creating series of integers using, EX 296–297 double-clicking, EX 304 entering dummy data into templates using, EX 426–427 filter criterion, EX 380 filtering PivotTables using page fields, EX 752 filters Advanced Filter dialog box, EX 386–387 querying table using AutoFilter, EX 380–384 financial functions, EX 281
Find and Replace commands, EX 481–482 Find and Replace dialog box, EX 483–484 fixed dollar signs, EX 114, EX 436 fixed width files, EX 713 floating dollar signs, EX 114, EX 116–117, EX 436 fonts changing, EX 36–38 changing color in cell entry, EX 39 default, EX 122 described, EX 34 using, EX 34 footers, adding to workbooks, EX 471–473 forecasting described, EX 765 Format as Table command, EX 344 Format Cells dialog box, EX 272–274, EX 352, EX 438–439, EX 444 format codes, EX 438 Format Painter button, EX 201–203 format symbol, EX 180 formats See also styles file. See file formats saving workbooks in earlier Excel, EX 683, EX 686 standard accounting, EX 436 undoing, EX 66, EX 290 verifying using Range Finder, EX 106–107 Web page, EX 256–257 formatting, EX 118 cells before adding values, EX 275 Clustered Cone charts, EX 465 conditional, EX 118–121, EX 291–294, EX 361–364 data tables, EX 290–291 dates in worksheets, EX 114 first table row as empty, EX 347 global, EX 271 numbers in worksheets, EX 44–45 numbers using Ribbon, EX 114–118 pie charts, EX 204–216 PivotTables, EX 753–754 ranges as tables, EX 346–347 system date, EX 183–185 templates, EX 434–443 What-If Assumptions table, EX 203 worksheet backgrounds, EX 768–769 worksheet cells, EX 34–47 worksheet column titles, EX 42–43 worksheet titles, EX 110, EX 199–200 worksheets generally, EX 33–34, EX 107–114 formula auditing described, EX 626 tracing precedents, EX 633–637
8/9/07 1:42:44 PM
Formula Auditing group buttons, EX 637–638 Formula AutoComplete, EX 99 formula bar, EX 12 formula checker, using, EX 266, EX 318–319 formulas See also functions absolute vs. relative addressing, EX 186–189 checking using formula checker, EX 318–319 copying, EX 95–96, EX 192–193, EX 301–302 copying worksheet, EX 201–202 determining values using goal seeking, EX 225–228 entering IF functions in worksheets, EX 189–190 entering in data tables, EX 287 entering into amortization schedule, EX 297–300, EX 302–303 entering into template, EX 428–432 entering into worksheets, EX 90–91 entering using Point mode, EX 93–94, EX 429–432 goal seeking, EX 225–228 loan amounts, entering using cell names, EX 279 potential profit, EX 428 replacing with constants, EX 191 replicating, EX 733–734 testing, EX 283 verifying with dummy data, EX 424 version of worksheet, EX 135–136, EX 191 Formulas command, Paste button menu, EX 460–461 freezing worksheet titles, EX 181–182 FTP locations, and Web folders, EX 252 FTP sites, APP 19 Function Wizard, EX 26 functions, EX 24 See also specific function or formula absolute vs. relative addressing, EX 186–189 database, EX 391–393 described, EX 82, EX 98 entering into worksheets, EX 98 financial, EX 281 lookup, EX 356 summary, for PivotTables, PivotCharts (table), EX 756
G galleries See also specific gallery described, EX 10
C6396_Index_CTP.4c.indd 5
Garbage In, Garbage Out (GIGO), EX 350 GIGO (Garbage In, Garbage Out), EX 350 global names in workbooks, EX 279 global formatting, EX 271 Goal Seek command problem-solving with, EX 645–647 using for formula values, EX 225–228 goal seeking, EX 225–228, EX 638 grades, determining with lookup table, EX 359–360 graphics inserting images on worksheets, EX 521–525 SmartArt, adding to worksheets, EX 510–521 grayscale, printing in, EX 57 gridlines printing, EX 309 turning off, EX 510 worksheet, EX 7–8 groups on Ribbon, EX 9 growth series, EX 427
H hard copies of worksheets, EX 57 Header & Footer Elements Group, Ribbon, EX 474 headers adding to charts, EX 475 adding to workbooks, EX 471–473 headings entering table column, EX 344 formatting worksheet, EX 200 worksheet column, row, EX 7–8 worksheet types, EX 43 Help Excel, EX 7, EX 67–68, EX 602 Office 2007, APP 7, APP 9–18 hiding elements of windows, EX 318 page breaks, EX 479–480 and unhiding worksheets, workbooks, EX 316–318 worksheet columns, EX 122 worksheet portions, EX 266 worksheet rows, EX 126, EX 127 hierarchical format, EX 511 hierarchy charts, EX 510 HLOOKUP function, EX 356 Home tab, Ribbon, EX 9–10 horizontal page breaks, EX 478 HTML (Hypertext Markup Language) viewing Web page source code, EX 258 and Web pages, EX 721 hyperlinks described, APP 4
I
Index
Index IND 5
icon sets, adding conditional formatting rule with, EX 362–364 IF function and cell formatting, EX 300 making decisions using, EX 189–190 nested, EX 195 and PV (rate, periods, payment) function, EX 298 If-Then-Else statements, EX 595–596 Ignore blank check box, EX 640 images SmartArt graphics, EX 508–521 using on worksheets, EX 521–525 Import Data dialog box, EX 716, EX 718 importing data from Access table into worksheets, EX 718–721 data into Excel, EX 706, EX 707 data into Excel using Web queries, EX 137–140 external data, EX 712 files into Excel, EX 713–717 Web pages into worksheets, EX 721–725 XML data into Excel, EX 732–734 in-cell editing, EX 64 in-Ribbon gallery, EX 10 information, protecting sensitive, EX 358 Information Rights Management (IRM), restricting access using, EX 685–688 input values and data tables, EX 284 Insert Function dialog box, EX 98, EX 101, EX 104, EX 393 Insert mode, EX 63–65 inserting See also adding comments into worksheets, workbooks, EX 739–740 images on worksheets, EX 521–525 page breaks, EX 478–479 pictures, APP 38 text from files, APP 39 worksheet cells, columns, EX 177–179 insertion point in worksheet, EX 17 inspecting documents with Document Inspector, EX 683–685 int operator, and Solver, EX 652 integers, creating series, EX 296–297 interest determining on loan, EX 281–282 entering rates into worksheets, EX 279 intermediate sort keys, EX 372 Internet Office 2007 and, APP 4–6 Word 2007 and, APP 5 intranets, and Office 2007, APP 4
8/9/07 1:42:44 PM
IND 6 Index
invalid data, circling, EX 647–648 IRM (Information Rights Management), EX 685–688
lookup tables, adding, EX 356–358 loops, Loop statement in VBA code, EX 593
K
M
Key Tips, EX 15 keyboard selecting range using, EX 97 worksheet formulas, entering using, EX 91 keyboard indicators, status bar, EX 9
macro names, specifying, EX 542 macro recorder, EX 530, EX 539, EX 557 macros described, EX 530 from earlier Excel versions, EX 553 opening workbooks with, EX 546–547 recording, EX 539–544 security, EX 546 viruses, protecting against, EX 545 major sort keys, EX 372 margins adding to workbooks, EX 471–473 changing worksheet’s, EX 130–132 match case, in searches, EX 481–482 mathematical operations, using AutoCalculate, EX 62–63 MAX function, EX 98, EX 101–102 Max property controls, EX 583 scroll bars, EX 574 maximums, determining using AutoCalculate, EX 62–63 menus shortcut, EX 12, EX 272 and submenus described, EX 14 merging and centering across sections, EX 344–345 and comparing workbooks, EX 760–764 described, EX 706 worksheet cells, EX 40–41 messages, displaying using VBA code, EX 562 metadata, document properties, EX 54 Microsoft Business Certification Program, APP 40 Microsoft Certified Application Specialist, APP 40 Microsoft Excel Workbook file format, EX 395 Microsoft Office 2007 customizing, APP 20–33 introduction to, APP 3–7 Help, APP 7, APP 9–18 Microsoft Office 2007 Help, APP 7 Microsoft Office Access 2007, APP 5 Microsoft Office Excel 2007. See Excel 2007 Microsoft Office Outlook 2007, APP 6 Microsoft Office PowerPoint 2007, APP 6
L Label controls, EX 572–573 setting properties for, EX 575–581 variable, setting properties for, EX 588–589 labels on chart data, EX 204 landscape orientation printing tables, EX 368 printing worksheets, EX 129–132 LargeChange property, controls, EX 583 left-aligned text in worksheet cells, EX 18, EX 22, EX 168 legend, chart, EX 464 linear programming, EX 649 linear series, EX 427 links creating in workbooks, EX 258, EX 489–490 described, and consolidation, EX 485–490 Help, APP 15 updating, EX 490–491 listing macros in workbooks, EX 536 lists creating, EX 344 SharePoint. See SharePoint lists live preview, galleries, EX 10 Loan Payment Calculator, EX 267–268 loans creating amortization schedules, EX 294–307 determining interest, EX 281–282 entering data into worksheet, EX 282–283 and PMT (rate, periods, loan amount) function, EX 280–281 and PV (rate, periods, payment) function, EX 298 Lock Cell command, EX 320 Locked check box, EX 314 locked formulas, EX 320 logical operators in IF functions, EX 189
C6396_Index_CTP.4c.indd 6
Microsoft Office Professional Edition 2007, APP 3 Microsoft Office Publisher 2007, APP 6 Microsoft Office Security Options dialog box, EX 546 Microsoft Office Word 2007, APP 4–6 MIN function, EX 98, EX 102–104 Min property, controls, EX 583 Mini toolbar, EX 12 minimizing Ribbon, APP 24–25, EX 10 minor sort keys, EX 372 mistakes, correcting while typing, EX 19 mixed cell reference, EX 186 Mode indicators, status bar, EX 9 models, Solver, EX 656 Modify Button dialog box, EX 551 Modify Table Quick Style dialog box, EX 352 monitor, changing screen resolution of, APP 20–24 More Controls button, EX 568 moving vs. copying worksheet cells, EX 177 MsgBox function (VBA), EX 562 MSN MoneyCentral Investor Stock Quotes, EX 139 MSQuery, EX 707 My templates link, Templates list, EX 444
N Name box, EX 12, EX 47 Name Manager, EX 276 names cell, EX 276 changing worksheet, EX 140–141 entering formulas using cell, EX 279 file, EX 29, EX 447 naming cells based on row titles, EX 276–278 cells, worksheet, EX 278–279 controls, EX 574–575 macros, EX 542 and printing worksheet portions, EX 310–312 ranges, EX 313 workbooks, EX 29, EX 31 worksheet, workbook files, EX 29 worksheets, EX 86, EX 216–217 negative numbers, handling, EX 197 nested IF functions, EX 195 networks, APP 4 New Data button, EX 559, EX 563 New Formatting Rule dialog box, EX 293 Normal view, EX 129 Notepad, opening, printing CSV files, EX 398
8/9/07 1:42:45 PM
NOW function, displaying system date on worksheets, EX 183–185 numbers calculating. See calculating, calculations entering as text, EX 24 entering into range of cells, EX 90 entering into worksheets, EX 22–24, EX 180–181 formatting, in amortization schedule, EX 303–304 formatting in worksheets, EX 44–45 formatting using Ribbon, EX 114–118 legal characters, EX 22 negative, EX 197 percentages, entering, EX 275
O objects annotating, EX 469 WordArt text, EX 466 Office 2007 customizing, APP 20–33 introduction to, APP 3–7 Help, APP 7, APP 9–18 Office 2007 Help, APP 9–18 Office Button, EX 14 Office Clipboard bypassing data validation, EX 350 copying worksheet cells using, EX 174–175 offsetting charts, EX 213–214 one-input data tables, EX 284 online collaboration using Office 2007, APP 4 Help, APP 11–17 opening Excel Help window, APP 10 text files in Excel, EX 713 Watch Window, EX 641 workbooks, EX 60–61, EX 486–487, EX 546–547 workbooks from SharePoint Services Web site, EX 795–796 operations arithmetic, EX 92 described, EX 90 order of, EX 92 operators See also specific operator conditional formatting, EX 121–124 logical, in IF functions, EX 189 OR operator, EX 384 order of operations, EX 90 organization charts, creating, EX 510–521 outlined worksheets, working with, EX 679–682 outlining features, EX 377, EX 378
C6396_Index_CTP.4c.indd 7
Outlook 2007, APP 6 Overtype mode, EX 64–65
P page breaks, inserting, removing, hiding, EX 478–480 page fields, filtering PivotTables using, EX 752 Page Layout View, EX 127–132 page numbers, EX 474 page setup, EX 136, EX 471 Page Setup dialog box, EX 307–308 Page Setup Dialog Box Launcher, EX 544 panes, splitting windows into, EX 222–223 parentheses (( )) in functions, EX 100 overriding formula order of operations, EX 92 passwords described, using, EX 538 protecting sensitive information, EX 358 protecting workbooks using, EX 659–662 protecting worksheets using, EX 315 protection levels, EX 544 tracking changes with, EX 745 paste area, EX 27 Paste button, Ribbon, EX 457–461 pasting 3-D references, EX 457–461 worksheet cells, EX 175–177 worksheet contents to other worksheets, EX 449–450 payments and PMT (rate, periods, loan amount) function, EX 280–281 PDF format, saving workbooks in, EX 479–480 Percent style format, EX 118 percentages creating percent series using fill handles, EX 286 entering, EX 275 Personal information management (PIM) programs, APP 6 Personal Macro Workbook, EX 542 pictures See also images inserting, APP 38 pie charts adding 3-D, to workbook, EX 204–216 exploding (offsetting), EX 213–214 PIM (personal information management) programs, APP 6 PivotCharts changing views of, EX 759 described, using, EX 707, EX 745 sorting, EX 760 summary functions (table), EX 756
PivotTables creating, working with, EX 745–756 described, using, EX 676–679, EX 707 sorting, EX 760 pixels described, EX 122 plus sign (+), mouse pointer, EX 8 PMT (rate, periods, loan amount) function entering into worksheets, EX 280–281 Point mode, entering formulas using, EX 93–94, EX 101, EX 429–432 point size in worksheet cells, EX 34, EX 38 pointers, adding to data tables, EX 291–294 portrait orientation, printing worksheets, EX 129, EX 542–544 positioning shapes on charts, EX 518–519 PowerPoint 2007, APP 6 precedent arrows, EX 634 precedents, tracing, EX 633–637 previewing printouts, EX 60 Web pages, EX 252–255, EX 255 worksheets before printing, EX 132–124 Print dialog box, EX 133 print preview, EX 60 Print Scaling option, EX 137 printing all worksheets in workbook, EX 476 in black and white, EX 218 comments, EX 740 conserving ink, toner, EX 57, EX 57–58 CSV files with Notepad, EX 398 options, Page Setup dialog box, EX 307–308 tables (databases), EX 368 worksheet sections, EX 307–312, EX 394–395 worksheets, EX 129–135 printouts, EX 54, EX 57 Private procedures, EX 558 problem-solving using Goal Seek command, EX 645–647 using Solver, EX 648–656 using trial and error, EX 643–645 problem constraints, EX 627 procedures for controls. See specific control creating to automate data entry, EX 552–561 described, EX 530 entering scroll bar, EX 594 production environments, templates in, EX 433
Index
Index IND 7
8/9/07 1:42:45 PM
IND 8 Index
Professional Edition, Office 2007, APP 3 profit potential and Clustered Cone charts, EX 464 profit potential formulas, EX 428 programming computer, EX 530 linear, EX 649 programs event-driven, EX 557 and procedures, EX 530 projects 401(k) investment model worksheet, EX 530–534 financial projection worksheet, EX 162–167 guidelines for planning, APP 1–2 loan payment calculator, amortization schedule, EX 266–270 order optimization worksheet, EX 627–631 profit potential worksheets with cone chart, EX 418–421 revenue analysis worksheet, EX 707–711 sales rep table, EX 338–343 saving workbook, EX 29–32 SharePoint, and collaboration, EX 786–788 workbook with chart saved as Web page, EX 251–252 worksheet with embedded chart, EX 2–5 worksheet with formulas, functions, Web queries, EX 82–86 worksheets with SmartArt and images, EX 508–509 properties See also specific property automatically updated, EX 54 determining, EX 574 standard, EX 54 Properties window, using, EX 557, EX 582 Protect Sheet button, EX 566 Protect Sheet dialog box, EX 315, EX 382 protecting change histories, EX 741 against computer viruses, EX 545 workbooks with passwords, EX 659–662 worksheets, workbooks, EX 313–318, EX 538–539, EX 566 Public procedures, EX 558 Publisher 2007, APP 6 publishing Web pages to Web servers, APP 19 workbooks, EX 252 PV (rate, periods, payment) function, EX 298
C6396_Index_CTP.4c.indd 8
Q queries for Access import, EX 718 Web, importing data into Excel using, EX 137–140, EX 725 querying tables using Advanced Filter dialog box, EX 386–387 tables using AutoFilter, EX 380–384 Quick Access Toolbar adding buttons to, EX 252–254, EX 549–550 adding scenarios to, EX 676 customizing, APP 25–32 described, EX 13 resetting, EX 258, EX 601 quick styles, modifying table, EX 351–352 quitting Excel, EX 59 quotation marks (“”) in links, EX 485
R R-squared values of trendlines, EX 765 range, criteria, using on worksheet, EX 385 range, extract, EX 387, EX 389 Range Finder, using, EX 106–107, EX 164, EX 281 range of values coloring background of, EX 272–274 converting tables to, EX 375–376 copying and transposing, EX 728 defining as data tables, EX 288–289 entering data in range of cells, EX 536–537 formatting as tables, EX 346–347 naming, EX 313 read-only workbooks, EX 662 Ready mode, status bar, EX 9 recording macros, EX 539–544 records, table described, EX 338 displaying in tables, EX 382 entering records into, EX 353–354 extracting, EX 387–389 showing all, in tables, EX 387 #REF! error message, EX 180 referencing absolute vs. relative, EX 186–189 cells in other worksheets, EX 456–460 refreshing worksheet data, EX 139 relational operators and conditional formatting, EX 121 relative vs. absolute addressing, EX 186–189 relative cell reference, EX 186
removing automatic subtotals from tables, EX 379 commands from Quick Access Toolbar, EX 254 dependent arrows, EX 637 page breaks, EX 478 panes from windows, EX 223 precedent arrows, EX 635 renaming worksheets, EX 216–217 Replace command, EX 483–484 replacing strings, EX 481–484 replicating formulas, EX 733–734 reports Answer Reports. See Answer Reports Sensitivity, EX 657 Solver Answer, EX 650, EX 658–659 repositioning controls, EX 590–591 requirements documents and planning worksheets, EX 3–5 reserved words, symbols, EX 31 resetting Quick Access Toolbar, EX 258, EX 601 resizing charts, EX 53 controls, EX 590–591 Label controls, EX 580–581 resolution, screen, changing, APP 20–24 revenue analysis worksheet, EX 707–711 reviewing tracked changes, EX 742–744 Ribbon described, EX 9–11 formatting numbers using, EX 114–118 Formulas tab, EX 637–638 Header & Footer Elements Group, EX 474 minimizing, APP 24–25 overview, EX 9–12 Paste button, EX 457–461 and screen resolution, APP 23–24 using, EX 194 right-aligned text in worksheet cells, EX 168 rotating pie charts, EX 209–210 text in worksheet cells, EX 168–171 worksheet cell entries, EX 114 ROUND function, EX 304, EX 428–429 rounding off errors, EX 304 row banding, EX 353, EX 367 row headings, EX 7 row level symbols, EX 377 rows, table, using Total Row check box, EX 365–367 rows, worksheet changing height, EX 126 deleting, EX 180
8/9/07 1:42:46 PM
entering titles, EX 21–22 entering titles into, EX 88 freezing titles, EX 181–182 hiding, EX 126, EX 127 inserting, EX 177–179 planning, EX 16 titles, naming cells based on, EX 276–278 rules background formula checking, EX 319–320 conditional formatting, adding with icon set, EX 362–364 data validation, EX 350 error-checking, EX 318–319 Run mode, EX 561, EX 563
S sales representative table, EX 339–340 Save As command, EX 395 saving custom views of worksheets, EX 766–768 documents in Word, APP 35–37 Solver solutions, EX 657 templates, EX 433 workbook as Web pages, EX 256–257 workbook in CSV format, EX 396–398 workbooks, EX 29–30, EX 29–32, EX 106 workbooks as macro-enabled, EX 540–541 workbooks as read-only, EX 662 workbooks in different file formats, EX 395–397 workbooks in earlier Excel formats, EX 683, EX 686 workbooks in PDF, XPS formats, EX 480–481 workbooks to SharePoint Services Web site, EX 792–794 workbooks with passwords, EX 660–662 scaling Print Scaling option, EX 137 Scenario Manager, analyzing data using, EX 627, EX 662–668 Scenario PivotTable worksheets, EX 676–679, EX 682 Scenario Summary worksheets, EX 676–679 scenarios, summarizing, EX 676–679 schedules, amortization. See amortization schedules schemas, XML file, EX 732 schemes, changing color, APP 33 screen resolution, changing, APP 20–24 scroll arrows, EX 567
C6396_Index_CTP.4c.indd 9
Scroll Bar controls, EX 584 scroll bar, scroll box scroll bars, scroll boxes described, EX 567 entering procedures for controls, EX 594, EX 596–597 in worksheet window, EX 9 searching Help, APP 11–17, EX 67–68 for strings, EX 481–482 for workbooks, EX 486–487 sections, merging and centering across, EX 344–345 selecting and deselecting worksheets, EX 476–477 external data, EX 742 worksheet cells, EX 15, EX 285 sensitive information, protecting, EX 358 sensitivity analysis, EX 223 sequence, sorting, EX 369 series, types supported, EX 427 servers, publishing Web pages on, EX 252 Set Print Area command, EX 307, EX 310 shapes adding to organization chart, EX 514–515 positioning on charts, EX 518–519 Shapes Effects gallery, EX 519–520 Shapes gallery, EX 470 Share Workbook dialog box, EX 736 shared workbooks, resolving conflicts between, EX 745 SharePoint, and collaboration, APP 7–8, EX 735 SharePoint lists creating, EX 789–790 described, EX 786 viewing, using, EX 791–792 SharePoint Services, EX 788 saving workbooks to Web site, EX 792–794 working with Excel Services, EX 797–798 sharing workbooks, EX 14 sheet references, entering, EX 456–460 sheet tabs, EX 7 shortcut menus, EX 12, EX 272 showing. See displaying shrinking worksheet cell entries, EX 114 worksheet, chart appearance, EX 220–223 Single File Web page format, EX 256 sizing worksheet columns using best fit, EX 122 worksheets, EX 9, EX 135–136 SmallChange property, controls, EX 583 smart tags, smart tag indicator, EX 96
SmartArt graphics adding to worksheets, EX 508–509 working with, EX 510–521 Solver problem-solving using, EX 648–656 using, EX 626, EX 669–674 working with options, EX 656–659 Sort & Filter button, EX 369–370 Sort Ascending command, EX 371 sort keys, major and minor, EX 369, EX 372 Sort Z to A button, Data tab, EX 370 sorting PivotTables, PivotCharts, EX 760 tables (databases), EX 369–374 source area, copying from, EX 27 source code, viewing Web page, EX 258 source workbooks, EX 490 spell checking, EX 118, EX 127–129, EX 218 spin button controls, EX 586–587 spin buttons adding to user interface, EX 572 described, EX 568 entering procedures for controls, EX 597–599 splitting merged worksheet cells, EX 41 windows into panes, EX 222–223 spreadsheets. See worksheets stack values in Solver answer reports, EX 657 standard accounting formatting, EX 436 standard properties, EX 54 starting Excel, EX 6–7, EX 343 Visual Basic Editor, EX 559–560 Word, APP 34–35 Startup submenu, adding Excel to, EX 167 statistical functions, EX 98 status bar, EX 9 stock quotes, MSN MoneyCentral Investor Stock Quotes, EX 139 storing macros, EX 542 strings, finding and replacing, EX 481–484 styles applying new, EX 443–444 changing worksheet cell, EX 35–38, EX 42–43 creating, applying to template, EX 440–444 SmartArt, EX 519 worksheet cell, applying, EX 112 Sub statements of procedures, EX 558, EX 560 submenus, EX 14 subtitles, selecting for worksheet, EX 16
Index
Index IND 9
8/9/07 1:42:46 PM
IND 10 Index
subtotals, automatic, displaying in tables, EX 374–379 Sum button, EX 97, EX 102 SUM function, EX 24, EX 28 SUMIF function, using, EX 393–394 summary functions, PivotTable, PivotChart, EX 755–756 sums, calculating, EX 24–26, EX 28–29 symbols format, EX 180 format, in format codes, EX 438 row level, EX 377 Synchronous Scrolling button, EX 762 system date displaying, EX 271 displaying on worksheets, EX 183–185 entering into template, EX 425–426
T tab split box, EX 9 table arguments, EX 357 table arrays, EX 357 table values, EX 357 tables (databases) adding computational fields to, EX 355–356 converting to ranges, EX 375–376 displaying automatic subtotals in, EX 374–379 entering records into, EX 353–354 formatting first row as empty, EX 347 formatting ranges as, EX 346–347 guidelines for creating, EX 361 modifying quick style, EX 351–352 printing, EX 368 querying using Advanced Filter dialog box, EX 386–387 querying using AutoFilter, EX 380–384 removing automatic subtotals from, EX 379 showing all records in, EX 382, EX 387 sorting, EX 369–374 Total Row check box, using, EX 365–367 using database functions, EX 391–393 tables, data. See data tables tables, lookup, EX 356–358 tabs coloring worksheet, EX 216–217 on Ribbon, EX 9 worksheet, EX 7, EX 141 worksheet window, EX 9–10
C6396_Index_CTP.4c.indd 10
tags smart, EX 96–97 XML, EX 732 target cells for Solver, EX 649 task pane described, EX 11 templates accessing on the Web, EX 445 creating, entering formulas into, EX 423–433 creating workbooks using, EX 446–447 described, EX 418 formatting, EX 434–443 saving, EX 433 testing controls in Personalization Center, EX 600–601 procedures, EX 557 worksheet formulas, EX 283 text converting to worksheet columns, EX 729–732 entering into worksheets, EX 15–19 rotating in worksheet cells, EX 168–171 WordArt tool, using, EX 466–468 wrapping, EX 87–89 text boxes, adding to charts, EX 469–471 text files, EX 713 Text Filters command, EX 380 Text Import Wizard, EX 714 Text pane, SmartArt graphics, EX 512, EX 516–517 themes formatting worksheets using, EX 107 using, EX 34, EX 37, EX 109 time, updating system, EX 183 tips, chart, EX 204 titles adding WordArt, to chart, EX 466–468 entering into worksheets, EX 87–89, EX 271 entering template, EX 425 entering worksheet, EX 17–18 entering worksheet column, EX 19–21, EX 285 entering worksheet row, EX 21–22 formatting worksheet, EX 199–200 freezing worksheet, EX 181–182 inserting chart, EX 206–209 naming cells based on row, EX 276–278 total rows described, EX 365 Trace Error button, EX 320 Trace Error command, EX 638 tracer arrows, and formula auditing, EX 633
tracing precedents and dependents, EX 633–637 Track Changes command, EX 740–741 tracking changes with passwords, EX 745 to workbooks, EX 706 Transpose command, EX 727–728 transposed data, EX 725 trendlines, adding to charts, EX 707, EX 765–766 trial and error process for problem-solving, EX 626, EX 643–645 Trust Center dialog box, EX 541 two-input data tables, EX 284
U underscore character (_) in cell names, EX 278 Undo button, EX 538 undoing formats, EX 290 formula calculations, EX 283 group of entries, EX 538 several actions, EX 539 worksheet cell entries, EX 65 worksheet changes, EX 180, EX 227 unhiding and hiding workbooks, EX 317–318 and hiding worksheets, EX 316–317 rows, worksheet, EX 122 worksheet rows, EX 127 unlocking formulas, EX 320 unprotected cells, EX 313 unprotecting password-protected worksheets, EX 538–539 worksheets, EX 315 updating system date, time, EX 183 workbook links, EX 490–491 USB flash drives removing from port after work, EX 69 saving worksheets to, EX 30–32 user interface adding controls to, EX 569–573 creating, EX 554, EX 568 described, EX 552
V validating data entry, EX 566, EX 638–640 validation circles, EX 638 validation, data. See data validation value axis in charts, EX 50
8/9/07 1:42:47 PM
values formula, determining using Goal Seek command, EX 225–228 input, and data tables, EX 284 summing, EX 393–394 table, EX 357 version of worksheet, printing, EX 132–136 variable Label controls, EX 588–589 variables, using, EX 593 VBA (Visual Basic for Applications) debugging code, EX 600 described, EX 530, EX 552 printing code, structuring statements, EX 562–563 viewing macro code, EX 548–549 verifying formulas using Formula Auditing, EX 164 formulas using Range Finder, EX 106–107 formulas with dummy data, EX 424 vertical page breaks, EX 478 viewing macros VBA code, EX 548–549 SharePoint lists, EX 791–792 Solver Answer reports, EX 658–659 views changing worksheet, EX 220–223 custom, of worksheets, EX 706 PivotChart, changing, EX 759 PivotTable, changing, EX 749–751 viruses. See computer viruses Visual Basic Editor changing window, EX 558 Debug menu, EX 600 using, EX 559–561 viewing VBA code, EX 548–549 Visual Basic for Applications. See VBA VLOOKUP function, EX 339–340, EX 356–360
W Watch Window described, EX 638 opening, adding cell watches, EX 641–642 Web, the access templates on, EX 445 Office 2007 and, APP 4–6 Web folders, APP 19, EX 252 Web Page format, EX 256 Web pages creating using Excel, EX 250–261 importing into worksheets, EX 721–725
C6396_Index_CTP.4c.indd 11
previewing, EX 255 publishing to Web servers, APP 19 saving Excel workbook as, EX 256–257 viewing, manipulating using browser, EX 260–261 Web queries, importing data into Excel using, EX 137–140, EX 725 Web servers, publishing Web pages to, APP 19 Web sites amortization schedules, EX 294 FTP, APP 19 SharePoint, APP 7–8, EX 792–794 what-if analysis using data tables for, EX 284 using in worksheets, EX 162, EX 164 using on worksheet data, EX 223–227 using Scenario Manager, EX 662–668 What-If Assumptions table, EX 181, EX 203 width, changing worksheet column, EX 173–174, EX 295–296 windows Help, APP 10–17 hiding elements of, EX 318 splitting into panes, EX 222–223 worksheet, EX 9–15 Windows Vista, procedure execution, EX 530 Windows XP users, steps for, APP 34–39 Word 2007 introduction to, APP 4–5 starting, saving documents, APP 34–37 Word documents, copying, transposing data into worksheets, EX 725–728 WordArt tool, using, EX 466–468 work days, EX 195 workbooks adding 3-D pie chart to, EX 204–216 adding digital signatures to, EX 602–603 adding headers, margins, EX 471–473 adding worksheets from, EX 447–448 changing themes, EX 109 comparing, EX 706 comparing and merging, EX 760–764 consolidating by linking, EX 485–490 creating from template, EX 446 creating hyperlinks in, EX 258 described, EX 7 distributing, preparation for, EX 682–685 e-mailing within Excel, EX 142–143 hiding and unhiding, EX 317–318 linking, EX 489–490 naming, EX 29, EX 31 opening, EX 60–61
opening from SharePoint Services Web site, EX 795–796 printing all worksheets in, EX 476 protecting, EX 566 publishing, EX 251 reviewing digital signatures on, EX 603 saving, EX 29–30, EX 29–32, EX 106 saving as macro-enabled, EX 540–541 saving as read-only, EX 662 saving as Web pages, EX 256–257 saving in different file formats, EX 395–397 saving in earlier Excel formats, EX 683, EX 686 saving to SharePoint Services Web site, EX 792–794 sharing, collaborating, EX 735–739 templates. See templates updating links, EX 490–491 viruses, disabling macros, EX 534 worksheet backgrounds, EX 766, EX 768–769 worksheets 401(k) investment model, EX 535 adding 3-D clustered column to, EX 49–54 adding custom borders, EX 272–274 adding to workbooks, EX 447–448 adjusting column width, EX 46, EX 173–174 aesthetics vs. function, EX 84 annotating, EX 469 Auto Fill Options, EX 28, EX 169–171 bold, applying to entire, EX 270 centering cells, EX 40–41, EX 113 changing column width, height, EX 122–126 changing margins, headers, orientation, EX 130–132 changing views, EX 220–223 changing names of, EX 140–141 Command Button controls, adding, EX 554–555 conditional formatting, EX 118–121 converting text to columns, EX 729–732 copying and pasting cells, EX 175–177 copying cell formulas, EX 201–202 copying cells, EX 26–28 copying contents to other worksheets, EX 449–450 correcting errors on, EX 63–67 created by others, checking, EX 536 creating, methodology for, EX 3–5 criteria range, using, EX 385 custom views, saving, EX 766–768
Index
Index IND 11
8/9/07 1:42:47 PM
IND 12 Index
debugging, EX 135–136 described, EX 7 designing, EX 270 determining multiple totals, EX 28–29 drilling entries, EX 451–452 entering column, row titles, EX 19–22 entering numbers into, EX 22–24 entering numbers with format symbols, EX 180–181 entering text into, EX 15–19 entering titles, EX 87–89 error checking, EX 129 fitting entries to cells, EX 174–175 font type, style, size, color, EX 34–47 formatting, EX 88, EX 107–114 formatting column titles, total row, EX 42–43 formatting generally, EX 33–34 formatting numbers in, EX 44–45 formatting titles, EX 110, EX 199–200 formulas, entering into, EX 90–91 freezing titles, EX 181–182 gridlines, EX 8 hiding, unhiding columns, EX 122 importing Access tables into, EX 718–721 importing Web pages into, EX 721–725 importing Word data into, EX 725–728 in-cell editing, EX 64–65 inserting cells, EX 177–179
C6396_Index_CTP.4c.indd 12
inserting columns, EX 179 merging cells, EX 40–41 naming, renaming, EX 216–217 order optimization, EX 627–631 outlined, working with, EX 679–682 planning, EX 16, EX 108, EX 269 previewing, EX 132–134 printing, EX 57–58, EX 129–135 printing all in workbook, EX 476 printing formulas or values version of, EX 135–136 printing sections of, EX 134–125, EX 307–312, EX 394–395 protected, and macros, EX 546 protecting, EX 313–318 revenue analysis, EX 707–711 Scenario Summary, PivotTable, EX 676–679 selecting cells, EX 47, EX 48 selecting, deselecting, EX 476–477 spell checking, EX 127–129, EX 218 splitting merged cells, EX 41 storing databases in, EX 338 system date, displaying, EX 183–185 testing formulas, EX 283 unprotecting password-protected, EX 538–539 using images on, EX 521–525 working with cells, EX 7–8
workspace files, creating, EX 488–489 Workspaces (SharePoint), APP 7 wrapping, text, EX 87–89
X xlsx files, EX 395 XML (Extensible Markup Language) data, importing into Excel, EX 732–734 macros, EX 553 maps, EX 733 XP users, steps for using this book, APP 34–39 XPS format, saving workbooks in, EX 480–481
Y y-axis in charts, EX 50
Z zooming on subtotaled table, EX 377 worksheet, chart appearance, EX 220–223
8/9/07 1:42:47 PM
Microsoft Excel 2007
Quick Reference Summary In the Microsoft Office Excel 2007 program, you can accomplish a task in a number of ways. The following table provides a quick reference to each task presented in this textbook. The first column identifies the task. The second column indicates the page number on which the task is discussed in the book. The subsequent four columns list the different ways the task in column one can be carried out. Microsoft Office Excel 2007 Quick Reference Summary Task
Page Number
Advanced Filter
EX 386
AutoCalculate
EX 62
AutoFilter
EX 380
Bold
EX 38
Bold button on Mini toolbar
Bold button on Home tab or Font Dialog Box Launcher on Home tab | Font tab
Format Cells | Font tab | Bold in Font style list
CTRL+B
Borders
EX 111
Borders button on Mini toolbar
Borders button on Home tab or Alignment Dialog Box Launcher on Home tab | Border tab
Format Cells | Border tab
CTRL+1
|B
Cell Style, Change
EX 35
Cell Watch, Add
EX 641
Add Watch button on Watch Window toolbar
Center
EX 113
Right-click cell | Center button on Mini toolbar
Center button on Home tab or Alignment Dialog Box Launcher on Home tab
Format Cells | Alignment tab
CTRL+1
|A
Center Across Columns
EX 40
Right-click selection | Merge & Center button on Mini toolbar
Merge & Center button on Home tab or Alignment Dialog Box Launcher on Home tab
Format Cells | Alignment tab
CTRL+1
|A
C6396_QR_CTP.4c.indd 1
Mouse
Ribbon
Shortcut Menu
Keyboard Shortcut
Advanced button on Data tab
ALT+A
|Q
Filter button on Data tab
ALT+A
|T
Select range | rightclick AutoCalculate area | click calculation
Cell Styles button on Home tab
8/9/07 1:43:16 PM
QR 2 Microsoft Excel 2007 Quick Reference Summary
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Chart, Add
EX 50, 205
Dialog Box Launcher in Charts group on Insert tab
F11
Check Compatibility
EX 686
Prepare command on Office Button menu | Run Compatibility Checker
ALT+F
Clear Cell
EX 66
Clear Worksheet
EX 66
Close All Workbooks
EX 69
Close Workbook
EX 59
Close button on Ribbon or Office Button | Close
Color Background
EX 110
Fill Color button on Home tab or Font Dialog Box Launcher on Home tab
Color Tab
EX 216
Column Width
EX 46, 122
Comma Style Format
EX 44
Mouse
Drag fill handle back
Ribbon
Clear button on Home tab
Clear Contents
Keyboard Shortcut
|E|C
DELETE
Select All button on worksheet | Clear button on Home tab Office Button | Exit Excel
ALT+F
|X
CTRL+W
Format Cells | Fill tab
CTRL+1
|F
Tab Color Drag column heading boundary
Comment
Home tab | Format button | Column Width
Column Width
ALT+O
Comma Style button on Home tab or Number Dialog Box Launcher on Home tab | Accounting
Format Cells | Number tab | Accounting
CTRL+1
New Comment button on Review tab
Insert Comment
ALT+R
|C
Conditional Formatting button on Home tab
ALT+H
|L |D
ALT+A
Conditional Formatting
EX 119, 362
Convert Text to Columns
EX 729
Text to Columns button on Data tab
Copy and Paste
EX 175
Copy button and Paste button on Home tab
Copy and Transpose
EX 725
Paste button on Home tab | Transpose
Copy to adjacent cells
EX 27
Currency Style Format
EX 116
C6396_QR_CTP.4c.indd 2
Shortcut Menu
Select source area | drag fill handle through destination cells
|C|W
|N
ALT+O
Copy to copy; Paste to paste
CTRL+C; CTRL+V
ALT+H
Select source area | click Copy button on Home tab | select destination area | click Paste button on Home tab
Right-click source area | click Copy | right-click destination area | click Paste
Currency Style button on Home tab or Format Cells | Number | Currency
Format Cells | Number | Currency
|E
|V|T
CTRL+1
|N
8/9/07 1:43:19 PM
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Custom Formats
Ribbon
Shortcut Menu
Keyboard Shortcut
EX 438
Number Dialog Box Launcher on Home tab | Custom
Format Cells | Number | Custom
ALT+H
| FM
Custom View, Save
EX 767
Custom Views button on Views tab
ALT+W
|C
Cut
EX 64
Cut button on Home tab
Data Table
EX 288
What-If Analysis button on Data tab | Data Table
ALT+A
|W|T
Data Validation, Cell
EX 348
Data Validation button on Data tab
ALT+A
|V|V
Data Validation, Cell
EX 639
Data Validation button on Data tab
ALT+A
|V|V
Date
EX 184
Date & Time button on Formulas tab | NOW
CTRL+SEMICOLON
Date, Format
EX 113
Font Dialog Box Launcher on Home tab | Number tab | Date
Format Cells | Number tab | Date
Decimal Place, Decrease
EX 115
Decrease Decimal button on Home tab or Number Dialog Box Launcher on Home tab | Number tab | Currency
Format Cells | Number tab | Currency
CTRL+1
|N
Decimal Place, Increase
EX 118
Increase Decimal button on Home tab or Number Dialog Box Launcher on Home tab | Number tab | Currency
Format Cells | Number tab | Currency
CTRL+1
|N
Delete Rows or Columns
EX 180
Home tab | Delete button arrow | Delete Sheet Rows or Home tab | Delete button arrow | Delete Sheet Columns
Delete | Entire row or Delete | Entire column
Digital Signature, Add
EX 602
Signature Line button on Insert tab
Digital Signature, Review
EX 603
Document Properties, Set or View
EX 55
Draft Quality
EX 309
E-Mail from Excel
EX 142
C6396_QR_CTP.4c.indd 3
Mouse
Insert Function button in formula bar | Date & Time | NOW
Cut
CTRL+X
ALT+N
|G
Prepare command on Office Button menu | View Signature
ALT+F
|E|R
Office Button | Prepare | Properties
ALT+F
|E|P
ALT+P
| SP | S
ALT+F
|D|E
Page Setup Dialog Box Launcher on Page Layout tab | Sheet tab Office Button | Send | E-Mail
Excel Quick Reference
Quick Reference QR 3
8/9/07 1:43:21 PM
QR 4 Microsoft Excel 2007 Quick Reference Summary
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Embedded Chart, Delete
EX 67
File Management
EX 259
Office Button | Save As | right-click file name
ALT+F
File Passwords, Saving
EX 602
Office Button | Save As | Tools | General Options
ALT+F
Mouse
Ribbon
Shortcut Menu
Keyboard Shortcut Select chart, press DELETE
| A | right-click file name | F then |G
ALT+L
Find
EX 481
Find & Select button on Home tab | Find
CTRL+F
Fit to Print
EX 156
Page Setup Dialog Box Launcher on Page Layout tab
ALT+P
| SP
Folder, New
EX 259
Office Button | Save As | Create New Folder button
ALT+F
|A
Font Color
EX 39
Font Color box arrow on Mini toolbar
Font Color button arrow on Home tab or Font Dialog Box Launcher on Home tab
Format Cells | Font tab
CTRL+1
|F
Font Size, Change
EX 38
Font Size box arrow on Mini toolbar
Font Size box arrow on Home tab or Font Dialog Box Launcher on Home tab
Format Cells | Font tab
CTRL+1
|F
Font Size, Increase
EX 39
Increase Font Size button on Mini toolbar
Increase Font Size button on Home tab
Font Type
EX 36
Font box arrow on Mini toolbar
Font box arrow on Home tab or Font Dialog Box Launcher on Home tab
Format Cells | Font tab
CTRL+1
|F
Formula Assistance
EX 101
Insert Function button in formula bar
Insert Function button on Formulas tab
Formulas Version
EX 136
Freeze Worksheet Titles
EX 182
Freeze Panes button on the View tab | Freeze Panes
ALT+W
|F
Full Screen
EX 9
Full Screen button on View tab
ALT+V
|U
Function
EX 101
Insert Function button in formula bar
Insert Function button on Formulas tab
SHIFT+F3
Go To
EX 48
Click cell
Find & Select button on Home tab
F5
Goal Seek
EX 225
What-If Analysis button on Data tab | Goal Seek
ALT+T
Gridlines
EX 309, 510
Gridlines check box on View tab or Page Setup Dialog Box Launcher on Layout tab | Sheet tab
ALT+W
C6396_QR_CTP.4c.indd 4
after you type function name
CTRL+A
CTRL+ACCENT MARK
|G
ALT+P
|V|G |V|G
8/9/07 1:43:22 PM
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Header
EX 130, 472
Page Setup Dialog Box Launcher on Page Layout tab | Header/ Footer tab
ALT+P
Help
EX 67 and Appendix C
Microsoft Office Excel Help button on Ribbon
F1
Hide Column
EX 122
Hide Row
EX 126
Mouse
Drag column heading boundary
Drag row heading boundary
Ribbon
Shortcut Menu
Format button on Home tab | Hide & Unhide or Hide & Unhide button on View tab
Hide
Format button on Home tab | Hide & Unhide | Hide Rows
Hide
Keyboard Shortcut | SP | H
CTRL+0
(zero) to hide
CTRL+SHIFT+RIGHT PARENTHESIS
CTRL+9
to display
to hide
CTRL+SHIFT+LEFT PARENTHESIS
Hide Sheet
EX 316
Hide Workbook
EX 317
Hide button on View tab
ALT+W
|H
Import Data from Access Table
EX 718
From Access button on Data tab
ALT+A
| FA
Import Data from Text File
EX 713
From Text button on Data tab
ALT+A
| FT
Import Data from Web Page
EX 721
From Web button on Data tab
ALT+A
| FW
In-Cell Editing
EX 63
Insert Rows or Columns
EX 178
Home tab | Insert button arrow | Insert Sheet Rows or Home tab | Insert button arrow | Insert Sheet Columns
Insert Single Cell or Range of Cells
EX 179
Home | Insert button arrow | Insert Cells
Invalid Data, Circle
EX 647
Data Validation button on Data tab | Circle Invalid Data
Italicize
EX 203
Italic button on Home tab or Font Dialog Box Launcher on Home tab | Font tab
Link Update
EX 138
Existing Connections button on Data tab
ALT+A
|X
Macro, Execute
EX 546
Macros button on Developer tab
ALT+L
| PM
Macro, Record
EX 542
Record Macro button on Developer tab
ALT+L
|R
Macro, View Code
EX 548
View Code button on Developer tab
ALT+L
|V
C6396_QR_CTP.4c.indd 5
Excel Quick Reference
Quick Reference QR 5
to display
Hide
Double-click cell
F2
Insert
ALT+I
| R or C
ALT+A
Format Cells | Font tab
|V|I
CTRL+I
8/9/07 1:43:24 PM
QR 6 Microsoft Excel 2007 Quick Reference Summary
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Mouse
Ribbon
Margins, Change
EX 130, 472
In Page Layout view, drag margin in ruler
Margins button on Page Layout tab or Page Setup Dialog Box Launcher | Margins tab
Mark as Final
EX 686
Prepare command on Office Button menu | Mark as Final
Merge Cells
EX 41
Move Cells
EX 177
Point to border and drag
Move Sheet
EX 217
Drag sheet tab to desired location
Name Cells
EX 276
Click Name box in formula bar and type name
New Workbook
EX 67
Office Button | New
Open Workbook
EX 61
Office Button | Open
Outline a Range
EX 273
Border button on Home tab
Outline a Worksheet
EX 377
Group button on Data tab
ALT+A
|G|G
Page Break, Insert
EX 478
Breaks button on Page Layout tab | Insert Page Break
ALT+P
|B|I
Page Break, Move
EX 479
Page Break Preview button on View tab | drag page breaks
ALT+ W
Page Break, Remove
EX 478
Breaks button on Page Layout tab | Remove Page Break
ALT+P
Paste Options
EX 176
Paste button arrow on Home tab
Percent Style Format
EX 118
Percent Style button on Home tab or Number Dialog Box Launcher on Home tab | Percentage
Picture, Insert
C6396_QR_CTP.4c.indd 6
EX 522
Click Page Break Preview button on status bar, drag page breaks
Shortcut Menu
Keyboard Shortcut ALT+P
|M
ALT+F
|E|F
|E|A
Merge & Center button on Home tab or Alignment Dialog Box Launcher on Home tab
Format Cells | Alignment tab
ALT+O
Cut button on Home tab; Paste button on Home tab
Cut; Paste
CTRL+X; CTRL+V
Move or Copy Define Name button on Formulas tab or Create from Selection button on Formula tab or Name Manager button on Formula tab
Name a Range
|M|D
ALT+M
CTRL+N CTRL+O
Insert Picture from File button on Insert tab
Format Cells | Border tab
Format Cells | Number tab | Percentage
CTRL+1
|B
|I
|B|R
CTRL+1
| N or
CTRL+SHIFT+%.
ALT+N
|P
8/9/07 1:43:25 PM
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Mouse
PivotChart, Add Data To
EX 756
Drag field from PivotTable Field List to PivotChart
PivotChart, Change View
EX 759
Click field buttons in PivotTable Field List
PivotChart, Create
EX 756
PivotChart button on Insert tab
ALT+N
PivotChart, Format
EX 756
Select chart | use button on Layout and Format contextual tabs
ALT+JO
PivotTable, Change View
EX 749
PivotTable, Create
EX 746
PivotTable button arrow on Insert tab | PivotTable
ALT+N
|V|T
PivotTable, Format
EX 753
PivotTable Styles More button on Design contextual tab
ALT+JY
|S
Preview Worksheet
EX 132
Print Area, Clear
EX 310
Print Area, Set
Ribbon
Shortcut Menu
Keyboard Shortcut
|V|C
Drag buttons from PivotTable Field List to PivotTable
Format Cells
ALT+F
|W|V
Print Area button on Page Layout tab | Clear Print Area
ALT+P
|R|C
EX 309
Print Area button on Page Layout tab | Set Print Area
ALT+F
|T|S
Print Row and Column Headings
EX 309
Page Setup Dialog Box Launcher on Page Layout tab | Sheet tab
ALT+P
| SP | S
Print Worksheet
EX 132
Protect Worksheet
EX 313
Protect Sheet button on Review tab
Quick Access Toolbar, Customize
EX 763
Customize Quick Access Toolbar button | More Commands
Quick Style, Add
EX 440
Quick Style, Apply
EX 443
Quit Excel
EX 59
Close button on title bar Office Button | Exit Excel
Range Finder
EX 106
Double-click cell
Redo
EX 65
Redo button on Quick Access Toolbar
C6396_QR_CTP.4c.indd 7
Excel Quick Reference
Quick Reference QR 7
Office Button | Print | Print Preview
Office Button | Print
CTRL+P
Protect Sheet
ALT+R
| PS
Cell Styles button on Home tab | New Cell Style
ALT+H
|J|N
Cell Styles button on Home tab
ALT+H
|J
ALT+F4
ALT+3
or CTRL+Y
8/9/07 1:43:27 PM
QR 8 Microsoft Excel 2007 Quick Reference Summary
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Remove All Arrows, Formula Auditing
EX 637
Remove Arrows button on Formulas tab
ALT+M
|A|A
Remove Precedent Arrows
EX 635
Remove All Arrows button arrow on Formulas tab | Remove Precedent Arrows
ALT+M
|A|P
Remove Splits
EX 223
Double-click split bar
Split button on View tab
ALT+W
|S
Rename Sheet tab
EX 217
Double-click sheet tab | type sheet name
Replace
EX 483
Find & Select button on Home tab | Replace
Rotate Text
EX 169
Alignment Dialog Box Launcher on Home tab
Format Cells | Alignment tab
ALT+O
|E|A
Row Height
EX 125
Drag row heading boundary
Format button on Home tab | Row Height
Row Height
ALT+O
|R|E
Save Workbook, Different Format
EX 395
Office Button | Save As, choose from Save as type list
ALT+F
|F|O
Save Workbook, New Name
EX 57
Office Button | Save As
ALT+F
|A
Save Workbook, Same Name
EX 57
Save button on Quick Access Toolbar or Office Button | Save
CTRL+S
Scenario Manager
EX 663
Scenario PivotTable
EX 680
Scenario Summary
Mouse
Ribbon
Shortcut Menu
Keyboard Shortcut
Rename CTRL+H
What-If Analysis button on Data tab | Scenario Manager
ALT+A
Summary button in Scenario Manager dialog box, choose Scenario PivotTable
What-If Analysis button on Data tab | Scenario Manager
ALT+A
EX 678
Summary button in Scenario Manager dialog box, choose Scenario Summary
What-If Analysis button on Data tab | Scenario Manager
ALT+A
Scenario, Add
EX 663
Add button in Scenario Manager dialog box
What-If Analysis button on Data tab | Scenario Manager
ALT+A
| W | S | ALT+A
Scenario, Show
EX 675
Show button in Scenario Manager dialog box
What-If Analysis button on Data tab | Scenario Manager
ALT+A
| W | S | ALT+S
Select All of Worksheet
EX 67
Select All button on worksheet
CTRL+A
Select Cell
EX 15
Click cell or click Name box, type cell reference, press ENTER
Use arrow keys
Select Multiple Sheets
EX 218
CTRL+click
tab or tab
|W|S
| W | S | ALT+U | ALT+P
| W | S | ALT+U | ALT+S
Select All Sheets
SHIFT+click
C6396_QR_CTP.4c.indd 8
8/9/07 1:43:28 PM
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Mouse
Ribbon
Shortcut Menu
Keyboard Shortcut
Series
EX 169, 286
Drag fill handle
Fill button on Home tab
Fill Series
ALT+E
|I|S |F|I
ALT+H
Shortcut Menu
EX 12
SmartArt
EX 510
Right-click object SmartArt button on Insert tab
ALT+N
|M
Solver
EX 651
Solver button on Data tab
ALT+A
| Y2
Solver, Solve Problem
EX 655
Solve button in Solver Parameters dialog box
Solver button on Data tab
ALT+A
| Y2 | ALT+S
Spell Check
EX 127
Spelling button on Review tab
Split Cell
EX 41
Split Window into Panes
EX 222
Stock Quotes
EX 138
SHIFT+F10
F7
Merge & Center button on Home tab or Alignment Dialog Box Launcher on Home tab | click Merge cells to deselect Drag vertical or horizontal split box
Format Cells | Alignment tab | click Merge cells to deselect
ALT+O
|E|A
Split button on View tab
ALT+W
|S
Existing Connections button on Data tab
ALT+D
|D|D |X
ALT+A
Subtotals
EX 375
Subtotal button on Data tab
ALT+A
|B
Subtotals, Remove
EX 379
Subtotal button on Data tab | Remove All button
ALT+A
| B | ALT+R
Sum
EX 25
Function Wizard button in formula bar | SUM
Switch Summary Functions
EX 755
Drag fields to Values area of PivotTable Field List
Table, Create
EX 346
Format as Table button on Home tab or Table button on Insert tab
Table, Sort
EX 369
Sort & Filter button on Home tab or Sort A to Z button on Data tab
Table Total Row, Add
EX 365
Total Row check box on Design tab of Table Tools contextual tab
Table Quick Style, Modify
EX 351
Format as Table button on Home tab | rightclick style | Duplicate
Trace Dependents, Formula Auditing
EX 636
Trace Dependents button on Formulas tab
C6396_QR_CTP.4c.indd 9
Excel Quick Reference
Quick Reference QR 9
Sum button on Home tab
Insert Function button on Formulas tab
ALT+=
Summarize Data by
Sort
ALT+H
|T
ALT+A
|A
ALT+J
Duplicate
|T|T
ALT+H
|T
ALT+M
|D
8/9/07 1:43:30 PM
QR 10 Microsoft Excel 2007 Quick Reference Summary
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Trace Precedents, Formula Auditing
EX 633
Trace Precedents button on Formulas tab
ALT+M
Track Changes, Disable
EX 745
Track Changes button on Review tab | Highlight Changes | remove check mark
ALT+R
|G|H
Track Changes, Enable
EX 740
Track Changes button on Review tab | Highlight Changes
ALT+R
|G|H
Track Changes, Review EX 742
Track Changes button on Review tab | Accept/Reject Changes
ALT+R
|G|C
Trendline, Create
EX 765
Trendline button on Layout tab | select trendline type
ALT+JA
Underline
EX 203
Underline button on Home tab or Font Dialog Box Launcher on Home tab
Undo
EX 65
Unfreeze Worksheet Titles
EX 194
Unhide Column
EX 122
Drag hidden column heading boundary to right
Unhide button on View tab
Unhide Row
EX 127
Drag hidden row heading boundary down
Unhide button on View tab
Unhide Sheet
EX 316
Unhide Workbook
EX 317
Unhide button on View tab
Unlock Cells
EX 313
Font Dialog Box Launcher on Home tab | Protection tab
Format Cells | Protection tab
CTRL+1
Unprotect Worksheet
EX 315
Unprotect Sheet button on Review tab
Unprotect Sheet
ALT+R
| PS
Validation Circles, Show
EX 647
Data Validation button arrow on Data tab | Circle Invalid Data
ALT+A
|V|I
Validation Circles, Clear
EX 647
Data Validation button arrow on Data tab | Clear Validation Circles
ALT+A
|V|R
Visual Basic Editor
EX 559
Visual Basic button on Developer tab or View Code button on Developer tab
ALT+L
|V
C6396_QR_CTP.4c.indd 10
Mouse
Ribbon
Shortcut Menu
Format Cells | Font tab
Undo button on Quick Access Toolbar
Keyboard Shortcut |P
|N
CTRL+U
ALT+2, CTRL+Z
Freeze Panes button on View tab | Unfreeze Panes
ALT+W
|F
Unhide
ALT+O
|C|U
Unhide
ALT+O
|R|U
ALT+W
|H
Unhide
View Code
| SHIFT+P
8/9/07 1:43:32 PM
Microsoft Office Excel 2007 Quick Reference Summary (continued) Task
Page Number
Watch Window, Open
EX 641
Web Page, Save Workbook As
EX 256
WordArt
Mouse
Ribbon
Shortcut Menu
Keyboard Shortcut
Watch Window button on Formulas tab
ALT+M
|W
EX 466
WordArt button on Insert tab
ALT+N
|W
Workbook Theme, Change
EX 109
Themes button on Page Layout tab
Workbooks, Compare
EX 761
View Side by Side button on View tab
ALT+W
|B
Worksheet Background, Format
EX 768
Background button on Page Layout tab
ALT+P
Worksheet Name, Change
EX 141
Workspace, Save
EX 488
Zoom
EX 220
C6396_QR_CTP.4c.indd 11
Excel Quick Reference
Quick Reference QR 11
Office button | Save As | Save as type: arrow | Single File Web Page or Office button | Save As | Save as type: arrow | Web Page
Double-click sheet tab, type new name
|G
Rename Save Workspace button on View tab
Zoom box on status Zoom button on bar or Zoom In and View tab Zoom Out buttons on status bar
ALT+W
ALT+V
|K |Z
8/9/07 1:43:33 PM
This page intentionally left blank
C6394_FM_CTP.4c.indd xvi
8/8/07 3:59:57 PM
141884344x_IBC.qxd
7/26/07
10:55 AM
Page 1
Many of the exercises in this book require that you begin by opening a data file. Data files are available on the CD-ROM that accompanies this book, or you can choose one of the following methods to obtain a copy of the Data Files for Students.
ssInstructorsss ☛ A copy of the Data Files for Students is on the Instructor Resources CD-ROM below the category Data Files for Students, which you can copy to your school’s network for student use.
☛ Download the Data Files for Students via the World Wide Web by following the instructions below.
ssStudentsss ☛ Check with your instructor to determine the best way to obtain a copy of the Data Files for Students. ☛ Download the Data Files for Students via the World Wide Web by following the instructions below.
Instructions for Downloading the Data Files for Students from the World Wide Web 1. Insert your removable media (USB flash drive, floppy disk, or Zip disk) into your computer. 2. Start your browser. Enter scsite.com in the Address box and then hit Enter. 3. When the scsite.com home page displays, locate your book using one of the methods below. • Browse: Using the Browse by Subject navigation bar on the left side of the screen, click the subject category and then sub-category to which your book belongs. For example, click Office Suites, and then Microsoft Office 2007. • Search: Using the Find Your Book feature at the top of the screen, enter the title of your book, or other identifying information, and then hit Enter. • Quick Link: If your book is featured in the Quick Link area on the right side of the screen, you may click your book title and proceed directly to your material. Skip to Step 5 below. 4. In the center of the screen, locate your book and click the title. For example, click Microsoft Office 2007: Introductory Concepts and Techniques. Note: You may need to scroll down or navigate to the next Results Page. 5. When the page for your textbook displays, click the appropriate data files link. 6. If Windows displays a File Download – Security Warning dialog box, click the Run button. If Windows displays an Internet Explorer – Security Warning dialog box, click the Run button. 7. When Windows displays the WinZip Self-Extractor dialog box, type in the Unzip to folder box the portable storage media drive letter followed by a colon, backslash, and a sub-folder name of your choice (for example, f:\Office 2007). 8. Click the Unzip button. 9. When Windows displays the WinZip Self-Extractor dialog box, click the OK button. 10. Click the Close button on the right side of the title bar in the WinZip Self-Extractor dialog box. 11. Start Windows Explorer and display the contents of the folder that you specified in Step 7 to view the results. 12. Repeat Steps 5–11 to download another set of files.