+ Reply to Thread
Results 1 to 8 of 8

Subtraction of formula contained time cells

  1. #1
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Subtraction of formula contained time cells

    Dear Excel Master,
    I am working on a sheet with calculations of time, in which i want to sutract

    "RTG Deployed in Ops Hrs (E4-D4)"

    minus

    "RTG Not Available/BD in R4 with contain a formula i.e. "G4-F4+(G4<F4)*24)+(I4-H4+(I4<H4)*24)+(K4-J4+(K4<J4)*24)+(M4-L4+(M4<L4)*24)+(O4-N4+(O4<N4)*24)+(Q4-P4+(Q4<P4)*24)"

    and result should be reflect in "RTG Ops Available Hrs" in S4

    for example (format HH:MM) 07:00 - 03:40 = 3:20, i have updated this manulaly as

    Please help me to resolve the same.

    Thanks in advance.

    RavindraK
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Subtraction of formula contained time cells

    How do you get your expected answer from 08:00 - 20:00 as the Deplyed interval?? That is 12 hrs, not 7????
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,211

    Re: Subtraction of formula contained time cells

    I agree with Glenn and your times in d and E are formatted as text , F:Q are numbers

    r4 should be
    =IF(F4>G4,1,0)+G4-F4 +IF(H4>I4,1,0)+I4-H4+IF(J4>K4,1,0)+K4-J4+IF(L4>M4,1,0)+M4-L4+IF(N4>O4,1,0)+O4-N4+IF(P4>Q4,1,0)+Q4-P4

    s4

    if(d4>e4,1,0)+e4-d4-r4

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Subtraction of formula contained time cells

    Please try at R4

    =SUMPRODUCT(MOD(G4:Q4+1-F4:P4,1)*(F2:P2>0))

    S4
    =MOD(1+E4-D4,1)-R4

    How did you get 7:00?
    Last edited by Bo_Ry; 12-14-2018 at 06:12 AM.

  5. #5
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Subtraction of formula contained time cells

    Sorry,
    12:00 - 3:40 = 8:20

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Subtraction of formula contained time cells

    Please try

    R4
    =SUMPRODUCT(MOD(G4:Q4+1-F4:P4,1)*(F2:P2>0))

    S4
    =MOD(1+E4-D4,1)-R4

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,211

    Re: Subtraction of formula contained time cells

    Much better solution than mine Bo-Ry

  8. #8
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Subtraction of formula contained time cells

    Bo_Ry,
    Superb, Yes, it's working as expected, You are Charm !!!
    Thanks a lot.

    Thanks to davsth also.

    Ravindrak

+ 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] How to subtract Time Values contained in Labels on a userform - Time Elapsed Live Clock
    By deadeye_draken in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-18-2017, 06:44 AM
  2. IF statement involving time subtraction versus entered time data
    By JasonTran in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-08-2016, 11:43 AM
  3. [SOLVED] Looking for a formula for the subtraction of time in hh:mm:ss format
    By syncguy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-27-2015, 04:13 AM
  4. Time Subtraction Formula
    By bgates in forum Excel General
    Replies: 7
    Last Post: 11-28-2013, 08:06 AM
  5. Time Subtraction
    By realniceguy5000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2009, 01:56 PM
  6. Replies: 2
    Last Post: 09-15-2005, 08:05 PM
  7. subtraction with time format cells
    By Stefano in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2005, 12:06 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