OzGrid

How to sort values in positive and negative numbers with formula

< Back to Search results

 Category: [Excel]  Demo Available 

How to sort values in positive and negative numbers with formula

 

Requirement:

 

I have a lot of values in a column such as 570, 850, 77, -44, 87, 90, -740.

I'd like to sort them with a formula but couldn't figure out how it'd be done.

Important point: these numbers must be listed as follows: 850, -740, 570 and goes on. Although it is a negative number, "change value" is essential for my report; that is why it follows 850 in my list.

I am aware of pivot or similar solutions but I would like to manage it with a formula.

Any help will be appreciated.

 

Solution:

 

Do you need to sort in Ascending or Descending order ...???

With an Array Formula ...

Either

Code:
=SMALL(ABS($A$1:$A$7),ROWS(A$1:A1))

or

Code:
=LARGE(ABS($A$1:$A$7),ROWS(A$1:A1))

 

Obtained from the OzGrid Help Forum.

Solution provided by Carim.

 

See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets

 

See also:

How to sort by phone #, phone # in different columns, phone # with extensions
How to look and sort blocks of rows
How to use VBA code to sort worksheets based on a pre-sorted named-range
How to sort results after copying data from multiple sheets

 

Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.


Gallery