+ Reply to Thread
Results 1 to 7 of 7

Calculate Time Range In Single Cell

  1. #1
    Registered User
    Join Date
    05-10-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    Microsoft 365 Personal
    Posts
    4

    Calculate Time Range In Single Cell

    Hi all

    I'm hoping to work out how to count the number of hours within a single cell, for eg if cell A1 had "10.00 15.00" then cell A2 would have the number "5"
    Any help appreciated! I've been searching online so far to no avail.

    Thanks
    A

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Calculate Time Range In Single Cell

    Try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 10.00 15.00 5
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    05-10-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    Microsoft 365 Personal
    Posts
    4

    Re: Calculate Time Range In Single Cell

    Thanks so much AlKey!!!

  4. #4
    Registered User
    Join Date
    05-10-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    Microsoft 365 Personal
    Posts
    4

    Re: Calculate Time Range In Single Cell

    hmmmm only problem now is that half hours in the B1 cell display as .3 rather than .5, which isn't much good if I want to get a total number of hours for a number of these cells. Any thoughts?

    Many thanks

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Calculate Time Range In Single Cell

    I think it would better to convert decimals to real time
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and format cell as Custom, h:mm
    v A B
    1 10.00 15.00 5:00

  6. #6
    Registered User
    Join Date
    05-10-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    Microsoft 365 Personal
    Posts
    4

    Re: Calculate Time Range In Single Cell

    Thanks AlKey - both cells should be formatted as Custom, h:mm? Or just one of them please?
    I have 10.00 15.30 in cell A1 and am getting 5:18 in cell B1 rather than 5.50 as I would hope.

    (I note 0.18 is 0.30 of 60 so the problem is somewhere there I suppose)

    Thank you

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Calculate Time Range In Single Cell

    Ok, try this
    formula in B1 and format as Number
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 10.00 15.00 5.00
    2 10.00 15.30 5.50
    Or
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by AlKey; 05-11-2017 at 12:17 AM.

+ 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] Need to calculate variables for single time only
    By shiva_raj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2017, 02:13 AM
  2. Excel Formula to Calculate Time Span Between Different Time Range.
    By omershafiq2012 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-06-2015, 08:28 AM
  3. Replies: 4
    Last Post: 09-02-2014, 04:25 AM
  4. Replies: 9
    Last Post: 07-13-2014, 11:09 PM
  5. Calculate if Time range appears in an other Time range
    By bajdr47 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-25-2013, 02:50 AM
  6. calculate a single range macro
    By neodjandre in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2007, 12:51 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