41
1 Using Conditional Using Conditional Formatting & Data Formatting & Data Validation Validation Applications of Applications of Spreadsheets Spreadsheets

1 Using Conditional Formatting & Data Validation Applications of Spreadsheets

Embed Size (px)

Citation preview

11

Using Conditional Using Conditional Formatting & Data Formatting & Data

ValidationValidation

Applications of SpreadsheetsApplications of Spreadsheets

2

Conventional FormattingConventional Formatting

►You use formats to emphasize cells in You use formats to emphasize cells in a worksheet to call attention to a worksheet to call attention to specific data.specific data. The formatting remains into effect, even if The formatting remains into effect, even if

the data changes.the data changes.

3

Applying Conditional Applying Conditional FormattingFormatting

► If you want to accent a cell depending If you want to accent a cell depending on the value of the cell, you can use on the value of the cell, you can use conditional formatting.conditional formatting. Conditional formats return a result based Conditional formats return a result based

on whether or not the value in the cell on whether or not the value in the cell meets a specified condition.meets a specified condition.

Formatting options include font size, font Formatting options include font size, font color, shading, patterns, borders, bold, color, shading, patterns, borders, bold, italic, and underlining.italic, and underlining.

4

Removing Conditional Removing Conditional FormattingFormatting

►You can remove all conditional You can remove all conditional formatting from a cell by selecting the formatting from a cell by selecting the cell and choosing Edit, Clear, Formats.cell and choosing Edit, Clear, Formats.

►You can specify up to three conditions, You can specify up to three conditions, with varying formats for each condition.with varying formats for each condition. For example, you could specify a red border For example, you could specify a red border

for values greater than expected, a green for values greater than expected, a green border for values equal to the expected, border for values equal to the expected, and a blue border for values less than and a blue border for values less than expected.expected.

5

Applying Conditional Applying Conditional FormattingFormatting

6

Conditional Formatting Dialog Conditional Formatting Dialog BoxBox

Specify a condition by first selecting “Cell Value Is” or “Formula Is”

Preview the formatting options selected

Select the formatting to apply if the current condition evaluates to true

Specify up to three conditions

7

Specifying a Condition Based Specifying a Condition Based on a Cell Valueon a Cell Value

8

Specifying a Condition Based Specifying a Condition Based on a Formulaon a Formula

9

Applying Conditional Applying Conditional Formatting in a WorksheetFormatting in a Worksheet

10

Validating DataValidating Data

► Validating data that is entered into a Validating data that is entered into a worksheet ensures the reliability and worksheet ensures the reliability and accuracy of a workbook application. accuracy of a workbook application.

► Excel 2003’s data validation featureExcel 2003’s data validation feature displays drop-down lists of valuesdisplays drop-down lists of values provides helpful prompts provides helpful prompts warn users when incorrect entries are madewarn users when incorrect entries are made

► As a workbook developer, it is your job to As a workbook developer, it is your job to determine what data is valid by setting a determine what data is valid by setting a numeric or date range or by comparing an numeric or date range or by comparing an entry to a list of acceptable values. entry to a list of acceptable values.

11

Guiding Cell Entry with Data Guiding Cell Entry with Data ValidationValidation

► Entering wrong data or creating calculations Entering wrong data or creating calculations that are not correct introduce errors into a that are not correct introduce errors into a worksheet.worksheet.

► If the data or the calculations in a worksheet If the data or the calculations in a worksheet are wrong, decisions based on the data are are wrong, decisions based on the data are likely to be wrong as well.likely to be wrong as well.

► Excel provides data validation options to set up Excel provides data validation options to set up data entry instructionsdata entry instructions drop-down lists of allowable entries drop-down lists of allowable entries error messageserror messages

12

Applying and Removing Applying and Removing Validation RulesValidation Rules

►To apply a validation method to a To apply a validation method to a worksheet, select a cell and open the worksheet, select a cell and open the Data Validation dialog box containing Data Validation dialog box containing three tabs. three tabs.

►These tabs can be used individually or These tabs can be used individually or in combination to set up messages in combination to set up messages and apply a variety of restrictions to a and apply a variety of restrictions to a cell.cell.

13

Applying and Removing Applying and Removing Validation RulesValidation Rules

► Options on the Settings Options on the Settings tab of the Data tab of the Data Validation dialog box Validation dialog box allow you to restrict the allow you to restrict the type of data that can type of data that can be entered in a cell. be entered in a cell.

► Choices range from Choices range from allowing any value to allowing any value to allowing only whole allowing only whole numbers, decimals, numbers, decimals, dates, times, values dates, times, values between two numbers, between two numbers, or values in a list.or values in a list.

