We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

Micrisoft xcell help???? postcode order

hi guys got a list of prospects however postcodes go from ie

ka11 then ka14 then ka3 how do i put them in order without cut, paste and insert etc

thanks in advance
«1

Comments

  • Seems quite difficult to do

    See here: http://www.mrexcel.com/forum/showthread.php?t=25271
    If my post helped you in anyway, please hit the "Thanks" button! Please note any advice I give is followed at your own risk!
  • DVardysShadow
    DVardysShadow Posts: 18,949 Forumite
    edited 14 September 2010 at 1:20PM
    foxyuk wrote: »
    hi guys got a list of prospects however postcodes go from ie

    ka11 then ka14 then ka3 how do i put them in order without cut, paste and insert etc

    thanks in advance
    It is a difficult one. I don't do excel, but as a general computing way of tackling the problem, I would look at it like this.

    By default, the sorting will be

    ka1
    ka10
    ka11
    ka2
    ka3
    ka31
    ka32
    ka4


    If you pack the leading space of the number and then sort, you will get

    ka01
    ka02
    ka03
    ka04
    ka10
    ka11
    ka31
    ka32

    Which puts everything in the right order, but makes it look wrong. So I might have a hidden column with a modified post code, where single digit numbers are packed with a leading 0. and I would have a visible column with the proper post code.

    And I would devise some code to modify the post code into the sortable form from the visible column to the hidden one.
    Hi, we’ve had to remove your signature. If you’re not sure why please read the forum rules or email the forum team if you’re still unsure - MSE ForumTeam
  • Create a new column and put this in the first row: =INT(MID(A1, 3, 10))

    Sort on this column.
    If my post helped you in anyway, please hit the "Thanks" button! Please note any advice I give is followed at your own risk!
  • foxyuk
    foxyuk Posts: 966 Forumite
    Create a new column and put this in the first row: =INT(MID(A1, 3, 10))

    Sort on this column.

    sorry i dont understand what you mean
  • googler
    googler Posts: 16,103 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Combo Breaker
    edited 17 September 2010 at 9:24AM
    I think that assumes that your postcode is in A1, A2, etc - that formula refers to A1. If you create new column, put that formula in the first cell, if necessary change A1 to whereever your postcodes start (B1? D1?), and 'Fill Down' the column with the same formula.......

    The MID function extracts chars 3 to 10 from your postcode, the INT function makes sure the result of this is a whole number, and I think for postcodes KA11, KA3 and KA 9 it will generate 11, 03 and 09 for you to sort on.

    Is this clear?
  • foxyuk
    foxyuk Posts: 966 Forumite
    googler wrote: »
    I think that assumes that your postcode is in A1, A2, etc - that formula refers to A1, and whilst I'm not sure about the MID function, if you create new column, if necessary change A1 to whereever your postcodes start, and 'Fill Down' the column with the same formula.......

    postcodes are in column j its drivin me crazy having to cut and paste in address order , although i am pc literate doing this is beyond me
  • googler
    googler Posts: 16,103 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Combo Breaker
    OK, let's break it down - which bit of this is unclear to you?

    Create a new column and put this in the first row: =INT(MID(A1, 3, 10))

    Sort on this column.


    Create a new column.
    Put this in the first row (of that column).

    Are both these statements clear?

    =INT(MID(A1, 3, 10)) - This is what you are to put in the first row of that column, but change the A1 to which column your postcodes are in - in your case J1. Is this clear?

    Use Edit - Fill Down to fill the rest of the column with the same formula, then highlight the column and use Data - Sort to sort the contents of the column. Is this statement clear?
  • Stompa
    Stompa Posts: 8,390 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    It is a difficult one. I don't do excel, but as a general computing way of tackling the problem, I would look at it like this.

    By default, the sorting will be

    ka1
    ka10
    ka11
    ka2
    ka3
    ka31
    ka32
    ka4


    If you pack the leading space of the number and then sort, you will get

    ka01
    ka02
    ka03
    ka04
    ka10
    ka11
    ka31
    ka32

    Which puts everything in the right order, but makes it look wrong. So I might have a hidden column with a modified post code, where single digit numbers are packed with a leading 0. and I would have a visible column with the proper post code.

    And I would devise some code to modify the post code into the sortable form from the visible column to the hidden one.
    I'd agree, that's the way to go. Particularly if the postcodes turn out to be 'full' postcodes of the form KA1 2HJ where the second number would also need to be padded out with leading zeros.
    Stompa
  • Why do you need to have them in order??

    Why not do an Index / Match formula??? (Similar to Vlookup)

    What are to trying to do?
  • john87_2
    john87_2 Posts: 71 Forumite
    edited 17 September 2010 at 11:54AM
    try this:
    put your post code in column A and this formula in column b

    =INT(MID(A1,3,2))

    then select columns a and b and sort by b first and a
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.2K Reduce Debt & Boost Income
  • 455.1K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 603K Mortgages, Homes & Bills
  • 178.1K Life & Family
  • 260.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.