So to ensure only the correct number of days are added, use =SUMPRODUCT(--(WEEKDAY(DATE(YEAR(B1),MONTH(B1),ROW(INDIRECT("1:"&DAY(DATE(YEAR(B1),MONTH(B1)+1,0))))))=6))
Regards, Sam Mathai Chacko On Fri, Nov 4, 2011 at 12:48 AM, Paul Schreiner <schreiner_p...@att.net>wrote: > He's using the first day of the month to create a valid date. > The formula then uses the year and month from THIS date, and uses > the numbers 1-31 > (from Row($A1:$A31) ) > to generate new date values and then determine the day of the week for > each day. > > > *Paul* > > ----------------------------------------- > *“Do all the good you can, > By all the means you can, > In all the ways you can, > In all the places you can, > At all the times you can, > To all the people you can, > As long as ever you can.” - John Wesley > *----------------------------------------- > > > ------------------------------ > *From:* dguillett1 <dguille...@gmail.com> > *To:* excel-macros@googlegroups.com > *Sent:* Thu, November 3, 2011 3:10:22 PM > > *Subject:* Re: $$Excel-Macros$$ Formula to count Fridays in a month > mis-reports February > > Your original post said that you would use the FIRST DAY of each month..... > > > > Don Guillett > SalesAid Software > dguille...@gmail.com > -----Original Message----- From: DaveO > Sent: Thursday, November 03, 2011 1:53 PM > To: MS EXCEL AND VBA MACROS > Subject: Re: $$Excel-Macros$$ Formula to count Fridays in a month > mis-reports February > > I didn't see your note, Paul, thanks for your response. I thought the > equivalent of date(2012,2,30) would return an error and not get > counted in the SUMPRODUCT. Instead, as you say it gets counted as the > next day and throws the count off. > > -- FORUM RULES (925+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > -- FORUM RULES (925+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > > -- > FORUM RULES (925+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > -- Sam Mathai Chacko -- FORUM RULES (925+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com