hoosierdaddy81 asked:
It’s a simple problem, with most likely a complicated answer. I have a series of data that is in auto-sum, I want the greatest value to be ranked first and the lesser value, which may be negative, to be last. The ranks go from 1st to 17th.
This will be a contiguos series, I don’t want to keep resorting every time I enter something.







select the range you want to sort.
select “sort…” .. in descending order
Near the formula bar there is a sign for function, click on it and enter rank and it will help you with the “rank function”
format is rank(number, range or array, ascending or descending)
Consider using the RANK funtion to return the rank of a value within a range or use the LARGE function to retun the value of a given rank in a range.
Here is an Auto-Sort sample file
and lesson1
and lesson2
Enjoy them, they got exactly what you need
VBAXLMan
I did it using VBA code. My column to search is Column A. Do you know how to input the VBA code? If not, just right click over “sheet 1″, click “view code” and then paste this code below in. Now anytime you enter numbers in column A it will automatically sort as soon as you leave the cell.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim colAValue As Variant
Dim formulaStr As String
If Not Intersect(Target, [A:A]) Is Nothing Then
colAValue = Target.EntireRow.Range(“A1″).Value
formulaStr = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row, Cells(Rows.Count, 2).End(xlUp))
Cells.Sort Key1:=[A1], Order1:=xlAscending
If TypeName(colAValue) = “String” Or colAValue = vbNullString Then
colAValue = Chr(34) & colAValue + Chr(34)
End If
formulaStr = “=max(–(A1:A” & formulaStr & “=” & colAValue & “)*row(A1:A” & formulaStr & “))”
Cells(Evaluate(formulaStr), 3).Select
End If
End Sub