0% found this document useful (0 votes)
16 views11 pages

3

The document provides guidance on applying custom number formats and validating data in Excel. It explains how to create custom formats using the Format Cells dialog box and details various formatting codes for numbers, dates, and text. Additionally, it includes step-by-step instructions for applying specific custom formats to a workbook.

Uploaded by

antoniofreches
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views11 pages

3

The document provides guidance on applying custom number formats and validating data in Excel. It explains how to create custom formats using the Format Cells dialog box and details various formatting codes for numbers, dates, and text. Additionally, it includes step-by-step instructions for applying specific custom formats to a workbook.

Uploaded by

antoniofreches
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

Applying Custom Formats and Validating Data

Although you can apply common number formats from the Ribbon, you may occasionally
want to create a custom number format to fit your needs. Custom formats can be
specified using the Custom category on the Number tab of the Format Cells dialog box.
Excel also provides options that allow you to populate cells using advanced Fill Series
options that include linear and growth series.
When typing new data in a workbook from a paper source—especially several records at
once—it’s easy for anyone to type the wrong digits or characters, especially in a field
where a single character denotes a type, such as a senior citizen or a child, or such as a
dog or a cat. Data validation helps to ensure that data gets entered correctly, before it
gets processed incorrectly.
Applying Custom Number Formats
In Excel, the same number can appear differently in a cell depending on its number
format. For example, 0.25, 1/4, and 6:00 A.M. are all the exact same number in Excel.
Changing the number format has the same impact on the cell’s value as changing its
color—none. In this section, we will look at some of the other things you can do with
number formatting.
You can use formatting controls on the Ribbon to quickly change your cells’ number
formats to the most commonly used formats. Now we’re going to explore custom number
formats. The first thing to understand when defining custom number formats is that Excel
allows four number formats in every cell, and they are separated with semicolons. The
basic structure is:
<Format for Positive Numbers> ; <Negative Numbers> ; <Zeroes> ; <Text>
The following table lists and describes the basic number formatting characters that can be
used in custom number formats.

Code Description
0 (zero) Digit placeholder. This means the number always displays, even
if it’s not significant. A format of 000.00 would display the
number 3.3 as 003.30
# Digit placeholder; doesn’t show insignificant zeroes. The #
symbol comes into play mostly when placing your thousands
separators. A format of #,##0.## would display the number 3.3
as 3.3
? The question mark is also a digit placeholder. It follows rules that
are similar to the # placeholder described above—if there’s a
non-zero number it will display the number, but it won’t display
a zero. However, unlike the # symbol, for a zero the ? will display
a space, not nothing. This means that if you use a format like
0.0?? Excel would align the numbers’ decimals vertically, three
digit-spaces from the right. The question mark also gets a lot of
use when formatting fractions.
. The period displays the decimal point in a number.
, The thousands separator. About the only time the decimal point
(.) and thousands separator (,) can get “interesting” is if you are
working with international workbooks and you have modified
the advanced options by deselecting the Use system separators
check box. If you do that, then Excel will update any custom
formats to use whichever separators you’ve indicated in your
advanced options.
% Displays the number as a percent—multiplies the number by 100
and places a
% symbol after it. Note that the value doesn’t change; 99% still
has a value of

1 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

0.99. When typing numbers manually, Excel interprets anything


