Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / June 2007

Tip: Looking for answers? Try searching our database.

Invalid date if weekend or bank holiday

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
grobertson - 14 Jun 2007 13:25 GMT
Hi,
I have a spreadsheet where cell C6 requires the user to enter a date, I
currently have a custom validation in the cell of the following:-

=WEEKDAY(C6,2)<=5

This displays an error message if a non-working day (i.e. a Saturday or
Sunday) is entered in the cell.  Is there anyway I could get this to work if
the user also enters a bank holiday date.

Regards, Glenn
vezerid - 14 Jun 2007 13:46 GMT
In a separate area in your workbook enter all bank holidays. Select
this range and Insert>Name>Define... call it Holidays.

Your DV formula:
=AND(WEEKDAY(C6,2)<=5,COUNTIF(Holidays,C6)=0)

HTH
Kostis Vezerides

On Jun 14, 3:25 pm, grobertson <grobert...@discussions.microsoft.com>
wrote:
> Hi,
> I have a spreadsheet where cell C6 requires the user to enter a date, I
[quoted text clipped - 7 lines]
>
> Regards, Glenn
grobertson - 14 Jun 2007 13:59 GMT
I have tried this but it is giving me the following error message :-

"A named range you specified cannot be found"

> In a separate area in your workbook enter all bank holidays. Select
> this range and Insert>Name>Define... call it Holidays.
[quoted text clipped - 18 lines]
> >
> > Regards, Glenn
bj - 14 Jun 2007 14:02 GMT
try networkday()
you may have to install the analysis toolpack
=networkday(date in question,date in question, hol list)=0 will give a true
when a holoday or weekend date is selected.

> Hi,
> I have a spreadsheet where cell C6 requires the user to enter a date, I
[quoted text clipped - 7 lines]
>
> Regards, Glenn
grobertson - 14 Jun 2007 14:10 GMT
I still can't get this to work.

I just want it to not validate if a date that I enter is a wekend or bank
holiday

> try networkday()
> you may have to install the analysis toolpack
[quoted text clipped - 12 lines]
> >
> > Regards, Glenn
Teethless mama - 14 Jun 2007 15:20 GMT
Post your formula

> I still can't get this to work.
>
[quoted text clipped - 17 lines]
> > >
> > > Regards, Glenn
bj - 14 Jun 2007 15:21 GMT
set up a range with the holidays you are interested in (Hol) and use in your
validation equations
=and(WEEKDAY(C6,2)<=5,c6<>hol)

> I still can't get this to work.
>
[quoted text clipped - 17 lines]
> > >
> > > Regards, Glenn
bj - 14 Jun 2007 15:24 GMT
Come to think of it, I occasssionally have problems with named ranges.
if you do , try to just put in the actual rewange where you have the
holidays listed.  (in my test it was H1:H3)

> I still can't get this to work.
>
[quoted text clipped - 17 lines]
> > >
> > > Regards, Glenn
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.