HI,
I want the user to be able to type times without the :
In A1 is custom formatted as: 00\:00 and when typing 1234 it displays 12:34
So far so good especially because I don't want to use helper/adjacent cells.
Cell B1 is formatted as hh:mm and has 13:15 in it.
I want to calculate the time difference between A2 and A1 (expected 00:41)
=B1-A1 in cell C1 (formatted as hh:mm) won't give the correct answer - so I tried:
=INT(B1/100)/24+MOD(B1,100)/1440-INT(A1/100)/24-MOD(A1,100)/1440
which is OK but I wonder if there is any shorter formula to calculate the difference ?
Thanks, Elm
Last edited by ElmerS; 05-08-2010 at 06:29 AM.
Use the same principles as per the Custom Format
C1: =MOD(B1-TEXT(A1;"00\:00");1)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Thanks. Elm
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks