Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jtmousel
 
Posts: n/a
Default Formatting Odd Number Strings

I have imported a text report into Excel. For some reason the date
string on the text file reads as 20/05/0728. Is there a quick way to
reformat the string so it reads 7/28/2005 or even 2005/07/28, for that
matter. I really don't want to manually edit 300+ lines! Thanks.

  #2   Report Post  
Dave O
 
Posts: n/a
Default Formatting Odd Number Strings

Assuming your fubared date is in column A, insert a new column
immediately to the right of that, and enter this formula:
=DATE(LEFT(A1,2)&MID(A1,4,2),MID(A1,7,2),RIGHT(A1, 2))

This parses the existing text string into arguments used by the DATE
function, which generates a date useable by Excel.

  #3   Report Post  
Sloth
 
Posts: n/a
Default Formatting Odd Number Strings

What is the cell value, and what is the format type? Is it a number like
20050728 with a custom format, or is it text 20/05/0728? You have a couple
options depending on what the cell values are.

"jtmousel" wrote:

I have imported a text report into Excel. For some reason the date
string on the text file reads as 20/05/0728. Is there a quick way to
reformat the string so it reads 7/28/2005 or even 2005/07/28, for that
matter. I really don't want to manually edit 300+ lines! Thanks.


  #4   Report Post  
Gary''s Student
 
Posts: n/a
Default Formatting Odd Number Strings

For example, if you value is in A1, then in a helper cell put:

=MID(A1,7,2) & "/" & RIGHT(A1,2) & "/" & LEFT(A1,2) & MID(A1,4,2)
--
Gary''s Student


"jtmousel" wrote:

I have imported a text report into Excel. For some reason the date
string on the text file reads as 20/05/0728. Is there a quick way to
reformat the string so it reads 7/28/2005 or even 2005/07/28, for that
matter. I really don't want to manually edit 300+ lines! Thanks.


  #5   Report Post  
jtmousel
 
Posts: n/a
Default Formatting Odd Number Strings

This work perfectly. Thank you!



  #6   Report Post  
jtmousel
 
Posts: n/a
Default Formatting Odd Number Strings

I used Dave O's solution. Thanks again.

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
Text Function with Different Formatting for Number MKenworthy Excel Discussion (Misc queries) 1 September 1st 05 11:34 PM
Number formatting when importing from Access to Excel Alicia Rittenhouse Excel Discussion (Misc queries) 1 August 25th 05 10:27 PM
number formatting question Ryan Case Excel Worksheet Functions 1 May 26th 05 12:48 AM
Pivot Table Drill Down Number Formatting Gregg Riemer Excel Discussion (Misc queries) 1 January 4th 05 10:53 PM
Conditional Formatting (Date vs Number) [email protected] Excel Discussion (Misc queries) 7 December 20th 04 10:23 PM


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