#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default editing numbers

I have imorted values from another program. Imported values are in
000:00 form (000 for hours and 00 for minutes). If there is less than
100 hours the value is still not treated as [h]:mm. For example:

029:15

How can I erase the first one or two zeros??

stremetzky

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default editing numbers

Make sure you don't have text. check for signgle quote att beginning of time.

"stremetzky" wrote:

I have imorted values from another program. Imported values are in
000:00 form (000 for hours and 00 for minutes). If there is less than
100 hours the value is still not treated as [h]:mm. For example:

029:15

How can I erase the first one or two zeros??

stremetzky


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default editing numbers

I think you'll find that it will default to text, without the need for a
single quote. A number of the normal tricks for converting to time won't
work.

If all else fails, try
=LEFT(A1,FIND(":",A1)-1)/24+RIGHT(A1,LEN(A1)-FIND(":",A1))/24/60
(or, if the number of characters is fixed, =LEFT(A1,3)/24+RIGHT(A1,2)/24/60)
and format as [h]:mm
--
David Biddulph

"Joel" wrote in message
...
Make sure you don't have text. check for signgle quote att beginning of
time.

"stremetzky" wrote:

I have imorted values from another program. Imported values are in
000:00 form (000 for hours and 00 for minutes). If there is less than
100 hours the value is still not treated as [h]:mm. For example:

029:15

How can I erase the first one or two zeros??

stremetzky




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default editing numbers

I think they want time, and got text instead. They need to convert from text
tto time.

"David Biddulph" wrote:

I think you'll find that it will default to text, without the need for a
single quote. A number of the normal tricks for converting to time won't
work.

If all else fails, try
=LEFT(A1,FIND(":",A1)-1)/24+RIGHT(A1,LEN(A1)-FIND(":",A1))/24/60
(or, if the number of characters is fixed, =LEFT(A1,3)/24+RIGHT(A1,2)/24/60)
and format as [h]:mm
--
David Biddulph

"Joel" wrote in message
...
Make sure you don't have text. check for signgle quote att beginning of
time.

"stremetzky" wrote:

I have imorted values from another program. Imported values are in
000:00 form (000 for hours and 00 for minutes). If there is less than
100 hours the value is still not treated as [h]:mm. For example:

029:15

How can I erase the first one or two zeros??

stremetzky





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default editing numbers

Can you suggest an easier way of converting 029:15 from text to time, Joel?
I feel there ought to be an easier way, but the usual ways don't seem to
work in this case.
--
David Biddulph

"Joel" wrote in message
...
I think they want time, and got text instead. They need to convert from
text
tto time.


"David Biddulph" wrote:

I think you'll find that it will default to text, without the need for a
single quote. A number of the normal tricks for converting to time won't
work.

If all else fails, try
=LEFT(A1,FIND(":",A1)-1)/24+RIGHT(A1,LEN(A1)-FIND(":",A1))/24/60
(or, if the number of characters is fixed,
=LEFT(A1,3)/24+RIGHT(A1,2)/24/60)
and format as [h]:mm
--
David Biddulph

"Joel" wrote in message
...
Make sure you don't have text. check for signgle quote att beginning
of
time.

"stremetzky" wrote:

I have imorted values from another program. Imported values are in
000:00 form (000 for hours and 00 for minutes). If there is less than
100 hours the value is still not treated as [h]:mm. For example:

029:15

How can I erase the first one or two zeros??

stremetzky









  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default editing numbers

Not sure if this is any better. the real problem is sttripping off leading
zeros

=TIMEVALUE(trimchar(E16,"0"))

wrote my own function to strip off leading zeroes

Function trimchar(MyString As String, MyChar As String) As String

trimchar = MyString
Do While Left(trimchar, 1) = MyChar
trimchar = Mid(trimchar, 2)
Loop
End Function



"David Biddulph" wrote:

Can you suggest an easier way of converting 029:15 from text to time, Joel?
I feel there ought to be an easier way, but the usual ways don't seem to
work in this case.
--
David Biddulph

"Joel" wrote in message
...
I think they want time, and got text instead. They need to convert from
text
tto time.


"David Biddulph" wrote:

I think you'll find that it will default to text, without the need for a
single quote. A number of the normal tricks for converting to time won't
work.

If all else fails, try
=LEFT(A1,FIND(":",A1)-1)/24+RIGHT(A1,LEN(A1)-FIND(":",A1))/24/60
(or, if the number of characters is fixed,
=LEFT(A1,3)/24+RIGHT(A1,2)/24/60)
and format as [h]:mm
--
David Biddulph

