0% found this document useful (0 votes)
19 views

Data Validation Examples

Uploaded by

lmaxphl
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Data Validation Examples

Uploaded by

lmaxphl
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Excel Data Validation Examples

The following worksheets have various completed Data Validation examples as mentioned

See more online: Apply Data Validation to cells

Each worksheet is listed below, along with what kind of Data Validation you'll find

Worksheet Data Validation Type


Whole number Limit entries to whole numbers
Decimal Limit entries to decimal (percentage) values
Departments Limit selections to list choices
Cost centers table Table for Cost center list source
Cost center budget Limit selections to Cost center list choices
Date Limit entries to dates within a range
Time Limit entries between a time frame
Text length Limit entries to a certain number of characters
HR Budget Limit entries to a certain maximum amount
Products Require entries to meet certain text guidelines
Age verification Limit entries below a certain age
Custom values Limit entries to unique values only (no repeated entries)
E-Mail Require entries to contain the @ symbol

• Cells highlighted like this are for input:


Input here
amples as mentioned in the following Support.Office.com article:

on you'll find

• Data Validation is limited to the following options:


wing options:
Data Validation - Limit entry to a whole number
Ranking Ranking
7
• This example limits users to entries
between 1 (Minimum) and 10
(Maximum).

Number of Dependents
Dependents Deductions
• This example limits users to entries
2 4 greater than or equal to 2 times the value
in cell A14. The Minimum value is
determined by a formula:

=2*A14

See more online: Apply Data Validation to cells


• Limit entry to values between 1 and 10

ries
he value
s

• Use a formula to limit an entry


Data Validation - Limit entry to a decimal
Current Salary Annual Merit Increase New Salary
$50,000 3.0% $51,500 Decimal
• This example limits users to a decim
(percent) value less than or equal to
3%.

See more online: Apply Data Validation to cells


• Limit entry to a decimal value less than or equal to 3%

Decimal
example limits users to a decimal
nt) value less than or equal to
an or equal to 3%
Data Validation List with a Table for a source

Department Dept ID Department Steps


Accounting 401 Sales
1. Add your list data and format it as
Payroll 501 a Table (Home tab > Styles > Format
Human Resources 301 as Table).
Sales 201 2. It's not necessary, but you can
Marketing 601 name your table from the Table tools
tab - this one is named
Operations 701 "DepartmentTable". This will help
Executive 101 you keep track of multiple tables.

3. Add a Named Range for your list,


by selecting the list range (A4:A10 in
this case), then from the Formulas
See more online: Apply Data Validation to cells tab select Name Manager, and input
an appropriate name. This one is
named "DepartmentList".

4. Select the cell where you want


your Data Validation list (D4 in this
case), and go to the Data tab > Data
Validation > Allow List > Source >
"=DepartmentList".

5. Add Input and Error Messages as


needed.
• Use the Name Manger to create and manage Defined Names
Steps
st data and format it as
e tab > Styles > Format

essary, but you can


ble from the Table tools
is named
Table". This will help
k of multiple tables.

ed Range for your list,


