Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default convert text "20100315" to date format

Hi,

I have some data exported from a system, the date is a text displayed as
"20100315" which should read yyyymmdd. I need to convert this text to
another date format showing mm/dd/yyyy in text for importing into another
system. As the text format yyyymmdd does not contain any "/" or "-" so
using text to column will be a difficulty.

Please advise how could I handle this.

Thanks a lot.

Best Regards,
Terry

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 464
Default convert text "20100315" to date format

=TEXT(DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)),"mm-dd-yyyy")

and copy paste special-values.



--
Regards
Dave Hawley
www.ozgrid.com
"Terry0928" <u59143@uwe wrote in message news:a610c18eb8b14@uwe...
Hi,

I have some data exported from a system, the date is a text displayed as
"20100315" which should read yyyymmdd. I need to convert this text to
another date format showing mm/dd/yyyy in text for importing into another
system. As the text format yyyymmdd does not contain any "/" or "-" so
using text to column will be a difficulty.

Please advise how could I handle this.

Thanks a lot.

Best Regards,
Terry

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default convert text "20100315" to date format

Assume that you are having the data like the below:

A1 cell
20100315

Copy and paste the below formula in B1 Cell

=IF(A1="","",MID(TRIM(A1),5,2)&"/"&RIGHT(TRIM(A1),2)&"/"&LEFT(TRIM(A1),4))

Copy the B1 cell and paste it to the remaining cells of B Column based on
the A Column Data.
But the above formula will get you the Text Date instead of Real Date.

For getting the Real Date Use the below formula:-

=IF(A1="","",VALUE(RIGHT(TRIM(A1),2)&"/"&MID(TRIM(A1),5,2)&"/"&LEFT(TRIM(A1),4)))

Choose the desired date format from Format Cells.

Change the cell reference A1 in the above formula to your desired cell.

--
Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"Terry0928" wrote:

Hi,

I have some data exported from a system, the date is a text displayed as
"20100315" which should read yyyymmdd. I need to convert this text to
another date format showing mm/dd/yyyy in text for importing into another
system. As the text format yyyymmdd does not contain any "/" or "-" so
using text to column will be a difficulty.

Please advise how could I handle this.

Thanks a lot.

Best Regards,
Terry

.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default convert text "20100315" to date format

Assuming the dates are in range A1:A15 and you want to change them in their
cells WITHOUT the need for helper column - try to run a small VBA Macro:
---------------------
Sub CD()
For Each CL In [A1:A15]
CL.Value = "'" + Mid(CL, 5, 2) + "/" + Right(CL, 2) + "/" + Left(CL, 4)
Next
End Sub
-------------------
Micky


"Terry0928" wrote:

Hi,

I have some data exported from a system, the date is a text displayed as
"20100315" which should read yyyymmdd. I need to convert this text to
another date format showing mm/dd/yyyy in text for importing into another
system. As the text format yyyymmdd does not contain any "/" or "-" so
using text to column will be a difficulty.

Please advise how could I handle this.

Thanks a lot.

Best Regards,
Terry

.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default convert text "20100315" to date format

Ms-Exl-Learner wrote:
Assume that you are having the data like the below:

A1 cell
20100315

Copy and paste the below formula in B1 Cell

=IF(A1="","",MID(TRIM(A1),5,2)&"/"&RIGHT(TRIM(A1),2)&"/"&LEFT(TRIM(A1),4))

Copy the B1 cell and paste it to the remaining cells of B Column based on
the A Column Data.
But the above formula will get you the Text Date instead of Real Date.

For getting the Real Date Use the below formula:-

=IF(A1="","",VALUE(RIGHT(TRIM(A1),2)&"/"&MID(TRIM(A1),5,2)&"/"&LEFT(TRIM(A1),4)))

Choose the desired date format from Format Cells.

Change the cell reference A1 in the above formula to your desired cell.

Hi,

[quoted text clipped - 12 lines]

Hi Ms-Exl-Learner,


Thanks for your prompt response.

I tried to work the two formula on my data on cell with text "20100201"
I tried fomula =IF(AI2="","",MID(TRIM(AI2),5,2)&"/"&RIGHT(TRIM(AI2),2)
&"/"&LEFT(TRIM(AI2),4)), it returned 02/01/2010. It works

