Data Validation Multiple Criteria

bobkap

Active Member
Joined
Nov 22, 2009
Messages
313
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
I have a column for users to enter a whole number. I only want to allow them to enter either a zero or any number >= 150. If they enter anything else they would get my custom error message.

I thought I could figure this out as it seems quite simple, but I just cannot. I think I need to use the "custom" in data validation and then enter the formula but that's where I get stuck.

Any help would be most appreciated.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You're almost there. When in Custom (assuming the first cell to have the validation is A1) type in the formula:

Excel Formula:
=OR(A1=0,A1>=150)

Then simply copy that cell to all cells where you want the validation to apply.
 
Upvote 0
You're almost there. When in Custom (assuming the first cell to have the validation is A1) type in the formula:

Excel Formula:
=OR(A1=0,A1>=150)
That would allow, for example, both of the following which don't meet the limitations.
155.5
abc

I would suggest
Excel Formula:
=AND(A1=INT(A1),OR(A1=0,A1>=150))
 
Upvote 0
You're almost there. When in Custom (assuming the first cell to have the validation is A1) type in the formula:

Excel Formula:
=OR(A1=0,A1>=150)

Then simply copy that cell to all cells where you want the validation to apply.
MEGA thanks!
 
Upvote 0
That would allow, for example, both of the following which don't meet the limitations.
155.5
abc

I would suggest
Excel Formula:
=AND(A1=INT(A1),OR(A1=0,A1>=150))
Excellent point. It works perfectly. THANKS!!
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,595
Members
449,089
Latest member
Motoracer88

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