?
Solved

Excel: converting formatted dates and sorting

Posted on 2002-05-29
5
Medium Priority
?
463 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 400 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
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 create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

770 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