MrExcel Publishing
Your One Stop for Excel Tips & Solutions

help with week days


Posted by Manuel on December 16, 2001 2:33 PM

Hi Is there a way of find out how many let`s say
Mondays or any day between two dates
example
culummA colummB colummC colummD
06-Dec-01 25-Dec-01 (how many Mondays) (Wednesdays)

Tanks Manuel


Posted by Aladin Akyurek on December 16, 2001 3:25 PM

Manuel --

Assuming that 06-Dec-01 is in A2 and 25-Dec-01 in B2.
In C1:I1 enter 1,2,3,4,5,6, and 7 where 1=Sunday,2=Monday, etc.

In C2 enter and copy across: =SUMPRODUCT((WEEKDAY($A$2-1+ROW(INDIRECT("1:"&$B$2-$A$2+1)))=C$1)+0)

I adapted a formula from Pearson's site: http://www.cpearson.com/excel/DateTimeWS.htm

Aladin

=========

Posted by Manuel on December 16, 2001 5:16 PM

Aladin
It works perfect Tank you very much for your help
Best regards Manuel