between 1 and 100 to be a shorthand percent. In other words,
even though 99 would really be 9900%, if a cell is formatted as
0.00% and you type 99, you’ll get 99%, which is
0.99. If you type 0.99 you’ll also get 99%, which is 0.99. If you
need a real 99, then you’ll need to type 9900. If you need 0.99%,
you’ll need to type 0.0099.
/ The fraction indicator. Use this in conjunction with the question
mark (?) character. The ? will limit the number of digits Excel uses
in the numerator or denominator.
E+ or E− Scientific Notation. If you put a “+1” after the E a sign always
displays for the exponent. If you put a “−” then a sign displays
only for negative exponents. Note that while you can type a
number in scientific notation by using a lowercase “e”, you
cannot use a lowercase “e” in the number format specification.
Excel always displays scientific notation using an uppercase “E”.
$ € ¥ £ + − ( ) space These symbols along with : ^ ’ { }, < >= ! ~ can be specified in a
number format without enclosing the character inside double
/
quotation marks.
\ Backslash is the literal demarcation character. This means that
whatever comes directly after the backslash gets shown.
_ Underscore. This is a special formatting character because, like
the backslash, it tells Excel to do something special based on
whatever character comes next. In the case of the underscore, it
means “insert space equal to this character’s width.” The most
common use is _) at the end of a positive number format, where
the negative numbers are enclosed in parentheses. By adding
the width of the closing parenthesis, all the decimal points in the
column remain aligned.
* The asterisk means “repeat after me.” Excel will apply all of the
formatting and if there is any space left in the cell, it will then use
whatever character follows the asterisk to fill out the rest of the
cell. The * is used most frequently in conjunction with a space in
the Accounting number formats. The Accounting formats begin
with a $ followed by “*” (without the double quotes) which tells
Excel to fill any unused width with spaces after the $.
“” Use the double quotes to add any kind of literal text.
@ The at (@) symbol is the text placeholder.
d or dd Days as digits. If you use one d, you’ll get 0 – 31. If you use two
d’s, you’ll get 00 – 31.
ddd or dddd Days as day of the week name. If you use three d’s, you’ll get
Sun – Sat. If you use four d’s, you’ll get Sunday – Saturday. There
is no cell number format that displays the day of the week as a
number, for example, displaying a 1 for a Sunday. You would
need to use the WEEKDAY function for that purpose.
m or mm Months as digits. If you use one m, you’ll get 0 – 12. If you use
two m’s, you’ll get 00 – 12.
mmm or mmmm Name of the month. Three m’s displays Jan – Dec. Four m’s
displays January – December.
mmmmm This one is counter-intuitive. Because the single m format gives
you a digit, in order to get a one-letter month you use five m’s,
so you get J – D. This number format is most useful on charts
where you might use a number format of mmmmm to show J F
M A M J . . . across the x-axis of a chart.
yy or yyyy Year as 00 – 99 or 1900 – 9999.
h or hh Hours as 0 – 24 or 00 – 24.
m or mm Minutes as 0 – 60 or 00 – 60.

2 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

s or ss Seconds as 0 – 60 or 00 – 60.
s.0 / s.00 / ss.0 / ss.00 Seconds as 0 – 60 or 00 – 60 but with one or two decimals of
precision.
am/pm or a/p The a.m. / p.m. indicators as one-letter or two.
[h] or [m] Elapsed time – hours will display above 24, minutes will display
above 60.
[Red] You can use the square brackets to specify a color for a section
[>500] of the number format specification. The color argument must
come first. Red for negative numbers is by far the most popular
use of the color argument. The other colors available are Black,
Blue, Cyan, Green, Magenta, White, and Yellow.
You can embed conditions into number formats. However you
are still limited to four overall number formats, which means that
you can specify two conditions before you are obliged to define
an “else” format and then a text format. Conditional formatting
is a much more robust and powerful way to handle this type of
format.
General This is the default number format. Numbers display as numbers
showing no thousands separator and as many decimals as
precision allows; text shows as text.
In certain cases, Excel will automatically change a cell’s number format based on how you
type the number in the cell. If you begin a cell entry with a dollar sign ($), Excel will
change the cell’s format to Currency. If you type a percent sign (%) after a number, Excel
will change the number format to a percentage, or a percentage with two decimal places
based on how many digits you typed. If you type 1/8 the cell will display the d-mmm date
format. If you type 1/1/1 the cell will display the d/m/yyyy date format. If you type 8 p the
cell reformats to the h:mm AM/PM time format.

Take Note You might be wondering “if we use ‘m’ for months and ‘m’ for minutes, and
both involve date/ time serial values, how does Excel know which to use?”. The answer is
“by context”. Simply put, whenever there’s an “m” in our number format, Excel checks for
an “h” before the “m” or an “s” after the “m.” If there is an “h” before the “m,” then Excel
interprets the “m” as minute; otherwise, Excel interprets the “m” as month.

STEP BY STEP Apply Custom Number Formats


