SUBTRACTING TIME VALUES INSTEAD OF DECIMAL!!

L

Lexicon

Please help! I have used the 00:\00:\00 format to input times without having
to press the colon every time. Now though, when Excel tries to minus one time
from another, because of the custom format it only recognizes times as
numbers...

e.g. 12:15:30 - 12:14:50

Excel thinks this equals 00:00:80!!

Can anybody help? How do I get it to recognise that the answer is 00:01:20 ?
Thank you
 
B

Bob Phillips

See previous post .misc

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Brett

I have a question for you! How do you format a cell with :00:\00:\00? I tried
creating this custom number format myself, but excel wouldn't allow it.
 
B

Bob Phillips

It should be 00\:00\:00

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
L

Lexicon

Brett - You just typed the numbers in wrong on your posting - that's probably
why it didn't work for you!

In formatting, in custom, type in 00:\00:\00 and this should enable you to
input for example 123245 and it will convert automatically to 12:32:45

Niki
 
B

Brett

Thanks! I had no idea it was this simple. I've been looking for this solution
for a long time, but the closest I got was some really complicated VBA code I
found on some Excel website a while ago. I never did bother with the VBA
code, but this is great. Thanks again!
 
B

Bob Phillips

No actually you typed it wrong, Brett just copied your error, I had the same
problem <g>

Bob
 
B

Bob Phillips

Yeah, but the math on times now becomes much more complex as against

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Brett

How about:

=TIME(($B1-MOD($B1,10000))/10000,(MOD($B1,10000)-MOD($B1,100))/100,MOD($B1,100))-TIME(($A1-MOD($A1,10000))/10000,(MOD($A1,10000)-MOD($A1,100))/100,MOD($A1,100))

OR

=TIME(MID(TEXT($B1,"000000"),1,2),MID(TEXT($B1,"000000"),3,2),MID(TEXT($B1,"000000"),5,2))-TIME(MID(TEXT($A1,"000000"),1,2),MID(TEXT($A1,"000000"),3,2),MID(TEXT($A1,"000000"),5,2))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top