ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Sorting (https://www.excelbanter.com/new-users-excel/84088-sorting.html)

bsoldner

Sorting
 
I need to sort a column in desending order so the first number is 121, 120,
etc. down to 1. Some numbers have an alpha (68a, 68b) but I still want them
in the correct order. Right now the cell formating is "general." How do I
accomplish? Thanks!

David McRitchie

Sorting
 
The answer you get is not likely to be better than your description.
So all I can say is see if this solves your question.

Create a helper column to extract the digits, and sort on that as
a descending number. Then sort on the original column which is
text in ascending or descending order depending on if
68a is to come before 68b or 68b is to be before 68a (In the
correct order doesn't quite work for me.

Install the the following User Defined Funciton using instructions in
if you are not familiar with installing macros and User Defined Functions.
http://www.mvps.org/dmcritchie/excel....htm#havemacro

The following macro is explained at
http://www.mvps.org/dmcritchie/excel/sorting.htm#VAL


Function CellValue(c) As Double
'John Walkenbach 2001-04-25
' misc returns number part
CellValue = Val(c)
End Function

B1: =Cellvalue(A1)
or if installed in your personal.xls workbook
B1: =personal.xls!CellValue(A1)



---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"bsoldner" wrote in message ...
I need to sort a column in desending order so the first number is 121, 120,
etc. down to 1. Some numbers have an alpha (68a, 68b) but I still want them
in the correct order. Right now the cell formating is "general." How do I
accomplish? Thanks!





All times are GMT +1. The time now is 12:55 AM.

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