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

Hi, I've exported data from different software which only recognises integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4. I'd
be very grateful for your advice on how to convert integers to time, cheers.

  #2   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Convert integer to time query

try
=time(int(val/100),mod(val,100),0)
"Bryony" wrote:

Hi, I've exported data from different software which only recognises integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4. I'd
be very grateful for your advice on how to convert integers to time, cheers.

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

try:

=TIME(LEFT(D1,LEN(D1)-2),RIGHT(D1,2),0)

"Bryony" wrote:

Hi, I've exported data from different software which only recognises integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4. I'd
be very grateful for your advice on how to convert integers to time, cheers.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Convert integer to time query

Is 950 9:50 AM or 9:50 PM?

Assuming these "times" are based on a 24hr clock and are either 3 or 4
characters in length:

950 = 9:50 AM
2150 = 9:50 PM

=TIME(LEFT(A1,IF(LEN(A1)=3,1,2)),RIGHT(A1,2),0)

I'm also assuming that you might have entries like 0030 (12:30 AM) and these
entries are formatted as TEXT (otherwise, as a number, Excel doesn't see the
leading 0s).

Biff

"Bryony" wrote in message
...
Hi, I've exported data from different software which only recognises
integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4.
I'd
be very grateful for your advice on how to convert integers to time,
cheers.



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

You could use a formula like:
=--TEXT(A1,"00\:00\:00")
if 950 represents 0 hours, 9 minutes, 50 seconds

or
=--TEXT(A1,"00\:00")
if 950 is 9 hours, 50 minutes and 0 seconds.

Give the resulting formula a number format like:
hh:mm:ss
or whatever you want.



Bryony wrote:

Hi, I've exported data from different software which only recognises integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4. I'd
be very grateful for your advice on how to convert integers to time, cheers.


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Convert integer to time query

Try

=--(TEXT(A1,"00\:00"))

where A1 holds the values like 950 1000 etc, note that it is important that
you format the cell with the formula as time


--
Regards,

Peo Sjoblom


"Bryony" wrote in message
...
Hi, I've exported data from different software which only recognises
integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4.
I'd
be very grateful for your advice on how to convert integers to time,
cheers.



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Convert integer to time query

Thank you BJ, that's brilliant!

"bj" wrote:

try
=time(int(val/100),mod(val,100),0)
"Bryony" wrote:

Hi, I've exported data from different software which only recognises integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4. I'd
be very grateful for your advice on how to convert integers to time, cheers.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Convert integer to time query

Thanks Toppers, that's great.

"Toppers" wrote:

try:

=TIME(LEFT(D1,LEN(D1)-2),RIGHT(D1,2),0)

"Bryony" wrote:

Hi, I've exported data from different software which only recognises integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4. I'd
be very grateful for your advice on how to convert integers to time, cheers.

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Convert integer to time query

Thank you, this works too.

"T. Valko" wrote:

Is 950 9:50 AM or 9:50 PM?

Assuming these "times" are based on a 24hr clock and are either 3 or 4
characters in length:

950 = 9:50 AM
2150 = 9:50 PM

=TIME(LEFT(A1,IF(LEN(A1)=3,1,2)),RIGHT(A1,2),0)

I'm also assuming that you might have entries like 0030 (12:30 AM) and these
entries are formatted as TEXT (otherwise, as a number, Excel doesn't see the
leading 0s).

Biff

"Bryony" wrote in message
...
Hi, I've exported data from different software which only recognises
integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4.
I'd
be very grateful for your advice on how to convert integers to time,
cheers.




  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Convert integer to time query

Thanks Dave, that's brilliant.

"Dave Peterson" wrote:

You could use a formula like:
=--TEXT(A1,"00\:00\:00")
if 950 represents 0 hours, 9 minutes, 50 seconds

or
=--TEXT(A1,"00\:00")
if 950 is 9 hours, 50 minutes and 0 seconds.

Give the resulting formula a number format like:
hh:mm:ss
or whatever you want.



Bryony wrote:

Hi, I've exported data from different software which only recognises integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4. I'd
be very grateful for your advice on how to convert integers to time, cheers.


--

Dave Peterson



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Convert integer to time query

I am trying to insert these formulas as suggested, however it keep giving me
errors???

"Toppers" wrote:

try:

=TIME(LEFT(D1,LEN(D1)-2),RIGHT(D1,2),0)

"Bryony" wrote:

Hi, I've exported data from different software which only recognises integers
and now need to convert these values to time e.g. 950 to 09:50 and 1000 to
10:00. I've tried a few formulas with no success, the closest I got was
using left, right and mid functions but this doesn't seem to work for the
complete dataset as the number of characters switches between 3 and 4. I'd
be very grateful for your advice on how to convert integers to time, cheers.

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
How do I convert char into integer in Excel VBA? RaY Excel Discussion (Misc queries) 2 July 21st 06 05:40 AM
Convert Text to Integer jerredjohnson Excel Discussion (Misc queries) 4 June 14th 06 07:45 PM
convert time imported as text to time format for calculations batfish Excel Worksheet Functions 3 October 27th 05 11:24 PM
Convert time into integer Ali Excel Worksheet Functions 1 October 20th 05 02:52 PM
convert decimal number to time : convert 1,59 (minutes, dec) to m agenda9533 Excel Discussion (Misc queries) 8 January 20th 05 10:24 PM


All times are GMT +1. The time now is 05:03 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"