+ Reply to Thread
Results 1 to 5 of 5

Single cell time entry formula?

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question Single cell time entry formula?

    Hi, my boss wants me to type up a spreadsheet using for hours worked in a day (minus lunch breaks of 30-60 minutes), but wants it done in a single cell with the total amount of hours worked displayed in the cell below it. Is there an equation/formula for this? Thanks! I've included a jpeg to show what I mean.

    untitled.JPG

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,794

    Re: Single cell time entry formula?

    I wish people would not post jpegs - all you can do with them is look at them - why not post a workbook?

    Anyway, it looks like B9 is the first cell where you have some "time ranges" above, so you can try out this formula in B9:

    =IF(or(B8="In",B8="off",B8=""),"",(--(right(B8,len(B8)-search("-",B8))&":00")+0.5-(left(B8,search("-",B8)-1)&":00"))*24)

    That should give you 9.25 hours, but it is not clear how much time should be subtracted for lunch.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-04-2012
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Single cell time entry formula?

    Thank you Pete, my experience with Excel is still fairly limited though so a jpeg was the quickest way for me to visualize what I had going on. The formula worked too, just have to plug in the rest of the cells, thanks again, cheers!

  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: Single cell time entry formula?

    couldnt agree more Pete, maybe you should have posted a pic of your solution?
    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 Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,794

    Re: Single cell time entry formula?

    Quote Originally Posted by FDibbins View Post
    couldnt agree more Pete, maybe you should have posted a pic of your solution?
    HeHe - I'll have to remember that in the future !! You've also reminded me about the thread in the Water Cooler about this from some time back.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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