How to Sort Column by Value in Excel (7 Easy Ways)

Let’s use a List of Employees. This dataset includes the IDs, Names, and their corresponding Income in columns B, C, and D, respectively. We’ll use it to sort the columns by some values.

excel sort column by value


Method 1 – Using Quick Sort Commands


Case 1.1 – Applying the Sort A to Z Button

Steps:

  • Select the cells in the D5:D14 range.
  • Go to the Data tab.
  • Click on the Sort A to Z icon on the Sort & Filter group of commands.

Applying the Sort A to Z Button

  • The Sort Warning dialog box appears. Click on Expand the selection under the What do you want to do? section.
  • Click on Sort.

Sort Warning Dialog Box

  • Our columns are sorted from smallest to largest.

Sort Column from smallest to largest in Excel


Case 1.2 – Applying the Sort Z to A Button

Steps:

  • Select the data in the Income column.
  • Move to the Data tab.
  • Click on the Sort Z to A icon.

Applying the Sort Z to A Button

  • Expand the selection in the warning box and confirm.

Applying the Sort Z to A Button to sort column by value in Excel

Read More: How to Sort Two Columns in Excel to Match


Method 2 – Utilizing the Filter Option

Steps:

  • Select all the column headings in the B4:D4 range.
  • Go to the Home tab.
  • Click on the Sort & Filter drop-down on the Editing group.
  • From the drop-down list, select the Filter option.

Utilizing Filter Option

  • The filter button is available next to each column heading.

Filter Button on Each Column Header

  • Click on the filter button of the Income column.
  • Select Sort Smallest to Largest from the options.

  • We can see the columns get sorted from the smallest to the largest value.

Utilizing Filter Option to sort column by value in Excel

  • Similarly, you can sort from largest to smallest.

Method 3 – Using a Custom Sort Tool

Steps:

  • Select cells in the B4:D14 range.
  • Go to the Data tab.
  • Click on the Sort icon on the Sort & Filter group.

Employing Custom Sort Tool

  • The Sort wizard pops up. Here you can customize your sorting styles. We will Sort by the Income column, Sort On the Cell Values, and the Order is Smallest to Largest.
  • Click on OK.

Working on Sort Dialog box

  • We can see the column sorted from smallest to largest in our worksheet.

  • You can also sort from largest to smallest in a similar way.

Employing Custom Sort Tool to sort column by value in Excel

Read More: Excel Sort by Column Without Header


Method 4 – Engaging Multi-level Sorting by Value

We added a new column titled Expenditure and we have changed the income of Mike, Adam, and Hayden to $95,000.

Engaging Multi-level Sorting by Value

Steps:

  • Open the Sort dialog box.
  • Select the sorting style like the previous method.
  • Click on Add Level.

  • We will customize this level by the Expenditure column, using the Sort on Cell Values and the Order is Largest to Smallest.
  • Click OK.

Adding New Level in Sort dialog box

  • We can see that four people have the same top Income, but their Expenditures are also sorted from largest to smallest order.

Engaging Multi-level Sorting by Value in Excel


Method 5 – Inserting the SORT Function

Steps:

  • Copy all the column headers and paste them in the F5:H5 range.

Inserting SORT Function

  • Select cell F6 and enter the following formula into the Formula Bar.
=SORT(B6:D15,3,-1)
  • Press Enter.

Inserting SORT Function to sort column by value in Excel


Method 6 – Implementing the SORTBY Function

Steps:

  • Select cell F6 and insert the following formula.
=SORTBY(B6:D15,D6:D15,-1)
  • Press Enter.

Implementing SORTBY Function

Read More: Sorting Columns in Excel While Keeping Rows Together


Method 7 – Applying VBA Code

Steps:

  • Right-click on the worksheet name.
  • From the context menu, select the View Code option.

Applying VBA Code

  • The Microsoft Visual Basic for Applications window appears. A code module is inserted for Sheet9 (VBA).

Code Module for Sheet9

  • Paste the following code into the module.
Sub Sort_Column_by_Value()
Range("B4:D15").Sort Key1:=Range("D5"), Order1:=xlDescending
End Sub

VBA Code to sort column by value in Excel

  • Run the code.

Run the Code

  • The column is sorted from largest to smallest by value.

Applying VBA Code to sort column by value in Excel

Read More: How to Sort Columns in Excel Without Mixing Data


Problems You Might Face While Sorting Column by Value

Though sorting columns by value in Excel is quite easy, you might face some problems if you have Blank or Hidden cells or rows in your data range. See the screenshot below.

Problems You Might Face While Sorting Column by Value

Let’s see what happens when we sort the columns by values.

Only a portion of our data until the first blank cell is sorted, while the remainder remains unsorted.

Problem to sort while having blank row

Solution:

  • Select all cells in the D4:D14 range instead of just selecting cell D4.
  • Go to the Data tab.
  • Click on the Sort A to Z icon.

Using Sort and Filter Option

  • Excel is showing the correct result.


Things to Remember

➤ The SORT and SORTBY functions are only available for Excel 365. You won’t be able to use this function unless you have this version of Excel.

➤ If you have a blank cell in your data table, select the whole data table to sort by value.

➤ You can auto-sort columns by their value when you use the SORT function.

➤ Always select the column header cell when you sort your data.


Practice Section

We have provided a Practice section like the one below on each sheet on the right side.

Practice Section


Download the Practice Workbook



<< Go Back to Sort in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Asikul Himel
Asikul Himel

Asikul Islam Himel, holding a BSc in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology, has contributed over two years to the ExcelDemy project. Starting as an Excel & VBA Content Developer, now he manages projects at You Have Got This Math Project. He wrote 60+ articles for ExcelDemy, reviewed 500+, and focused on quality maintenance. Currently, his responsibilities include project management and team leadership. Himel's interests encompass data analysis, leadership, WordPress applications, and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo