Count number of specific days between dates

TheAntisocial

New Member
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

Thanks

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Jonmo1

MrExcel MVP
If C1 is an actual text string "Monday"

Try

=SUMPRODUCT(--(TEXT(ROW(INDEX(A:A,A1):INDEX(A:A,A2)),"dddd")=A3))

TiaXL

Board Regular
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

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``````

TheAntisocial

New Member
C1 is indeed a text string, and the formula works a treat!

Thanks for the help, very much appreciated

Replies
0
Views
204
Replies
3
Views
419
Replies
3
Views
293
Replies
12
Views
270
Replies
3
Views
256

1,195,749
Messages
6,011,436
Members
441,614
Latest member
TiaGtz

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.

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

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