Skip to main content

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

Author: Xiaoyang Last Modified: 2024-10-09

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?

A screenshot showing a list of numbers in Excel Arrow A screenshot showing the sorted list in Excel after applying sort by odd or even numbers

Sort rows by odd or even numbers with a helper column

Sort rows by odd or even numbers with Kutools for Excel


Sort rows by odd or even numbers with a helper column

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:

A screenshot showing how to apply the ISODD formula in Excel to identify odd numbers

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:

A screenshot showing the results of the ISODD formula in Excel indicating odd and even numbers

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.

A screenshot showing the Sort options in Excel

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

A screenshot of the Sort Warning dialog box

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:

A screenshot showing even numbers sorted together followed by odd numbers in Excel

Notes:

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.


Sort rows by odd or even numbers with Kutools for Excel

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 offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After installing Kutools for Excel, please do as follows:

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

2. Then click Kutools Plus > SortAdvanced Sort, see screenshot:

A screenshot showing the Advanced Sort feature on the Kutools tab on the ribbon

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:

A screenshot of the Advanced Sort dialog box

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
A screenshot showing original unsorted data Arrow A screenshot showing data sorted from even to odd numbers in Excel Arrow A screenshot showing data sorted from odd to even numbers in Excel

Click to know more about this Advanced Sort feature.

 Download and free trial Kutools for Excel Now!


Demo: Sort rows by odd or even numbers with Kutools for Excel

Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download 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?

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!