+ Reply to Thread
Results 1 to 7 of 7

Can't get Excel to sort a table by postcode THEN date correctly

  1. #1
    Registered User
    Join Date
    12-11-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Unhappy Can't get Excel to sort a table by postcode THEN date correctly

    Hi. I am working on a VERY simple spreadsheet at work (think is Excel 2007 but am not at work at the moment to double check) where I need to sort the data by UK postcode (first part only, ie GU34) THEN by date (oldest to newest). When I attempt to do this, it seems to sort the postcode part OK, but then cannot sort the dates correctly! The cells with dates are formatted at "dates" but I keep ending up with older dates occuring after newer dates. Surely sorting data in this way is not beyond the capabilities of Excel?!

    Any help appreciated!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can't get Excel to sort a table by postcode THEN date correctly

    are the dates "real" excel dates or dates entered in text format ? if you format the column with dates in as general do they all turn into 5 digit numbers or do they still look like dates.
    if they stay as dates when formated general
    select the column of dates
    then data tab/text to columns click next twice select the date option and choose dmy from the dropdown
    click finish
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    12-11-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Can't get Excel to sort a table by postcode THEN date correctly

    Hi

    Many thanks for your reply, but it hasn't worked!!

    I followed your instructions but the data still won't sort correctly. When I go BACK to data tab / text to column, click next twice the column data format has revered to "General"!!!

    More help much appreciated!!

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can't get Excel to sort a table by postcode THEN date correctly

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Registered User
    Join Date
    12-11-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Can't get Excel to sort a table by postcode THEN date correctly

    Hi

    I have attached a sample of the spreadsheet but have only left in relevant data. I am trying to achieve a list which is sorted primarily by UK postcode (first part as shown), then by application date. i.e. all those with a KT21 postcode then sorted by date, followed by those applications with a KT22 postcode, also sorted by date.

    As you can see from sheet 1 there are some KT21 entries, which are not sorted in date order (i.e. lines 40-45)

    Hope thats enough info.

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can't get Excel to sort a table by postcode THEN date correctly

    ok the problem is not the dates but col a
    all those in rows 40-45 have a trailing space so kt21 isnt the same as kt21[space]
    select col a
    data/text to columns/fixed width
    click finish
    that should remove all trailing spaces
    now re sort

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can't get Excel to sort a table by postcode THEN date correctly

    oops forum double posting AGAIN

  8. #8
    Registered User
    Join Date
    12-11-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Can't get Excel to sort a table by postcode THEN date correctly

    Thank you so much!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Correctly format UK Postcode
    By MikeWaring in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2010, 05:57 AM
  2. Excel won't sort my data correctly
    By Sirritys in forum Excel General
    Replies: 2
    Last Post: 07-10-2006, 03:29 AM
  3. Postcode Sort?
    By KarenScott in forum Excel General
    Replies: 7
    Last Post: 06-13-2006, 09:45 PM
  4. [SOLVED] [SOLVED] Why won't data sort correctly in Excel
    By moonfang in forum Excel General
    Replies: 6
    Last Post: 10-19-2005, 11:05 AM
  5. Excel won't sort numbers correctly
    By martin0642 in forum Excel General
    Replies: 2
    Last Post: 09-27-2005, 01:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1