Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reformat existing 4 digit number as hh:mm?

I have a column of 3 and 4 digit numbers. I would like to insert a colon :
to the immediate left of the 2 numbers on the far right of the cell. Is
there a way to do this easily?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Reformat existing 4 digit number as hh:mm?


Carol
if i read you correctly you need timeserials

add a temporary column..

if the last 2 digits are seconds then
with formula =TIMEVALUE(TEXT(B1,"00\:00\:00"))
if they are minutes then
with formula =TIMEVALUE(TEXT(B1,"00\:00"))

dragdown.. then copy /pastespecial values..





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Carol Wolfe wrote :

I have a column of 3 and 4 digit numbers. I would like to insert a
colon : to the immediate left of the 2 numbers on the far right of
the cell. Is there a way to do this easily?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reformat existing 4 digit number as hh:mm?

That didn't seem to work, here's a sample of what happened:

840 0.361111111
1213


I copied your formula into the cell in my temporary column

"keepITcool" wrote:


Carol
if i read you correctly you need timeserials

add a temporary column..

if the last 2 digits are seconds then
with formula =TIMEVALUE(TEXT(B1,"00\:00\:00"))
if they are minutes then
with formula =TIMEVALUE(TEXT(B1,"00\:00"))

dragdown.. then copy /pastespecial values..





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Carol Wolfe wrote :

I have a column of 3 and 4 digit numbers. I would like to insert a
colon : to the immediate left of the 2 numbers on the far right of
the cell. Is there a way to do this easily?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Reformat existing 4 digit number as hh:mm?


..3611 is the correct time serial..
you only need to format the new column to display the number as time.








--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Carol Wolfe wrote :

That didn't seem to work, here's a sample of what happened:

840 0.361111111
1213


I copied your formula into the cell in my temporary column

"keepITcool" wrote:


Carol
if i read you correctly you need timeserials

add a temporary column..

if the last 2 digits are seconds then
with formula =TIMEVALUE(TEXT(B1,"00\:00\:00"))
if they are minutes then
with formula =TIMEVALUE(TEXT(B1,"00\:00"))

dragdown.. then copy /pastespecial values..





--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam



Carol Wolfe wrote :

I have a column of 3 and 4 digit numbers. I would like to insert
a colon : to the immediate left of the 2 numbers on the far
right of the cell. Is there a way to do this easily?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Reformat existing 4 digit number as hh:mm?

If you don't want it to be an actual time that you can manipulate
mathematically then you can just use text functions

=IF(LEN(A2)=3, LEFT(A2, 1) & ":" & RIGHT(A2,2), LEFT(A2,2) & ":" &
RIGHT(A2,2))
Where the number is in Cell A2.

Cools function (without having tried it) is giving you the time, but it
needs to be re-foramtted. Select the cell with the formula and change the
format from general to Time... It should then look correct...

HTH


"Carol Wolfe" wrote:

I have a column of 3 and 4 digit numbers. I would like to insert a colon :
to the immediate left of the 2 numbers on the far right of the cell. Is
there a way to do this easily?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Reformat existing 4 digit number as hh:mm?

spreadsheet

if C6 is your number, then in another cell
=SUBSTITUTE(C6,RIGHT(C6,2),":" & RIGHT(C6,2))

VBA

Sub Adjust()
Dim cell As Range
Dim text As String
For Each cell In Range("A:A").SpecialCells(xlCellTypeConstants)
text = cell.Value
cell.Value = Replace(text, Right(text, 2), ":" & Right(text, 2))
Next
End Sub

"Carol Wolfe" wrote:

I have a column of 3 and 4 digit numbers. I would like to insert a colon :
to the immediate left of the 2 numbers on the far right of the cell. Is
there a way to do this easily?

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 reformat a 6-digit date to general & look the same? jean Excel Discussion (Misc queries) 0 September 12th 08 03:35 AM
How to validate a cell to insert from 9 digit number to 13 digit number. ramulu via OfficeKB.com Excel Worksheet Functions 1 February 21st 07 02:32 PM
How to validate a cell to insert from 9 digit number to 13 digit number. ramulu Excel Worksheet Functions 1 February 21st 07 10:00 AM
Color a single digit in a mult-digit number cell Phyllis Excel Discussion (Misc queries) 6 November 17th 05 12:46 AM
When we enter a 16 digit number (credit card) the last digit chan. ceking Excel Discussion (Misc queries) 5 December 8th 04 11:45 PM


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