Formula to arrange rows in numerical order.
Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: Formula to arrange rows in numerical order.
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Mar 2011
    Posts
    215
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Formula to arrange rows in numerical order.

    3 18 30 34 42
    4 5 6 31 41
    24 26 36 40 41
    17 19 27 33 37
    1 9 26 30 36
    18 19 25 26 32
    11 17 30 35
    37

    1 9 26 30 36
    3 18 30 34 42
    4 5 6 31 41
    11 17 30 35 37
    17 19 27 33 37
    18 19 25 26 32
    24 26 36 40 41

    Hello Everyone!!

    My computer is Dell and operating system is 10.

    Can someone please help me with a formula to automatically arrange rows of numbers in numerical order? The top sets of numbers are how they look originally. The bottom sets are how I'd like them to look.

    Thank you in advance.

    Frankie x

  2. #2
    Board Regular
    Join Date
    Jun 2014
    Posts
    832
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help with formula to arrange rows in numerical order.

    Hello Frankie,

    I'm assuming that the numbers are in Columns A:E starting in Row2 with headings in Row1 and that you are sorting on Column A values. If so, try this code:-

    Code:
    Sub SortIt()
    
    Sheet1.Range("A2", Sheet1.Range("E" & Sheet1.Rows.Count).End(xlUp)).Sort Sheet1.[A2], 1
    
    End Sub
    Change the sheet references to suit yourself.

    I hope that this helps.

    Cheerio,
    vcoolio.

  3. #3
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    26,841
    Post Thanks / Like
    Mentioned
    459 Post(s)
    Tagged
    45 Thread(s)

    Default Re: Help with formula to arrange rows in numerical order.

    Why not just use the inbuilt sort facility?
    Just select your data & sort on the first column
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  4. #4
    Board Regular
    Join Date
    Mar 2011
    Posts
    215
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help with formula to arrange rows in numerical order.

    Hello Vcoolio!!

    First, thank you so much for the code. Unfortunately my aptitude isn't up to snuff for the code. Would you have a formula I can use? Thank you again!
    Blessings.... <3

  5. #5
    Board Regular Sam_D_Ben's Avatar
    Join Date
    Oct 2012
    Location
    New Jersey, USA
    Posts
    371
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help with formula to arrange rows in numerical order.

    As Fluff said why not use inbuilt sort facility. (Excel - Data tab - Sort option). Thank you
    Sam_D_Ben

  6. #6
    Board Regular
    Join Date
    Mar 2011
    Posts
    215
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help with formula to arrange rows in numerical order.

    Hello Fluff!
    Thank you so much for your response. I did try the built in function, but unfortunately, it didn't produce the results I'm looking for.
    Also, I had to post the examples one above the other. In an ideal scenerio, they would be side by side (horizonally).

    Would you have a formula that can help?? Thanks again. Blessings! <3

  7. #7
    Board Regular
    Join Date
    Mar 2011
    Posts
    215
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help with formula to arrange rows in numerical order.

    Hello Sam!
    As I told Fluff, I wasn't getting the reults I needed using the built in function.

    Thank you so much for the comment. I really appreciate it.

  8. #8
    Board Regular Sam_D_Ben's Avatar
    Join Date
    Oct 2012
    Location
    New Jersey, USA
    Posts
    371
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help with formula to arrange rows in numerical order.

    Kindly dont say that, that is the easiest and safest way of sorting in excel without messing up your data.

    Could you please explain us - how did you try doing it
    Sam_D_Ben

  9. #9
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    40,386
    Post Thanks / Like
    Mentioned
    86 Post(s)
    Tagged
    19 Thread(s)

    Default Re: Help with formula to arrange rows in numerical order.

    @MrsFrankieH
    In your original sample data, the 2nd column contains two numbers the same (19). Therefore I assume that is also possible with the first, or any other, column.
    If that is possible, can you please post the expected result for this set of data, with any further clarification?
    I have highlighted green where some rows have columns of equal values.

    Sort rows

    ABCDE
    1318303442
    21719273337
    3318263036
    41819252632
    5318303437


    Excel tables to the web >> Excel Jeanie HTML 4
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the VBHTML Maker
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  10. #10
    Board Regular Sam_D_Ben's Avatar
    Join Date
    Oct 2012
    Location
    New Jersey, USA
    Posts
    371
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help with formula to arrange rows in numerical order.

    Please ignore-
    Last edited by Sam_D_Ben; Aug 17th, 2019 at 04:07 AM. Reason: Please ignore-
    Sam_D_Ben

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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