Sort Positive Numbers and Negative Numbers by Absolute Values

If both positive numbers and negative numbers exist in the same column, when sorting them by absolute values, we can sort them with the help of ABS function and helper column. In this article, we will show you the way to sort numbers by absolute values.

EXAMPLE

We want to sort numbers in “Numbers” column from smallest to largest by absolute values.

ANALYSIS

If we directly click “Sort Smallest to Largest” button, numbers are sorted by actual values, negative numbers are always the smallest ones. So, if we want to sort them by absolute values, we need to do below two steps:

a. Convert negative numbers to positive number.

b. Sort all positive numbers.

We can apply ABS function to help us solve this problem.

STEPS

First of all, create a helper column. A helper column can help us save temporary data or simplifies some complex formulas. In this instance, we create a helper column to save absolute values of the given numbers.

a. In this instance, just create the helper column adjacent to “Numbers” column.

b. Enter =ABS(A2) into B3 and press Enter. ABS function is used for returning the absolute value of the given number. The syntax is ABS(number).

c. Drag down the fill handle to copy down this formula from B2 to B8.

d. Select range B2:B8, then click Data > Sort A to Z (Sort Smallest to Largest) in Sort & Filter section.

e . Verify that below “Sort Warning” dialog pops up immediately. As we want to sort numbers in “Numbers” column (A column) with the help of helper column (B column), so just keep default option checked, and click “Sort”. If we just want to sort current selection, check on “Continue with the current selection”. The two options are mutually exclusive.

f. After clicking “Sort” button on “Sort Warning” dialog, numbers are sorted from smallest to largest properly in both two columns. We can see that in A column negative numbers are still displayed with negative sign.

g. Delete helper column, now numbers in A column are sorted by absolute values properly as we expect.

Related Functions


  • Excel ABS Function
    The Excel ABS function returns the absolute value of a number.The ABS function is a build-in function in Microsoft Excel and it is categorized as a Math and Trigonometry Function.The syntax of the ABS function is as below:=ABS (number)…
Related Posts

If Cell is This Value or That Value

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of logical test. If you want to see if a cell is A or B, and if one of ...

If Value is Greater Than A Certain Value
If Value is Greater Than A Certain Value 1

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the logical test result. If you want to see if a value in one cell is greater than a specific value, ...

If Cell is Not Blank
If Cell is Not Blank 6

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if a cell is blank or not, and leave some ...

If Cell is Blank
If Cell is Blank_1

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if a cell is blank or not, and leave some ...

If Cell Equals Certain Text String
If cell equals certain text_1

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if cell equals a certain text string like “Win”, you ...

If Cell Contains Either Text1 or Text2
If cell contains text1 or text2_1

IF function is frequently used in Excel worksheet to return “true value” or “false value” based on the logical test result. If you want to see if cell contains certain substring1 like “abc” or substring2 like “def”, and returns true ...

If Cell Contains Certain Text OR Equals Certain Text

IF cell equals certain text IF function is frequently used in Excel worksheet to return “true value” or “false value” based on the logical test result. If you want to test values to see if they equal certain text like ...

VLOOKUP From Another Sheet Not Working
vlookup from another sheet not working3

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you reasons why your VLOOKUP formula is not working ...

If Cell Begins with One of Three Supplied Characters
If Cell Begins with One of Three Supplied Characters

If you want to test values to see if they begin with some given specific characters like “x”, ”y”, or “z”, you can create a formula with COUNTIF and SUM functions to return results. EXAMPLE You can see “TRUE” or ...

Fix #N/A Error For VLOOKUP From Another Sheet
vlookup from anther sheet not working1

This post will show you how to fix the #N/A error why it occurs when you extract values from another sheet using VLOOKUP function in Excel 2016,2013,2010 or other Excel versions. How can you correct a #N/A error in VLOOKUP ...

Sidebar