+ Reply to Thread
Results 1 to 7 of 7

Thread: how to find time diffrence d/w two dates

  1. #1
    Registered User
    Join Date
    03-15-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    2

    how to find time diffrence d/w two dates

    Hi All,
    Can any one provide solution for the follwing problem in excel.
    I have to compare time between two dates, we have to exclude saturdays & sundays
    and exclude non business hours. My business hours is 12:30 P.M to 23:30.

    Reference :
    From Date :1/31/11 3:17:01 PM (M/dd/yy)
    To Date : 2/7/11 3:57:31 PM (M/dd/yy)

    I need output in Hours, can any one help in this.

  2. #2
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: how to find time diffrence d/w two dates

    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: how to find time diffrence d/w two dates

    Perhaps:

    =(A2-A1)*24

    formatted as General gives total hours...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  4. #4
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: how to find time diffrence d/w two dates

    NBVC, that will just give the hours difference whereas as the OP wants to exlude Sat & Sun and just include the business hours stated.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  5. #5
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: how to find time diffrence d/w two dates

    I am still waking up.. I've only got one eye open...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  6. #6
    Registered User
    Join Date
    03-15-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: how to find time diffrence d/w two dates

    Hi,

    I tried this logic but it is not wroking.

    My crietia is if the starting time is less than 13:30, it has to count as 13:30
    if the Ending time is greater that 23:30 then it has to take end time as 13:30.

    can u help in this issue.
    It is good to provide macro or any good formula.


    Thanks in advance,

    Regards
    Komal Manohar

  7. #7
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: how to find time diffrence d/w two dates

    Which did you try? Please provide the formula or even better a sample workbook.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ 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.2.0