View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Bryony Bryony is offline
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.