View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default count weekday()=1

Nice catch, Biff

Warning: Lame excuse to follow...
I had that formula in my junk pile, source unknown.
It's been replaced with the one you posted...with credit to you (unless I
hear differently)

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

XL2002, WinXP


"T. Valko" wrote:

That doesn't work as a "generic" formula.

A1 = 12/1/2006
B1 = 12/7/2006

Count of Sundays returns 0.

Biff

"Ron Coderre" wrote in message
...
Try this:

With
A1: (the start date)
B1: (the end date)

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

Note: 1=Sunday, 2=Monday.....7=Saturday

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"dribler2" wrote:

pls give me a single formula to count the desired number of specific
weekday.

something like this

=countif(start_date:end_date,weekday(1))

e.g.
if start_date is 01/Dec/06 and end_date is 31/Dec/06, then find how many
sundays are within this 2 dates. (in this case the count = 5)

I hope someone out there can share their bright formulated gifts this new
year.
.
wish it is easy...
dribler2.