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


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:

doc-sort-by-odd3

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:

doc-sort-by-odd3

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.

doc-sort-by-odd3

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

doc-sort-by-odd3

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:

doc-sort-by-odd3

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.


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 30 days.

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:

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:

doc-sort-by-odd3

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 300 handy Excel add-ins, free to try with no limitation in 30 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?


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

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!
officetab bottom
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.