A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Trim function



 
 
Thread Tools Display Modes
  #1  
Old February 14th, 2009, 03:17 PM posted to microsoft.public.excel.newusers
exalan
external usenet poster
 
Posts: 31
Default Trim function

In cell A2, I use the trim function to trim cell A1 containing a date eg
1202/09, the result in A2 is 39856. However, this 39856 is text and not date
value. I therefore cannot convert it back to date after the trimming. Can
someone please help? Many thanks...
--
exalan
  #2  
Old February 14th, 2009, 03:24 PM posted to microsoft.public.excel.newusers
Gary''s Student
external usenet poster
 
Posts: 7,584
Default Trim function

Just format the cell as date to display:
2/12/2009

--
Gary''s Student - gsnu200833
  #3  
Old February 14th, 2009, 03:50 PM posted to microsoft.public.excel.newusers
joeu2004
external usenet poster
 
Posts: 1,748
Default Trim function

On Feb 14, 7:17*am, exalan wrote:
In cell A2, I use the trim function to trim cell
A1 containing a date eg 1202/09, the result in A2
is 39856. However, this 39856 is text and not date
value. I therefore cannot convert it back to date
after the trimming. Can someone please help?


=value(trim(A1))

should do the trick. You still might need to explicitly format the
cell as Date. (But it worked for me without that when I did that in a
virgin cell.)
  #4  
Old February 14th, 2009, 04:23 PM posted to microsoft.public.excel.newusers
mdmackillop[_16_]
external usenet poster
 
Posts: 1
Default Trim function


Try
=--TRIM(A1)


--
mdmackillop
------------------------------------------------------------------------
mdmackillop's Profile: http://www.thecodecage.com/forumz/member.php?userid=113
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=64437

  #5  
Old February 14th, 2009, 04:41 PM posted to microsoft.public.excel.newusers
exalan
external usenet poster
 
Posts: 31
Default Trim function

Million thanks to Gary"s Student, joeu2004 and mdmackilop for their prompt
response. I've got it!
--
exalan


"mdmackillop" wrote:


Try
=--TRIM(A1)


--
mdmackillop
------------------------------------------------------------------------
mdmackillop's Profile: http://www.thecodecage.com/forumz/member.php?userid=113
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=64437


  #6  
Old February 14th, 2009, 07:59 PM posted to microsoft.public.excel.newusers
Shane Devenshire[_3_]
external usenet poster
 
Posts: 3,333
Default Trim function

Hi,

I know your problem has been solved, but I do have two questions -
1. why are you entering dates 1202/09 (Excel will not treat these as dates)
it should be 12/02/09
2. what is the purpose of using TRIM? It is designed to remove leading and
trailing spaces plus any extra spaces in between words. If you have a date
in A1 then TRIM really does nothing.
3. If on the other hand 12/02/09 is text then rather than use =--TRIM(A1)
just use =--A1 and format the cell accordingly.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"exalan" wrote:

In cell A2, I use the trim function to trim cell A1 containing a date eg
1202/09, the result in A2 is 39856. However, this 39856 is text and not date
value. I therefore cannot convert it back to date after the trimming. Can
someone please help? Many thanks...
--
exalan

  #7  
Old February 16th, 2009, 04:21 AM posted to microsoft.public.excel.newusers
exalan
external usenet poster
 
Posts: 31
Default Trim function

Hello Shana, responded yesterday but not sure why not yet posted, hence this
repeated reply below:

Yes, I've simplified the question because I know the result is the same.

My real case is: I've donwloaded some data from "Pro Alpha" ESR system and
done the "text to column" and "trim" routines. The date columns after "trim"
all become text and I need to make use of the dates to continue my data
analysis.

Anyway, your advice on no.3 is helpful to me. Thanks
--
exalan


"Shane Devenshire" wrote:

Hi,

I know your problem has been solved, but I do have two questions -
1. why are you entering dates 1202/09 (Excel will not treat these as dates)
it should be 12/02/09
2. what is the purpose of using TRIM? It is designed to remove leading and
trailing spaces plus any extra spaces in between words. If you have a date
in A1 then TRIM really does nothing.
3. If on the other hand 12/02/09 is text then rather than use =--TRIM(A1)
just use =--A1 and format the cell accordingly.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"exalan" wrote:

In cell A2, I use the trim function to trim cell A1 containing a date eg
1202/09, the result in A2 is 39856. However, this 39856 is text and not date
value. I therefore cannot convert it back to date after the trimming. Can
someone please help? Many thanks...
--
exalan

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.