PC Review


Reply
Thread Tools Rate Thread

Counting number of Sundays

 
 
Excelman
Guest
Posts: n/a
 
      26th Mar 2008
I am looking for a formula that will count the number of Sundays within a
date range. Example: I want to enter a start date in one cell, and today's
date in another,and need a formula that will count the number of Sundays
between the two.A1 3/01/2008
A2 3/31/2008
A3 5 (5 Sundays between the dates)
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      26th Mar 2008
If the two dates are:

Sunday, March 23, 2008
Sunday, March 30, 2008

does that count as two Sundays, one Sunday, or no Sundays??
--
Gary''s Student - gsnu200775


"Excelman" wrote:

> I am looking for a formula that will count the number of Sundays within a
> date range. Example: I want to enter a start date in one cell, and today's
> date in another,and need a formula that will count the number of Sundays
> between the two.A1 3/01/2008
> A2 3/31/2008
> A3 5 (5 Sundays between the dates)

 
Reply With Quote
 
PCLIVE
Guest
Posts: n/a
 
      26th Mar 2008

{=SUM(IF(WEEKDAY(A1-1+ROW(INDIRECT("1:"&TRUNC(A2-A1)+1)))=1,1,0))}

Do not type the outter brackets { } . This is an array formula committed by
Ctrl+Shift+Enter.

HTH,
Paul

--

"Excelman" <(E-Mail Removed)> wrote in message
news:B5C3E83D-F3BC-4156-AD54-(E-Mail Removed)...
>I am looking for a formula that will count the number of Sundays within a
> date range. Example: I want to enter a start date in one cell, and today's
> date in another,and need a formula that will count the number of Sundays
> between the two.A1 3/01/2008
> A2 3/31/2008
> A3 5 (5 Sundays between the dates)



 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      26th Mar 2008
Hi,

Srat date in a1
End date in b1

=SUM(IF(WEEKDAY(A1-1+ROW(INDIRECT("1:"&TRUNC(B1-A1)+1)))=1,1,0))

Just for interest the =1 bit looks for Sundays 2 would be mondays etc

Mike

"Excelman" wrote:

> I am looking for a formula that will count the number of Sundays within a
> date range. Example: I want to enter a start date in one cell, and today's
> date in another,and need a formula that will count the number of Sundays
> between the two.A1 3/01/2008
> A2 3/31/2008
> A3 5 (5 Sundays between the dates)

 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      26th Mar 2008
good point

"Gary''s Student" wrote:

> If the two dates are:
>
> Sunday, March 23, 2008
> Sunday, March 30, 2008
>
> does that count as two Sundays, one Sunday, or no Sundays??
> --
> Gary''s Student - gsnu200775
>
>
> "Excelman" wrote:
>
> > I am looking for a formula that will count the number of Sundays within a
> > date range. Example: I want to enter a start date in one cell, and today's
> > date in another,and need a formula that will count the number of Sundays
> > between the two.A1 3/01/2008
> > A2 3/31/2008
> > A3 5 (5 Sundays between the dates)

 
Reply With Quote
 
Ron Coderre
Guest
Posts: n/a
 
      26th Mar 2008
With
A1: (the start date)
A2: (the end date)

This formula counts the number of Sundays within that range
=SUM(INT((WEEKDAY(A1-1)+A2-A1)/7))

Note: To count different weekdays, replace 1 with
one of these values: 1=Sun, 2=Mon.....7=Sat

Does that help?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Excelman" <(E-Mail Removed)> wrote in message
news:B5C3E83D-F3BC-4156-AD54-(E-Mail Removed)...
>I am looking for a formula that will count the number of Sundays within a
> date range. Example: I want to enter a start date in one cell, and today's
> date in another,and need a formula that will count the number of Sundays
> between the two.A1 3/01/2008
> A2 3/31/2008
> A3 5 (5 Sundays between the dates)




 
Reply With Quote
 
Jim Thomlinson
Guest
Posts: n/a
 
      26th Mar 2008
Check out this link... it has a pile of great date formulas...

http://www.cpearson.com/excel/DateTimeWS.htm
--
HTH...

Jim Thomlinson


"Excelman" wrote:

> I am looking for a formula that will count the number of Sundays within a
> date range. Example: I want to enter a start date in one cell, and today's
> date in another,and need a formula that will count the number of Sundays
> between the two.A1 3/01/2008
> A2 3/31/2008
> A3 5 (5 Sundays between the dates)

 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      27th Mar 2008
On Wed, 26 Mar 2008 14:26:03 -0700, Excelman
<(E-Mail Removed)> wrote:

>I am looking for a formula that will count the number of Sundays within a
>date range. Example: I want to enter a start date in one cell, and today's
>date in another,and need a formula that will count the number of Sundays
>between the two.A1 3/01/2008
> A2 3/31/2008
> A3 5 (5 Sundays between the dates)



=INT((A2-WEEKDAY(A2)-A1+8)/7)

--ron
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i sum day of the week without counting sats and sundays? =?Utf-8?B?U2ltb24gRFI=?= Microsoft Excel Worksheet Functions 2 28th Dec 2005 02:20 PM
Counting How many Sundays (or any day) in a given time range... =?Utf-8?B?TWFyY3Vz?= Microsoft Access 1 30th Aug 2005 05:40 PM
counting Sundays between two dates =?Utf-8?B?a2lwcGkzMDAw?= Microsoft Excel Programming 5 31st Dec 2004 05:20 PM
Counting Workdays & Sundays with Holidays Polos Microsoft Excel Worksheet Functions 7 8th Jul 2004 10:42 AM
RE: Counting number of Sundays in a month =?Utf-8?B?SG93YXJkIEJyb2R5?= Microsoft Access Getting Started 0 24th May 2004 08:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:13 PM.