Forum Home
Press F1
 
Thread ID: 102236 2009-08-12 12:35:00 Excel formula bpt2 (6653) Press F1
Post ID Timestamp Content User
800390 2009-08-12 12:35:00 I have two columns which may only contain numbers 0,1 or 2. However any two adjacent cells may only contain the combinations: 0-2, 1-2, 2-0 or 2-1. How can I set up the spreadsheet so that no other combinations can be entered? bpt2 (6653)
800391 2009-08-13 08:02:00 Hi, use Data Validation and select the Custom option to enter a formula. As an example assuming the cells in question are A1 and B1...


DV for cell A1
=OR(A1=0,A1=1,A1=2)
DV for cell B1
=OR(AND(A1=0,B1=2), AND(A1=1,B1=2), AND(A1=2,B1=0),AND(A1=2,B1=1))

regards,
Graham
Parry (5696)
800392 2009-08-17 01:00:00 Thanks bpt2 (6653)
1