Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default how many times a particular day of the week appears in a given month

Hello - I'm building a spreadsheet that is supposed to calculate how
many times a particular day of the week appears in the month for a
billing letter. Students are scheduled for a lesson on one of the days
of the week, and based on that day, I want to count how many times that
day appears in a given month and calculate their bill. For example,
there are 5 Tuesdays, Wednesdays and Thursdays in July 2006, but only 4
Fridays, Saturdays, Sundays and Mondays. I've got a column for the
date, and another column for the day (Monday, Tues. etc.) Is there some
function in Excel that would help do this or a formula or algorithm?
Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default how many times a particular day of the week appears in a given month

You mean August not July

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(DATE(2006,8,1)&":"&DATE(2006 ,9,0))))=3))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"CheapTequila" wrote in message
ps.com...
Hello - I'm building a spreadsheet that is supposed to calculate how
many times a particular day of the week appears in the month for a
billing letter. Students are scheduled for a lesson on one of the days
of the week, and based on that day, I want to count how many times that
day appears in a given month and calculate their bill. For example,
there are 5 Tuesdays, Wednesdays and Thursdays in July 2006, but only 4
Fridays, Saturdays, Sundays and Mondays. I've got a column for the
date, and another column for the day (Monday, Tues. etc.) Is there some
function in Excel that would help do this or a formula or algorithm?
Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default how many times a particular day of the week appears in a given month

This formula from Chip Pearson gives you the date of the Nth Day of the week in a month and year:

=DATE(Yr,Mon,1+((Nth-(DoW=WEEKDAY(DATE(Yr,Mon,1))))*7)+(DoW-WEEKDAY(DATE(Yr,Mon,1))))

Where Yr, Mon, Nth, and DoW are cell references or values indicating Year, Month, Nth, and Day-Of-Week.



Use it to find the 5th day in a month.
Now just compare the month of that date (using the MONTH() function with your month; if they'r equal, you have 5 of those days,
otherwise 4.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"CheapTequila" wrote in message ps.com...
| Hello - I'm building a spreadsheet that is supposed to calculate how
| many times a particular day of the week appears in the month for a
| billing letter. Students are scheduled for a lesson on one of the days
| of the week, and based on that day, I want to count how many times that
| day appears in a given month and calculate their bill. For example,
| there are 5 Tuesdays, Wednesdays and Thursdays in July 2006, but only 4
| Fridays, Saturdays, Sundays and Mondays. I've got a column for the
| date, and another column for the day (Monday, Tues. etc.) Is there some
| function in Excel that would help do this or a formula or algorithm?
| Thanks!
|


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default how many times a particular day of the week appears in a given month


You say you have column for the month and column for the day.

If the month has been input in the format Aug-06 and day is the full
weekday, e.g. "Wednesday" then assuming date in A2 and weekday in B2

=SUMPRODUCT(--(TEXT(ROW(INDIRECT(A2&":"&A2+31-(DAY(A2+31)))),"dddd")=B2))


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=568898

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default how many times a particular day of the week appears in a given month

On 7 Aug 2006 01:14:21 -0700, "CheapTequila" wrote:

Hello - I'm building a spreadsheet that is supposed to calculate how
many times a particular day of the week appears in the month for a
billing letter. Students are scheduled for a lesson on one of the days
of the week, and based on that day, I want to count how many times that
day appears in a given month and calculate their bill. For example,
there are 5 Tuesdays, Wednesdays and Thursdays in July 2006, but only 4
Fridays, Saturdays, Sundays and Mondays. I've got a column for the
date, and another column for the day (Monday, Tues. etc.) Is there some
function in Excel that would help do this or a formula or algorithm?
Thanks!


To calculate the number of a particular weekday in a month:

=4+(MONTH(A1+35-WEEKDAY(A1+7-WDN))=MONTH(A1))

where A1 contains day 1 in the month (e.g. 1 AUG 2006) and WDN is the weekday
number (1=Sun, 2=Mon, etc).


--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
Show week number in current month DKerr Excel Discussion (Misc queries) 4 February 23rd 06 09:20 PM
Macro to insert copied cells [email protected] Excel Discussion (Misc queries) 17 January 18th 06 10:40 AM
PivotTable Group by Week and Month Monica Hall Excel Discussion (Misc queries) 5 January 9th 06 11:11 PM
How to count the number of times something occurs within a certain month Joyce Excel Worksheet Functions 2 October 18th 05 08:38 PM
Need to calulate a sum for once a month X #days X #times used per. pattyh Excel Worksheet Functions 0 September 28th 05 05:07 PM


All times are GMT +1. The time now is 10:42 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"