Académique Documents
Professionnel Documents
Culture Documents
Create a PivotTable
AutoFormat PivotTables
1. Choose PivotTable Tools DesignPivotTable Styles.
2. Click the More arrow. A gallery of PivotTable stylesappears
3. Select a format. Excel provides over 85 different predefined
PivotTable formats, or you can create your ownformat.
To remove the formatting, Choose PivotTable ToolsDesignPivotTable StylesMoreClear.
Create a PivotChart
1. Create a PivotTable.
2. Click anywhere in the PivotTable. Choose InsertChartsand select a chart type. Excelautomatically creates a
chart from your PivotTable. AllPivotTable data, except for the totals and subtotals,appear in the
PivotChart.Changes to the PivotTable affect the PivotChart, and field changesto the PivotChart affect the
PivotTable.
3. Format the chart with the followingexceptions:
You cannot move or resize the plot area.
You cannot add data to the PivotChart from outsidethe PivotTable.
1. Select the changing cells in the spreadsheet; that is, the cells whose values vary in each of your
scenarios.Remember that you can select nonadjacent cells in the worksheet byholding down the Ctrl key as you
click them.
2. Click the What-If Analysis command button on the Ribbons Datatab and then click Scenario Manager on its
drop-down menu orpress Alt+AWS. This action opens the Scenario Manager dialog box
4. Type a descriptive name for the new scenario in the Scenario Nametext box.
Now, you should check over the cell references in the Changing Cellstext box to make sure that theyre correct.
You can modify them if necessaryby clicking the Changing Cells text box and then by clicking the cells in the
worksheet while holding down the Ctrl key. You can also editthe note in the Comment box if you want to add
more information aboutyour assumptions as part of the new scenario.
5. In the Protection section of the Add Scenario dialog box, choose whatkind of scenario protection that you
need, if any, with the PreventChanges and Hide check boxes.Now youre ready to specify the changing values for
the new scenario.
7. Check the values in each changing cells text box and modify thevalues as needed.
Now youre ready to close the Scenario Values dialog box, which completesthe definition of the new scenario.
8. Click the Add button in the Scenario Values dialog box.This action closes the Scenario Values dialog box and
returns you to theAdd Scenario dialog box, where you can define a new scenario name for the changing cells.
10. Click OK in the Add Values dialog box and then click the Close buttonin the Scenario Manager dialog box.
When you return to the Scenario Manager dialog box, the names of all thescenarios that you added appear in the
Scenarios list box.
To show a particular scenario in the worksheet that uses the values youentered for the changing cells, you simply
double-click the scenario name inthis list box or click the name and then click the Show command button.
If, after creating the scenarios for your worksheet, you find that you need touse different input values or you
want to add or remove scenarios, you canedit the scenarios in the Scenario Manager dialog box. To modify the
scenariosname and/or the input values assigned to the changing cells of thatscenario, click the scenario name in
the Scenarios list box and then click theEdit button so that you can make the appropriate changes in the Edit
Scenariodialog box. To remove a scenario from a worksheet, select the scenariosname in the Scenarios list box
and then click the Delete button.
You can also merge scenarios from other Excel workbook files that are open(of course, the workbooks should
share the same spreadsheet layout andchanging cells). To merge a scenario into the current worksheet from
anotherworkbook, click the Merge button in the Scenario Manager dialog box, and
then select the workbook in the Book drop-down list box and the worksheetin the Sheet drop-down list box
before you click OK. Excel then copies all thescenarios defined for that worksheet and merges them with any
scenariosthat youve defined for the current worksheet.
Producing a summary report
After creating the different scenarios for your worksheet, you can use theSummary button in the Scenario
Manager dialog box to create a summaryreport that shows the changing values used in each scenario and, if you
want,key resulting values that each produces. When you click the Summary button,Excel opens a Scenario
Summary dialog boxwhere you may designate a cell selection of result cells in theResult Cells text box to be
included in the report. After selecting the resultcells for the report, click OK to have Excel generate the summary
report anddisplay it in a new worksheet window.
To use the Goal Seek command, simply select the cell containing the formulathat will return the result that you
are seeking (referred to as the set cell),indicate what value you want this formula to return, and then indicate
thelocation of the input value that Excel can change to return the desired result.
To find out how much sales must increase to return a net income of$300,000 in the first quarter, you first select
cell B7, which contains the formulathat calculates the first quarter income before you click Goal Seek onthe What-
If Analysis buttons drop-down menu on the Ribbons Data tab orpress Alt+AWG. This action opens the Goal Seek
dialog box. Because cell B7 is the active cell when you openthis dialog box, the Set Cell text box already contains
the cell reference B7.You then select the To Value text box and enter 300000 as the goal. Then,you select the By
Changing Cell text box and select cell B3 in the worksheet(the cell that contains the first quarter sales).The Goal
Seek Status dialog box that appears whenyou click OK in the Goal Seek dialog box to have Excel go ahead and
adjustthe sales figure to reach your desired income figure. As this figure shows,Excel increases the sales in cell B3
from $250,000 to $352,941.18, which, inturn, returns $300,000 as the income in cell B7. The Goal Seek Status
dialogbox informs you that goal seeking has found a solution and that the currentvalue and target value are now
the same (if this were not the case, the Stepand Pause buttons in the dialog box would become active, and you
couldhave Excel perform further iterations to try to narrow and ultimately eliminate the gap between the target
and current values).
5. Specify the conditions by using the displayed controls. Your selection in Step 4 determines what other controls
you can access.
6. (Optional) Click the Input Message tab and specify which message to display when a user selects the cell. You
can use this optional step to tell the user what type of data is expected. If this step is omitted, no message will
appear when the user selects the cell.
7. (Optional.) Click the Error Alert tab and specify which error message to display when a
user makes an invalid entry. The selection for Style determines what choices users have when they make invalid
entries. To prevent an invalid entry, choose Stop. If this step is omitted, a standard message will appear if the user
makes an invalid entry.
8. Click OK.
After youve performed these steps, the cell or range contains the validation criteria you specified.
List: The user must choose from a list of entries you provide.
Date: The user must enter a date. You specify a valid date range by using the Data drop-down list. For example,
you can specify that the entered data must be greater than or equal to January 1, 2007, and less than or equal to
December 31, 2007.
Time: The user must enter a time. You specify a valid time range by using the Data drop-down list. For example,
you can specify that the entered data must be greater than 12:00 p.m.
Text Length: The length of the data (number of characters) is limited. You specify a valid length by using the Data
drop-down list. For example, you can specify that the length of the entered data be 1 (a single alphanumeric
character).
Custom: To use this option, you must supply a logical formula that determines the validity of the users entry (a
logical formula returns either True or False). You can enter the formula directly into the Formula control (which
appears when you select the Custom option), or you can specify a cell reference that contains a formula. This
chapter contains examples of useful formulas.
The Settings tab of the Data Validation dialog box contains two other check boxes:
Apply These Changes to All Other Cells with the Same Setting: If checked, the changes youmake apply to all
other cells that contain the original data validation criteria.
Its important to understand that, even with data validation in effect, the user can enter invalid data. If the
Style setting in the Error Alert tab of the Data Validation dialog box is set to anything except Stop, invaliddata can
be entered. Also, remember that data validation does not apply to the calculated results of formulas.
In other words, if the cell contains a formula, applying conditional formatting to that cell will have no effect. Excel
can draw circles around invalid entries (in this case, cells that contains values greater than 100).
1. Enter the list items into a single-row or single-column range. These items are the ones that appear in the
drop-down list.
2. Select the cell that will contain the drop-down list and access the Data Validation dialog box.
3. In the Settings tab, select the List option and specify the range that contains the list using the Source control.
Building SimpleMacros
You can often save yourself time by automating tasks you perform frequently. The automation takes the form of
an Excel Macro, which is a series of commands and functions grouped together as a single command. Macros are
created in a special programming language called Visual Basic and can be run whenever you need to perform the
task. Although you can write your own very complex macros in the Visual Basic programming language, the
easiest method for creating many macros is to use the Excel Macro Recorder. When you record a macro, Excel
stores information about each step you take as you perform a series of commands. You then run the macro to
Record a Macro
1. Choose Developer Code Record Macro.
2. Type a name and optional description for the macro.
3. From the Store Macro In drop-down list, select where you want to store the macro:
This Workbook: Save the macro in only the current workbook file.
New Workbook: Create macros that you can run in any new workbooks created during the current Excel
session.
Personal Macro Workbook: Choose this option if you want the macro to be available whenever you use
Excel, regardless of which worksheet you are using.
4. Click OK. The Record Macro option changes to Stop Recording.
5. Perform the actions you want to record. Excel is recording your keystrokes as you type.
6. Choose Developer Code Stop Recording.
Run a Macro
1. Choose Developer Code Macros.
2. Select the macro you want to run.
3. Click Run. Excel executes the selected macro.
Delete a Macro
1. Open the workbook containing the macro you want todelete.
2. Choose DeveloperCodeMacros.
3. From the Macro dialog box, select the name of themacro you want to delete.
4. Click Delete. A confirmation box appears.
5. Click Yes.