but when I tried to get the value with the fomula =IF(AI2="","",VALUE(RIGHT
(TRIM(AI2),2)&"/"&MID(TRIM(AI2),5,2)&"/"&LEFT(TRIM(AI2),4))), it returned
#VALUE!

I tried to change the fomate of the cell to a date formate but nothing
changed.

don't understand what is wrong.

Please advise.

Thanks Terry



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default convert text "20100315" to date format

ozgrid.com wrote:
=TEXT(DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)),"m m-dd-yyyy")

and copy paste special-values.

Hi,

[quoted text clipped - 10 lines]
Best Regards,
Terry


Thanks ozgrid.com
I tried and it works,
Thanks a lot.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default convert text "20100315" to date format

=--TEXT(A1,"0000\-00\-00") and format as date to suit.
--
David Biddulph


"Terry0928" <u59143@uwe wrote in message news:a610c18eb8b14@uwe...
Hi,

I have some data exported from a system, the date is a text displayed as
"20100315" which should read yyyymmdd. I need to convert this text to
another date format showing mm/dd/yyyy in text for importing into another
system. As the text format yyyymmdd does not contain any "/" or "-" so
using text to column will be a difficulty.

Please advise how could I handle this.

Thanks a lot.

Best Regards,
Terry


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default convert text "20100315" to date format

If I'm not mistaken - you have missed the important part [quote]:
....I need to convert this text to another date format showing mm/dd/yyyy !!!
IN TEXT !!! for importing into another system. [end quote]
Micky


"David Biddulph" wrote:

=--TEXT(A1,"0000\-00\-00") and format as date to suit.
--
David Biddulph


"Terry0928" <u59143@uwe wrote in message news:a610c18eb8b14@uwe...
Hi,

I have some data exported from a system, the date is a text displayed as
"20100315" which should read yyyymmdd. I need to convert this text to
another date format showing mm/dd/yyyy in text for importing into another
system. As the text format yyyymmdd does not contain any "/" or "-" so
using text to column will be a difficulty.

Please advise how could I handle this.

Thanks a lot.

Best Regards,
Terry


.

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default convert text "20100315" to date format

I had assumed that if the OP wanted it in text for exporting to another
system, he would do so by saving the Excel output as csv or another text
format. I guessed that he knew how to do that, and that his question was
the one he asked: how to "convert this text to another date format".
--
David Biddulph


"????? (????) ?????" <micky-a*at*tapuz.co.il wrote in message
...
If I'm not mistaken - you have missed the important part [quote]:
...I need to convert this text to another date format showing mm/dd/yyyy
!!!
IN TEXT !!! for importing into another system. [end quote]
Micky


"David Biddulph" wrote:

=--TEXT(A1,"0000\-00\-00") and format as date to suit.
--
David Biddulph


"Terry0928" <u59143@uwe wrote in message news:a610c18eb8b14@uwe...
Hi,

I have some data exported from a system, the date is a text displayed
as
"20100315" which should read yyyymmdd. I need to convert this text to
another date format showing mm/dd/yyyy in text for importing into
another
system. As the text format yyyymmdd does not contain any "/" or "-"
so
using text to column will be a difficulty.

Please advise how could I handle this.

Thanks a lot.

Best Regards,
Terry


.


  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default convert text "20100315" to date format

=TEXT(--TEXT(A1,"0000\-00\-00"),"mm/dd/yyyy")

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"מיכאל (מיקי) אבידן" <micky-a*at*tapuz.co.il wrote in message
...
If I'm not mistaken - you have missed the important part [quote]:
...I need to convert this text to another date format showing mm/dd/yyyy
!!!
IN TEXT !!! for importing into another system. [end quote]
Micky


"David Biddulph" wrote:

=--TEXT(A1,"0000\-00\-00") and format as date to suit.
--
David Biddulph


"Terry0928" <u59143@uwe wrote in message news:a610c18eb8b14@uwe...
Hi,

I have some data exported from a system, the date is a text displayed
as
"20100315" which should read yyyymmdd. I need to convert this text to
another date format showing mm/dd/yyyy in text for importing into
another
system. As the text format yyyymmdd does not contain any "/" or "-"
so
using text to column will be a difficulty.

Please advise how could I handle this.

Thanks a lot.

Best Regards,
Terry


.




  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default convert text "20100315" to date format

This is a "different" symphony and answers the OP question.
Micky


