How to Reverse the Order of Words in a Text StringLast reviewed: November 2, 1994Article ID: Q75513 |
SUMMARYYou can reverse the order of words in a comma-separated text string by using Excel's FIND, LEFT, LEN, and RIGHT functions.
MORE INFORMATIONSuppose there are two words separated by a comma in cell A1 on your worksheet. A typical example would be "LastName, FirstName". The following formula will reverse the order of the two words and eliminate the comma:
=RIGHT(A1,(LEN(A1)-(FIND(",",A1)+1)))&" "&LEFT(A1,(FIND(",",A1)-1))The formula searches for a comma and takes the text that falls to the left of the comma, and concatenates that text to the end of the text that falls to the right of the comma. If A1 contains the text string "Jones, Bill", and you enter the above formula in cell B1, the text string "Bill Jones" is returned.
REFERENCES"Microsoft Excel Function Reference," version 3.0, pages 76, 137, 200
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |