+ Reply to Thread
Results 1 to 4 of 4

function:time calculation

  1. #1
    Registered User
    Join Date
    07-15-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Smile function:time calculation

    Hi all,

    I looked into many topics but my doubt still exists

    I need to calculate time according to working hours and working days (excluding sat and sun)
    The problem is we have no start date or end date the process continues.
    I have attached a sample sheet.
    Coloumn A= names
    Coloumn B=allotment time
    Coloumn C=estimated time where in only extra hours is entered so that coloumn D shows actual date and time.(after adding C with coloumn B).

    But this goes out of working hours some times like in example.

    I want to use some formula to get result as coloumn E
    i.e if the estimated time crosses 6 PM it takes next day in to account.
    start time=9:00 Am and end time 6:00PM
    Is this possible????
    Attached Files Attached Files

  2. #2
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    re: function:time calculation

    Put this formula in D2:

    =IF(MOD(B2,1)+C2>TIMEVALUE("6:00:00 PM"),(C2-(TIMEVALUE("6:00:00 PM")-MOD(B2,1))+(INT(B2)+1+TIMEVALUE("9:00:00 AM"))),B2+C2)


    Or, without the time values:

    =IF(MOD(B2,1)+C2>0.75,(C2-(0.75-MOD(B2,1))+(INT(B2)+1.375)),B2+C2)
    Last edited by JBeaucaire; 07-21-2011 at 04:44 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-15-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    re: function:time calculation

    Quote Originally Posted by JBeaucaire View Post
    Put this formula in D2:

    =IF(MOD(B2,1)+C2>TIMEVALUE("6:00:00 PM"),(C2-(TIMEVALUE("6:00:00 PM")-MOD(B2,1))+(INT(B2)+1+TIMEVALUE("9:00:00 AM"))),B2+C2)


    Or, without the time values:

    =IF(MOD(B2,1)+C2>0.75,(C2-(0.75-MOD(B2,1))+(INT(B2)+1.375)),B2+C2)
    thanks a lot..JBeaucaire

    just to know how can we reverse it??? in the sense columnD-B gives C??

  4. #4
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    re: function:time calculation

    In C2:

    =IF(INT(D2)>INT(B2),(MOD(D2,1)-0.375)+(0.75-MOD(B2,1)),D2-B2)

+ 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