FWIW,
Can't overshadow the text / number formulas, but this little one works great
for numbers *only*:
Ascending,
=SMALL($A$1:$A$100,ROW())
Descending,
=LARGE($A$1:$A$100,ROW())
--
Regards,
RD
--------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit!
-------------------------------------------------------------------
Is there a built in formula in Excel for Sort? For
example, I would like to have B1:B10 returned as the
sorted (alphabet) result of A1:A10. I know I could create
a marco for this, but I am hoping a formula (or complex
multiple formulas) would solve this issue. Thanks in
advance.
First off, if all cells in A1:A10 hold distinct values, there's no need for
tie-breaking. If there were duplicate values in A1:A10, and B1:B10 were only
to
hold the sorted values from A1:A10, there's still no need for tie-breaking.
Enter the following array formula in B1.
=INDEX($A$1:$A$10,MATCH(SMALL(COUNTIF($A$1:$A$10,"<"&$A$1:$A$10)
+COUNT($A$1:$A$10)*ISTEXT($A$1:$A$10),ROW()-ROW($B$1)+1),
COUNTIF($A$1:$A$10,"<"&$A$1:$A$10)+COUNT($A$1:$A$10)*ISTEXT($A$1:$A$10),0))
Then double click on the Fill Handle, the square in the bottom right corner
of
the border around the active cell. This sorts in ascending order, numbers
before
text. To sort in descending order, text before numbers, replace the SMALL
calls
with LARGE calls in the formula above.
If A1:A10 contained only numbers or only text, this could be reduced to
=INDEX($A$1:$A$10,MATCH(SMALL(COUNTIF($A$1:$A$10,"<"&$A$1:$A$10),
ROW()-ROW($B$1)+1),COUNTIF($A$1:$A$10,"<"&$A$1:$A$10),0))
No intermediate ancillary calculations in other cells needed.