ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to count # of dates that fall between a start and end date. (https://www.excelbanter.com/excel-programming/426073-how-count-dates-fall-between-start-end-date.html)

ascottbag-hcm

How to count # of dates that fall between a start and end date.
 
Can someone help with a formula that will give a count in one worksheet of
hire dates that exist in one column of another worksheet. I have a second
worksheet (example below) that contains two criteria columns, one with month
start date, the other with month end date. I'm trying to get a count of all
dates from the first worksheet that would be =the below start date AND <=
the below end date.

START OF MONTH END OF MONTH COUNT
4/1/2009 4/30/2009


OssieMac

How to count # of dates that fall between a start and end date.
 
You just subtract one date from the other and add 1. The resulting formula
cell must be formattd as a number; not a date.

Examples:-
If formula is on the same worksheet as source data
=B2-A2 +1

If formula is on a different worksheet to the source data
=Sheet1!B2-Sheet1!A2+1

--
Regards,

OssieMac


"ascottbag-hcm" wrote:

Can someone help with a formula that will give a count in one worksheet of
hire dates that exist in one column of another worksheet. I have a second
worksheet (example below) that contains two criteria columns, one with month
start date, the other with month end date. I'm trying to get a count of all
dates from the first worksheet that would be =the below start date AND <=
the below end date.

START OF MONTH END OF MONTH COUNT
4/1/2009 4/30/2009


Jacob Skaria

How to count # of dates that fall between a start and end date.
 
The below formula should work.

Sheet2 Column A contains all dates
Sheet1 A2 = StartDate
Sheet1 B2 = End Date

=SUMPRODUCT((Sheet2!A:A=A2)*(Sheet2!A:A<=B2))

If this post helps click Yes
---------------
Jacob Skaria



OssieMac

How to count # of dates that fall between a start and end date
 
Ignore my previous answer. After seeing Jacob's answer I realize that I
initially totally miss understood the question.

--
Regards,

OssieMac


"OssieMac" wrote:

You just subtract one date from the other and add 1. The resulting formula
cell must be formattd as a number; not a date.

Examples:-
If formula is on the same worksheet as source data
=B2-A2 +1

If formula is on a different worksheet to the source data
=Sheet1!B2-Sheet1!A2+1

--
Regards,

OssieMac


"ascottbag-hcm" wrote:

Can someone help with a formula that will give a count in one worksheet of
hire dates that exist in one column of another worksheet. I have a second
worksheet (example below) that contains two criteria columns, one with month
start date, the other with month end date. I'm trying to get a count of all
dates from the first worksheet that would be =the below start date AND <=
the below end date.

START OF MONTH END OF MONTH COUNT
4/1/2009 4/30/2009



All times are GMT +1. The time now is 02:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com