ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Calculating total number of days (https://www.excelbanter.com/excel-worksheet-functions/192907-calculating-total-number-days.html)

mac56er

Calculating total number of days
 
I need to calculate the total number of days for a project. The spreadsheet
is set up to calculate the number of days for each month and then sum the
total of days. However, I cannot figure out the formula to calculate when
the beginning and end date is the same. For example, the projects ends on 1
Jun 08. The total number of days for June needs to be 1. Also, if a month
has no dates, the result should be 0. Any suggestions?

Storm

Calculating total number of days
 
Have you tried to nest the formula with an if statement? Where you would say
=if(a1=b1,1,if(isblank(b1),0,day(b1-a1)))

"mac56er" wrote:

I need to calculate the total number of days for a project. The spreadsheet
is set up to calculate the number of days for each month and then sum the
total of days. However, I cannot figure out the formula to calculate when
the beginning and end date is the same. For example, the projects ends on 1
Jun 08. The total number of days for June needs to be 1. Also, if a month
has no dates, the result should be 0. Any suggestions?


Roger Govier[_3_]

Calculating total number of days
 
Hi

In order to include the whole of the start day and the whole of the end day
in any calculation, you need to use
=enddate-startdate+1
With startdate in A1 and enddate in B1
Try
=IF(COUNT(A1:B1)<2,"",B1-A1+1)

--
Regards
Roger Govier

"mac56er" wrote in message
...
I need to calculate the total number of days for a project. The
spreadsheet
is set up to calculate the number of days for each month and then sum the
total of days. However, I cannot figure out the formula to calculate when
the beginning and end date is the same. For example, the projects ends on
1
Jun 08. The total number of days for June needs to be 1. Also, if a
month
has no dates, the result should be 0. Any suggestions?



mac56er

Calculating total number of days
 
Roger,

Thanks! It worked.

Van Matthews

"Roger Govier" wrote:

Hi

In order to include the whole of the start day and the whole of the end day
in any calculation, you need to use
=enddate-startdate+1
With startdate in A1 and enddate in B1
Try
=IF(COUNT(A1:B1)<2,"",B1-A1+1)

--
Regards
Roger Govier

"mac56er" wrote in message
...
I need to calculate the total number of days for a project. The
spreadsheet
is set up to calculate the number of days for each month and then sum the
total of days. However, I cannot figure out the formula to calculate when
the beginning and end date is the same. For example, the projects ends on
1
Jun 08. The total number of days for June needs to be 1. Also, if a
month
has no dates, the result should be 0. Any suggestions?





All times are GMT +1. The time now is 08:13 AM.

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