+ Reply to Thread
Results 1 to 7 of 7

calculating time in 24hr clock with added conditions

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    calculating time in 24hr clock with added conditions

    Hello
    I have made a complicated formula (to me it's complicated anyway) made up from various formulas I have got from very helpful people on this site. I'm struggling with it now so I would be grateful for any help. (Worksheet attached)
    The worksheet is a pilots logbook, and column 'G' dictates which column the hours are logged e.g. If 'P1' or 'PIC' is entered into Column 'G' the the hours are recorded into Column 'L'
    If 'PUT' or 'P1/s' is in column 'G' the the time is put into column 'M'.
    That all works OK but if the flight is over-night for instance starts at 23:50 and ends at 01:50 all I get is ######## (please see worksheet). I have tried by coming up with this formula but it doesn't work and I'm sure someone will spot why. I apologise in advance, but I have tried to sort it out.

    =IF(OR(G7="P1",G7="PIC",)*J7="","",-(J7>K7)+K7-J7)

    If possible I woul also like to use the 24 hour clock by not having to put in the colons, I have read an interesting post on here where it advises to use 00\:00 as a custom format. This does work but getting it to add up is another problem

    Thanks very much, I hope you can help
    Attached Files Attached Files
    Last edited by nje; 07-25-2010 at 04:54 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,032

    Re: calculating time in 24hr clock with added conditions

    I must admit I don't quite understand but maybe this in L7:

    =IF(J7="", "", IF(OR(G7="P1",G7="PIC"), MOD(K7-J7,1)), "")
    Never use Merged Cells in Excel

  3. #3
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: calculating time in 24hr clock with added conditions

    Thanks ZBOR, is it my question you don't understand? I've tried your fomula but I can't get it twork but will keep trying in case I hav ecopied it down wrong. Thaks again

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,695

    Re: calculating time in 24hr clock with added conditions

    I think Zbor's suggestion should be like this

    =IF(J7="","",IF(OR(G7="P1",G7="PIC"),MOD(K7-J7,1),""))

    That assumes you have times in J7 and K7. If you want to type in just 2350 and 0700 without the colons then format as you suggested and use this version

    =IF(J7="","",IF(OR(G7="P1",G7="PIC"),MOD(TEXT(K7,"00\:00")-TEXT(J7,"00\:00"),1),""))

    to input the times you can omit leading zeroes so for 07:00 AM you can just input 700
    Audere est facere

  5. #5
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: calculating time in 24hr clock with added conditions

    Daddylonglegs - Thank you very much. It all works, I'm goig to use the the 24 hour clock without the colons as it seems to perform perfectly. I really appreciate your help. Can you foresee any problems using the the 24 hour clock this way, all I ever want it to do is just add to up, it isn't restricted to a certain number is it? as it might eventually have to count over a 1000 hours or more. I have checked your formula against ZBOR and the only difference that I could see was a space between the comma and the word MOD
    Last edited by nje; 07-25-2010 at 02:44 PM.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,695

    Re: calculating time in 24hr clock with added conditions

    What will be over 1000 hours? If you are summing columns L or M to get those sums then that won't be a problem - those result columns will still be in "real time" format.

  7. #7
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: calculating time in 24hr clock with added conditions

    Daddylonglegs - Thanks, the columns to be added are L & M and it would be those (including the grand total) that may go up to or over a 1000.

+ 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