Then enter data like:
07:30
--
Gary''s Student - gsnu200860
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email
"fontana" <fon...@discussions.microsoft.com> wrote in message
news:38CDEEA6-C3BD-4B3B...@microsoft.com...
"Bernard Liengme" <blie...@stfx.ca> wrote in message
news:OkBTLq1G...@TK2MSFTNGP04.phx.gbl...
If you want to enter it without the colon and let Excel store it as a number
945 and then you want to go through the process of translating that number
to a time, you can produce formulae to do that if you want, but that's the
long way round.
The colon is the short way of doing it.
--
David Biddulph
"fontana" <fon...@discussions.microsoft.com> wrote in message
news:459109A7-CE9D-45B6...@microsoft.com...
"David Biddulph" <groups [at] biddulph.org.uk> wrote in message
news:4a82d92c$1...@glkas0286.greenlnk.net...
Although I fully agree with the remarks everyone has made about hte use of
":" for time, you can try to format the cells as "0000" (without the
quotes).
5 will be displayed as 0005
740 ... 0740
2355 ... 2355
As these are still numbers, calculations on it will not return an error.
Please let me know if this was of any help.
Wkr,
JP
"fontana" <fon...@discussions.microsoft.com> wrote in message
news:38CDEEA6-C3BD-4B3B...@microsoft.com...
Hence, as I said earlier, if you don't want to use Excel's methods of
calculating times, you'll have to write your own formulae to convert the
numbers to treat them as if they were times.
--
David Biddulph
See Chip Pearson's site for code.
http://www.cpearson.com/excel/DateTimeEntry.htm
Gord Dibben MS Excel MVP
Very good remark, tnx. I was too much fixed on the format and not enough on
the time system.
Fontana,
To sum military time, this is the best formula I could think of.
=--(SUM(LEFT(A1:A11;1)*--(LEN(A1:A11)=3))+SUM(LEFT(A1:A11;2)*--(LEN(A1:A11)=4))+INT(SUM(--RIGHT(A1:A11;2))/60)&MOD(SUM(--RIGHT(A1:A11;2));60))
Has to be entered with ctrl-shift-enter.
Although you see always 4 digits, the length of the cell varies from 1 to 4.
(SUM(LEFT(A1:A11;1)*--(LEN(A1:A11)=3)) sums the hours having 1 digit, e.g.
0740
SUM(LEFT(A1:A11;2)*--(LEN(A1:A11)=4)) sums the hours having 2 digits, e.g.
1710
INT(SUM(--RIGHT(A1:A11;2))/60) sums the minutes and convert it to hours
MOD(SUM(--RIGHT(A1:A11;2));60)) returns the sum of the minutes less then 1
hour
Use the & tho link the hours and minutes, the leading -- is to convert this
string back to a value.
Tested on the values below.
0740 07:40
1240 12:40
0530 05:30
0805 08:05
1710 17:10
1820 18:20
0006 00:06
1523 15:23
0933 09:33
0103 01:03
0023 00:23
9553 95:53
Wkr,
JP
"David Biddulph" <groups [at] biddulph.org.uk> wrote in message
news:Sb2dnQNqiqVZux7X...@bt.com...
"JP Ronse" <fb89...@skynet.be> wrote in message
news:%23iqd0PA...@TK2MSFTNGP03.phx.gbl...
Tnx, why and when is the "\" needed in the format string?
The help is not explaining this and it looks to me as an escape character as
frequently used in UNIX commands.
Wkr,
JP
"David Biddulph" <groups [at] biddulph.org.uk> wrote in message
news:4a83f46d$1...@glkas0286.greenlnk.net...
"JP Ronse" <fb89...@skynet.be> wrote in message
news:%23SO7$xAHKH...@TK2MSFTNGP02.phx.gbl...
Tnx for your explanation and the second example.
Wkr,
JP
"David Biddulph" <groups [at] biddulph.org.uk> wrote in message
news:4a840e8c$1...@glkas0286.greenlnk.net...
Hi David ,
In the above formula what are these 2 dashes for...."=--TEXT"
Regards
Neeraj
"Neeraj Gupta" <sandesh...@gmail.com> wrote in message
news:cbe69d7d-c110-464a...@y10g2000prf.googlegroups.com...