formula to remove a space and replace but depending on the details

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

Ok so please help with this formula if you can?

I have names in column B

I need to change the way they are recorded for our new system.

In colunm "B" I have names that are all set up as either sir name and first name or sirname and initial.

I need to reove the space between these words and follow this simple rule.

If the name in the cell (say"B6") has only one digit after the space then replace the space with a full stop "."

examples:

Tony W becomes Tony.W
Jon K = Jon.k
Billy X = Billy.X etc

but if its more than 1 digit remove the space

So:

Tony Wills =TonyWills
Jon Ko = JonKO
Billy Xavia = BillyXavia

please help if you can.
thanks

Tony
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
One option
=IF(SEARCH(" ",B6)=LEN(B6)-1,SUBSTITUTE(B6," ","."),SUBSTITUTE(B6," ",""))
 
Upvote 0
Here's another way:
=SUBSTITUTE(A1," ",IF(LEFT(RIGHT(A1,2))=" ",".",""))
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,242
Members
452,623
Latest member
russelllowellpercy

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