Formula to arrange rows in numerical order.

MrsFrankieH

Active Member
Joined
Mar 25, 2011
Messages
252
318303442
4563141
2426364041
1719273337
19263036
1819252632
11173035
37

<colgroup><col span="5"></colgroup><tbody>
</tbody>

19263036
318303442
4563141
1117303537
1719273337
1819252632
2426364041

<colgroup><col span="5"></colgroup><tbody>
</tbody>

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
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

vcoolio

Well-known Member
Joined
Jun 29, 2014
Messages
988
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.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,562
Office Version
365
Platform
Windows
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
 

MrsFrankieH

Active Member
Joined
Mar 25, 2011
Messages
252
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
 

Sam_D_Ben

Active Member
Joined
Oct 17, 2012
Messages
379
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
 

MrsFrankieH

Active Member
Joined
Mar 25, 2011
Messages
252
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
 

MrsFrankieH

Active Member
Joined
Mar 25, 2011
Messages
252
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. :)
 

Sam_D_Ben

Active Member
Joined
Oct 17, 2012
Messages
379
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
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
45,170
Office Version
365
Platform
Windows
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.

Excel Workbook
ABCDE
1318303442
21719273337
3318263036
41819252632
5318303437
Sort rows
 

Sam_D_Ben

Active Member
Joined
Oct 17, 2012
Messages
379
Re: Help with formula to arrange rows in numerical order.

Please ignore-
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,102,206
Messages
5,485,348
Members
407,497
Latest member
astaha

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top