MajorGeeks Support Forums IOBit Software

Go Back   MajorGeeks Support Forums > Majorgeeks.Com - Support Forums > Software
Register FAQ Members List Calendar Casino Mark Forums Read

Software Software such as operating systems like Windows XP, Windows Vista, Windows 7 etc., or specific programs.


Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-06, 23:08
bigbazza's Avatar
bigbazza bigbazza is offline
R.I.P. 14/12/2011 - Good Onya Geek
 
Join Date: Jan 2004
Location: Cairns,Far North Qld,Australia
Posts: 10,770
Thanks: 891
Thanked 331 Times in 293 Posts
Default Need help with an Excel date sort

I have a column in an Excel spreadsheet that is formatted as dd.mm.yyyy.

I need something that will read this column and output it as yyyy.mm.dd into a separate filed so Excel will sort it properly in chronological sequence.

At present the "date" sort only sorts on the first 2 numerics, ie dd and sorts then from 1-31, irrespective of the balance of the date field.

Hope someone can help.


Bazza
Reply With Quote
Sponsored links
  #2  
Old 02-23-06, 23:30
brownizs's Avatar
brownizs brownizs is offline
Major Geek
 
Join Date: May 2005
Location: Central IL.
Posts: 2,935
Thanks: 77
Thanked 223 Times in 214 Posts
Default Re: Need help with an Excel date sort

You would have to do a little work in VB in order to get it to work. I found this http://office.microsoft.com/en-us/as...093431033.aspx
__________________
I threw out the map a long time ago. Now I follow my own direction!
Reply With Quote
  #3  
Old 02-23-06, 23:53
bigbazza's Avatar
bigbazza bigbazza is offline
R.I.P. 14/12/2011 - Good Onya Geek
 
Join Date: Jan 2004
Location: Cairns,Far North Qld,Australia
Posts: 10,770
Thanks: 891
Thanked 331 Times in 293 Posts
Default Re: Need help with an Excel date sort

Thanks, browizs, for the quick reply. Unfortunately the spreadsheet is a dump from SAP and as such is not in an M$ date format, I believe. I've tried using Format column--> the various date options in Excel, but nothing changes the existing format.

I probably need a little program that will extract the yyyy using something like Right string command, and then get the mm and then the dd using the Left string command.

I am really stretching my memory as I can remember using Left string and Right string in the old DOS Basic days. Bazza

===

Quote:
Originally Posted by brownizs
You would have to do a little work in VB in order to get it to work. I found this http://office.microsoft.com/en-us/as...093431033.aspx
Reply With Quote
  #4  
Old 02-24-06, 00:00
bigbazza's Avatar
bigbazza bigbazza is offline
R.I.P. 14/12/2011 - Good Onya Geek
 
Join Date: Jan 2004
Location: Cairns,Far North Qld,Australia
Posts: 10,770
Thanks: 891
Thanked 331 Times in 293 Posts
Default Re: Need help with an Excel date sort

Brownizs, I've tried the example in the link you provided and was able to reverse the dates into 3 columns as yyyy, mm, dd, so will give this a try on the whole worksheet. If anyone comes up with a solution that would transpose the date into one column instead of 3, I would appreciate it. Bazza

==

Quote:
Originally Posted by brownizs
You would have to do a little work in VB in order to get it to work. I found this http://office.microsoft.com/en-us/as...093431033.aspx
Reply With Quote
  #5  
Old 02-24-06, 00:04
bigbazza's Avatar
bigbazza bigbazza is offline
R.I.P. 14/12/2011 - Good Onya Geek
 
Join Date: Jan 2004
Location: Cairns,Far North Qld,Australia
Posts: 10,770
Thanks: 891
Thanked 331 Times in 293 Posts
Default Re: Need help with an Excel date sort

Doesn't work with 7.5.2006, but appears to work if I replace 7.5.2006 with 7/5/2006. Will give it a try across the whole worksheet. Bazza
Reply With Quote
Sponsored links
  #6  
Old 02-24-06, 08:22
Mada_Milty's Avatar
Mada_Milty Mada_Milty is offline
Major Geek
 
Join Date: Aug 2005
Location: Ontario, Canada
Posts: 4,880
Thanks: 4
Thanked 52 Times in 48 Posts
Default Re: Need help with an Excel date sort

If you read each line with vb, you could use the split function to break the date into three substrings, each separated by your periods..

What's the Split?
Let's look at the function itself. The Split function, according to the documentation, "returns a zero based, one-dimensional array containing a specified number of substrings." Yes, I can hear the groans; "oh no, not another array function. I don't use no stinkin' arrays in my code anyway!"

Don't give up yet. There is hope. The Split function is defined by this syntax:


Split(expression [, delimiter [, count [, compare]]])

This is how it is explained:

* The function name is Split, and yes, it is a function, so it needs to be on the right hand side of an equal-to sign.
* "Expression" is a required string expression containing substrings and delimiters.
* "Delimiter" is an optional string identifying the delimiter character. By default, a space character (" ") is considered to be the delimiter.
* "Count" is an optional number of substrings to return. The default is -1, which indicates all substrings are to be returned.
* "Compare" is an optional numeric value signifying how the comparison should take place for evaluating substrings. A 0 indicates binary comparison; a 1 (the default) signifies textual comparison.

Given a text string, the Split function can quickly and efficiently break it down into an array of strings, based on your chosen delimiter.

After using this, you would have a day string, a month string, and a year string, and from there, it is EASY to manipulate into the format you like.
Reply With Quote
  #7  
Old 02-24-06, 14:12
bigbazza's Avatar
bigbazza bigbazza is offline
R.I.P. 14/12/2011 - Good Onya Geek
 
Join Date: Jan 2004
Location: Cairns,Far North Qld,Australia
Posts: 10,770
Thanks: 891
Thanked 331 Times in 293 Posts
Default Re: Need help with an Excel date sort

Thanks Mada_Milty and browizs for your solutions. Somehow, and I'm not sure how I did it, I converted 23.10.2005 to 23-Oct-2005, etc., and was able to get the results I was after. Bazza
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 17:51.


MajorGeeks.Com Home Page
| Admin Tools | All In One | Anti-Spyware | Anti-Virus | Appearance | Backup | Benchmarking | BIOS | Browsers | Covert Ops |
Data Recovery | Diagnostics | Drive Cleaners | Drive Utilities | Drivers | Driver Tools Ergonomics | Firewalls | Games | Game Tweaks | Graphics | Input Devices | Internet Tools | Macintosh | Mail Utilities | Memory | Messaging | Monitoring | Microsoft | Multimedia | Networking | Office Tools | Process Management | Processor | Registry | Security | System Info | Toys | Video | Miscellaneous
|

-->
Powered by vBulletin® Version 3.8.4
Copyright © 2009 vBulletin Solutions, Inc. All rights reserved.
Ad Management by RedTyger