Switching names and adding period

natthefatcat

New Member
Joined
Jan 12, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi I am trying to create a formula and I have figured out how to do each seperately but not combined. I would like to be able to reverse order of names and add a "." to any middle initial given. An example would be

Johnson V Edward

I would like it to translate to

Edward V. Johnson in a separate cell.

Any help is appreciated!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Names are notoriously hard to work with. A few questions:

* What would the input be if a person has multiple middle names, e.g.: 'Johnson VE Edward', or rather; How is input displayed when a person has multiple middle names?;
* What would the output be if a person has no middle names but multiple spaces, e.g.: 'Johnson Jackson Edward';
* What version of Excel are you using? You can edit this in your profile settings and will help other help you correctly;

.... probably more questions comming depending on input =)
 
Last edited:
Upvote 0
It is unlikely that we would encounter that but I would believe it would show as

Johnson V Adam Edward

It should read as

Edward Adam V. Johnson
 
Upvote 0
So not only would you like to switch first/last name around, you'd also like re-order the words used for both first- & lastname?

I edited my previous comment to include a few other questions for clarification.
 
Upvote 0
Sorry I am trying to teach myself excel and this forum I appreciate your patience and help!

Multiple middle names are shown as Johnson Edward V Adam, I need it to be shown as Edward V. Adam Johnson. Or if the middle name isn't shown in full it would show as Johnson Edward V A and I need it to be shown as Edward V. A. Johnson.

If there is no middle name, I just need the names to be flipped to show as Edward Johnson rather than Johnson Edward.

I have Microsoft 365 if that helps.

Very sorry I am not much help, but I really appreciate your help.
 
Upvote 0
=MID(D4&" "&D4,SEARCH(" ",D4)+1,LEN(D4))

This is a code I am currently using to flip the names.

This helps it read properly, placing the first name first and then the last name. I am struggling with names that have a middle initial on adding a period after the initial. The formula places the initial in the correct spot so the name reads as Edward V Johnson but I cannot figure out how to place the "." without getting a #value issue for that cell.
 
Upvote 0
That's a bit different to your 1st initial post. Maybe it's best to use the xl2bb tool to showcase different types of input and the desired output. But based on your latest comment I came up with:

Book1
AB
1Johnson Edward V AdamEdward V. Adam Johnson
2Johnson Edward V AEdward V. A. Johnson
3Edward JohnsonJohnson Edward
Sheet12
Cell Formulas
RangeFormula
B1:B3B1=MAP(A1:A3,LAMBDA(z,LET(x,TEXTSPLIT(z,," "),y,IF(LEN(x)=1,x&".",x),TEXTJOIN(" ",,DROP(y,1),TAKE(x,1)))))
Dynamic array formulas.


Note this is different to your initial post and won't work for 'Johnson V Edward' since the above is simply not in the same sequence of First-middle-lastname.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,667
Members
449,045
Latest member
Marcus05

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