days of the week per month

Flashart

New Member
Joined
Jun 25, 2009
Messages
2
Hi

I need to find the actual number Sundays or Mondays and every other day of the week for any given date range.

So for example from the 01/06/09 to 30/06/09 there are 4 Sundays and 5 Mondays, 5 Tuesdays, 4 Wednesdays etc.

I just can't find a way of getting the desired result, any help would be appreciated.

Thanks

Steve
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi Steve

Welcome to the Board

=SUMPRODUCT(--(WEEKDAY($A$1:$A$30)=1))

for a sunday, change the 1 to a 2 for a monday or reference a cell.

HTH


Dave
 
Upvote 0
Put your first and last dates in cell A1 and A2. Put a numerical value for day of the week in cell A3 (Sunday = 1, Saturday = 7).

Then use this formula. When you enter it, press control-shift-enter, not just enter.

=SUM(IF(WEEKDAY(ROW(INDIRECT("$A"&A1&":$A"&A2)))=A3,1,FALSE))

When you update your first and last dates and day of the week, the formula gives you the result. Or in the formula, copy it seven times and change A3 to 1, 2, 3, 4... Then you have a cell for each day of the week.

Tai

p.s. I love this guy's site; this specific link explains all about array formulas: http://www.cpearson.com/excel/ArrayFormulas.aspx
 
Upvote 0
If you have start date in A1 and end date in B1 this formula will give you a count of Mondays between those two dates (inclusive)

=INT((WEEKDAY(A1-2)+B1-A1)/7)

change the 2 to get other days (1=Sun through to 7 = Sat)
 
Upvote 0
Nice, Barry! So short and elegant. But I spent ten minutes staring at it and can't quite understand how yours works...
 
Upvote 0
Hi

Thank you all for your contributions, I've just tried Barry's solution and it does the job perfectly.

Thanks again Guys.

Steve
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top