14

Restricting Cell Entries to Data Restricting Cell Entries to Data from a Listfrom a List

►Selecting from a list instead of typing is Selecting from a list instead of typing is likely to improve the speed and likely to improve the speed and accuracy of data entry.accuracy of data entry.

►You can create a list right in the Source You can create a list right in the Source text box by typing allowable entries text box by typing allowable entries separated by commas.separated by commas.

►You can also type the allowable entries You can also type the allowable entries in another area of the worksheet and in another area of the worksheet and refer to that range in the Source text refer to that range in the Source text box.box.

15

Restricting Cell Entries to Whole Restricting Cell Entries to Whole Numbers Within Specified LimitsNumbers Within Specified Limits► Controlling data entry through a drop-down Controlling data entry through a drop-down

list is suitable for selecting among relatively list is suitable for selecting among relatively few exact-match entries. few exact-match entries. Some data, such as whole numbers, decimals, Some data, such as whole numbers, decimals,

dates, and times, normally would not be validated dates, and times, normally would not be validated using a list. using a list.

► As an alternative, you can specify that data As an alternative, you can specify that data must fit specified criteria, and that any must fit specified criteria, and that any attempt to enter invalid data produces an attempt to enter invalid data produces an error alert message in one of three styles—error alert message in one of three styles—Stop, Warning, or Information.Stop, Warning, or Information.

16

Data Validation Dialog BoxData Validation Dialog BoxInput Message TabInput Message Tab

► Use an input Use an input message to display message to display instructions to users instructions to users when they access a when they access a specific cell in the specific cell in the worksheet.worksheet.

► Display can have two Display can have two parts: an optional parts: an optional heading and the heading and the message itselfmessage itself

17

Attaching an Input Message to a Attaching an Input Message to a CellCell

►Clicking a cell formatted with an input Clicking a cell formatted with an input message causes the predefined text to message causes the predefined text to display in a balloon.display in a balloon. The balloon is attached to the Office The balloon is attached to the Office

Assistant if active, or to the corner of the Assistant if active, or to the corner of the cell.cell.

You can drag the Office Assistant closer to You can drag the Office Assistant closer to the cells where you are entering data.the cells where you are entering data.

18

Creating a User-Specified Error Creating a User-Specified Error Alert MessageAlert Message

► When validation When validation settings have been settings have been specified, Excel specified, Excel displays an Error Alert displays an Error Alert message when invalid message when invalid data is entered in the data is entered in the cell.cell.

► This message is very This message is very general and does not general and does not explain how to correct explain how to correct the problem.the problem.

► You can specify an You can specify an Error Alert message Error Alert message that replaces the one that replaces the one generated by Excel.generated by Excel.

19

Data Validation Dialog BoxData Validation Dialog BoxError Alert TabError Alert Tab

20

Creating a User-Specified Error Creating a User-Specified Error Alert MessageAlert Message

► You can choose from three different levels You can choose from three different levels of error alerts: Information, Warning, and of error alerts: Information, Warning, and Stop. Stop.

► Each style of error message offers different Each style of error message offers different levels of protection. levels of protection.

► Information messages allow you to accept Information messages allow you to accept the invalid data or cancel entry. the invalid data or cancel entry.

► Warnings allow you to accept the invalid Warnings allow you to accept the invalid data, change your data, or cancel entry. data, change your data, or cancel entry.

► Stop messages prevent invalid data from Stop messages prevent invalid data from being entered.being entered.

21

Displaying a Custom Warning Displaying a Custom Warning MessageMessage

Displays the text entered on the Error Alert tab of the Data Validation dialog box

Displays the text entered on the Input Message tab of the Data Validation dialog box

22

Copying Data Restrictions and Copying Data Restrictions and Messages to Other CellsMessages to Other Cells

► You can apply validation settings and You can apply validation settings and messages to a single cell or to an entire range messages to a single cell or to an entire range of cells.of cells.

► If you are designing a worksheet and have If you are designing a worksheet and have not yet entered data, you can apply one or not yet entered data, you can apply one or more validation settings to the first blank cell more validation settings to the first blank cell of a range and copy the specifications to the of a range and copy the specifications to the rest of the range:rest of the range: Copy the cell containing the validation restrictions Copy the cell containing the validation restrictions

using Copy and Paste commands or drag the fill using Copy and Paste commands or drag the fill handle.handle.

23

Copying Data Restrictions and Copying Data Restrictions and Messages to Other CellsMessages to Other Cells

