+ Reply to Thread
Results 1 to 2 of 2

Excel Function to calculate difference in time in same cell

  1. #1
    Registered User
    Join Date
    08-08-2007
    Posts
    1

    Excel Function to calculate difference in time in same cell

    What formula would I use to calculate the difference in time for same cell.

    A1: 7am-3pm
    B1: 7am-3pm
    C1: 1pm-6pm
    D1: 3pm-11pm
    E1: 3pm-7pm
    F1: OFF
    G1: OFF

    H1: Total hours scheduled to work

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Excel Function to calculate difference in time in same cell

    Wow.....You really didn't do yourself any favors by allowing inconsistencies in the data! You've got am's and pm's with and without preceding spaces.

    Please Login or Register  to view this content.
    Note_1: Format B1 as Time

    Note_2: there are some spaces in that formula, but ONLY within quotes AND preceeding an "a" and a "p".....so be careful.

    If there was some control over the input, for example if each cell followed this pattern:
    hh am/pm-hh am/pm

    Example: 07 am-11 pm

    Please Login or Register  to view this content.
    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

+ 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