View Single Post
  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Tue, 7 Jun 2005 12:30:02 -0700, "postitnote"
wrote:

I work in a medical records office and we are attempting to combine five
years' worth of records onto one spreadsheet. Our office uses Terminal Digit
Order (or TDO) and it doesn't appear that Excel can sort this way as it is in
order with the last four digits, then the middle two, then the top three.
Does anyone know if there is a way to do this without having to put the SSN
in three separate columns and then merging the columns together somehow?


The simplest method would be to add a "helper column" that has the digit groups
in the order to be sorted -- then sort on that column.

If your digit groups are separated by dashes (and are located in column G),
then:

=RIGHT(G1,4)&MID(G1,5,2)&LEFT(G1,3)

will return a text string of the digits in the order you specified.

Include this helper column in your sort table, and sort on that column. You
can then delete or hide the helper column.

If it is going to be a repetitive task, it can be automated using a macro.

If your numbers are NOT separated by dashes, but are rather a sequential
string, then use this formula:

=RIGHT(TEXT(G1,"000-00-0000"),4)&MID(TEXT(
G1,"000-00-0000"),5,2)&LEFT(TEXT(G1,"000-00-0000"),3)


--ron