Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to sort rows by odd or even numbers in Excel?

It is easy for us to sort the numbers by ascending or descending order in Excel, but if I have a long list of numbers, and now I want to sort them by odds or evens. That is to say, all odd or even numbers are sorted together as following screenshots shown. Is it possible for us to sort by even or odd numbers in Excel?

doc-sort-by-odd1 -2 doc-sort-by-odd2

Sort rows by odd or even numbers with a helper column

Sort rows by odd or even numbers with Kutools for Excel

Advanced Sort ( Sort data by odd even numbers, sort data by last name and so on):

Kutools for Excel’s Advanced Sort feature can help you to sort data by text length, last name, odd and even numbers, frequency and so on with only one click.


Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!

To sort the list of numbers by odds or evens, you need to create a helper column to identify the odd or even numbers, and then apply the Sort function.

1. Next to the numbers, please enter this formula =ISODD(A2) in a blank cell, see screenshot:


2. Then drag the fill handle over to the cells that you want to contain this formula, the TRUE indicates odd numbers and FALSE indicates even numbers, see screenshot:


3. Then you can sort the column B that you are created by clicking Data > Sort Smallest to Largest or Sort Largest to Smallest as you want.


4. And in the Sort Warning dialog, check Expand the selection option, see screenshot:


5. Then click Sort button and the even numbers has been sorted together and then followed by the odd numbers if you select Sort Smallest to Largest icon. See screenshot:



1. If you want to sort all odd numbers before the even numbers, you just need to select Sort Largest to Smallest in Step 3.

2. After finishing the sorting, you can delete the helper column as you need.

Here, I can talk about an easy tool – Kutools for Excel, with its Advanced Sort feature, you can quickly sort all odd numbers together and followed even numbers or vice versa.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.

After installing Kutools for Excel, please do as follows:

1. Select the data range that you want to sort.

2. Then click Enterprise > Advanced Sort, see screenshot:


3. In the Advanced Sort dialog box, click the column name that you want to sort by under Column section, and then choose Odd and even number from the Sort On section, at last specify the sort order (A to Z stands for from even to odd numbers, and Z to A stands for from odd to even numbers), see screenshot:


4. And then click OK, and you will get the following results:

Original data   Sort from even to odd numbers   Sort from odd to even numbers
doc-sort-by-odd3  2 doc-sort-by-odd3  2 doc-sort-by-odd3

Click to know more about this Advanced Sort feature.

 Download and free trial Kutools for Excel Now !

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!

Related articles:

How to sort email address by domain in Excel?

How to sort data by the most frequent value in Excel?

How to sort or filter data by strikethrough in Excel?

How to sort rows to put the blank cells on top in Excel?

Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.