ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sorting by equations (https://www.excelbanter.com/excel-worksheet-functions/8128-sorting-equations.html)

cpastor

Sorting by equations
 
Is it possible to sort by equation results? If so, how?

Frank Kabel

Hi
it is possible BUT is only feasible for small amount of records (as it's
quite slow). Depending on your data structure you may try the following array
formulas (entered with CTRL+SHIFT+ENTER): These formulas sort mixed data
types (text, numbers, boolean values, error codes - If you have simpler data
- e.g. only numbers - post back as you can simplify the formulas))
(assuming your data is in A3:A20) try:
B3:
=INDEX(IF(ISBLANK($A$3:$A$20),"",$A$3:$A$20),MATCH (SMALL(COUNTIF(
$A$3:$A$20,"<"&$A$3:$A$20)+0*BigNumber*ISNUMBER($A $3:$A$20)+1*BigNumber*ISTEXT($A$3:$A$20)+2*BigNumb er*ISLOGICAL($A$3:$A$20)+3*BigNumber*ISERROR($A$3: $A$20)+4*BigNumber*ISBLANK($A$3:$A$20),ROW(1:1)),C OUNTIF($A$3:$A$20,"<"&$A$3:$A$20)+0*BigNumber*ISNU MBER($A$3:$A$20)+1*BigNumber*ISTEXT($A$3:$A$20)+2* BigNumber*ISLOGICAL($A$3:$A$20)+3*BigNumber*ISERRO R($A$3:$A$20)+4*BigNumber*ISBLANK($A$3:$A$20),0))

B4:
=INDEX(IF(ISBLANK($A$3:$A$20),"",$A$3:$A$20),MATCH (SMALL(COUNTIF(
$A$3:$A$20,""&$A$3:$A$20)+3*BigNumber*ISNUMBER($A $3:$A$20)+2*BigNumber*ISTEXT($A$3:$A$20)+1*BigNumb er*ISLOGICAL($A$3:$A$20)+0*BigNumber*ISERROR($A$3: $A$20)+4*BigNumber*ISBLANK($A$3:$A$20),ROW(1:1)),C OUNTIF($A$3:$A$20,""&$A$3:$A$20)+3*BigNumber*ISNU MBER($A$3:$A$20)+2*BigNumber*ISTEXT($A$3:$A$20)+1* BigNumber*ISLOGICAL($A$3:$A$20)+0*BigNumber*ISERRO R($A$3:$A$20)+4*BigNumber*ISBLANK($A$3:$A$20),0))

and copy this formula down. Bignumber is a large number which is than your
number of rows. e.g. define a name for this and set the name equatl to 70000

"cpastor" wrote:

Is it possible to sort by equation results? If so, how?



All times are GMT +1. The time now is 08:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com