GET READY. LAUNCH Excel 2016.
1. OPEN the 02 Formats and Auto Fill.xlsx workbook from the data files for this
lesson.
2. SAVE the workbook as 02 Formats and Auto Fill Solution.xlsx in the lesson folder
on your flash drive.
3. In the Number Formats worksheet, select the range C5:F5 and press Ctrl+1 to open
the Format Cells dialog box. Click the Number tab if it is not active. In the Category
list, select Number with 3 decimal places. Select the Use 1000 Separator (,) check
box, and in the list for Negative numbers, select the first occurrence of (1,234.210).
Then, in the Category list, click Custom and edit the formatting string in the Type
text box control to the following (Figure 2-1):
#,##0.000_);[Blue](#,##0.000)

3 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

Figure 2-1: Modifying a custom format in the Format Cells dialog box
4. Click OK. Use the Number tab in the Format Cells dialog box to set the number
formats in the ranges listed below, per the specification indicated. In all instances
you can directly select the Custom category and type in the number format.
However you can often “jump start” the process by using a predefined number
format first and then switching to the Custom category and making any final edits.
If available, a shortcut that will default to the desired format or get you close is
shown below the desired number format. After trying each shortcut, select the
Custom category to make sure you have the desired format and make any needed
edits there.

Cell or Number Format