"Niek Otten" wrote:

=TEXT(--TEXT(A1,"0000\-00\-00"),"mm/dd/yyyy")

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"מיכאל (מיקי) אבידן" <micky-a*at*tapuz.co.il wrote in message
...
If I'm not mistaken - you have missed the important part [quote]:
...I need to convert this text to another date format showing mm/dd/yyyy
!!!
IN TEXT !!! for importing into another system. [end quote]
Micky


"David Biddulph" wrote:

=--TEXT(A1,"0000\-00\-00") and format as date to suit.
--
David Biddulph


"Terry0928" <u59143@uwe wrote in message news:a610c18eb8b14@uwe...
Hi,

I have some data exported from a system, the date is a text displayed
as
"20100315" which should read yyyymmdd. I need to convert this text to
another date format showing mm/dd/yyyy in text for importing into
another
system. As the text format yyyymmdd does not contain any "/" or "-"
so
using text to column will be a difficulty.

Please advise how could I handle this.

Thanks a lot.

Best Regards,
Terry


.


  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default convert text "20100315" to date format

If your System Date setting in Control Panel is MM-DD-YYYY then the below
formula will work fine.
=IF(A1="","",VALUE(MID(TRIM(A1),5,2)&"/"&RIGHT(TRIM(A1),2)&"/"&LEFT(TRIM(A1),4)))

If your System Date setting in Control Panel is DD-MM-YYYY then the below
formula will work fine.
=IF(A1="","",VALUE(RIGHT(TRIM(A1),2)&"/"&MID(TRIM(A1),5,2)&"/"&LEFT(TRIM(A1),4)))

To check your system Date Format:-
Run Type control.exeRegional and Language
OptionsCustomizeDateShort Date formatCheck whether it is DD-MM-YYYY
or MM-DD-YYYY
In Long Date Format Also. Use the formula based on your Control Panel Date
Setting.

--------------------
(Ms-Exl-Learner)
--------------------


"Terry0928" wrote:

Ms-Exl-Learner wrote:
Assume that you are having the data like the below:

A1 cell
20100315

Copy and paste the below formula in B1 Cell

=IF(A1="","",MID(TRIM(A1),5,2)&"/"&RIGHT(TRIM(A1),2)&"/"&LEFT(TRIM(A1),4))

Copy the B1 cell and paste it to the remaining cells of B Column based on
the A Column Data.
But the above formula will get you the Text Date instead of Real Date.

For getting the Real Date Use the below formula:-

=IF(A1="","",VALUE(RIGHT(TRIM(A1),2)&"/"&MID(TRIM(A1),5,2)&"/"&LEFT(TRIM(A1),4)))

Choose the desired date format from Format Cells.

Change the cell reference A1 in the above formula to your desired cell.

Hi,

[quoted text clipped - 12 lines]

Hi Ms-Exl-Learner,


Thanks for your prompt response.

I tried to work the two formula on my data on cell with text "20100201"
I tried fomula =IF(AI2="","",MID(TRIM(AI2),5,2)&"/"&RIGHT(TRIM(AI2),2)
&"/"&LEFT(TRIM(AI2),4)), it returned 02/01/2010. It works

but when I tried to get the value with the fomula =IF(AI2="","",VALUE(RIGHT
(TRIM(AI2),2)&"/"&MID(TRIM(AI2),5,2)&"/"&LEFT(TRIM(AI2),4))), it returned
#VALUE!

I tried to change the fomate of the cell to a date formate but nothing
changed.

don't understand what is wrong.

Please advise.

Thanks Terry

.

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
retain custom date format "text" when pasting or reformatting data frustrated worker Excel Discussion (Misc queries) 2 October 28th 09 06:03 PM
Convert numbers to date: "586" to read "May 1986" CEckels Excel Worksheet Functions 5 May 14th 09 04:46 PM
Convert WEEKNUM(date;2) to text "Monday 25th - Sunday 31st Oct" Orcababe Excel Discussion (Misc queries) 3 April 22nd 09 11:52 AM
how i convert "100" to "hundred"( number to text) in excel-2007 mohanraj Excel Worksheet Functions 1 May 11th 08 09:07 PM
Convert text "date" (DDMMMYY) to datetime value of YYYY-MM-DD - ho j.a. harriman Excel Discussion (Misc queries) 7 March 29th 07 01:20 AM


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