Results 1 to 5 of 5

Calculate the difference in hours in a range

Threaded View

marduk87RP Calculate the difference in... 08-31-2020, 09:17 AM
Bernie Deitrick Re: Calculate the difference... 08-31-2020, 10:35 AM
marduk87RP Re: Calculate the difference... 08-31-2020, 10:52 AM
Tsjallie Re: Calculate the difference... 08-31-2020, 11:55 AM
Bernie Deitrick Re: Calculate the difference... 08-31-2020, 12:15 PM
  1. #1
    Registered User
    Join Date
    08-31-2020
    Location
    Forli,Italy
    MS-Off Ver
    2016
    Posts
    2

    Calculate the difference in hours in a range

    I have a situation like this:
    In one cell, I split the time ranges over several lines, for example
    07: 15-10: 27
    10: 35-11: 00
    11: 15-12: 27
    13: 15-13: 27
    14: 15-18: 27
    19: 15-20: 27
    21: 15-23: 39
    I know it would be more logical to have an hourly range divided over several lines, unfortunately I can't do otherwise ... I tried this formula:

    RIGHT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(0)*LEN($G8)+1;LEN($G8)));".";":");5)-LEFT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(0)*LEN($G8)+1;LEN($G8)));".";":");5)+(RIGHT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(1)*LEN($G8)+1;LEN($G8)));".";":");5)-LEFT(REPLACE(TRIM(MID(REPLACE($G8;CHAR(10);REPT(" ";LEN($G8)));(1)*LEN($G8)+1;LEN($G8)));".";":");5))

    But this formula only calculates the first row(To the eye the calculation is also wrong) and doesn't consider the others, is there a way, a formula to do this, calculate the time differences and then add the total, without having to write code in Visual Basic?
    Attached Files Attached Files
    Last edited by marduk87RP; 08-31-2020 at 09:19 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] how to calculate the difference between two dates&time within certain hours
    By Qhamzarul15 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 01-12-2020, 03:41 PM
  2. Formula to calculate difference of hours based on condiitons
    By saxena_mk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-14-2019, 11:35 AM
  3. Calculate hours difference excl weekends
    By DubX in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-18-2012, 09:21 AM
  4. Calculate the difference in hours between two dates?
    By Jonblomberg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-14-2011, 09:42 AM
  5. Replies: 1
    Last Post: 08-26-2005, 06:05 AM
  6. [SOLVED] calculate difference in time to hours
    By Chris in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-18-2005, 03:06 PM
  7. How do I calculate difference in days & hours between two dates e.
    By probi2 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2005, 12: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