►You can also apply validation You can also apply validation specifications to existing data by using specifications to existing data by using Past Special instead of Paste. Past Special instead of Paste.

►Paste Special allows you to select Paste Special allows you to select among a variety of copy options, one among a variety of copy options, one of which is Validation.of which is Validation.

24

Finding and Copying Validation Finding and Copying Validation RulesRules

Select the Data validation option button and then All or Same to locate validation rules in your worksheet

25

Paste Special Dialog BoxPaste Special Dialog Box

26

Creating a Dynamic Range Creating a Dynamic Range ReferenceReference

27

Using Dynamic Ranges For Data Using Dynamic Ranges For Data ValidationValidation

28

Applying Validation After Data Applying Validation After Data EntryEntry

►Applying validation restrictions to Applying validation restrictions to worksheets after data is already worksheets after data is already entered is a common situation.entered is a common situation.

► If you do apply validation to cells that If you do apply validation to cells that already contain data, be sure to look already contain data, be sure to look for and correct any pre-existing errors.for and correct any pre-existing errors.

29

Using Audit Tools to Find Invalid Using Audit Tools to Find Invalid DataData

► Once validation restrictions are applied to a cell they Once validation restrictions are applied to a cell they are in effect whenever you enter data in that cell. are in effect whenever you enter data in that cell.

► However, if you apply validation to a cell that However, if you apply validation to a cell that already contains data, the existing data are not already contains data, the existing data are not automatically checked for validity. automatically checked for validity.

► Excel offers a variety of auditing tools, one of which Excel offers a variety of auditing tools, one of which finds cells with errors.finds cells with errors.

30

Using Auditing tools to Interpret Using Auditing tools to Interpret Error MessagesError Messages

► Important decisions Important decisions can ride on the results can ride on the results of data analysis and of data analysis and projections, so it is projections, so it is critical to verify that critical to verify that formulas produce formulas produce accurate results. accurate results.

► Excel’s Trace Error Excel’s Trace Error auditing tool allows you auditing tool allows you to find errors in your to find errors in your worksheet formulas.worksheet formulas.

31

Error Messages Related to Error Messages Related to FormulasFormulas

► Excel provides a variety of messages to identify a Excel provides a variety of messages to identify a problem in a formula.problem in a formula. #DIV/0! – The formula is attempting to divide by zero.#DIV/0! – The formula is attempting to divide by zero. #N/A – There is no value in the formula.#N/A – There is no value in the formula. #NAME? – Excel doesn’t recognize the name in the #NAME? – Excel doesn’t recognize the name in the

formula.formula. #NULL! – An incorrect cell reference or range operator is #NULL! – An incorrect cell reference or range operator is

used in the formula.used in the formula. #NUM! – There is a problem with a number in the formula.#NUM! – There is a problem with a number in the formula. #REF! – The formula refers to a cell that is not valid.#REF! – The formula refers to a cell that is not valid. #VALUE! – The wrong type of operand or argument is used #VALUE! – The wrong type of operand or argument is used

in the formula.in the formula.► A red tracer line points to a formula that is in error, A red tracer line points to a formula that is in error,

rather than to the values involved in the error.rather than to the values involved in the error.

32

Using Auditing Tools to Check Using Auditing Tools to Check Worksheet FormulasWorksheet Formulas

►Trace Precedents and Trace Trace Precedents and Trace Dependents are auditing tools that Dependents are auditing tools that enable you to review your worksheets enable you to review your worksheets for errors or to help you understand for errors or to help you understand how a worksheet performs its how a worksheet performs its calculations. calculations.

►Trace Precedents shows what cells Trace Precedents shows what cells provide data to the current cell, and provide data to the current cell, and Trace Dependents show what other Trace Dependents show what other cells use the results of the current cell.cells use the results of the current cell.

33

Disappearing Tracer LinesDisappearing Tracer Lines

►Whenever a change is made to a cell Whenever a change is made to a cell included in a trace, the tracer lines included in a trace, the tracer lines automatically disappear.automatically disappear. Doesn’t mean the formula is correct.Doesn’t mean the formula is correct. Retrace the formula to check for Retrace the formula to check for

accuracy.accuracy.

34

Using Auditing Tools to ‘Reverse Using Auditing Tools to ‘Reverse Engineer’ a WorksheetEngineer’ a Worksheet

►Often you are face with the task of Often you are face with the task of understanding a worksheet you did not understanding a worksheet you did not create. create.

