Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Change format of a date field

I have been given a csv file - on opening in excel the dates are in the
format 25051917, 5051949, 23121979 etc.
I have been struggling to get them into the standard date format - in this
case 25/05/1917, 05/05/1949, 23/12/1979 etc. Any help appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default Change format of a date field

suppose u have value in cell A1 then put this formula in B1

=IF(LEN(A1)=8,LEFT(A1,2)&"/"&MID(A1,3,2)&"/"&RIGHT(A1,4),LEFT(A1,1)
&"/"&MID(A1,2,2)&"/"&RIGHT(A1,4))


On Nov 12, 2:02*pm, Sageman wrote:
I have been given a csv file - on opening in excel the dates are in the
format 25051917, *5051949, 23121979 *etc.
I have been struggling to get them into the standard date format - in this
case 25/05/1917, 05/05/1949, 23/12/1979 etc. *Any help appreciated.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Change format of a date field

Brilliant - works a treat - Thanks very much.

"muddan madhu" wrote:

suppose u have value in cell A1 then put this formula in B1

=IF(LEN(A1)=8,LEFT(A1,2)&"/"&MID(A1,3,2)&"/"&RIGHT(A1,4),LEFT(A1,1)
&"/"&MID(A1,2,2)&"/"&RIGHT(A1,4))


On Nov 12, 2:02 pm, Sageman wrote:
I have been given a csv file - on opening in excel the dates are in the
format 25051917, 5051949, 23121979 etc.
I have been struggling to get them into the standard date format - in this
case 25/05/1917, 05/05/1949, 23/12/1979 etc. Any help appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Change format of a date field

Hi,

You can also try this. Highlight the range and go to Data Text to
columns. While on Delimited, click on next twice and then select Date in
Column Date format. Select DMY in the drop down and select any blank cell
in destination. Click on Finish. This should get the dates in the required
format. Please note that this will not give you the correct result for
5051949. To make this work, you will have to precede 5051949 with
05051949.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Sageman" wrote in message
...
I have been given a csv file - on opening in excel the dates are in the
format 25051917, 5051949, 23121979 etc.
I have been struggling to get them into the standard date format - in this
case 25/05/1917, 05/05/1949, 23/12/1979 etc. Any help appreciated.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 53
Default Change format of a date field

A slightly different answer from me:

you can use:

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),MID(A1,3,2),LEFT(A1 ,2)),DATE(RIGHT(A1,4),MID(A1,2,2),LEFT(A1,1)))

Here if the DATE FORMAT that you derived from a CSV file and your EXCEL
program is different then just extracting date using left right and mid
functions can give errors (like date of mm/dd/yyyy type in place of
dd/mm/yyyy).

--
Kind Regards,
Satti Charvak
Only an Excel Enthusiast
Noida, India


"Sageman" wrote:

Brilliant - works a treat - Thanks very much.

"muddan madhu" wrote:

suppose u have value in cell A1 then put this formula in B1

=IF(LEN(A1)=8,LEFT(A1,2)&"/"&MID(A1,3,2)&"/"&RIGHT(A1,4),LEFT(A1,1)
&"/"&MID(A1,2,2)&"/"&RIGHT(A1,4))


On Nov 12, 2:02 pm, Sageman wrote:
I have been given a csv file - on opening in excel the dates are in the
format 25051917, 5051949, 23121979 etc.
I have been struggling to get them into the standard date format - in this
case 25/05/1917, 05/05/1949, 23/12/1979 etc. Any help appreciated.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Change format of a date field

This is a little more compact...

=TEXT(A1,"00\/00\/0000")

--
Rick (MVP - Excel)


"Sageman" wrote in message
...
Brilliant - works a treat - Thanks very much.

"muddan madhu" wrote:

suppose u have value in cell A1 then put this formula in B1

=IF(LEN(A1)=8,LEFT(A1,2)&"/"&MID(A1,3,2)&"/"&RIGHT(A1,4),LEFT(A1,1)
&"/"&MID(A1,2,2)&"/"&RIGHT(A1,4))


On Nov 12, 2:02 pm, Sageman wrote:
I have been given a csv file - on opening in excel the dates are in the
format 25051917, 5051949, 23121979 etc.
I have been struggling to get them into the standard date format - in
this
case 25/05/1917, 05/05/1949, 23/12/1979 etc. Any help appreciated.




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Change format of a date field

Thanks guys for all your help - very useful and some ideas to use with other
problems!

"Ashish Mathur" wrote:

Hi,

You can also try this. Highlight the range and go to Data Text to
columns. While on Delimited, click on next twice and then select Date in
Column Date format. Select DMY in the drop down and select any blank cell
in destination. Click on Finish. This should get the dates in the required
format. Please note that this will not give you the correct result for
5051949. To make this work, you will have to precede 5051949 with
05051949.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Sageman" wrote in message
...
I have been given a csv file - on opening in excel the dates are in the
format 25051917, 5051949, 23121979 etc.
I have been struggling to get them into the standard date format - in this
case 25/05/1917, 05/05/1949, 23/12/1979 etc. Any help appreciated.


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Change format of a date field

You are welcome.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Sageman" wrote in message
...
Thanks guys for all your help - very useful and some ideas to use with
other
problems!

"Ashish Mathur" wrote:

Hi,

You can also try this. Highlight the range and go to Data Text to
columns. While on Delimited, click on next twice and then select Date in
Column Date format. Select DMY in the drop down and select any blank
cell
in destination. Click on Finish. This should get the dates in the
required
format. Please note that this will not give you the correct result for
5051949. To make this work, you will have to precede 5051949 with
05051949.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Sageman" wrote in message
...
I have been given a csv file - on opening in excel the dates are in the
format 25051917, 5051949, 23121979 etc.
I have been struggling to get them into the standard date format - in
this
case 25/05/1917, 05/05/1949, 23/12/1979 etc. Any help appreciated.


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
Format date and time from one contiguous field RCCruiser Excel Discussion (Misc queries) 4 August 19th 08 07:08 PM
Help: format records (color) at each change in continious field MRGREEN Excel Discussion (Misc queries) 9 October 15th 07 03:27 AM
Update date field upon cell range change Carole O Excel Worksheet Functions 1 May 16th 07 05:04 AM
How do I format date field in footer? Terry Sharman New Users to Excel 5 April 12th 06 08:08 PM
How can I format a cell so date field only displays the Month? tk_2u Excel Discussion (Misc queries) 3 December 4th 04 12:54 AM


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