+ Reply to Thread
Results 1 to 4 of 4

Calculate number of days between 2 dates

Hybrid View

  1. #1
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Calculate number of days between 2 dates

    cell H1964 is date (cell format ddd, dd-mmm-yyyy)
    cell K1964 is date & time (cell format ddd, dd-mmm-yyyy h:mm AM/PM)

    cell H1964 = 4-Sep-2019
    cell K1964 = 4-Sep-2019 1:00 AM

    this formula gives me result -1 (I want result 0)
    =IFERROR(IF(ISBLANK($H1964),"",INT($H1964-K1964)),"")

    if I change time in cell K1964 to 12:00 AM, I get result 0,
    which is what I desire


  2. #2
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Calculate number of days between 2 dates

    You are calculation numbers of days which means it is zero. From 12 AM to 1 AM is zero only

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Calculate number of days between 2 dates

    4-Sep-2019 is just midnight of that day. so I expect probably best suited formula will be:
    Formula: copy to clipboard
    =IFERROR(IF(ISBLANK($H1964),"",INT($H1964)-INT(K1964)),"")
    Best Regards,

    Kaper

  4. #4
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Calculate number of days between 2 dates

    That works...thanks a lot

+ 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. Replies: 7
    Last Post: 12-27-2017, 09:57 AM
  2. Calculate number of days between 2 dates
    By DTYS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-28-2017, 06:01 AM
  3. Calculate number of days between two dates
    By alexlund in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-29-2014, 05:52 PM
  4. Calculate number of days between 2 dates & then assign a number based on the answer
    By MrHappyGoLucky12 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-27-2014, 09:20 PM
  5. Calculate number of days between dates
    By karl8695 in forum Excel General
    Replies: 1
    Last Post: 05-08-2012, 12:54 PM
  6. calculate number days between dates less Sat and Sun
    By maacmaac in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-26-2010, 11:09 AM
  7. calculate number of days btw dates
    By Nelson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-01-2006, 09:02 PM

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