+ Reply to Thread
Results 1 to 12 of 12

Forcing time to round to single decimal (flight calculator)

  1. #1
    Registered User
    Join Date
    05-02-2020
    Location
    noneya
    MS-Off Ver
    Excel 2016
    Posts
    7

    Question Forcing time to round to single decimal (flight calculator)

    I need to log flight time. I currently have it set so that I can enter a date and time 5/5/2020 and say 19:03 for take off and landing is 5/6/2020 at 04:23. Which results in 9.3 hours. 19:03 to 04:23 is 9 hours and 20 mins. I need it to say 9.4 (19-24 mins = 0.4 from chart below), not 9.3.

    I need to force the times into this format:

    1 to 6 = 0.1
    7 to 12 = 0.2
    13 to 18 = 0.3
    19 to 24 = 0.4
    25 to 30 = 0.5
    31 to 36 = 0.6
    37 to 42 = 0.7
    43 to 48 = 0.8
    49 to 54 = 0.9
    55 to 60 = 1

    This is slightly different that the way Excel calculates time. If I fly for 1 min, excel will see that as 0.01667 and rounds it to 0.0. But I need it to say 0.1 even for only 1 min of flight.

    I hope this makes sense and that I have provided enough detail. I feel that I am almost there, I just need a little boost to get to the end. Example is attached. Thank you for any help!
    Attached Files Attached Files
    Last edited by bmwflyboy; 05-02-2020 at 09:51 AM.

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

    Re: Forcing time to round to single decimal (flight calculator)

    Please try
    =CEILING((B3+B4-B1-B2)*24,0.1)

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Forcing time to round to single decimal (flight calculator)

    Welcome to the forum.

    Is this what you are after?

    =IF(ISBLANK(B4),"-",ROUND(((B3-B1)+(B4-B2)),2)*24)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    05-02-2020
    Location
    noneya
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: Forcing time to round to single decimal (flight calculator)

    Thank you. I did try it and it works well in the beginning. Once I get to 12 mins, it switches to 0.3 instead of staying at 0.2 though.

    I changed the dates to 5/5/2020 for takeoff and landing and the times to 19:00 take off and started working up the chart for landing time 19:01, 19:02...etc. When I get to 19:12 it changes to 0.3, but should remain 0.2.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Forcing time to round to single decimal (flight calculator)

    Excel has several rounding functions to handle a variety of rounding scenarios. In column E, you are using number formatting which uses the standard "round to the nearest" that we're all familiar with. It appears to me that you want to round up to the nearest 0.1 hour or 6 minutes. Excel can do this using either the ROUNDUP() function or the CEILING() function.
    ROUNDUP(decimal hours,1)
    CEILING(time serial number,TIME(0,6,0))
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Forcing time to round to single decimal (flight calculator)

    Quote Originally Posted by Bo_Ry View Post
    Please try
    =CEILING((B3+B4-B1-B2)*24,0.1)
    Nice and elegant, and it works for the example provided, but I am not sure it works in all cases, for instance it returns 9.4 for 09:18, which should be 9.3.

    My much klunkier suggestion

    =IF(B4="","-",INT((((B3+B4)-(B1+B2))*24*60)/60)+((INT(MOD(((B3+B4)-(B1+B2))*24*60,60)/6.1)+1)/10))

  7. #7
    Registered User
    Join Date
    05-02-2020
    Location
    noneya
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: Forcing time to round to single decimal (flight calculator)

    So far this klunky solution seems to work the best! I just tested everything for an hour of time, and then started expanding it over several hours. The only prob I found was trying to do a flight from 5/5/2020 19:00 to 5/6/2020 landing 19:00. This returns a result of 24.1 ha ha…
    Last edited by AliGW; 05-02-2020 at 09:45 AM. Reason: Please don't quote unnecessarily!

  8. #8
    Registered User
    Join Date
    05-02-2020
    Location
    noneya
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: Forcing time to round to single decimal (flight calculator)

    And I noticed one other thing, if I enter 19:00 for take off and 19:59 for landing on the same day, it returns a 1 hour. Should be 0.9. I am very grateful for the formulas and effort on this. Is there a way to get that last part correct? I don't understand the klunky formula so I am at your mercy. Thank you again.
    Last edited by AliGW; 05-02-2020 at 09:45 AM. Reason: Please don't quote unnecessarily!

  9. #9
    Registered User
    Join Date
    05-02-2020
    Location
    noneya
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: Forcing time to round to single decimal (flight calculator)

    I stand corrected. I was wrong on that last post. Sorry.

  10. #10
    Registered User
    Join Date
    05-02-2020
    Location
    noneya
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: Forcing time to round to single decimal (flight calculator)

    Thank you everyone I am marking this as SOLVED. Thanks Bob!

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

    Re: Forcing time to round to single decimal (flight calculator)

    How about this

    =ROUNDUP(MROUND(B3+B4-B1-B2,"0:1")*24,1)

  12. #12
    Registered User
    Join Date
    05-02-2020
    Location
    noneya
    MS-Off Ver
    Excel 2016
    Posts
    7

    Re: Forcing time to round to single decimal (flight calculator)

    Thank you Bo_Ry, that is a less klunky solution!

+ 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] Calculating Flight Time Per Crew Member
    By Raginginferno1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-02-2018, 04:41 AM
  2. Calculate Aircraft Parking Time but with same flight Registration
    By vba1234 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-04-2018, 05:23 PM
  3. Pilot trying to calcualte Night flight time
    By Hernie in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-12-2015, 03:12 PM
  4. How to pull airport flight time from web to excel?
    By andyaf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-02-2013, 09:44 AM
  5. 24 hour lookback - flight time tracker for pilots
    By KenBrown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-16-2012, 07:50 AM
  6. Replies: 2
    Last Post: 01-29-2007, 06:37 PM
  7. [SOLVED] How can I accumulate time in a flight log?
    By RossR in forum Excel General
    Replies: 1
    Last Post: 01-01-2006, 01:55 AM

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