Count number of specific days between dates

TheAntisocial

New Member
Joined
Sep 7, 2009
Messages
33
Office Version
  1. 2013
Platform
  1. Windows
Hi all.

I'm hoping you can help me with a formula to count the number of specific days between dates.

For example, i have two dates in two cells

A1 = 20/08/11
B1 = 20/09/11

I have a third column with a specific day

C1 = Monday

Is there a formula i can use to calculate how many "C1"s there were between "A1" and "B1"??

Any help is greatly appreciated :biggrin:

Thanks
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
If C1 is an actual text string "Monday"

Try

=SUMPRODUCT(--(TEXT(ROW(INDEX(A:A,A1):INDEX(A:A,A2)),"dddd")=A3))
 
Upvote 0
Hi all.

I'm hoping you can help me with a formula to count the number of specific days between dates.

For example, i have two dates in two cells

A1 = 20/08/11
B1 = 20/09/11

I have a third column with a specific day

C1 = Monday

Is there a formula i can use to calculate how many "C1"s there were between "A1" and "B1"??

Any help is greatly appreciated :biggrin:

Thanks

USE VBA


Code:
Sub test()
Dim dStart As Date
Dim dEnd As Date
Dim iDateCount As Integer
dStart = RANGE("A1").VALUE
dEnd = RANGE("B1").VALUE
 
Do Until dStart = dEnd
  dStart = dStart + 1
  If Weekday(dStart) = WEEKDAY(RANGE("C1")).VALUE Then
    iDateCount = 1
  End If
Loop
 
 RANGE("D1").VALUE = IDATECOUNT
End Sub
 
Upvote 0
C1 is indeed a text string, and the formula works a treat!

Thanks for the help, very much appreciated :biggrin:
 
Upvote 0

Forum statistics

Threads
1,215,726
Messages
6,126,498
Members
449,316
Latest member
sravya

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