Subract Time

aliaslamy2k

Active Member
Joined
Sep 15, 2009
Messages
416
Office Version
  1. 2019
Platform
  1. Windows
Dear Experts,

How can I subract time ? below is an example i am trying but the result is just #######
I want to know how much time was consumed.

Formula used =B1-A1


A1B1Result
22:1002:39##############

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>


Rgds,
AB
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hello Mr Vog,

Nice to see you !

I am getting incorrect results, the problem is little confusing. I am analyzing the total delay time of the flights ( there are 100's of data)
the Actual time of Arrival minus Standard time of departure of other flight.

So the data will be fluctuating between yesterday and today, as some flights arrive on 21 dec and some on 22dec and same with departures
some will depart on 21st dec and some will depart on 22nd Dec



Actual Time of ArrivalStandard time of departureRESULTSSTATUS
02:3923:3520:56Incorrect result
02:3923:5021:11Incorrect result
02:3900:4022:01Incorrect result
01:0601:200:14ok
01:0601:200:14ok
01:0601:250:19ok
The time includes yesterday and today i.e 21dec12 & 22 Dec12

<tbody>
</tbody>
 
Upvote 0
I am a little confused over pattern of your Actual time of arrival and Standard time of departure
Can you post an input sample includind additional columns of Dates for ATA and STD, for me to understand and help you out

Also include the expected result
 
Last edited:
Upvote 0
Hi Norulen,

Please find below data. the result is in STD-ATA ( Schedule time of Departure - Actual Time of Arrival )

In Flt noIn Flt DateIn SectorSchedule Time Of ArrivalActual Time of ArrivalOut Flt noOut Flt DateOut SectorSchedule Time of DepartureActual Time of DepartureSTD-ATA
XX12312-21-2012TUN22:1002:39XX17212-20-2012MCT23:2523:253:14
XX12312-21-2012TUN22:1002:39XX72212-20-2012RUH23:2523:423:14
XX12312-21-2012TUN22:1002:39XX14812-20-2012KWI23:3523:293:04
XX12312-21-2012TUN22:1002:39XX14212-20-2012DXB23:5023:572:49
XX12312-21-2012TUN22:1002:39XX45412-21-2012SAH00:4000:401:59
XX12312-21-2012TUN22:1002:39XX58412-21-2012JNB01:0501:371:34
XX12312-21-2012TUN22:1002:39XX10212-21-2012DXB01:1001:211:29
XX12312-21-2012TUN22:1002:39XX88812-21-2012PVG01:1001:241:29
XX12312-21-2012TUN22:1002:39XX61412-21-2012BKK01:2001:491:19
XX12312-21-2012TUN22:1002:39XX61412-21-2012HAN01:2001:491:19
XX12312-21-2012TUN22:1002:39XX23412-21-2012DEL01:2501:291:14
XX12312-21-2012TUN22:1002:39XX15012-21-2012BAH01:3001:491:09
XX12312-21-2012TUN22:1002:39XX62412-21-2012HKT01:3002:221:09
XX12312-21-2012TUN22:1002:39XX62412-21-2012KUL01:3002:221:09
XX12312-21-2012TUN22:1002:39XX13812-21-2012KWI01:3501:361:04
XX12312-21-2012TUN22:1002:39XX71812-21-2012DMM01:3501:391:04
XX12312-21-2012TUN22:1002:39XX81212-21-2012HKG01:5001:530:49
XX12312-21-2012TUN22:1002:39XX89812-21-2012PEK02:0502:360:34
XX12312-21-2012TUN22:1002:39XX54612-21-2012JRO02:1002:100:29
XX12312-21-2012TUN22:1002:39XX64612-21-2012MNL02:1002:150:29
XX12312-21-2012TUN22:1002:39XX12012-21-2012AUH02:1502:130:24
XX12312-21-2012TUN22:1002:39XX67212-21-2012CGK02:2002:190:19
XX12312-21-2012TUN22:1002:39XX10412-21-2012DXB02:3502:340:04
XX45612-21-2012GRU22:5001:06XX14212-20-2012DXB23:5023:571:16
XX45612-21-2012GRU22:5001:06XX42012-20-2012BEY23:5500:021:11
XX45612-21-2012GRU22:5001:06XX03012-21-2012MEL00:5501:230:11
XX45612-21-2012GRU22:5001:06XX38012-21-2012MLE01:0001:150:06
XX45612-21-2012GRU22:5001:06XX48412-21-2012IKA01:0501:130:01
XX45612-21-2012GRU22:5001:06XX58412-21-2012JNB01:0501:370:01
XX45612-21-2012GRU22:5001:06XX84812-21-2012CKG01:0501:110:01
XX45612-21-2012GRU22:5001:06XX10212-21-2012DXB01:1001:2123:56
XX45612-21-2012GRU22:5001:06XX88812-21-2012PVG01:1001:2423:56
XX45612-21-2012GRU22:5001:06XX80212-21-2012KIX01:1501:2023:51
XX45612-21-2012GRU22:5001:06XX61412-21-2012BKK01:2001:4923:46
XX45612-21-2012GRU22:5001:06XX63812-21-2012SIN01:2002:1323:46

<tbody>
</tbody>


Current formula is =MOD(E2-I2,1), but if you see the below results it shows 23:56.... which is wrong. it should be somewhere around 2hrs 30min


Rgds,
AB
 
Last edited:
Upvote 0
Try this formula
=IF(G2=B2,E2-I2,E2+24-I2)
B2=In Flt Date
G2=Out Flt Date
E2=Actual Time of Arrival
I2=Schedule Time of Departure
 
Upvote 0
This seems to give the correct result. But there seems to be some error in the last five rows where Actual Time of Arrival is Before Scheduled Time of Departure. I wonder how the STD-ATA is arrived at. Do you mind explaining. Shouldn delay in this case be Zero?? If it has to be Zero then formula would be
=IF(G32=B32,IF(I32>E32,0,E32-I32),E32+24-I32)
 
Upvote 0
Hi Norulen,

The logic behind this is if Inbound flight XX456 is delayed it will misconnect the outbound flight which is XX102 because of the STD.
so I want to know the time difference between those. ( Positive & Negative both )

Many thanks, I got the correct answer for positive time range. but still I am getting ###### error on negative time :(

XX45612-21-2012GRU22:5001:06XX10212-21-2012DXB01:1001:21############
XX45612-21-2012GRU22:5001:06XX88812-21-2012PVG01:1001:24############
XX45612-21-2012GRU22:5001:06XX80212-21-2012KIX01:1501:20############
XX45612-21-2012GRU22:5001:06XX61412-21-2012BKK01:2001:49############
XX45612-21-2012GRU22:5001:06XX63812-21-2012SIN01:2002:13############

<tbody>
</tbody>



Many thanks in advance.


Rgds,
AB
 
Last edited:
Upvote 0
Can you tell me what is the result that you expect for these five rows and which formula are you using out of the two formulas i gave

Please explain the logic also for arriving the expected result
 
Last edited:
Upvote 0
I have completely understood you but just shooting in dark try this
=IF(G36=B36,IF(I36>E36,I36-E36,E36-I36),E36+24-I36)
 
Upvote 0

Forum statistics

Threads
1,215,749
Messages
6,126,661
Members
449,326
Latest member
asp123

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