Count Number of Certain day between two dates

eoinymc

Board Regular
Joined
Jan 29, 2009
Messages
203
Hi,

I want to count the number of Wednesdays between 02-Apr-14 & 22-Oct-14.

If I have the first date in A1 and the second date in B1, does anyone know if it's possible to do this in a formula?

thanks,

Eoin
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I want to count the number of Wednesdays between 02-Apr-14 & 22-Oct-14.

If I have the first date in A1 and the second date in B1, does anyone know if it's possible to do this in a formula?
Give this array-entered** formula a try...

=SUM(0+(WEEKDAY(ROW(INDIRECT("A"&A1&":A"&B1)))=4))

**Commit this formula using CTRL+SHIFT+ENTER and not just Enter by itself.

Note: The 4 in my formula is the weekday number for Wednesday.
 
Upvote 0
The following will work also includes start and end date in the calculation:

=(WEEKNUM(B1)+IF(WEEKDAY(B1)<4,0,1))-(WEEKNUM(A1)+(IF(WEEKDAY(A1)<5,0,1)))
 
Upvote 0
Give this array-entered** formula a try...

=SUM(0+(WEEKDAY(ROW(INDIRECT("A"&A1&":A"&B1)))=4))

**Commit this formula using CTRL+SHIFT+ENTER and not just Enter by itself.

Note: The 4 in my formula is the weekday number for Wednesday.

Actually, we can simplify that formula slightly (still array-entered)...

=SUM(0+(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))=4))
 
Upvote 0
There are some non array alternatives, e.g.

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

or if you are using Excel 2010 or later you can use NETWORKDAYS.INTL function like this

=NETWORKDAYS.INTL(A1,B1,"1101111")
 
Upvote 0

Forum statistics

Threads
1,216,118
Messages
6,128,939
Members
449,480
Latest member
yesitisasport

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