Subtracting time in excel

I want to subtract time.
Cell C10 and C11 contains time .
CEll D10 contains C11 - C10

Ideally the answer should be  4 but i am getting some negative value .
Ramesh sharmaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


You are effectively subtracting 21 hours from 1 hour to get minus 20 hours.

Excel measures time as a fraction of a day (24 hours) so minus 20 hours = -20/24 = -0.833333....

To get four, you could just add 'one' to your answer = -0.8333 +1 = 0.166666

You can then display that as hours (HH:mm format for example) or multiply by 24 to go from days to hours:

0.166666 x 24 = 4 (hours)

See F10 and F11 in the attached for examples.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
or in cell D10, try apply formula such as:

=IF(C11<C10, TEXT((TODAY()+1+C11)-(TODAY()+C10),"h"),TEXT(C11-C10,"h"))

Open in new window

Wayne Taylor (webtubbs)Commented:
I provided you with the answer in your previous question -
Ramesh sharmaAuthor Commented:
@alan  formula you gave in excel file will work fine for all the negative values .
But what about the positive ones .
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Please try this...


Open in new window

and format the formula cell as General.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.