number to time format when digit length varies

  • Thread starter Thread starter UM Win
  • Start date Start date
U

UM Win

I am struggling to convert following "number" format cells as 24 hrs "time"
format (hh:mm)

516
2306
637
202
2353
300
3
6

It should then appear as:
05:16
23:06
06:37
02:02
23:53
03:00
00:03
00:06

Any help will be a great relief.

Thanks/regards,
 
You can't use format to do this, you would need a formula (or a macro) and
help cells, then you can copy and paste as special over the old values, with
your value in A1

=(INT(A1/100)+MOD(A1,100)/60)/24

format as hh:mm

--
Regards,

Peo Sjoblom

(No private emails please)
 
It worked. Your kind help saved my day(s).

Thank you so much !

Regards,

UM Win
--
 
This does the same thing, but may be a bit more intuitive:

=TIME(INT(A1/100),MOD(A1,100),0)
 
Maybe but it will format AM and PM automatically while my formula will give
the option to the regional settings and if the time is more than 24 hours
like 2530 your formula will only return 01:30 even if it is formatted as
[hh]:mm

--
Regards,

Peo Sjoblom

(No private emails please)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top