Unable to satisfy multiple conditions in data validation

ishpahuja

New Member
Joined
May 6, 2015
Messages
27
Office Version
  1. 365
Platform
  1. Windows
Hi guys, need some help with Excel formula and/or data validation.
I have two columns with multiple rows. For each row, the first column will have only two options "Yes, No", which I gave options using data validation by writing "yes, no" in another hidden sheet.
Now for second column, there are two conditions for each of the row item.
1. The cell in 2nd column should get activated only if the response in the corresponding cell in 1st column is "Yes", otherwise nothing is allowed to enter and it should have gray color.
2. When the response in a cell in 1st column is "Yes", the corresponding cell in 2nd column should have two options only to enter i.e. Yes, No (No free text).

Sample situation below in image.

I was able to use data validation for the 2nd column but I could only apply one of the two conditions. Can you help what shall I do so both conditions are satisfied?

1661960891634.png
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
For the 1st column, I would recommend typing the list directly in the Data Validation "Source" field, like this:
1661974533583.png

Then for the 2nd column, which would be a dependent list (depending on the 1st column contents), I would set up helper columns to construct the list that should be used by Data Validation (for the 2nd column). The formula for those helpers is: =IF(A2="Yes",{"Yes","No"},"")
You may need to enter this as an array formula with Ctrl-Shift-Enter (whereupon curly brackets will automatically surround the formula) and drag to the right to cause the Yes and No to spill across two columns (not necessary in Excel 365). Then, because these helper columns contain either 0 or 2 entries, to force the dropdown list to display only the items in the helper columns and no extra blank cells, I use a formula with OFFSET and COUNTA to construct a dynamically sized list. =OFFSET(D2,,,,COUNTA(D2:E2))
1661975695461.png

Finally, conditional formatting is used to fill the 2nd column with gray when "No" appears in the 1st column. There is only one issue...if used as intended and no second edits are made to the cells, there is no issue. However, If the 1st column is selected as "Yes" and then the 2nd column choice is made (either Yes or No), and then one returns to the 1st column and chooses No, the existing Yes/No in the 2nd column will remain there unless physically deleted or the dropdown in the 2nd column is chosen again to select the only option (a blank)...see this demonstrated in row 5.

The helper columns are then hidden or otherwise positioned out of the way.
MrExcel_20220831.xlsx
ABCDE
1Requires TechnologyEstimate CompletedHelpers
2YesNoYesNo
3No 
4YesYesYesNo
5NoNo 
Sheet5
Cell Formulas
RangeFormula
D2:E2,D4:E4,D3,D5D2=IF(A2="Yes",{"Yes","No"},"")
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B5Expression=$A2="No"textNO
Cells with Data Validation
CellAllowCriteria
A2:A5ListYes,No
B2:B5List=OFFSET(D2,,,,COUNTA(D2:E2))
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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