+ Reply to Thread
Results 1 to 5 of 5

sorting table of contents

  1. #1
    Registered User
    Join Date
    06-15-2011
    Location
    ny
    MS-Off Ver
    Excel 2003
    Posts
    3

    sorting table of contents

    I need to sort a table of contents that has multiple decimal points so that all the entries with no decimals are followed by the entries with two decimals etc.

    For example
    4
    4.1
    4.2
    4.3
    4.2.1
    4.2.2
    4.3.1
    4.3.1.1
    4.3.1.2.5
    4.3.2
    4.3.2.1
    4.3.1.2

    ends up like

    4
    4.1
    4.2
    4.3
    4.2.1
    4.2.2
    4.3.1
    4.3.2
    4.3.1.1
    4.3.1.2
    4.3.2.1
    4.3.1.2.5

    I hope I made myself clear

    thank you in advance
    bil

  2. #2
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: sorting table of contents

    So you want them sorted by length after the first number?

  3. #3
    Registered User
    Join Date
    06-15-2011
    Location
    ny
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: sorting table of contents

    Quote Originally Posted by 111StepsAhead View Post
    So you want them sorted by length after the first number?
    Yes they do not need to be sorted by number I just need all with no decimals followed by those with 1 followed by those with 2 etc

  4. #4
    Registered User
    Join Date
    06-15-2011
    Location
    ny
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: sorting table of contents

    What I may need to clarify here is the following
    I can accomplish what I need to do by counting the decimal points in each number.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: sorting table of contents

    If your first example is the sort order you want, then just ensure that all the values are text, and when prompted, specify to sort text and text that looks like numbers separately.

    If your elements can exceed 9 (e.g., 4,10.2) then you need to do something different, for which I can provide a UDF to help.
    Entia non sunt multiplicanda sine necessitate

+ 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