Finding number of particular days in a period

L

Les

I need to find the number of Thursdays in a period that occur on the 15th, 16th, 17th, 18th, 19,th 20th or 21st dates

For example, I need to write a formula that tells me say, how many occur between 16th July and 20th August 2004. The answer would be 1.
 
F

Frank Kabel

Hi
lets assume your starting state (e.g. 16th July) is in cell A1 and your
ending date in cell A2 (e.g. 20th August) then try the following
formula
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1 & ":" &
A2)))=5),--(DAY(ROW(INDIRECT(A1 & ":" &
A2)))>=15),--(DAY(ROW(INDIRECT(A1 & ":" & A2)))<=21))
 
D

Daniel.M

Also (for this specific case):
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1 & ":" &
A2)))=5),--(DAY(ROW(INDIRECT(A1 & ":" &
A2)))>=15),--(DAY(ROW(INDIRECT(A1 & ":" & A2)))<=21))

=SUMPRODUCT((WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=5)*
(ABS(DAY(ROW(INDIRECT(A1&":"&A2)))-18)<4))

Regards,

Daniel M.
 

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