"Joel" wrote in message
...
Make sure you don't have text. check for signgle quote att beginning
of
time.

"stremetzky" wrote:

I have imorted values from another program. Imported values are in
000:00 form (000 for hours and 00 for minutes). If there is less than
100 hours the value is still not treated as [h]:mm. For example:

029:15

How can I erase the first one or two zeros??

stremetzky








  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default editing numbers

Not sure if this is any better. the real problem is sttripping off
leading
zeros

=TIMEVALUE(trimchar(E16,"0"))

wrote my own function to strip off leading zeroes

Function trimchar(MyString As String, MyChar As String) As String

trimchar = MyString
Do While Left(trimchar, 1) = MyChar
trimchar = Mid(trimchar, 2)
Loop
End Function


You can do this directly with worksheet formulas...

=TIMEVALUE(SUBSTITUTE(TRIM(SUBSTITUTE(C2,"0"," "))," ", "0"))

Rick

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default editing numbers

That seems to return 5:15, not 29:15 ?
--
David Biddulph

"Rick Rothstein (MVP - VB)" wrote in
message ...

You can do this directly with worksheet formulas...

=TIMEVALUE(SUBSTITUTE(TRIM(SUBSTITUTE(C2,"0"," "))," ", "0"))


Not sure if this is any better. the real problem is sttripping off
leading
zeros

=TIMEVALUE(trimchar(E16,"0"))

wrote my own function to strip off leading zeroes

Function trimchar(MyString As String, MyChar As String) As String

trimchar = MyString
Do While Left(trimchar, 1) = MyChar
trimchar = Mid(trimchar, 2)
Loop
End Function



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default editing numbers

I think it returns what Joel's formula returns, which is all I was trying to
do. HOWEVER, the formula I posted has a much bigger problem... it doesn't
handle trailing zeroes correctly... I would need a LTRIM function to do
that, but Excel does not have one. So, my entire post should be ignored.

Rick


"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
That seems to return 5:15, not 29:15 ?
--
David Biddulph

"Rick Rothstein (MVP - VB)" wrote in
message ...

You can do this directly with worksheet formulas...

=TIMEVALUE(SUBSTITUTE(TRIM(SUBSTITUTE(C2,"0"," "))," ", "0"))


Not sure if this is any better. the real problem is sttripping off
leading
zeros

=TIMEVALUE(trimchar(E16,"0"))

wrote my own function to strip off leading zeroes

Function trimchar(MyString As String, MyChar As String) As String

trimchar = MyString
Do While Left(trimchar, 1) = MyChar
trimchar = Mid(trimchar, 2)
Loop
End Function




  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default editing numbers

"David Biddulph" <groups [at] biddulph.org.uk wrote...
Can you suggest an easier way of converting 029:15 from text to
time, Joel?
I feel there ought to be an easier way, but the usual ways don't
seem to work in this case.

....

=LOOKUP(1E6,--MID(A1,{3;2;1},16))



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default editing numbers

That seems to return 5:15, not 29:15 ?
--

I think it returns what Joel's formula returns, which is all I was trying
to do. HOWEVER, the formula I posted has a much bigger problem... it
doesn't handle trailing zeroes correctly... I would need a LTRIM function
to do that, but Excel does not have one. So, my entire post should be
ignored.


Okay, first let me state that I am not entirely sure what final result the
OP was looking for; however, if all that is wanted is to return a text
string without leading zeroes (and which handles trailing zeroes
correctly<g), then I think this does that...

=SUBSTITUTE(TEXT(SUBSTITUTE(C2,":","."),"#.00"),". ",":")

Rick

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default editing numbers

On May 22, 4:02 am, Harlan Grove wrote:

=LOOKUP(1E6,--MID(A1,{3;2;1},16))


Very elegant, Harlan.

  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default editing numbers

I have got solution for it:

=LEFT(A1)/24*100+RIGHT(A1,5)

Thank you for help anyway,

stremetzky

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
Editing out numbers in a cell Aversin Excel Discussion (Misc queries) 5 April 13th 06 09:29 PM
Min Max Editing bkj8890 Excel Worksheet Functions 1 March 27th 06 08:52 PM
Min Max Editing bkj8890 Excel Discussion (Misc queries) 3 March 27th 06 05:45 PM
editing a name TUNGANA KURMA RAJU Excel Discussion (Misc queries) 2 October 18th 05 11:33 AM
Editing the name box TDS570 New Users to Excel 2 August 7th 05 06:12 PM


All times are GMT +1. The time now is 06:20 AM.

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

About Us

"It's about Microsoft Excel"