Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can I test if a date is a workday?

I need to test whether a date entered by the user is a workday, so I
can use the "true" or "false" returned by the test in another formula
in the spreadsheet. I have a cell range of holidays set up. The date
entered by the user could be any date in the year and any day of the
week.

Thanks,

Nolo

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How can I test if a date is a workday?

Nolo,

Assuming date in E1, and the holidays in named range called holidays

=AND(WEEKDAY(E1,2)<5,COUNTIF(holidays,E1)=0)

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
I need to test whether a date entered by the user is a workday, so I
can use the "true" or "false" returned by the test in another formula
in the spreadsheet. I have a cell range of holidays set up. The date
entered by the user could be any date in the year and any day of the
week.

Thanks,

Nolo



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default How can I test if a date is a workday?

Hi

with your holidays in the range E2:E6 and assuming that both saturday and
sunday are non-workdays, the following formula will return "workday" or "not
workday" for a date in A1

=IF(AND(WEEKDAY(A1)<1,WEEKDAY(A1)<7,ISNA(MATCH(A 1,E2:E6,0))),"weekday","not
weekday")

Cheers
JulieD

wrote in message
oups.com...
I need to test whether a date entered by the user is a workday, so I
can use the "true" or "false" returned by the test in another formula
in the spreadsheet. I have a cell range of holidays set up. The date
entered by the user could be any date in the year and any day of the
week.

Thanks,

Nolo



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How can I test if a date is a workday?

oops. small error

=AND(WEEKDAY(E1,2)<6,COUNTIF(holidays,E1)=0)


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...
Nolo,

Assuming date in E1, and the holidays in named range called holidays

=AND(WEEKDAY(E1,2)<5,COUNTIF(holidays,E1)=0)

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
I need to test whether a date entered by the user is a workday, so I
can use the "true" or "false" returned by the test in another formula
in the spreadsheet. I have a cell range of holidays set up. The date
entered by the user could be any date in the year and any day of the
week.

Thanks,

Nolo





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can I test if a date is a workday?

=WORKDAY(A1-1,1,Holidays)=A1

Ron, I love the brilliant simplicity of your solution! Thanks so much.

Nolo

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default How can I test if a date is a workday?

On 8 Mar 2005 11:59:55 -0800, wrote:

=WORKDAY(A1-1,1,Holidays)=A1


Ron, I love the brilliant simplicity of your solution! Thanks so much.

Nolo


You're welcome. Glad to help.


--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DATE WORKDAY PROBLEM XLtest Excel Discussion (Misc queries) 3 January 11th 10 02:08 PM
How to shift a weekend date to the last or next workday staplers Excel Discussion (Misc queries) 2 July 3rd 09 05:00 AM
Workday return a Saturday date Jessie Setting up and Configuration of Excel 2 March 23rd 07 07:47 PM
Workday Date Calculation kdlilly Excel Worksheet Functions 7 January 17th 07 08:21 PM
workday date function sjayar Excel Worksheet Functions 3 November 11th 05 05:15 PM


All times are GMT +1. The time now is 12:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"