PC Review


Reply
Thread Tools Rate Thread

delete spaces

 
 
=?Utf-8?B?YWJ1Z29saQ==?=
Guest
Posts: n/a
 
      26th Jun 2007
in my excel file there is a column of times in the format hh:mm:ss.
I want to convert it to decimal value (i.e. 02:15:30 will be 135.5 min.).
the problem is that every value starts end ends with spaces, and because of
that I can't use the functions hour(),minute(),second().
I can delete the spaces one by one, but it's a large file and a lot of work.
how can I delete the spaces ??
thanks a lot
--
abugoli
 
Reply With Quote
 
 
 
 
Naraine Ramkirath
Guest
Posts: n/a
 
      26th Jun 2007
use the trim function to remove the unwanted space
"abugoli" <(E-Mail Removed)> wrote in message
news:2678A7CE-12FF-4229-BEC2-(E-Mail Removed)...
> in my excel file there is a column of times in the format hh:mm:ss.
> I want to convert it to decimal value (i.e. 02:15:30 will be 135.5 min.).
> the problem is that every value starts end ends with spaces, and because

of
> that I can't use the functions hour(),minute(),second().
> I can delete the spaces one by one, but it's a large file and a lot of

work.
> how can I delete the spaces ??
> thanks a lot
> --
> abugoli



 
Reply With Quote
 
meh2030@gmail.com
Guest
Posts: n/a
 
      26th Jun 2007
On Jun 26, 12:38 pm, abugoli <a...@dalia.org.il> wrote:
> in my excel file there is a column of times in the format hh:mm:ss.
> I want to convert it to decimal value (i.e. 02:15:30 will be 135.5 min.).
> the problem is that every value starts end ends with spaces, and because of
> that I can't use the functions hour(),minute(),second().
> I can delete the spaces one by one, but it's a large file and a lot of work.
> how can I delete the spaces ??
> thanks a lot
> --
> abugoli


Look up the TRIM Function, it should do what you are looking for. If
you can't embed the hour function in the trim function (=TRIM(HOUR())
then you could do a TRIM, copy the values, do a paste special values,
and then use the HOUR, ect. Functions. If for what ever reason it
doesn't, then you can write a small macro to remove the spaces.

Matt

 
Reply With Quote
 
George Nicholson
Guest
Posts: n/a
 
      26th Jun 2007
-Create a new "Helper" column
- In the Helper Column, add the formula: = Trim(B2)
(Where B is the column you want to Trim spaces from)
- Replace the old B values with the results from the Helper (Copy &
PasteSpecial(Values))
- Delete the Helper column

or

Do both steps at once. To convert your existing data to minutes-as-decimal,
use this in your helper column instead:
=(HOUR(TRIM(B2))*60)+MINUTE(TRIM(B2))+(SECOND(TRIM(B2))/60)

HTH,

"abugoli" <(E-Mail Removed)> wrote in message
news:2678A7CE-12FF-4229-BEC2-(E-Mail Removed)...
> in my excel file there is a column of times in the format hh:mm:ss.
> I want to convert it to decimal value (i.e. 02:15:30 will be 135.5 min.).
> the problem is that every value starts end ends with spaces, and because
> of
> that I can't use the functions hour(),minute(),second().
> I can delete the spaces one by one, but it's a large file and a lot of
> work.
> how can I delete the spaces ??
> thanks a lot
> --
> abugoli



 
Reply With Quote
 
=?Utf-8?B?YWJ1Z29saQ==?=
Guest
Posts: n/a
 
      27th Jun 2007
Thank u G., for your complete solution
--
abugoli


"George Nicholson" wrote:

> -Create a new "Helper" column
> - In the Helper Column, add the formula: = Trim(B2)
> (Where B is the column you want to Trim spaces from)
> - Replace the old B values with the results from the Helper (Copy &
> PasteSpecial(Values))
> - Delete the Helper column
>
> or
>
> Do both steps at once. To convert your existing data to minutes-as-decimal,
> use this in your helper column instead:
> =(HOUR(TRIM(B2))*60)+MINUTE(TRIM(B2))+(SECOND(TRIM(B2))/60)
>
> HTH,
>
> "abugoli" <(E-Mail Removed)> wrote in message
> news:2678A7CE-12FF-4229-BEC2-(E-Mail Removed)...
> > in my excel file there is a column of times in the format hh:mm:ss.
> > I want to convert it to decimal value (i.e. 02:15:30 will be 135.5 min.).
> > the problem is that every value starts end ends with spaces, and because
> > of
> > that I can't use the functions hour(),minute(),second().
> > I can delete the spaces one by one, but it's a large file and a lot of
> > work.
> > how can I delete the spaces ??
> > thanks a lot
> > --
> > abugoli

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete spaces rexmann Microsoft Excel Misc 4 7th Mar 2008 02:38 PM
delete spaces lshavit Microsoft Excel Misc 0 23rd Sep 2004 04:21 PM
Delete Spaces Paul Microsoft Access VBA Modules 2 11th Jun 2004 08:56 PM
Delete Spaces Paul Microsoft Access 2 11th Jun 2004 08:56 PM
Delete Spaces Paul Microsoft Access Database Table Design 2 11th Jun 2004 08:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:17 PM.