I NEED AN EXCEL FORMULA - HELP!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I HAVE A COLUMN OF DATES AND I NEED TO SORT BY THE MOST CURRENT DATE AS IT IS UPDATED, WHAT IS THAT FORMULA?
 
As long as they are in true date format, select the data and do Data / Sort /
Descending.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
Seasons Greetings and Very Best wishes to all :-)
----------------------------------------------------------------------------



LITTLE1 said:
I HAVE A COLUMN OF DATES AND I NEED TO SORT BY THE MOST CURRENT DATE AS IT IS
UPDATED, WHAT IS THAT FORMULA?
 
It depends on the size of your list. Formulas cannot directly sort data. To actually sort you will need to go to Data>Sort on the pulldown menu

If your list isn't too long you might be able to set up a helper column and use the RANK function on the dates. Then on another sheet you could use LOOKUP to pull each data set based on its rank. This isn't very practical for large data sets, and will require tweeking every time you add a new line of data

FYI - Typing in all caps is considered yelling

Good Luck
Mark Graesse
(e-mail address removed)

----- LITTLE1 wrote: ----

I HAVE A COLUMN OF DATES AND I NEED TO SORT BY THE MOST CURRENT DATE AS IT IS UPDATED, WHAT IS THAT FORMULA?
 
Ken,

I think that LITTLE1 wanted to auto sort when he changed a date
but he was shouting so I turned the volume off.

John
 
This might do what you want - It's not sophisticated, but
might do the job:

Let's say you have two columns of data that you want
sorted every time a date is updated:
(colA) (col B)
Last loggedin User
06/23/1995 Wallace
06/15/1999 bigbubba
04/27/2001 Sallhy
05/04/2005 Bobb
06/15/2005 frank
01/08/2010 miranda

First, select column A data (dates only) and name
as "DRange"; then select these cells AND the user
names (names only) from Col B and name that
combined set of cells "SrtRange".

Insert the following code in your workbook (select
the tab name at the bottom (ie "Sheet1") by right-
clicking, then view code and paste.

----------------------------
Public sFlag As Boolean
Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r As Range
Dim s As Range
Set r = Range("DRange")
Set s = Range("SrtRange")
If InRange(Target, r) Then
SortEm s
sFlag = True
Else
If sFlag Then
SortEm s
sFlag = False
End If
End If
End Sub
Function InRange(Target As Range, r As Range)
Dim c As Variant
For Each c In r
If Target.Address = c.Address Then
InRange = True
Exit Function
End If
Next c
End Function
Sub SortEm(s As Range)
s.Sort Key1:=s.Cells(1, 1)
End Sub
------------------------------------

Each time you change dates, both columns will be sorted.
(actually it sorts even when you click on any date
in range "DRange", but I can't get around that.)

good luck,
jr

-----Original Message-----
I HAVE A COLUMN OF DATES AND I NEED TO SORT BY THE MOST
CURRENT DATE AS IT IS UPDATED, WHAT IS THAT FORMULA?
 
Back
Top