How do I find how many of a certain day are in a given month
On Tue, 9 Feb 2010 13:35:01 -0800, Paris2459
wrote:
I need to find out how many of a certain day are in a given month.
Ex: I need to know how many Thursdays are in each month for a calendar year
so I would need to find how many Thursdays are in Jan, Feb, Mar etc
If you have the year, e.g. 2010, in cell A1,
the month (1 for Jan, 2 for Feb etc) in cell A2
and the type of day (1 for Sun, 2 for Mon,..., 7 for Sat) in cell A3,
try the following formula:
=SUMPRODUCT((WEEKDAY(DATE(A1,A2,ROW($1:$31)))=A3)* (MONTH(DATE(A1,A2,ROW($1:$31)))=A2))
Hope this helps / Lars-Åke
|