ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   count dates in excel (https://www.excelbanter.com/excel-discussion-misc-queries/15763-count-dates-excel.html)

skchth

count dates in excel
 
I am trying to count the days between 2 dates. Start date 01/01/01 and End
date 01/05/01 should return 5. However the Datediff function will return 4
because it doesn't count the start date. Adding "+1" to the Datediff function
does not work for me because when the cells with the start and end date are
empty the cell with the Datediff function must be empty.

Bob Phillips

=IF(OR(A1="",A2=""),"",A1-A2+1)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"skchth" wrote in message
...
I am trying to count the days between 2 dates. Start date 01/01/01 and

End
date 01/05/01 should return 5. However the Datediff function will return 4
because it doesn't count the start date. Adding "+1" to the Datediff

function
does not work for me because when the cells with the start and end date

are
empty the cell with the Datediff function must be empty.




tjtjjtjt

Is there a reason why COUNT won't work?

tj

"skchth" wrote:

I am trying to count the days between 2 dates. Start date 01/01/01 and End
date 01/05/01 should return 5. However the Datediff function will return 4
because it doesn't count the start date. Adding "+1" to the Datediff function
does not work for me because when the cells with the start and end date are
empty the cell with the Datediff function must be empty.


tjtjjtjt

Somehow I read your post as referring to a list of dates. Perhaps I should
read what's actually there instead. Sorry about that.

tj

"tjtjjtjt" wrote:

Is there a reason why COUNT won't work?

tj

"skchth" wrote:

I am trying to count the days between 2 dates. Start date 01/01/01 and End
date 01/05/01 should return 5. However the Datediff function will return 4
because it doesn't count the start date. Adding "+1" to the Datediff function
does not work for me because when the cells with the start and end date are
empty the cell with the Datediff function must be empty.


CLR

=IF(OR(A1="",B1=""),"",(B1-A1)+1)

Vaya con Dios,
Chuck, CABGx3


"skchth" wrote in message
...
I am trying to count the days between 2 dates. Start date 01/01/01 and

End
date 01/05/01 should return 5. However the Datediff function will return 4
because it doesn't count the start date. Adding "+1" to the Datediff

function
does not work for me because when the cells with the start and end date

are
empty the cell with the Datediff function must be empty.




skchth



"CLR" wrote:

=IF(OR(A1="",B1=""),"",(B1-A1)+1)

Vaya con Dios,
Chuck, CABGx3


"skchth" wrote in message
...
I am trying to count the days between 2 dates. Start date 01/01/01 and

End
date 01/05/01 should return 5. However the Datediff function will return 4
because it doesn't count the start date. Adding "+1" to the Datediff

function
does not work for me because when the cells with the start and end date

are
empty the cell with the Datediff function must be empty.


Thank you all so much. It works and you probably think "Of Course".

I would have never been able to figure it out without your help.

skchth


CLR

You're welcome, and thanks for the feedback. And, BTW, today one of us
helps you with something we can, and tomorrow you help someone else with
something you can.........the World gets better with each
experience..........

Vaya con Dios,
Chuck, CABGx3

"skchth" wrote in message
...


"CLR" wrote:

=IF(OR(A1="",B1=""),"",(B1-A1)+1)

Vaya con Dios,
Chuck, CABGx3


"skchth" wrote in message
...
I am trying to count the days between 2 dates. Start date 01/01/01

and
End
date 01/05/01 should return 5. However the Datediff function will

return 4
because it doesn't count the start date. Adding "+1" to the Datediff

function
does not work for me because when the cells with the start and end

date
are
empty the cell with the Datediff function must be empty.


Thank you all so much. It works and you probably think "Of Course".

I would have never been able to figure it out without your help.

skchth





All times are GMT +1. The time now is 10:24 PM.

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