+ Reply to Thread
Results 1 to 5 of 5

Formula to Subtract Time if Over a Value

  1. #1
    Registered User
    Join Date
    08-26-2015
    Location
    Illinois
    MS-Off Ver
    Office 2013
    Posts
    2

    Formula to Subtract Time if Over a Value

    Hey there. I am a novice Excel user and I am basically making a spreadsheet to help manage employees hours at my job on campus. Basically the employees get a 30 minute unpaid break if they work over 6 hours. I have two columns, starting and ending time, both in the 12:00 AM format. I have a third column that I want to calculate the time between them. (Essentially OUT_TIME - IN_TIME). I want it to basically subtract 30 minutes if the shift is over 6 hours. So if someone works from 12:00 PM to 5:30 PM, the third column should display 5:30 (5 hours and 30 minutes), but if they work from 12:00 PM to 7:00 PM, I want it to show 6:30 (6 hours and 30 minutes) because of their unpaid break. How would I do this? I'm stuck.

    Thanks.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Formula to Subtract Time if Over a Value

    I'm sure there's a neater way to do this...

    =IF(B1-A1>TIMEVALUE("06:30:00"),TIMEVALUE("06:30:00"),B1-A1)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Formula to Subtract Time if Over a Value

    ...and this could be it

    =MIN(B1-A1,TIME(6,30,0))

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Formula to Subtract Time if Over a Value

    With A1: In, B1: Out time (A1 and B1 in a same day)

    =B1-A1-(B1-A1>6/24)*1/48
    Quang PT

  5. #5
    Registered User
    Join Date
    08-26-2015
    Location
    Illinois
    MS-Off Ver
    Office 2013
    Posts
    2
    Quote Originally Posted by bebo021999 View Post
    With A1: In, B1: Out time (A1 and B1 in a same day)

    =B1-A1-(B1-A1>6/24)*1/48
    I had to modify it to be greater than or equal to instead of greater than. It worked perfectly. Awesome. You guys are great!

+ 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. [SOLVED] Formula to subtract duration from fixed time
    By TopDog0310 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-22-2013, 04:19 PM
  2. [SOLVED] How to subtract time without entering colon and retain time format?
    By blmholland in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2013, 10:36 PM
  3. Need Formula to subtract Different date and time
    By Chobi in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-17-2013, 06:03 AM
  4. Replies: 2
    Last Post: 05-31-2013, 04:37 AM
  5. [SOLVED] Formula to subtract two time stamps
    By jiminic in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-13-2013, 11:04 PM
  6. Replies: 3
    Last Post: 02-22-2011, 01:53 PM
  7. formula to subtract time, 12:10 am (00:10) - 11:50 pm (23:10) ?
    By teezee in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-08-2006, 07:15 PM
  8. What formula is used to add or subtract minutes from a time in a .
    By Lucky Phil in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2005, 04:07 AM

Tags for this Thread

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