1st Monday of a month in date range??

D

daddylonglegs

scwilly said:
Example:

How many 5th Fridays are between 5/1/2006 and 6/30/2006

The answer should be 1, your formula works if I change the end date t
7/1/2006 but not for 6/30/2006 which I need and would love.

It is more for a date range where the begin and end date could fall o
days other than the first of the month.

Thanks again, cheers

Hi scwilly, how are you getting 1 for the above? If you include th
start and end dates should it not be 2, 31st March and 30th June? O
are you not counting the start and end dates as part of the range
Assuming you are you could use this formula

=SUMPRODUCT(--(TEXT(ROW(INDIRECT(A1&":"&A2)),"ddd")=A4),--(ABS(DAY(ROW(INDIRECT(A1&":"&A2)))-A3*7+3)<4))

works for any start/end date
 
D

daddylonglegs

scwilly said:
Example:

How many 5th Fridays are between 5/1/2006 and 6/30/2006

The answer should be 1, your formula works if I change the end date to
7/1/2006 but not for 6/30/2006 which I need and would love.

It is more for a date range where the begin and end date could fall on
days other than the first of the month.

Thanks again, cheers

Hi scwilly, how are you getting 1 for the above? If you include the
start and end dates should it not be 2, 31st March and 30th June? Or
are you not counting the start and end dates as part of the range?
Assuming you are you could use this formula

=SUMPRODUCT(--(TEXT(ROW(INDIRECT(A1&":"&A2)),"ddd")=A4),--(ABS(DAY(ROW(INDIRECT(A1&":"&A2)))-A3*7+3)<4))

works for any start/end dates
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top