24hr time subtraction

DevinSutherland

New Member
Joined
Nov 2, 2015
Messages
11
I really need some help with this one!!!

I am trying to subtract 6hrs off of the Zulu time to equal the Local time , these are the times that I have below.
Its not a hard formula if the number stays above 0600 I am having a problem when the time has to switch back to 2300.

Zulu time Local time
1255 0655
2341 1741
0541 2341
1921 1321
0007 1807
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
here is what I get...
1255 -0600
2341 -0600
0541 2341
1921 -0600
0007 1807

it works great when it is less than 0600 but not for the others
 
Upvote 0
Given that your cells contain leading 0's, they're probably numbers stored as text.
So the > and/or < operations are invalid against those Text values.

Try

=IF(A1+0>1200,A1-600,A1+1800)
 
Upvote 0
Also, it's taking advantage of a mathematical coincidence because you're subtracting an exact hour value.
This type of structure would fail if you had to include any minutes or seconds

Here's how I'd do it.

=TEXT(MOD(TEXT(A2,"00\:00")-"6:00:00",1),"hhmm")
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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