Data validation on holidays

Zubair

Active Member
Joined
Jul 4, 2009
Messages
304
Office Version
  1. 2016
Platform
  1. Windows
Hi Experts,

1. Selection is available for users to put Number of holidays in a week in cell B1 through data validation from C1:C2
2. User can also select Holiday 1 from drop down list from D1:D7
3. User can also select Holiday 2 from drop down same list

How to stop user

1. Wrongly repeating same day twice for example Holiday 1 = Sat & Holiday 2 = Sat
2. If B1 = 1 user can not select Holiday 2

Please help


No of holidays in a week
1​
1​
Sun
Holiday 1Sat
2​
Mon
Holiday 2Tue
Wed
Thu
Fri
Sat
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Something like this maybe?
If you want more than 2 then it will be easier with a different method. Note that this will not prevent the user from changing Holiday1 after selecting Holiday2, I've kept it simple until we know if there are going to be additional criteria to consider.
Book1
ABCDE
1No of holidays in a week21SunSun
2Holiday 1Sat2MonMon
3Holiday 2TueTue
4WedWed
5ThuThu
6FriFri
7Sat
Sheet2
Cell Formulas
RangeFormula
E1:E6E1=IF($B$2=D1,D2,D1)
Cells with Data Validation
CellAllowCriteria
B3List=IF($B$1=2,$E$1:$E$6,$E$7)
 
Upvote 0
Thanks Jasonb75,

Your given formula is working for Holiday 2.

For control purpose I need to restrict people for selecting duplicate days for holidays and if number of holidays in a week is 1, only option to select 1 day should available, if 2 than must select 2 holidays, hope more mind to put in this.
 
Upvote 0
Sorry, I misread it and thought that you already had validation in the first one.
Book1
ABCDE
1No of holidays in a week2SunSun
2Holiday 1WedMonTue
3Holiday 2MonTueThu
4Holiday 3WedFri
5ThuSat
6Fri 
7Sat 
Sheet1
Cell Formulas
RangeFormula
E1:E7E1=IFERROR(INDEX($D$1:$D$7,AGGREGATE(15,6,ROW($D$1:$D$7)/ISNA(MATCH($D$1:$D$7,$B$2:$B$3,0)),ROWS(E$1:E1))),"")
Cells with Data Validation
CellAllowCriteria
B2:B4List=IF(ROWS(B$2:B2)>$B$1,$E$8,$E$1:$E$7)
 
Upvote 0
Solution
Sorry, I misread it and thought that you already had validation in the first one.
Book1
ABCDE
1No of holidays in a week2SunSun
2Holiday 1WedMonTue
3Holiday 2MonTueThu
4Holiday 3WedFri
5ThuSat
6Fri 
7Sat 
Sheet1
Cell Formulas
RangeFormula
E1:E7E1=IFERROR(INDEX($D$1:$D$7,AGGREGATE(15,6,ROW($D$1:$D$7)/ISNA(MATCH($D$1:$D$7,$B$2:$B$3,0)),ROWS(E$1:E1))),"")
Cells with Data Validation
CellAllowCriteria
B2:B4List=IF(ROWS(B$2:B2)>$B$1,$E$8,$E$1:$E$7)
Marvellous Jasonb75

its perfectly matches my requirement. Many thanks.
 
Upvote 0

Forum statistics

Threads
1,215,695
Messages
6,126,263
Members
449,307
Latest member
Andile

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