►Determining how someone else’s Determining how someone else’s product works by taking it apart and product works by taking it apart and looking at it is sometimes called looking at it is sometimes called reverse engineering.reverse engineering.

►When you print a worksheet showing When you print a worksheet showing formulas instead of formula results, set formulas instead of formula results, set your print specifications correctly.your print specifications correctly.

35

Printing Cell FormulasPrinting Cell Formulas

►When you print a worksheet showing When you print a worksheet showing formulas instead of formula results, set formulas instead of formula results, set your print specifications correctly:your print specifications correctly: Display the Page Setup dialog boxDisplay the Page Setup dialog box Click the Sheet tabClick the Sheet tab Check two boxesCheck two boxes

►GridlinesGridlines►Row and column headingsRow and column headings

Set the landscape orientation on the Page Set the landscape orientation on the Page tab.tab.

36

Using Audit Tools to Find Invalid Using Audit Tools to Find Invalid DataData

► The Auditing toolbar contains a feature to The Auditing toolbar contains a feature to circle invalid data that works in combination circle invalid data that works in combination with validation.with validation.

► When you select the Circle Invalid Data When you select the Circle Invalid Data button on the Auditing toolbar, Excel places button on the Auditing toolbar, Excel places a red circle around cells with contents that a red circle around cells with contents that don’t meet the validation rule settings.don’t meet the validation rule settings.

► As you correct the data, the red circles As you correct the data, the red circles disappear.disappear.

► Corrections are controlled by the new Corrections are controlled by the new validation settings.validation settings.

37

Impact of Saving on Circled DataImpact of Saving on Circled Data

► Saving or closing a workbook turns off Saving or closing a workbook turns off the Circle Invalid Data featurethe Circle Invalid Data feature

The red circles around incorrect data The red circles around incorrect data disappear.disappear.

► To display the circles again, repeat the To display the circles again, repeat the process to turn on the Auditing toolbar process to turn on the Auditing toolbar and select Circle Invalid Data.and select Circle Invalid Data.

► If AutoSave is active, it can interfere If AutoSave is active, it can interfere with editing.with editing.

You may want to turn the AutoSave setting You may want to turn the AutoSave setting off temporarily.off temporarily.

38

Editing Errors Including Editing Errors Including Validation SettingsValidation Settings

► Once you have identified errors in your data, you Once you have identified errors in your data, you must investigate each one and make corrections.must investigate each one and make corrections.

► In this lesson you will also be entering a page break In this lesson you will also be entering a page break between the validation work area and the data area. between the validation work area and the data area.

► A page break enables you to end a printed page at a A page break enables you to end a printed page at a specified point and start a new page. Cell contents to specified point and start a new page. Cell contents to the right of a page break print on a new page.the right of a page break print on a new page.

39

Setting Horizontal and Vertical Setting Horizontal and Vertical Page BreaksPage Breaks

► If you click a cell in column A, Excel If you click a cell in column A, Excel inserts only a horizontal page break.inserts only a horizontal page break.

► If you click a cell in row 1, Excel inserts If you click a cell in row 1, Excel inserts only a vertical page break.only a vertical page break.

► If you click a cell in any other location If you click a cell in any other location on the worksheet, Excel inserts both a on the worksheet, Excel inserts both a horizontal and a vertical page break.horizontal and a vertical page break.

40

Removing Page BreaksRemoving Page Breaks

► In Page Break Preview mode, you canIn Page Break Preview mode, you can can remove any page break by dragging its line can remove any page break by dragging its line

outside of the print area.outside of the print area. remove all manual page breaks by right clicking remove all manual page breaks by right clicking

any cell on the worksheet and selecting Reset All any cell on the worksheet and selecting Reset All Page Breaks on the Shortcut menu.Page Breaks on the Shortcut menu.

► You can also remove a manual page break by You can also remove a manual page break by clicking eitherclicking either a cell below the horizontal page break a cell below the horizontal page break to the right of a vertical page break to the right of a vertical page break

► and then choosing Insert, Remove Page Breakand then choosing Insert, Remove Page Break

41

Finding Cells That Have Finding Cells That Have Restrictions of MessagesRestrictions of Messages

► You may not know if the worksheet you are using You may not know if the worksheet you are using contains data validation restrictions and messages. contains data validation restrictions and messages.

► This is especially true if you are using a worksheet This is especially true if you are using a worksheet someone else has designed. someone else has designed.

► Using the Go To Special dialog box accessed Using the Go To Special dialog box accessed through the Edit menu, you can highlight cells that through the Edit menu, you can highlight cells that contain validation restrictions and messages.contain validation restrictions and messages.