+ Reply to Thread
Results 1 to 5 of 5

looking to round values up

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Torrance, CA
    MS-Off Ver
    Excel 2013
    Posts
    75

    looking to round values up

    I'm creating a spreadsheet to track time in/time out from our lab; the problem I'm running into is when items are submitted prior to breaktime. I need to showcase that this is happening, so I can't round that value up.

    So...how can I round the value up in the cell that showcases the total time?

    It would be something like this: subtract Time In from Time out, but if Time In is between 11:30 & 12:00, round up Time In to 12:00.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: looking to round values up

    Time in=A2, Time out=B2

    =IF(AND(A2>=TIME(11,30,0),A2<=TIME(12,0,0)),B2-TIME(12,0,0),B2-A2)0

  3. #3
    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: looking to round values up

    What you need to understand about dates and times in excel is...

    a date is just a number representing the number of days passed since 1/1/900...and then formated in a way that we recognise as a date. So, for instance, today (Tue Jun 2015) is actually 42171

    Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75

    So, you just need to subtract that 30 mins from the total. 30 mins is 30/60/24
    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

  4. #4
    Registered User
    Join Date
    09-27-2012
    Location
    Torrance, CA
    MS-Off Ver
    Excel 2013
    Posts
    75

    Re: looking to round values up

    Thanks you two!

  5. #5
    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: looking to round values up

    Happy to help, thanks for the feedback

+ 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. Possible to round up values to set amounts?
    By Fred45 in forum Excel General
    Replies: 14
    Last Post: 04-01-2014, 09:51 PM
  2. Need to round UP to values from a table.
    By jomofro39 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2010, 11:06 AM
  3. Need to round to values from a table
    By jomofro39 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2010, 10:43 AM
  4. Formula to Round off Values
    By kamalthakur in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2010, 11:17 AM
  5. How to round values up
    By Vbort44 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-10-2008, 12:56 AM

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