PDA

View Full Version : Solved: Count Dates in a Week



Ger
03-26-2008, 07:58 AM
Can someone tell me why i don't get a correct value?

I'm trying to count how many dates are in a specific week.

See the example.


Ger

:doh:

ProteanBeing
03-26-2008, 08:09 AM
There are 7 days in every week. The function you are using WEEKNUM tells you the week number within the year.
For example

Dec 30, 2008 returns 52 because Dec 30 is in the 52nd week of 2008

Bob Phillips
03-26-2008, 08:50 AM
Because WEEKNUM is one of those annoying functions (ATP) that just won't take anj array of values.

Use

=SUMPRODUCT(--(1+INT((A1:G1-(DATE(YEAR(A1:G1),1,2)-WEEKDAY(DATE(YEAR(A1:G1),1,1))))/7)=19))

ProteanBeing
03-26-2008, 09:10 AM
Ger,
What are you trying to do?

Ger
03-26-2008, 10:05 AM
What i'm trying to do is count how many of the dates in a range are in a specific week.
There are 260 people that must have 6 dates behind there name. I don't need the date but i need the weeknumber.


XLD,
can you give a dutch translation of the formula.


Ger

Bob Phillips
03-26-2008, 10:19 AM
=SOMPRODUCT(--(1+INTEGER((A1:G1-(DATUM(JAAR(A1:G1);1;2)-WEEKDAG(DATUM(JAAR(A1:G1);1;1))))/7)=19))

Ger
03-26-2008, 10:40 AM
Thanks, this works fine.


Ger

mdmackillop
03-26-2008, 11:32 AM
Hi Ger,
Please use meaningful titles to your questions.
Regards
MD