he list range (A4:A10 in
en from the Formulas
me Manager, and input
e name. This one is
rtmentList".

cell where you want


idation list (D4 in this
to the Data tab > Data
Allow List > Source >
tList".

and Error Messages as


• Create your Data Validation List

• Add Input & Error Messages


Excel Table that can be used for a Data Validation List source
Cost Center Category
110 Salary - Regular Wages Cost Centers
120 Salary - Hourly Wages
• This list is used in the second example
130 Salary - Commission in the next worksheet (Cost Center
140 Salary - Bonus Budget).
150 Salary - Vacation • It's named "lst_CostCenter" in the
160 Salary - Sick Time Name Manager (Formulas > Name
Manager).
170 Tax - Fed
180 Tax - State
190 Tax - SDI

See more online: Apply Data Validation to cells


ation List source
• Use the Name Manger to create and manage Defined Names
DI
• If you us
Validation Lis
dynamic - th
adjust them
DID YOU KNOW?
• If you use Excel Tables for your Data
Validation List source, then your lists will be
dynamic - that is, they will automatically
adjust themselves as you add or remove
items!
Data Validation - Limit a list to certain entries
Current Year Future Year
Cost Center Category Variance
Projected Budget
110 Salary - Regular Wages 63,578 60,000 (3,578)
120 Salary - Hourly Wages 19,721 25,000 5,279
130 Salary - Commission 37,500 40,000 2,500
140 Salary - Bonus 12,605
150 Salary - Vacation 28,391 30,000 1,609
160 Salary - Sick Time 7,303 8,500 1,197
170 Tax - Fed 44,985 50,000 5,015
180 Tax - State 20,287 21,000 713
190 Tax - SDI 1,470 1,500 30

Data Validation - Use the Cost Center list


Current Year Future Year
Cost Center Category Variance
Projected Budget
110 Salary - Regular Wages 63,578 60,000 (3,578)
120 Salary - Hourly Wages 19,721 25,000 5,279
130 Salary - Commission 37,500 40,000 2,500
140 Salary - Bonus 12,605
150 Salary - Vacation 28,391 30,000 1,609
160 Salary - Sick Time 7,303 8,500 1,197
170 Tax - Fed 44,985 50,000 5,015
180 Tax - State 20,287 21,000 713
190 Tax - SDI 1,470 1,500 30

See more online: Apply Data Validation to cells


• Limit users to entries between 100-999

Cost Centers
• This example limits users to Cost Center
entries from 100-999 in range A4:A12.

• Or look at the next example if you want to


use the list from the Cost Centers worksheet
to set up a list selection.

Use VLOOKUP to return the


Category name
• Use the Cost Center list instead
• Note the VLOOKUP formula example in both
tables that returns the Category name based
on the Cost Center entry/selection.

• You can click this to learn more about


VLOOKUP.
ies between 100-999

er list instead
Data Validation - Limit users to date entries only
Time Off Request
Start Date End Date Date Entries
11/09/24 11/14/24
• This example limits users to entering a start
date after today by using the TODAY()
function, and an end date after the start date.

See more online: Apply Data Validation to cells


• Use the Date option to limit the Start Date

• Use the Date option to limit the End Date


Data Validation - Limit users to time entries only
Start Time End Time Meeting Time Time Entries
8:00 AM 5:00 PM 9:30 AM
• This example (cell C4) limits users to
entering time values between cells A4 & B4
(8:00 AM and 5:00 PM).

• Note that this example uses references


to the values in cells A4 & B4 instead of
inputting the values into the Data
Validation dialog. It's much easier to
update those values when they're in cells.

See more online: Apply Data Validation to cells


• Use the Start & End Time options to limit Time entries
Entries
C4) limits users to
between cells A4 & B4
M).

mple uses references


A4 & B4 instead of
into the Data
s much easier to
when they're in cells.
Data Validation - Limit entries to a certain text length
Enter text up to 25 characters Limit Text Length
Enter a brief description
• This example (cell A4) limits users to text
entries less than 25 characters by using the
"less than or equal to" Data option.

See more online: Apply Data Validation to cells


• Text Length Settings
Data Validation - Limit entries to a set value

Budget
65,000
Budget Input -- Human Resource Maximum

Current Year Future Year


Cost Center Category Variance
Projected Budget
110 Salary - Regular Wages 63,578 60,000 (3,578)
120 Salary - Hourly Wages 19,721 25,000 5,279
130 Salary - Commission 37,500 40,000 2,500
140 Salary - Bonus 12,605 25,000 12,395
150 Salary - Vacation 28,391 30,000 1,609
160 Salary - Sick Time 7,303 8,500 1,197
170 Tax - Fed 44,985 50,000 5,015
180 Tax - State 20,287 21,000 713
190 Tax - SDI 1,470 1,500 30

See more online: Apply Data Validation to cells


• Allow a whole number entry limited to a
Limit entries to a set value
• This example (cell D10) limits users to a
whole number entry less than or equal to
the value in cell E4

• Note that this example uses a reference to


the value in cell E4 instead of inputting the
value into the Data Validation dialog. It's
much easier to update that value when it's
in a cell.
ber entry limited to a set value
Data Validation - Custom option with a formula to restrict a tex
Product ID Product Name Custom Option to restrict a Text entry
ID-1234567 Widget
• This example uses the Custom option in cells A4:A5.
ID-29876534 Fetzer Valve
• In this case the user can only enter a Product ID
beginning with the text "ID-" and 9 or more total
characters by using the formula:

