Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

This article was previously published under Q75513

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


Keywords: KB75513, kbhowto

↑ Back to the top

Article Info
Article ID : 75513
Revision : 3
Created on : 9/19/2011
Published on : 9/19/2011
Exists online : False
Views : 476