Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Counting number of Sundays

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)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Counting number of Sundays

If the two dates a

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)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Counting number of Sundays

good point

"Gary''s Student" wrote:

If the two dates a

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)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Counting number of Sundays


{=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" wrote in message
...
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)



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Counting number of Sundays

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)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,118
Default Counting number of Sundays

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" wrote in message
...
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)




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Counting number of Sundays

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)

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Counting number of Sundays

On Wed, 26 Mar 2008 14:26:03 -0700, 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)



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

--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
Counting calendar Days - not including Sundays KenCanuck Excel Discussion (Misc queries) 3 April 28th 09 05:46 PM
how do i sum day of the week without counting sats and sundays? Simon DR Excel Worksheet Functions 2 December 28th 05 02:20 PM
Need number of Saturdays and number of Sundays between 2 dates Class316 Excel Worksheet Functions 1 June 10th 05 02:47 AM
Number of sundays Mark Scholes Excel Programming 4 February 23rd 05 12:25 PM
counting Sundays between two dates kippi3000 Excel Programming 5 December 31st 04 05:20 PM


All times are GMT +1. The time now is 07:53 PM.

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"