You are here:

Excel/creat a dropdown if previous cell =

Advertisement


Question
Hi Aiden its been a long time. I am in need of your expertise again. I have 2 columns (A and B). Cells in column A require customer to input 0,1,2,3,4. Cell B also needs 0,1,2,3,4. but if one cell has 0 then the other has to have 1,2,3,4 and the same goes for the other.
If cell A has 0 then cell B has to have 1,2,3,4 not allowing user to input 0.
Likewise, if cell A has 1,2,3,4 then Cell B can only have 0 not allowing user to input any number other than 0.
I tried to make a dropdown and was successful but this only asks user to input the numbers for either column and allows them to do it wrong. Users put 0 in both A and B and or 1thru4 in both A and B. First can this be done and 2nd how. In my head it seems easy but in excel not so.
Thanks for your input.

Answer
it's actually quite tricky (as you guessed) - I've only managed to do it using a "helper" column and an array formula.  This version assumes that the A cell is A1

=IF(SMALL(IF(ROW(A1:A5)-1=A1,9999,ROW(A1:A5)-1),ROW())=9999,"",SMALL(IF(ROW(A1:A5)-1=A1,9999,ROW(A1:A5)-1),ROW()))

enter by pressing ctrl shift enter - the -1 should be replaced with whatever number you need to get the row count to start at zero, and A1 replaced with whatever cell has the value you want to exclude.  This column is then the source of the data validation list.  People who are determined to put rubbish answers can do it by overwriting the first value in column a with a duplicate, but I think that's unlikely to happen!  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Aidan Heritage

Expertise

I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards. I'm based in the UK, so please allow for time differences when asking me questions from other parts of the world!

Experience

My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.

Education/Credentials
I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!

©2016 About.com. All rights reserved.