Counting specific dates between date range

Seacucumber

New Member
Joined
Jun 14, 2011
Messages
5
Hi - I am trying to work out how much interest I have to pay for a loan I have. The interest gets applied every month on the 2nd.

I want to be able to input

Cell A1: First date for example 14/06/2011
Cell B1: Second date for example 04/08/2011

Cell C1: Result 2

Hope this makes sense; I have been banging my head on the table for the last two days trying to figure it out!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
=DATEDIF(A1,B1,"m")

You won't have result as 2 'cause there aren't full two months between two dates.
 
Upvote 0
Thanks for the reply.

But I am not looking to count the months, I am looking to count the instances of the 2nd of each month.

The formula as you quite rightly point out will bring the volume back as one.

I need it to equal two.

Thanks
 
Upvote 0
Change "less than" to "<"

=DATEDIF(A1;B1;"m")+IF(DAY(B1) "less than" DAY(A1);1;0)
 
Last edited:
Upvote 0
Thanks again, tried that formula and it doesn't have the desired effect.

For example 01/01/2011 and 03/02/2011 - returns one and not two.
 
Upvote 0
Thanks for the reply.

But I am not looking to count the months, I am looking to count the instances of the 2nd of each month.

The formula as you quite rightly point out will bring the volume back as one.

I need it to equal two.

Thanks
Try this...

A1 = start date
B1 = end date

=SUMPRODUCT(--(DAY(ROW(INDIRECT(A1&":"&B1)))=2))
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

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