+ Reply to Thread
Results 1 to 7 of 7

Count Number of Hours based on time

  1. #1
    Registered User
    Join Date
    05-22-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    47

    Question Count Number of Hours based on time

    Hi All!

    Would like to seek help in counting the total hours based on the Time In and Out of an employee


    Example

    If cell A1 is time in = 10:00 AM
    If cell B1 is time in = 07:00 PM


    then I need a formula that will show a result of 09:00
    Last edited by Locust; 10-17-2013 at 04:38 PM.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Count Number of Hours based on time

    Isnt' B1 07:00 PM? if so use

    =B1-A1

    format as h:mm
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    05-22-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Count Number of Hours based on time

    Yeah, it should be 7:00 pm, my apologies for the typo.

    But if the Start time is 10pm while the end time is at 7am?

  4. #4
    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,946

    Re: Count Number of Hours based on time

    If cell A1 is time in = 10:00 AM
    If cell B1 is time in = 07:00 PM
    Try this...
    =1-A1-B1

    edit: wrap it in an IF statement...
    =IF(B17<B16,1-B16+B17,B17-B16)
    Last edited by FDibbins; 10-17-2013 at 05:19 PM.
    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

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count Number of Hours based on time

    I think that this is what you are looking for:

    A1=10:00 PM
    B1= 7:00 AM


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Count Number of Hours based on time

    hi Locust. another alternative:
    =MOD(B1-A1,1)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  7. #7
    Registered User
    Join Date
    05-22-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Count Number of Hours based on time

    Thanks you guys!

+ 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] Timesheet that calcs time in, time out, lunch used, reg hours, ot hours, double hours
    By noobface in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-21-2021, 03:45 AM
  2. Replies: 21
    Last Post: 11-30-2012, 07:28 PM
  3. Calculating END time based on start time, breaks, and hours to complete
    By sweedey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2012, 11:29 AM
  4. Count hours (time) between four time criteria
    By adhide in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 08-25-2009, 07:43 PM
  5. [SOLVED] count TIME that is GREATER than 24 hours
    By JonPilot in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-31-2005, 07:06 PM

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