+ Reply to Thread
Results 1 to 6 of 6

Custom Sorting Of A Column Based On Numbers

  1. #1
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Custom Sorting Of A Column Based On Numbers

    Hi guys,

    I have a column, G in my Excel worksheet. This column has 600 rows that are populated with the subject lines of emails. Each individual row is a separate subject heading.

    Here is my problem. I would like to be able to customize my view so that ONLY rows that contain numbers that are 9 digits long are visible, but I don't know how to do this.

    For example, the G4 contains the text "Re: Invoice 929253212". Because this cell has a number, and that number is 9 digits in length, it would return a positive. G5 contains "Help with Invoice 032?" While this cell contains numbers, the number are only 3 digits in length, so they would not be shown in my results. I don't know if this is even possible, but it would save me a ton of time if it were possible, (for this, and for my future sorting needs.)

    Does anyone have a solution to this? I have access to Excel 2003 and 2007.

    Thanks,

    Brian

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Custom Sorting Of A Column Based On Numbers

    Can the # appear mid string or is it always at the end ?

    Presumably 012345678 would be "positive" ?

    edit:

    Presumably the # is not always preceded by "Invoice" ?
    Last edited by DonkeyOte; 02-14-2011 at 08:18 AM.

  3. #3
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Custom Sorting Of A Column Based On Numbers

    The number could appear anywhere in the string, the numbers are always positive, and the number could have any mixture of words around it, (remember, these are e-mail subject headers)

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Custom Sorting Of A Column Based On Numbers

    In terms of native functionality:

    Please Login or Register  to view this content.
    Though I'm sure with thought the above can be streamlined...
    the above is designed to disregard numbers with <9 digits and >9 digits which may appear at any point in the string
    (edit: also designed to assume mixed punctuation/delimiters, leading zeroes etc...)

    The alternative would be to use a basic UDF looking for the 9 digit pattern (where not preceded or succeeded by another digit)
    If you want a UDF let us know.
    Last edited by DonkeyOte; 02-14-2011 at 04:30 PM. Reason: edit narrative

  5. #5
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Custom Sorting Of A Column Based On Numbers

    Thou art the man. I will try that solution. Thanks!!

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Custom Sorting Of A Column Based On Numbers

    This shorter version might work also - not really tested in depth:

    Please Login or Register  to view this content.
    edit: scrap that - would fail the "variety of punctuation" test (eg 123456789? & !012345678 etc...)
    Last edited by DonkeyOte; 02-14-2011 at 04:53 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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