Change order of text string

GScott

New Member
Joined
Oct 12, 2013
Messages
28
Office Version
  1. 365
Platform
  1. Windows
I have a cell that contain the text (say) CITIZEN, JOE MR

What I need to do is write a formula that results in MR JOE CITIZEN in once cell.


Can anyone suggest an appropriate formula please.

thanks
 
Here is an example
Thank you, that is much clearer. For example, this sample also has a double surname which we hadn't seen before.

Excel Workbook
AB
1CITIZEN HAWKINS, ELIANE MRSMRS ELIANE CITIZEN HAWKINS
2CITIZEN, SUSAN MRSMRS SUSAN CITIZEN
3JOHNSON, CLINTON MR (CODE RED)MR CLINTON JOHNSON (CODE RED)
4DEAKIN, RICHARD MRMR RICHARD DEAKIN
5WANDAH, PETRI-SEBASTIAN MRMR PETRI-SEBASTIAN WANDAH
6PETERS-JONES, SUZANNE MSMS SUZANNE PETERS-JONES
7JIMBO, PER MR (YELLOW)MR PER JIMBO (YELLOW)
8LYNCH-WATKINSON, KATIER MSMS KATIER LYNCH-WATKINSON
9LIMBO, LI MEI MRS (CODE WHITE-ORANGE)MRS LI MEI LIMBO (CODE WHITE-ORANGE)
Rearrange Names
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Another option :

=LOOKUP(2,1/FIND({"MR","MRS","MS"},A1),{"MR","MRS","MS"})&MID(A1,FIND(",",A1)+1,MIN(FIND({"MR","MRS","MS"},A1&"MRMRSMS")-FIND(",",A1)-1))&LEFT(A1,FIND(",",A1)-1)&MID(A1,FIND(" (",A1&" ("),99)

Regards
 
Upvote 0
Another option :

=LOOKUP(2,1/FIND({"MR","MRS","MS"},A1),{"MR","MRS","MS"})&MID(A1,FIND(",",A1)+1,MIN(FIND({"MR","MRS","MS"},A1&"MRMRSMS")-FIND(",",A1)-1))&LEFT(A1,FIND(",",A1)-1)&MID(A1,FIND(" (",A1&" ("),99)

Regards
That will fail or produce erroneous results for names like

THOMSON, ELIANE MRS
CITIZEN, KAMRAN MR
 
Upvote 0
That will fail or produce erroneous results for names like

THOMSON, ELIANE MRS
CITIZEN, KAMRAN MR

Then......

In avoid the words contain MR, MRS and MS, herein the following formula is fixed by adding a space behind :

=LOOKUP(2,1/FIND({" MR"," MRS"," MS"},A1),{"MR","MRS","MS"})&MID(A1,FIND(",",A1)+1,MIN(FIND({" MR"," MRS"," MS"},A1&" MR MRS MS")-FIND(",",A1)))&LEFT(A1,FIND(",",A1)-1)&MID(A1,FIND(" (",A1&" ("),99)

Regards
 
Upvote 0
I had identified the issues you mentioned.
Peter's solution is the preferable one because it avoids the need to define the salutations. Whilst I don't have any DR's or PROF's much less MISS or HON, it is possible somebody might try and enter this information.

Thanks for your efforts. I know have a solution.

Gavin
 
Upvote 0
.. much less MISS ..
That's interesting. I don't know where your list relates to but Miss would be a very common title here in Australia.

In any case, glad you have something that you can work with. :)
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,457
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top