Professional Documents
Culture Documents
Validare Conditionala-Formule
Validare Conditionala-Formule
6. (optional) On the Error Message tab, add a title and error message, e.g.
Duplicate ID -- "That number has already been assigned."
No Spaces in Text
Thanks to Jerry Latham for this example.
You can prevent users from adding ANY spaces in a text string. The
SUBSTITUTE function replaces each space character " " with an empty
string ""
The formula in this example checks that the entry in cell B3 is equal to the
entry without spaces.
1. Select cell B3
2. On the Ribbon, click the Data tab, then click Data Validation
3. Choose Allow: Custom
4. For the formula, enter:
=B3=SUBSTITUTE(B3," ","")
No Spaces in Cell
You can prevent users from adding ANY spaces in the cell -- whether the entry
is text, numbers, or a combination of both. Here are two formulas that check
for spaces.
Example 1
Thanks to Jerry Latham for this example.
The LEN function counts the number of characters entered in cell B3, and
compares that to the number of characters after SUBSTITUTE removes the
space characters.
1. Select cell B3
2. On the Ribbon, click the Data tab, then click Data Validation
3. Choose Allow: Custom
4. For the formula, enter:
=LEN(B3)=LEN(SUBSTITUTE(B3," ",""))
Example 2
The FIND function looks for the space character " " and the ISERROR
function result is TRUE, if the space character is not found.
The formula in this example checks that the entry in cell B3 is equal to the
entry without spaces.
1. Select cell B3
2. On the Ribbon, click the Data tab, then click Data Validation
3. Choose Allow: Custom
4. For the formula, enter:
=ISERROR(FIND(" ",B3))
6. Type a date in the Start Date and/or End Date boxes, OR refer to a
worksheet cell that contains the start or end date.
7. (optional) Add an Input Message, to explain the data validation rule
when the cell is selected
8. (optional) Change the Error Alert setting, so it shows a message, or
warns users about invalid data.
9. Click OK, to close the dialog box.
5. Depending on the operator you selected, Start Date and/or End Date
boxes will appear
6. Type a formula in the Start Date and/or End Date boxes, using the
TODAY function. For example,
To set the earliest start date allowed as 60 days prior to the
current date:
=TODAY()-60
To set the latest start date allowed as 60 days after the current
date:
=TODAY()+60
7. (optional) Add an Input Message, to explain the data validation rule
when the cell is selected
8. (optional) Change the Error Alert setting, so it shows a message, or
warns users about invalid data.
9. Click OK, to close the dialog box.