+ Reply to Thread
Results 1 to 5 of 5

Time calculation formula

  1. #1
    Registered User
    Join Date
    08-31-2012
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    4

    Time calculation formula

    Hello,
    I am trying to get formula which will help me to get the difference between two date and time. But the there is one condition that while calculation difference i need to calculate till particular time in one day and then after that calculation will start from next day.

    I guess below example will clear my question properly.

    Column A (Start date & time) Column B (End date & time) Column C (Available hours) Column D total time

    12/13/12 5:00 12/14/12 16:00 07:00 - 18:00


    So in above example i need calculate the difference in D column as per the given time i.e 07:00 - 18:00 which is in C column.

    Manually i calculate this as below.

    I will concider the start time from 12/13/12 07:00 hrs till 18:000. so it will be 11 hrs.

    Then again from 12/14/12 07:00 hrs till 16:00 hrs bcz end time is 16:00. so it will be 9 hrs.

    So my result will be 20 hrs in D column.



    Is it possible to do it with help of formula??

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Time calculation formula

    Not clear if you have to exclude weekends & public holidays etc but assuming not (per post) then:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    where A1 has start datetime and B1 end datetime

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Time calculation formula

    These might help..

    http://www.excelforum.com/excel-form...me-stamps.html
    http://www.excelforum.com/excel-form...-weekends.html
    http://www.ozgrid.com/forum/showthread.php?t=80540
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    08-31-2012
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Time calculation formula

    Thanks for the quick response....really appriciated....

    I have few more question here

    07:00 - 18:00 is just an example. It get change per incident. But whatever the time i need to refer is mentioned in C column.

    so can we make chanes in formula which will refer to time mentioned in C column instead of typing it manually everytime.

    Also in many cases we need to consider the time only for Mon to Fri, some time Mon to Sat and some time Mon to Sun.

    Your reply will be highly appriciated

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Time calculation formula

    Quote Originally Posted by mahesh8498
    07:00 - 18:00 is just an example. It get change per incident. But whatever the time i need to refer is mentioned in C column.
    In which case I would strongly advise you split "C" into two separate columns namely Start Time and End Time and reference accordingly.
    Note: you can use a delimited string, however, it will add needless complexity to your formula.

    Quote Originally Posted by mahesh8498
    Also in many cases we need to consider the time only for Mon to Fri, some time Mon to Sat and some time Mon to Sun.
    Please refer to the various threads provided by Ace_XL as these will cover most (if not all) of your various requirements.

    Failing that - search for related posts by daddylonglegs - widely regarded as the best in the world on this subject matter.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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