0

I have three fields in a list called Level 1 data incident, Level 1 data incident(Yes), and Level 1 data incident(No).

Based on Yes or No selected from a drop down option only the appropriate field has to be entered which is a required mandatory to be entered, both options cannot be left empty. At least one has to be entered based on the Yes or No. Both of the options also cannot be left empty or I cannot save. Also I should not be able to save when I enter Level 1 data incident(No) field when I select Yes option or vice versa.

The code below works when I enter both the fields based on a Yes or No but doesn't work when both are empty or when I select Yes and the Level 1 data incident(No) or the opposite. Can you let me know where I might be doing wrong?

IF(OR(AND(ISBLANK([Level 1 data incident (No)])=TRUE,[Level 1 Data Incident]="No"),AND(NOT(ISBLANK([Level 1 data incident (No)]))=TRUE,NOT(ISBLANK([Level 1 data incident (Yes)]))=TRUE,[Level 1 Data Incident]="No")),FALSE,IF(OR(AND(ISBLANK([Level 1 data incident (Yes)])=TRUE,[Level 1 Data Incident]="Yes"),AND(NOT(ISBLANK([Level 1 data incident (Yes)]))=TRUE,NOT(ISBLANK([Level 1 data incident (No)]))=TRUE,[Level 1 Data Incident]="Yes")),FALSE,TRUE))

0

The following should require the user to EITHER select Yes and fill out "Level 1 data incident (Yes)" OR select No and fill out "Level 1 data incident (No)." It also will not validate if the user fills out BOTH the "Level 1 data incident (Yes)" AND the "Level 1 data incident (No)" fields.

=AND(OR(AND([Level 1 data incident]="Yes",NOT(ISBLANK([Level 1 data incident (Yes)]))), AND([Level 1 data incident]="No",NOT(ISBLANK([Level 1 data incident (No)])))),OR(ISBLANK([Level 1 data incident (Yes)]),ISBLANK([Level 1 data incident (No)])))

Side note: Boolean operators such as AND, OR, ISBLANK, and NOT return true or false by default. There's no need to compare them like NOT(something)=TRUE

I also assumed [Level 1 Data Incident] capitalization from your code example was correct, as opposed to [Level 1 data incident] with lower case "d" and "i" from the text of your question.

0

Thank you for your input. It helped me get what I want done with the part which was missing. Adding the code here.

=IF(AND(ISBLANK([Level 1 data incident (No)]),[Level 1 data incident]="No"),FALSE,IF(AND(ISBLANK([Level 1 data incident (Yes)]),[Level 1 data incident]="Yes"),FALSE,IF(AND(NOT(ISBLANK([Level 1 data incident (Yes)])),NOT(ISBLANK([Level 1 data incident (No)]))),FALSE,TRUE)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.