Share via

sort by last word in a field

Anonymous
2011-05-31T15:49:20+00:00

In Word 2007, is it possible to sort a list by the last word in the field (when all parts of the name are in just one field)? I'm trying to sort a list of names that look like this:

Mr. Joe Smith

Mr. and Mrs. Tom Baker

Mrs. Mary Ann Jones

Dr. and Mrs. William T. Miller

Thanks!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-05-31T17:02:42+00:00

The functions required for this are not available in Word (see Use a formula in a Word table: Available functions). However, they are native to Excel, so you could move your list there, perform the desired actions and copy the results back to your Word list/table.

  1. Open Excel to a blank worksheet and copy your list of names to column A.
  2. Place the following formula in B1 and copy or fill down as necessary:

     =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),99))

This should result in something like the following,

                      3. Highlight the entire range of data (e.g. A1:B4 in this example) and Select Data then Sort from the Sort & Filter group. 4. Change the Column, Sort by to Column B and click OK in the lower right.

         

The result should look like this,

                      5. Copy column A back to your Word list/table.

If you have more columns of information than just the names, bring those along with the names to Excel and adjust the column references in the example as necessary.

Was this answer helpful?

20+ people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2011-05-31T17:32:42+00:00

    Thank you so much for such a quick (and easy to understand) answer! It worked like a charm. And the finished product was supposed to be in Excel anyway so it worked out perfectly.

    Thanks again!

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments