Data validation with conditions

Beneindias

Board Regular
Joined
Jun 21, 2022
Messages
120
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hey guys.

I have a problem with data validation.
I'm trying to learn how to make custom validations, but It´s been hard, so I'm here to ask your help.

So, I need to turn this in to some data validation:

OR(F9="ESolteiro";AND(F9="ECasado";G9=1) -> allow between 0 and 3
AND(F9="ECasado";G9=2) -> alow between 0 and 6

This validation needs to be in the same cell (BI9)

I was aiming to have data validation by numbers, minumun 0, and maximum would depend on the formula..

Can this be done?

Thank you all
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try this in Data Validation

=OR(AND(F9="ECasado",G9=2,B19>=0,B19<=6),AND(OR(F9="ESolteiro",AND(F9="ECasado",G9=1)),B19>=0,B19<=3))
 
Upvote 0
Solution
Try this in Data Validation

=OR(AND(F9="ECasado",G9=2,B19>=0,B19<=6),AND(OR(F9="ESolteiro",AND(F9="ECasado",G9=1)),B19>=0,B19<=3))
This one is correct.

And it helped me to understand a little better how to make custom validations.

Thank you
 
Upvote 0
I'm realy not good doing validations and the internet is not very good to help me in this regard.

I want to add a condition to that data validation formula.

=OR(AND(F9="ECasado",G9=2,B19>=0,B19<=6),AND(OR(F9="ESolteiro",AND(F9="ECasado",G9=1)),B19>=0,B19<=3))

This works as intended for what I was trying to acomplish, but I need another condition, added to this.

OR(I9=0;I9="")BI9=0)

Problem is that every way that I tred to incorporate this part in the "old" formula, it works in the oposite way...I want it to only allow 0, when I9 is 0 or empty.

Can anybody help me with this?

thank you
 
Upvote 0
Try this in Data Validation

=OR(AND(F9="ECasado",G9=2,B19>=0,B19<=6),AND(OR(F9="ESolteiro",AND(F9="ECasado",G9=1)),B19>=0,B19<=3))
Dear Friend,

I encountered with a similar situation where I need to validate a Column based on the entry in the adjacent column.
I tried with the above formula of yours. I was partial success.

I need Column "N" to accept the value only 0 (zero) if the value in Column "P" = "ABC" or "XYZ". For other values in column P, column N should accept a value greater than 0.

ie., IF(OR(P5="ABC",P5="XYZ"),N5=0,N5<>0).

My first row is 5. and the column to be validated is N.

Any help will be much appreciated.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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