Solved

Excel: converting formatted dates and sorting

Posted on 2002-05-29
5
462 Views
Last Modified: 2012-06-27
I have a column of dates in the format od ddd mmm dd hh:mm:ss yyyy, for example:
Thu May 21 11:45:21 2001
How to convert them to numeric values so I can sort by this column? Using Excel 97.
0
Comment
Question by:Kim Ryan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7041127
If the format is date, Excel will sort properly by the date values. If the value is a pure string representing a date, then you need to get the true date value from that string (use cdate() function)...

CHeers
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7041261
Hi Teraplane, are these string values or real dates? :O)Bruintje
0
 
LVL 1

Accepted Solution

by:
gd2000 earned 100 total points
ID: 7041361
Say the info is in cell A3.

Define     Space1 =FIND(" ",$A$3,1)
     Space2 =FIND(" ",$A$3,Space1+1)
     Space3 =FIND(" ",$A$3,Space2+1)
     Space4 =FIND(" ",$A$3,Space3+1)

Then the day is =MID(A3,Space2+1,2)
The month is =TRIM(MID(A3,Space1,Space2-Space1))
The year is =RIGHT(A3,4)
The time is =TRIM(MID(A3,Space3,Space4-Space3))

The combined value is =day&"-"&month&"-"&year&" "&time
0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 7043318
Yes, they are real date values. CDATE diesn't seem to be availabe on my version, only DATEVALUE, which can't handle these long formats.
0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 7043410
Thanks gd2000, it worked fine. Has MS every considered using regular expressionsin Excel? You could then reduce all of these steps into 1 simple pattern.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question