Range
C6:F6 0.0%_);[Red](0.0%)
C7:F7 “Optimist”;”Pessimist”;”Nihilist”;”Learning “@” is fun!”
C11:F11 #,##0.00;[Red]#,##0.00
Shortcut: category = “Number”, check Use 1000 Separator (,) check
box, then select the 2nd option in the Type list box
C12:F12 #,##0.0000;[Red]#,##0.0000
Shortcut: category = “Number”, check Use 1000 Separator (,) check
box, select the 2nd option in the Negative numbers: list box,
increase decimals to 4.
C13:F13 # ?/?
Shortcut: category = “Fraction”, select the 1st option in the Type list
box
C14:F14 # ???/???
Shortcut: category = “Fraction”, select the 3rd option in the Type list
box
C15:F15 # ??/16
Shortcut: category = “Fraction”, select the 7th option in the Type list
box
C19:F19 $#,##0.00_);[Red]($#,##0.00)
Shortcut: category = “Currency”, select the 4th option in the Type list
box
C20:F20 #,##0.00 Pts_);(#,##0.00 Pts)
Hint: You can get the “Pts” symbol by holding down the Alt key while
keying 158 in the numeric keypad on your keyboard. Otherwise, you
would need to find an empty cell, click the Insert tab, click the
Symbol button, and insert the Pts symbol into the cell. Then,
highlight and copy the symbol to the Clipboard so you can paste it
into the custom format.
C21:F21 _(£* #,##0.00_);[Red]_(£* (#,##0.00);_(£* “-”??_);_(@_)
Shortcut: category = “Accounting”, change the currency symbol to
the English pound then change category to “Custom” and edit from
there.
C22:F22 _(€ **#,##0.00_);[Red]_(€ **(#,##0.00);_(€ *–_);_(@_)
Hint: You can get the “€” symbol by holding down the Alt key while
keying 0128 in the numeric keypad on your keyboard.
C23:F23 _(€ **#,##0.00_);[Red]_(€ **(#,##0.00);_(€ *–_);_(“Note: “@_)
D27 #,##0.00,
D28 #,##0.0,,

4 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

D29 #,##0.0,,,
D30 \B$ #,##0.00,,,
D31 $ #,##0.0,, “MM”
5. Compare your results with Figure 2-2 and make any necessary adjustments.

Figure 2-2: Custom number formats applied through row 31 of the Number
Formats worksheet
6. Continue applying the additional formats specified in the following table, using the
instructions from step 4.

Cell or Number Format


Range
C35 m/d/yyyy
Shortcut: On the Home tab, in the Number group, click the drop-
down arrow and select Short Date from the list.
C36 dddd, mmmm d, yyyy
C37 d-mmm-yy
Shortcut: Press Ctrl+Shift+#
C38 dd-mmm-yy;@
C39 mmmmm-yy
C43 h:mm AM/PM
Shortcut: Press Ctrl+Shift+@
C44 h:mm:ss;@
Shortcut: category = “Time”, select the 4th option in the Type list
box
C45 h:mm:ss AM/PM;@
C46 mm:ss.0;@
C47 h:mm:ss a/p
C49:C54 h:mm:ss;@
C58 000-00-0000
Shortcut: category = “Special”, select the Social Security Number
option in the Type list box. If the SSN option isn't displayed, make
sure your Locale is set to English (United States).
C59 00000
Shortcut: category = “Special”, select the Zip Code option in the
Type list box.
C60 00000-0000
Shortcut: category = “Special”, select the Zip Code + 4 option in the
Type list box.
C61 [<=9999999]###-####;(###) ###-####
Shortcut: category = “Special”, select the Phone Number option in

5 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

the Type list box.


C62 0000 0000 0000 0000
7. Go to cell C54 and press Alt+= to insert an AutoSum. Excel displays a sum of only
7:07:30, but clearly we have over 50 hours in our column. This is where time formats
can get frustrating. We need the elapsed time format. In other words, we need to put
brackets around the h in the format.
8. Edit the number format in cell C54 to be:
[h]:mm:ss;@
NOTE: Placing brackets around an “h” or an “m” in a time format allows that part of
the time specification to go past its normal rollover limit. So if you are summing
minutes and need to show more than sixty minutes, use [m] or [mm]. If you need to
show more than 24 hours, use [h] or [hh].
9. Compare your results with Figure 2-3 and make any necessary adjustments.

Figure 2-3: The remaining custom number formats applied to the Number
Formats worksheet
10. SAVE the workbook.
PAUSE. LEAVE the workbook open to use in the next exercise.

Take Note Excel has a precision limitation of 15 significant digits. If you go beyond that,
Excel starts putting in zeroes for the least significant digits. This means that standard 16-
digit credit card numbers need to be stored as text. Do not try to format them as
numbers! You will not retain all of the data.

Using Advanced Fill Series Options


If you have been using Excel for any length of time, then Auto Fill is already a friend. After
this exercise, you’ll love it even more. Learning how to use its many features can save you
a lot of time. The options in the Series dialog box allow you to further customize how
Excel fills data in a specified range.

STEP BY STEP Use Advanced Fill Series Options


GET READY. USE the 02 Formats and Auto Fill Solution.xlsx workbook that is open
from the previous exercise.
1. Select the Auto Fill worksheet. Select cell B4 and use the fill handle to fill down
through cell B27. Notice how the quarters roll over correctly.
2. Select cell C4 and double-click the fill handle. Note the pattern’s correctness.
3. Select D4 and double-click the fill handle. Notice that Excel will pick up on the Qtr
and not continue to extend based on the ordinal prefix. So, instead of “5th Qtr” in
cell D8, “1st Qtr” displays.
4. Select E4 and double-click the fill handle. This time Excel continued on to 5th Year,
6th Year, and so on.
5. Select F4 and double-click the fill handle. Excel is smart enough to increment the
number after “Exercise.”
6. Select G4:G5 and double-click the fill handle. Excel will pick up on the pattern and

6 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

continue counting by fives.


7. Select H4 and double-click the fill handle. What happened? If you start with a
number and you want Auto Fill to increment by one you have some options:
○ Start with two numbers, for example 1 and 2.

○ Hold down the Ctrl key as you drag the fill handle.
○ Double-click the fill handle, click the Auto Fill Options button at the bottom-
right corner of the filled range, and select the Fill Series option.
Use any of these three options to fill the range H4:H27 with numbers 1 through 24.
8. Select I4 and double-click the fill handle. Click the Auto Fill Options button and
select Fill Formatting Only.
9. Select J4 and double-click the fill handle. Notice that the default fill for a time value
is by the hour.
10. Select K4:K5 and double-click the fill handle. If you need to fill in times by any other
increment, you’ll need to start with two times.
11. Select L4:L27 (don’t drag the fill handle) and on the Home tab, in the Editing group,
click the Fill drop-down arrow and select Series. Change the Step value to 2.5
(Figure 2-4). Click OK.
12. Select M4:M27 and on the Home tab, in the Editing group, click the Fill drop-down
arrow and select Series. Change Type to Growth and the Step value to 2 and then
click OK.
13. Select N4:N27 and on the Home tab, in the Editing group, click the Fill drop-down
arrow and select Series. Leave Type as Linear, select the Trend check box, and then
click OK.

Figure 2-4: Using the Series dialog box to specify fill series options
14. Select O4:O27 and on the Home tab, in the Editing group, click the Fill drop-down
arrow and select Series. Change Type to Growth, select the Trend check box, and
then click OK.
Notice how changing the Type to Growth allows Excel to correctly figure out the
appropriate growth equation—the numbers in column O match the numbers in
column M.
15. For our first use of Flash Fill, using the data in P4:P12 we want to extract from the
first dash to just before the second dash. Select Q4, double-click the fill handle, click
the Auto Fill Options button, and select Flash Fill. Excel correctly fills the data.

Take Note Most Flash Fill examples tend to be pretty simple, but the algorithms
this feature uses can do some pretty good guesswork. However, these algorithms are
not quite infallible.

16. Now, we want to extract data from the first dash until two characters after the
second (using P4:P12). Select R4, double-click the fill handle, click the Auto Fill
Options button, and select Flash Fill. This time, Excel didn’t quite figure out what we
wanted. Instead it guessed that our rule was “first dash then five more characters”.
17. Select cell R6 and edit it to be -112-KN. (Use the F2 key and add an “N” to the
existing value in R6. Otherwise Excel will think you’re entering a formula.)

7 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

18. Select cells R7:R12 and press the Delete key to clear the remaining cells that were
flash-filled incorrectly the first time.
19. Now select R4:R6, double-click the fill handle, click the Auto Fill Options button,
and select Flash Fill. This time Excel is able to correctly figure out our rule.
20. Select S4:S7. Drag the fill handle over to column V. Auto Fill is able to appropriately
fill multiple rows simultaneously.
21. Select S10 and drag the fill handle down to row 27 (Auto Fill will stop with Feb.
17th). Then, from the Auto Fill Options button select Fill Months. Notice that Auto
Fill has guessed you wanted the last day of each month.
22. Select cell T11 and drag the fill handle down to T27. Click the Auto Fill Options
button and then select Fill Weekdays. Notice, our range has no Saturdays or
Sundays.
23. Select V11:V36. Click the File tab, click Options, select Advanced, and then scroll
almost to the bottom of the dialog box. Click the Edit Custom Lists button.
24. The Import list from cells control should already display the range $V$11:$V$36.
Click the Import button. A list starting with “Black, Blue, Brown, Chartreuse” should
appear in the Custom lists box (Figure 2-5). Click OK. Click OK in the Excel Options
dialog box.

Figure 2-5: Creating a new custom list


25. In cell W11, type Green and press Ctrl+Enter. Double-click the fill handle. Excel fills
the range with the data from the custom list, beginning with Green.
26. SAVE the 02 Formats and Auto Fill Solution.xlsx workbook and then CLOSE the
workbook.
PAUSE. LEAVE Excel open for the next exercise.

Specifying Data Validation Criteria


You can use Excel’s data validation tools to set up rules that keep you or anyone else from
entering invalid or unusable data, or from failing to enter data when it’s required. In North
America, names of states are often expressed with a two-character designation. You can
set up a rule in Excel that pings the user whenever he accidentally types an entry that
does not consist of two characters. The user may then respond by dismissing the message
and starting over, or cancelling the entry altogether.

STEP BY STEP Using Input Messages and Error Alerts


GET READY. LAUNCH Excel if it is not already open.
1. OPEN the 02 Patients.xlsx workbook from the data files for this lesson.
2. SAVE the workbook as 02 Patients Solution.xlsx in the lesson folder on your flash
drive.
3. Freeze rows 1 through 4 in both worksheets in the workbook.
4. In the Client List worksheet, select column F.
5. Click the Data tab, and then in the Data Tools group, click Data Validation. The Data
Validation dialog box opens.

8 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

6. Click the Settings tab, if necessary.


7. Click the Allow drop-down arrow and choose Text length. This is the first step in
the creation of a rule governing how many characters each new entry should
contain.
8. Click the Data drop-down arrow and choose equal to.
9. Click the Length box and type 2 (Figure 2-6).

Figure 2-6: Use the Settings tab to specify the data validation rule
10. Click the Input Message tab. This tab displays a message when you select a cell in
the validation range.
11. Click the Title box and type Rule:.
12. Click the Input message box and type Please enter the two-character state
abbreviation.
13. Click the Error Alert tab. Excel can display an error alert message when a user
attempts to enter data that is invalid.
14. Click the Title box and type Data Entry Error.
15. Click the Error message box and type Only two-character state abbreviations are
recognized. This message is displayed in a dialog box whenever an invalid entry is
made in column F.
16. Click OK.
17. To test the new validation rule, click cell F57. The notification message you typed
into the Input Message tab displays.
18. Type Ohio and press Enter. Excel displays an alert dialog box with the error message
you created (Figure 2-7).

Figure 2-7: Worksheet with data validation rule enforced


19. Click Cancel. The partial entry in cell F57 is removed. SAVE the workbook.
PAUSE. LEAVE the workbook open to use in the next exercise.

Take Note Excel’s validation rules pertain only to new data that is entered into the
workbook, not to data that existed in the workbook prior to creating the rules.

9 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

Many databases includes fields that allow a specified number of valid entries, such as
political party affiliation or the work shift to which one is assigned. In data entry, it’s easy
for someone to slip and type an invalid entry. You can preempt events like this by building
a rule that restricts entry to a handful of valid entries.

STEP BY STEP Using Lists for Data Validation Criteria


GET READY. USE the 02 Patients Solution.xlsx workbook that is open from the previous
exercise.
1. Click the Patient List sheet tab.
2. Select column B.
3. Click the Data tab, and then in the Data Tools group, click Data Validation.
4. In the Data Validation dialog box, click the Settings tab.
5. Click the Allow drop-down arrow and choose List. The Source box appears at the
bottom of the dialog box.
6. Click the Source box. Type Dog,Cat,Other being careful to include the commas.
7. Uncheck the Ignore blank box (Figure 2-8).

Figure 2-8: Using a list to limit possible cell entries


8. Click the Input Message tab. Click the Title box and type Rule:. Then, click in the
Input message box and type Choose from Dog, Cat, or Other.
9. Click OK. Now anyone entering a new patient into the database must specify the
animal type from a drop-down list in column B. We’ll test this validation rule later in
this exercise.
10. Next, we’ll specify a validation list for another column in the database. Select column
E (Owner #).
11. In the Data Tools group, click Data Validation.
12. Click the Settings tab. Click the Allow drop-down arrow and click List.
13. On the right side of the Source box, click the Collapse Dialog button.
14. With the Data Validation dialog box collapsed, click the Client List worksheet tab.
15. Select column A (Client #).
16. At the end of the Source box, click the Expand Dialog button. The full dialog box
returns, and the Source box should now read =’Client list’!$A:$A.
17. Uncheck the Ignore blank and In-cell dropdown boxes.
18. Click the Error Alert tab. Click the Style drop-down arrow and choose Warning.
19. Click in the Error message box and type Owner must be the number for a pre-
existing client.
20. Click OK. Now the Owner # column may contain only numbers for clients who
appear in the Client # column of the Client List worksheet.
21. To make sure your new validation rules are working, in the Patient List worksheet, at
the bottom of the list, click cell A57 and attempt to type the following data:
Zac Puppy Beagle F 61

10 de 11 14/04/2021, 14:31
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...

22. After you attempt to enter Puppy into column B, respond to the error message by
clicking Cancel and by selecting Dog from the drop-down list.
23. After you attempt to enter 61 into column E, respond to the error message shown in
Figure 2-9 by clicking No and typing 31.

Figure 2-9: Excel attempts to enforce a validation rule


24. SAVE the 02 Patients Solution.xlsx workbook and then CLOSE the workbook.
PAUSE. LEAVE Excel open for the next exercise.

Take Note It’s still feasible for an invalid value to remain in a worksheet after the user
has been warned that it’s invalid. For example, in the previous steps if you were to click
Yes instead of No, the value 61 would remain in column E, even though there is no client
numbered 61 in column A of the Client List worksheet. Conceivably, this way you can
purposefully enter a new canine patient into the list without an owner, if you intend to
add the owner’s information later.

11 de 11 14/04/2021, 14:31

You might also like