+ Reply to Thread
Results 1 to 7 of 7

Calculate number of days including both days

  1. #1
    Registered User
    Join Date
    04-07-2020
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    45

    Calculate number of days including both days

    Hi,

    I am trying to calculate number of days in a date range.

    For eg: 1 September and 3 September. I am looking for 3 days. however when i apply datedif i just get difference between both the dates which is 2.

    Anybody can help to get 3 as output? since there is 1 sep, 2 sep and 3 sep in the range.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: Calculate number of days including both days

    Add 1 to the DATEDIF function =DATEDIF(Start,end,"d")+1

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,366

    Re: Calculate number of days including both days

    Yes:

    =DATEDIF(A1,B1,"d")+1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    04-07-2020
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    45

    Re: Calculate number of days including both days

    Thanks, But with this alternative, i get 1 in the blank cells , where there is no date entered ( if i extend the formulae in a bigger range)

    Is there any direct solution or formula for this??

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: Calculate number of days including both days

    As you have not defined which empty cell (start or end date) should be checked, the general formula is =IF(emptycell_ref="","",DATEDIF(Start,end,"d")+1 )

  6. #6
    Registered User
    Join Date
    04-07-2020
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    45

    Re: Calculate number of days including both days

    serves the purpose, thanks a ton

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: Calculate number of days including both days

    You're welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Storage Days - Calculate Days when i type a number in.
    By ExcelnoviceUK in forum Excel General
    Replies: 5
    Last Post: 05-04-2018, 08:09 AM
  2. [SOLVED] To calculate number of days including start date
    By gautham_p in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 05-11-2016, 10:47 AM
  3. [SOLVED] calculate total number of days between two days based on 365 days year
    By aparunkumar in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-14-2016, 12:51 AM
  4. Replies: 0
    Last Post: 06-11-2015, 03:12 AM
  5. Replies: 14
    Last Post: 04-06-2015, 09:19 PM
  6. [SOLVED] Calculate the number days between two user input days.
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2013, 10:44 PM
  7. [SOLVED] Calculate number of days between two days
    By hecgroups in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2012, 11:28 AM

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