=AND(LEFT(A4,3)="ID-",LEN(A4)>9)

• Another option would be to use a Custom Number


Format from the Format Cells dialog (Ctrl+1) - See the
example below.

Data Validation - Custom option with a formula to ensure a tex


Product ID Product Name Custom Option to ensure a Text entry
ID-1234567 Widget
• This example uses the Custom option in cells B22:B23.
ID-29876534 Fetzer Valve
• In this case the user can only enter a Product Name that
is text, so it can't be just numeric:

=ISTEXT(B22)

Custom Number Format


Custom Number Format
Product ID Product Name
• Another option for the Product ID would be to use a
ID-1234567 Widget Custom Number Format from the Format Cells dialog
(Ctrl+1) to automatically display the "ID-" text, and allow
the user to only enter the actual Product ID numbers.
Note that the text "ID-" isn't actually part of the Product
ID, it's just displayed for you.
Custom Number Format
• Another option for the Product ID would be to use a
Custom Number Format from the Format Cells dialog
ID-29876534 Fetzer Valve (Ctrl+1) to automatically display the "ID-" text, and allow
the user to only enter the actual Product ID numbers.
Note that the text "ID-" isn't actually part of the Product
ID, it's just displayed for you.

• Custom Format - "ID-"#######

• You could still use Data Validation to limit the overall


Text entry length however.

See more online: Apply Data Validation to cells


o restrict a text entry
• Custom option for Product ID entry
Text entry
cells A4:A5.

oduct ID
re total

om Number
+1) - See the

o ensure a text entry


• Custom option to ensure a Text (non-numeric only) entry
Text entry
cells B22:B23.

oduct Name that

• Custom Number format


mat
d be to use a
t Cells dialog
text, and allow
ID numbers.
t of the Product
mat
d be to use a
t Cells dialog
text, and allow
ID numbers.
t of the Product

mit the overall


nly) entry
Data Validation - Custom format to verify age requirement

Does a participant meet an age Custom Option


requirement?
• This example uses the Custom option in cell B6 to
Age Limit: 18 determine if a participant meets a set age
Must be born before: 11/13/06 requirement.
Birthday: 01/15/96 • In this case the user can only enter an employee
age that is greater than 18 (this can be changed in
Current Age: 28.84 cell B4).
=IF(B6<=(TODAY()-(365*B4)),TRUE,FALSE)

• This formula uses TRUE/FALSE arguments to


evaluate the entries. If the condition is TRUE, then
Data Validation will allow the entry to be
confirmed, otherwise it will be rejected.

See more online: Apply Data Validation to cells


requirement
• Custom option to verify age requirement
ption
m option in cell B6 to
ets a set age

y enter an employee
s can be changed in

RUE,FALSE)

SE arguments to
ndition is TRUE, then
entry to be
e rejected.
Data Validation - Custom option to ensure Unique entries only

Unique List Custom Option - Unique Entries Only


1
• This example uses the Custom option for cells A4:A12
2
3 • In this case the user can only enter a value that has
not already been entered in the range.
4
5 =COUNTIF($A$4:$A$12,A4)=1
6 • This formula counts the number of times each entry
7 has been made and will only allow it if it's been entered
once (unique), otherwise Data Validation will reject it.
8
9

See more online: Apply Data Validation to cells


ique entries only

• Custom option to ensure Unique entries only


Data Validation - Custom option for e-mail address validation
E-Mail Address Custom Option - E-Mail validation
[email protected]
• This example (cell A4) uses the Custom option to
validate an e-mail address entry.
• In this case the user can only enter a value that
includes the @ symbol for an e-mail address. It's
not a perfect validation method, but it should work
for most cases.
=ISNUMBER(FIND("@",A4))

• This formula uses the FIND function to look for


the @ symbol in the text entry. If it exists, then FIND
will return a number, which is the @ symbol's
position in the text string and allow the entry to
pass. If the @ symbol isn't found, then the fomula
will return an error, which ISNUMBER will force
Data Validation to reject.

See more online: Apply Data Validation to cells


ddress validation
• Custom option for e-mail address validation

You might also like