ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Swapping two words in one cell (https://www.excelbanter.com/excel-worksheet-functions/220483-swapping-two-words-one-cell.html)

Christie

Swapping two words in one cell
 
I have two words in one cell and would like to swap them and place them in
another cell eg Allan Smith and I would like it to say Smith Allan.

Once this is done I would then like the two words into two seperete cells.

How can I do this?

Rick Rothstein

Swapping two words in one cell
 
Try this...

=MID(A1&" "&A1,FIND(" ",A1)+1,LEN(A1))

--
Rick (MVP - Excel)


"Christie" wrote in message
...
I have two words in one cell and would like to swap them and place them in
another cell eg Allan Smith and I would like it to say Smith Allan.

Once this is done I would then like the two words into two seperete cells.

How can I do this?



mdmackillop[_10_]

Swapping two words in one cell
 

=RIGHT(E12,LEN(E12)-SEARCH(" ",E12)) & " " & LEFT(E12,SEARCH("
",E12)-1)
You can put it into two cells by using the Right and Left parts of the
code separately.


--
mdmackillop
------------------------------------------------------------------------
mdmackillop's Profile: http://www.thecodecage.com/forumz/member.php?userid=113
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=62831



All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com