G
Guest
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.
Answer: 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))
Thankyou to those who answered this; your formula works, and it gives the right answer. However, this formula is activated from cells that get dates from a calendar. Whenever a date in the calendar is chosen, it gives a REF# answer, not a numerical answer as it should; but whenever you type the date in the cell, it works! Help - what do I need to change to get this formula to work from the calendar?
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.
Answer: 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))
Thankyou to those who answered this; your formula works, and it gives the right answer. However, this formula is activated from cells that get dates from a calendar. Whenever a date in the calendar is chosen, it gives a REF# answer, not a numerical answer as it should; but whenever you type the date in the cell, it works! Help - what do I need to change to get this formula to work from the calendar?