XL: How to Reverse the Order of Words in a Text String (75513)



The information in this article applies to:

  • Microsoft Excel 2000
  • Microsoft Excel 97 for Windows
  • Microsoft Excel for Windows 95

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 "LastName, FirstName". The following formula reverses the order of the two words and eliminates 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; 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 "Jones, Bill", and you type the formula in cell B1, the text string "Bill Jones" is returned.

Modification Type:MinorLast Reviewed:8/15/2005
Keywords:kbhowto KB75513