+ Reply to Thread
Results 1 to 10 of 10

help with formula

  1. #1
    Registered User
    Join Date
    10-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    help with formula

    this is for a time sheet with 6.5 and 8.5 hour shifts
    now if A1 is 10:00:00am and A2 is 6:30:00pm i need B1 to be =A1+TIME(2,0,0) but if A1 is 10:00:00am and A2 is only 4:30:00pm i need B1 to be blank.
    Please if anyone knows this help

  2. #2
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: help with formula

    Try:

    =IF(A2="4:00.00pm", "", A1+TIME(2,0,0)

    Or maybe have a control cell with 4pm time, and say =IF(A2="ControlCellLocation", "", A1+TIME(2,0,0)

  3. #3
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: help with formula

    However, your limitation here is the trigger for the IF is exactly 4pm. If the person clocks in a 4:01 or 3:59, this will not work. It depends if it is entered (controlled) or live data.

  4. #4
    Registered User
    Join Date
    10-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: help with formula

    sorry i should have been clearer the times will change as its a rotational roster its the time variance of 6.5 or 8.5 that remain the constant. but i do thank you for your quick response

  5. #5
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: help with formula

    If that was the case, then I would have a calculation column for the hours worked, and set this to be =IF(CalcColumn="6.5", "", A1+TIME(2,0,0).

    Excel calculates dates in terms of days, so to get hours, subtract the information then multiply by 24 to convert to days. You could leave it in terms of days, but be aware of that if you expect to see 6.5 and you see .27

  6. #6
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: help with formula

    If you posted a sample sheet, it may help us figure out this a little faster.

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: help with formula

    szurkeshadow,

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  8. #8
    Registered User
    Join Date
    10-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: help with formula

    this is a rough out of it
















    time sheet 2.jpg

  9. #9
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: help with formula

    If you attach the spreadsheet I'd be more likely to help you out. No offense, but I don't want to retype all of that data. Could you just send the .xlsx?

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: help with formula

    szurkesshadow and jake.masters...

    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore Moderators' or Administrators' requests - note that this includes requests by senior members as well, if you are unclear about their request or instruction then send a private message to them asking for help. Do not post a reply to a thread where a moderator has requested an action that has not been complied with e.g Title change or Code tags...etc
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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