SUMIF time between formula

jmw116

New Member
Joined
Dec 16, 2021
Messages
1
Platform
  1. Web
Hello all,

Not an excel person what so ever. I use excel for my pilot log book logging, the problem comes for night time logging.

My works software spits out in a CSV format file for me, and has departure date, take off time and landing time all in separate collums. What I need is something along the lines of
If cell A later than 2000 (8PM) than log difference between A+B until the cut off time 0700 (7AM). Or something along these lines. Please see below what it looks like outputted from the software. Obviously there is some slight error involved with the time change because both times are in local and not UTC but what would be a correct formula to caculate a total based on between times between the blocks?

DateA/C TypeTailOriginDestDepartArrivetotal
10/31/2021CRJN*****SHVDEN7:168:362.33


Option B would be to convert the local time to UTC time. Is there a way to make excel do that?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi Jmw116,

To convert times to UTC then you'd need a database of local time/UTC for each airport along with the dates they change for DST, if applicable. I'm sure there's proprietary software available to calculate this (and even account for local civil sunset and sunrise times) but I don' think Excel can do that for you.

Below I show a flight duration calculation. You only have departure date so there's a small wrinkle as the calculation needs to add a day to departure if arrival time is less than departure time (i.e. you landed the next day).

For the calculation of times between 8pm and 7am it gets trickier as it needs to figure out the date for the 8pm and for the 7am (e.g. if depart is 2am and arrive is 9am then the 8pm you want is the previous day).

Please note you'll probably need to specifically format result cells as Time, and if you include totals then you will need to format as Custom [hh:mm] as normal Time formats don't handle values over 24 hours.

JMW116.xlsx
AFGHIJ
1DateDepartArriveDurationDuration between 8pm and 7am
231-Oct-217:168:361:200:00
327-Nov-2119:2721:572:301:57
430-Nov-2119:3822:082:302:08
503-Dec-217:4922:1914:302:19
604-Dec-2120:0022:302:302:30
707-Dec-2120:112:005:495:49
810-Dec-2112:0014:302:300:00
913-Dec-210:112:412:302:30
1015-Dec-2112:2221:008:381:00
1116-Dec-217:1519:3012:150:00
1217-Dec-2118:006:3012:3010:30
13
14Totals67:3228:43
1st
Cell Formulas
RangeFormula
H2:H12H2=IF(G2<F2,(A2+1+G2)-(A2+F2),(A2+G2)-(A2+F2))
J2:J12J2=MAX(MIN(((IF(G2<F2,(A2+1+G2),(A2+G2)))),(IF(OR(G2<F2,F2>TIME(7,0,0)),A2+1+TIME(7,0,0),$A2+TIME(7,0,0))))-MAX((A2+F2),(IF(F2<TIME(7,0,0),A2-1+TIME(20,0,0),A2+TIME(20,0,0)))),0)
H14,J14H14=SUM(H2:H13)
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,582
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top