+ Reply to Thread
Results 1 to 6 of 6

Rounding up or down in Excel

Hybrid View

  1. #1
    Registered User
    Join Date
    11-29-2017
    Location
    newport
    MS-Off Ver
    MS Office 365
    Posts
    21

    Rounding up or down in Excel

    Hi everyone,

    I have created a spread sheet for employees to log flexible working hours. The problem we have is that they enter their time in in 08.00 format (24hr) and the following formula calculates the time of flexible hours banked.

    =TRUNC(P7/60)+(P7-TRUNC(P7/60)*60)/100)

    I have data validation set up within the time in / out boxes already which are to the 15 minute marks (ie 08.15, 08.30, 08.45 etc...) but what this means is that someone could foreseeably log 15 mins, 45 mins of flex etc... The rule our company has come up with is to only allow flex increments to 30 minutes or 1 hour (up to a max of 3 hours)

    So what I am trying to do is; if a person says they come in at 7:45am and then leaves at 5pm, this means they have worked an extra 15mins but because we only recognise 30 minute intervals, I want the flex sheet to read zero. conversely, if someone puts in 7:15am - 5pm, they would have 45 mins but I want it to round down to the nearest half hour.

    in addition to this, I want the daily maximum flex allowance to be capped at 3 hours

    Thanks all!

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Rounding up or down in Excel

    I think you need to add an attachment with a few representative lines to get an answer. it is unclear:
    • are the times entered as decimals
    • do shifts span midnight
    • what about lunch breaks

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    11-29-2017
    Location
    newport
    MS-Off Ver
    MS Office 365
    Posts
    21

    Re: Rounding up or down in Excel

    Hello, thank you for this.

    I have attached the document - does this work?

    EDIT - I believe it worked. to answer your questions

    1. times are entered using a drop down list box
    2. shifts do not span midnight
    3. people enter the time they go on lunch and the time they return
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Rounding up or down in Excel

    Tell us what results you want i a few cells in the sample, im not clear. In the sheet everything is perfect
    if I worked 7.30, 8.30, 8.15, 8.15, 8 in a week
    what should the results be for accum hours? 40.30
    diff hours? 0.30

    if so
    if I worked 7.15, 8.30, 8.15, 8.15, 8 in a week
    what should the results be for accum hours? 40.15
    diff hours? 0 even tho I worked 30 minutes over in a day?

    is it impossible to work 8.15 if I am behind with my hours to make it up?

    when is flexi applied, weekly or at the end of a timesheet?

  5. #5
    Registered User
    Join Date
    11-29-2017
    Location
    newport
    MS-Off Ver
    MS Office 365
    Posts
    21

    Re: Rounding up or down in Excel

    Hi Davsth, thanks for coming back to me.

    The sheet itself works perfectly fine but at the moment, people are able to enter a start time as 7:45am and then finish at say 5:00pm and the spreadsheet would register 15minutes of flexi time. The problem is, we only recognise flex increments of 30 minutes so in the above situation, I would want the flexi sheet to not give minutes, but to give 0 minutes. Conversely, if they were to work 7:15am - 5pm (thereby working an extra 45 minutes) I would only want to spreadsheet to recognise 30 minutes.

    Thank you again

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,048

    Re: Rounding up or down in Excel

    If I understand the question and spreadsheet correctly then I believe you could resolve both issues by making the following modification to the formula in cell M5 (and copying down):
    Formula: copy to clipboard
    =MIN(K5+L5-MOD(K5+L5,30)+(TRUNC(F5)*60+((F5-TRUNC(F5))*100)),660)

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. MROUND Rounding Issues (Rounding Down, Not Up)
    By roundandout in forum Outlook Formatting & Functions
    Replies: 4
    Last Post: 06-16-2015, 10:39 PM
  2. [SOLVED] Rounding problems using lookup instead of rounding functions
    By thnkfree in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-18-2014, 06:21 PM
  3. Excel not rounding up
    By Ladyrose722 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-05-2014, 01:28 PM
  4. Rounding in Excel
    By groleaujj in forum Excel General
    Replies: 2
    Last Post: 06-13-2011, 04:29 PM
  5. Rounding up in Excel
    By Jodie Fox in forum Excel General
    Replies: 2
    Last Post: 04-28-2008, 10:17 AM
  6. [SOLVED] rounding in excel
    By textile1 in forum Excel General
    Replies: 3
    Last Post: 04-20-2006, 12:15 PM
  7. [SOLVED] Rounding in Excel
    By DG in forum Excel General
    Replies: 1
    Last Post: 12-05-2005, 04:40 PM

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