Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Convert number to time


Hi all,

I cannot figure out how to convert a number to time format (eg: 1340 to
13:40). I've tried following the directions 'here'
(http://www.exceltip.com/st/Convertin...Value/99.html),
but there seems to be an error in the IF statement (no logic check?). I
can't seem to fix it. Any help would be greatly appreciated.

Thanks in advance,
Nick


--
NCSemon
------------------------------------------------------------------------
NCSemon's Profile: http://www.excelforum.com/member.php...o&userid=35999
View this thread: http://www.excelforum.com/showthread...hreadid=557869

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,047
Default Convert number to time

Hi,

use:

=time(left(a1,2),rigth(a1,2),0)

hth
regards from Brazil
Marcelo

"NCSemon" escreveu:


Hi all,

I cannot figure out how to convert a number to time format (eg: 1340 to
13:40). I've tried following the directions 'here'
(http://www.exceltip.com/st/Convertin...Value/99.html),
but there seems to be an error in the IF statement (no logic check?). I
can't seem to fix it. Any help would be greatly appreciated.

Thanks in advance,
Nick


--
NCSemon
------------------------------------------------------------------------
NCSemon's Profile: http://www.excelforum.com/member.php...o&userid=35999
View this thread: http://www.excelforum.com/showthread...hreadid=557869


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 136
Default Convert number to time

Hi Nick,

There seems to be a typo in your link: A31000 should be A3<1000, I
think.

But I suggest to take:
=TIMEVALUE(LEFT(TEXT(A1,"#000"),LEN(TEXT(A1,"#000" ))-2)&":"&RIGHT(TEXT(A1,"#000"),2))

HTH,
Bernd

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Convert number to time

Nick,
There is an error in the example you looked at (a "<" missing in
the IF statement ...A31000 should be A3<1000).

The following works OK with cell formatted as hh:mm

=IF(A1<1000,TIMEVALUE(LEFT(A1,1)&":"&RIGHT(A1,2)), TIMEVALUE(LEFT(A1,2)&":"&RIGHT(A1,2)))

HTH

"NCSemon" wrote:


Hi all,

I cannot figure out how to convert a number to time format (eg: 1340 to
13:40). I've tried following the directions 'here'
(http://www.exceltip.com/st/Convertin...Value/99.html),
but there seems to be an error in the IF statement (no logic check?). I
can't seem to fix it. Any help would be greatly appreciated.

Thanks in advance,
Nick


--
NCSemon
------------------------------------------------------------------------
NCSemon's Profile: http://www.excelforum.com/member.php...o&userid=35999
View this thread: http://www.excelforum.com/showthread...hreadid=557869


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Convert number to time

Some mo
13 minutes 40 seconds returned from 1340???
=--TEXT(A1,"00\:00\:00")

13 hours 40 minutes 0 seconds???
=--TEXT(A1,"00\:00\:\0\0")

Format either as time.


NCSemon wrote:

Hi all,

I cannot figure out how to convert a number to time format (eg: 1340 to
13:40). I've tried following the directions 'here'
(http://www.exceltip.com/st/Convertin...Value/99.html),
but there seems to be an error in the IF statement (no logic check?). I
can't seem to fix it. Any help would be greatly appreciated.

Thanks in advance,
Nick

--
NCSemon
------------------------------------------------------------------------
NCSemon's Profile: http://www.excelforum.com/member.php...o&userid=35999
View this thread: http://www.excelforum.com/showthread...hreadid=557869


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Convert number to time


Thanks, all!

Dave: Your suggestion (for hh/mm/ss) worked great.

Marcelo and Toppers: Had some problems with yours returning odd values
for some times in the 00 hour range, but Dave's equation took care of
it. I'll provide you examples if you're terribly interested, but I
appreciate your help either way.

Thanks again!


--
NCSemon
------------------------------------------------------------------------
NCSemon's Profile: http://www.excelforum.com/member.php...o&userid=35999
View this thread: http://www.excelforum.com/showthread...hreadid=557869

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling Data off Web - Need Function Help patfergie44 Excel Worksheet Functions 9 June 22nd 06 03:27 AM
how do I convert a general number to a time format? doveness Excel Worksheet Functions 6 May 26th 06 12:39 AM
Convert a number to a time Jack Excel Discussion (Misc queries) 4 January 19th 06 09:08 AM
convert number to time format? JLHORMAN Excel Discussion (Misc queries) 1 May 26th 05 06:38 PM
how do i convert a number into minutes for a time of completion c. dhelmers Excel Discussion (Misc queries) 2 January 29th 05 08:49 AM


All times are GMT +1. The time now is 11:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"