Multiple Data Validation

Pisolippia

New Member
Joined
Mar 28, 2002
Messages
16
Hi all,
I wish I could have multiple Data Validation for one cell.
The conditions I need to check are :
- That the value entered is at least 2 digits long
- That its numeric value is less than the value of another cell (constant).
Depending on any of the two conditions I need to have different message boxes.
Thanks in advance for your kind advice.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
The first part is easy. Use the Custom Validation and the AND function. Something like =AND(Len(Cell)>1,Cell>RefCell). Getting two different messages is more challenging and prbably would best be done with the WorksheetChange Event.
 
Upvote 0
Thanks for your quick answer.
I still have problems using your formula when I enter values 01 to 09 in my cell.
They're converted to 1-9 and I get the error box.
 
Upvote 0
On 2002-03-29 08:18, Pisolippia wrote:
Thanks for your quick answer.
I still have problems using your formula when I enter values 01 to 09 in my cell.
They're converted to 1-9 and I get the error box.

Adjust lenze's formula to suit your situation:

=AND(LEN(Cell)>1,Cell+0<ComparisonCell)
 
Upvote 0
We're still not there.
Let try to explain better :
Input cell A1 has your suggested data validation formula :
AND(LEN(A1)>1,A1+0<$A$2)
Cell A2 has a constant value say 70
if I enter values in the range 10-69 they're
accepted.
If I enter values from 70 over I get the message box.
If I enter values from 01 to 09 (two digits) it looks they're missing the zero hence their length becomes < 2 and I get the message box which is not right.
 
Upvote 0
Format A1 as Text. The "+0" in Aladin's formula converts it back to a number
 
Upvote 0
Great !
It works just as expected; will check again to see if someone has any ideas on how to get different message boxes for the same data validation.
Thanks and Happy Easter to you all.
 
Upvote 0
On 2002-03-29 08:30, Pisolippia wrote:
We're still not there.
Let try to explain better :
Input cell A1 has your suggested data validation formula :
AND(LEN(A1)>1,A1+0<$A$2)
Cell A2 has a constant value say 70
if I enter values in the range 10-69 they're
accepted.
If I enter values from 70 over I get the message box.
If I enter values from 01 to 09 (two digits) it looks they're missing the zero hence their length becomes < 2 and I get the message box which is not right.

That's right.

If you insist entering the numbers as 01, 09, 11, etc., format A1 as Text. Then the formula

=AND(LEN(A1)>1,A1+0<$A$2)

will simply work.

If you format A1 as General, you can use a much simpler formula:

=A1<A2

Aladin
 
Upvote 0
Aladin is correct. If you must display the cells as 05,09,etc., then you can use Custom Formating '00' to display the leading zero for numbers less than 10. This will eliminate the LEN() part of the formula, reducing it to A1<A2
This message was edited by lenze on 2002-03-29 09:02
This message was edited by lenze on 2002-03-29 09:03
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top