Microsoft KB Archive/75513

= XL: How to Reverse the Order of Words in a Text String =

Article ID: 75513

Article Last Modified on 11/16/2006

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition
 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 95 Standard Edition

-



This article was previously published under Q75513



SUMMARY
This article explains how to reverse the order of words in a comma-separated text string by using the FIND, LEFT, LEN, and RIGHT functions in Excel.



MORE INFORMATION
Suppose that there are two words separated by a comma in cell A1. A typical example is &quot;LastName, FirstName&quot;. The following formula reverses the order of the two words and eliminates the comma:

=RIGHT(A1,(LEN(A1)-(FIND(&quot;,&quot;,A1)+1)))&&quot; &quot;&LEFT(A1,(FIND(&quot;,&quot;,A1)-1))

The formula searches for a comma and takes the text that falls to the left of the comma; it then concatenates that text to the end of the text that falls to the right of the comma. If A1 contains the text string &quot;Jones, Bill&quot;, and you type the formula in cell B1, the text string &quot;Bill Jones&quot; is returned.

Keywords: kbhowto KB75513

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.