+ Reply to Thread
Results 1 to 6 of 6

Time Formula

  1. #1
    Registered User
    Join Date
    11-24-2015
    Location
    Glasgow
    MS-Off Ver
    Office 2016
    Posts
    2

    Time Formula

    Hi

    New to Excel so still learning :-(

    I am trying to make a time card to keep track of hours worked., this is what i have so far

    time card.JPG

    In total hours i have =TEXT(E21-D21,"h:mm")

    what i need is a formula so that if total hours is less than 6, then subtract 15 minutes from total hours, if more than 6 subtract 30 minutes.

    I have =IF(F21<6,F21-0.25,F21-0.5) but it continues to give me a result of -0.15

    Using office 365 (office 16)

    many thanks

    John

  2. #2
    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
    53,050

    Re: Time Formula

    Hi, welcome to the forum
    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 formatted in a way that we recognize as a date. So, for instance, today (Tue Nov 2015) is actually 42332

    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, with that said, you need to test for 6/24 (or 0.25) and 15 mins =15/60/24

    Also, unless you need to ad some actual text, you should try and avoid using TEXT() to "convert" values - they become (surprise, surprise) text and are no longer values that can be directly used in future formulas
    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

  3. #3
    Registered User
    Join Date
    11-19-2015
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    22

    Re: Time Formula

    Hi John,

    Please find attached Spreadsheet with your example.

    I have entered the formula into cell F6, it subtracts 15 mins if worked less than 6 hrs, and 30 mins if worked 6 or more hours.

    I have also formatted the style of the date, so you can have a look.

    I have also added in the IsBlank and IsError functions, so that any days not worked, will show as blanks.

    Hope this is what you want.

    Regards,

    Sonia
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-19-2015
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    22

    Re: Time Formula

    Hi John,

    Sorry, I just noticed a mistake in the formula, it was subtracting 15 mins where it should have subtracted 30 mins. I have adjusted the formula now.

    Regards,

    Sonia
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-24-2015
    Location
    Glasgow
    MS-Off Ver
    Office 2016
    Posts
    2

    Re: Time Formula

    Hi Sonia

    Many many thanks for that

    exactly what i was looking for

  6. #6
    Registered User
    Join Date
    11-19-2015
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    22

    Re: Time Formula

    Your Welcome,

    Glad to be of help.

    Regards,

    Sonia

+ 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 fill C5 with a time that makes J5 equal 8 hours based on time put into B5
    By possumbarnes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-26-2015, 10:08 PM
  2. Replies: 3
    Last Post: 12-19-2013, 06:49 AM
  3. Replies: 5
    Last Post: 04-18-2013, 11:31 AM
  4. Formatting a total time entry and building a cumulative time formula.
    By TMc10 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-16-2012, 10:26 PM
  5. Formula for Calculating Paid Time Off for fiscal anniversary date real time
    By 168rockwood in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-07-2012, 04:15 PM
  6. Replies: 2
    Last Post: 04-27-2011, 08:21 AM
  7. [SOLVED] template or formula for start time -finish time -total hours ple
    By cc in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-27-2006, 01:10 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