+ Reply to Thread
Results 1 to 3 of 3

subtract dates to include start date

  1. #1
    Registered User
    Join Date
    08-25-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    2

    subtract dates to include start date

    HI,

    Basically, in my work, we work out holidays in weekly blocks, so if I put the start date as e.g. 25/8/10 and the end date as 31/8/10, I want to be able to subtract it so it gives 7 days, rather than 6, so I can divide the result by 7 to give its weekly value (1 week).

    I've got it to work by adding '+1' into the formula, but that's no use when some cells are blank as that would just leave the formula of 1/7 and give 0.143......, which then messes up the rest of my spreadsheet.

    Any ideas would be appreciated.

    Thanks.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: subtract dates to include start date

    What about this one

    =IF(COUNTA(A1:B1),B1-A1+1,0)

    Where A1 start date and B1 is end date
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Registered User
    Join Date
    08-25-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: subtract dates to include start date

    Thanks for your reply. That works ok if I want the number of holidays days, as it produces the result of '7' for days when there are holidays and no value when there is are no holidays, but when I want to convert that to a weekly value, by dividing by 7, it correctly gives the value of '1' for 7 days, but as you can't divide 7 by 0 I get the error message #DIV/0! when I fill the rest of the cells with the formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1