Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default How do I test if the weekday is between Monday and Friday ?

Hello everyone,

How could I test in Excel that the weekday is between Monday and Friday, in
other words, the weekday can only be: Monday, Tuesday, Wednesday, Thursday
and Friday.

Thanks very much
Tom
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default How do I test if the weekday is between Monday and Friday ?

Hi Tom,

=AND(WEEKDAY(A1)1,WEEKDAY(A1)<7)

Returns TRUE or FALSE

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"tom" wrote in message ...
| Hello everyone,
|
| How could I test in Excel that the weekday is between Monday and Friday, in
| other words, the weekday can only be: Monday, Tuesday, Wednesday, Thursday
| and Friday.
|
| Thanks very much
| Tom


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,118
Default How do I test if the weekday is between Monday and Friday ?

Not sure if this is a *programming* question...

The testing part is fairly easy:

This formula returns TRUE if the date in A! is a Monday thru Friday. FALSE
if a weekend:
=WEEKDAY(A1,2)<6

(Note: you can also use the WEEKDAY function in VBA)

Does that get you headed in the right direction?

***********
Regards,
Ron

XL2002, WinXP


"tom" wrote:

Hello everyone,

How could I test in Excel that the weekday is between Monday and Friday, in
other words, the weekday can only be: Monday, Tuesday, Wednesday, Thursday
and Friday.

Thanks very much
Tom

  #4   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default How do I test if the weekday is between Monday and Friday ?

Hi Niek and Ron,

thanks very much for your quick answer. What should A1 contain please ? in
my case, A1 should be the today day: "Monday", "tuesday", "wednesday",
"thursday" or "friday".
Does the condition you mentioned still work ?
Please help
Thanks very much and regards
Tom

"Niek Otten" wrote:

Hi Tom,

=AND(WEEKDAY(A1)1,WEEKDAY(A1)<7)

Returns TRUE or FALSE

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"tom" wrote in message ...
| Hello everyone,
|
| How could I test in Excel that the weekday is between Monday and Friday, in
| other words, the weekday can only be: Monday, Tuesday, Wednesday, Thursday
| and Friday.
|
| Thanks very much
| Tom



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,118
Default How do I test if the weekday is between Monday and Friday ?

If A1 is a text entry (Monday, Tuesday, etc)....

Here's something to try:
B1:
=SUM(COUNTIF(A1,{"Saturday","Sunday","Monday","Tue sday","Wednesday","Thursday","Friday"})*{1,2,3,4,5 ,6,7})2

Note: In case text wrap impacts the display, there are NO spaces in that
formula

Does that help?

***********
Regards,
Ron

XL2002, WinXP


"tom" wrote:

Hi Niek and Ron,

thanks very much for your quick answer. What should A1 contain please ? in
my case, A1 should be the today day: "Monday", "tuesday", "wednesday",
"thursday" or "friday".
Does the condition you mentioned still work ?
Please help
Thanks very much and regards
Tom

"Niek Otten" wrote:

Hi Tom,

=AND(WEEKDAY(A1)1,WEEKDAY(A1)<7)

Returns TRUE or FALSE

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"tom" wrote in message ...
| Hello everyone,
|
| How could I test in Excel that the weekday is between Monday and Friday, in
| other words, the weekday can only be: Monday, Tuesday, Wednesday, Thursday
| and Friday.
|
| Thanks very much
| Tom





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,118
Default How do I test if the weekday is between Monday and Friday ?

A shorter alternative:

=SUM(COUNTIF(A1,TEXT("12/30/2005"+{1,2,3,4,5,6,7},"dddd"))*{1,2,3,4,5,6,7})2

***********
Regards,
Ron

XL2002, WinXP


"tom" wrote:

Hi Niek and Ron,

thanks very much for your quick answer. What should A1 contain please ? in
my case, A1 should be the today day: "Monday", "tuesday", "wednesday",
"thursday" or "friday".
Does the condition you mentioned still work ?
Please help
Thanks very much and regards
Tom

"Niek Otten" wrote:

Hi Tom,

=AND(WEEKDAY(A1)1,WEEKDAY(A1)<7)

Returns TRUE or FALSE

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"tom" wrote in message ...
| Hello everyone,
|
| How could I test in Excel that the weekday is between Monday and Friday, in
| other words, the weekday can only be: Monday, Tuesday, Wednesday, Thursday
| and Friday.
|
| Thanks very much
| Tom



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
Formula to display next Friday from B1 works except on the Friday itself. StargateFan[_2_] Excel Discussion (Misc queries) 4 August 11th 11 09:20 AM
Calculating and listing only Monday-Friday in a work schedule Jugglertwo Excel Discussion (Misc queries) 8 April 20th 08 10:57 PM
Help change Friday to following Monday David Excel Discussion (Misc queries) 4 June 22nd 06 01:24 AM
Function to write Weekday - Monday, Tuesday etc Shrikant Excel Discussion (Misc queries) 3 September 26th 05 11:32 AM
Setting WEEKDAY function to Exclude Friday in Calculation Faizan Excel Programming 4 September 27th 04 06:15 AM


All times are GMT +1. The time now is 10:01 AM.

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

About Us

"It's about Microsoft Excel"