Rearranging a formula

smalik

Board Regular
Joined
Oct 26, 2006
Messages
180
Office Version
  1. 365
Platform
  1. Windows
A fellow board member helped me earlier with a formula that I have been using without a problem. However, I have new situation where I need help in modifying the formula.

This formula breaks down the name into three columns by First, Last, and Middle name

Here is what I have and need:
1699550114591.png


I need a modified formula for First Name and Middle Initial so that if the first name has "&" then the formula considers it as part of the first name. For example, Anthony & Sheryl should go in the first name field and Middle Initial field is blank. Everything else is fine.

Here is the formula I am using:

1699550280212.png


Since I am unable to upload the XL2BB version, here is the Excel area (it does not look pretty, but hopefully get the job done):
Current Result​
Desired Result​
Full NameFirst NameLast NameMiddle InitialFirst NameLast NameMiddle Initial
Albrecht, DougDougAlbrechtDougAlbrecht
Bevis, Anthony & SherylAnthonyBevis& SherylAnthony & SherylBevis
Allford, Daniel WDanielAllfordWDanielAllfordW
First NameIF(A3="","",IFERROR(TRIM(SUBSTITUTE(LEFT(A3,FIND(" ",A3&" ",FIND(",",A3)+2)-1),C3&",","")),LET(t,SUBSTITUTE(A3," & ","/"),SUBSTITUTE(LEFT(t,FIND(" ",t)-1),"/"," & "))))
Last NameIF(A3="","",IFERROR(LEFT(A3,FIND(",",A3)-1),TRIM(RIGHT(SUBSTITUTE(A3," ",REPT(" ",50)),50))))
Middle InitialIF(A3="","",TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A3&", ",C3&",","",1),"/"," & "),","," "),"."," "),B3&" ","",1)))

As usual, any help is greatly appreciated.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
HI

Excel Formula:
=CHOOSECOLS(SUBSTITUTE(TEXTSPLIT(TEXTSPLIT(SUBSTITUTE(A3& ", , "," & ",", &"&CHAR(160))," ")," "),",",""),2,1,3)
 
Upvote 0
Thanks for the formula. However, this still gives me "& Sheryl" in the Middle Initial Column.
 
Upvote 0
Hi

Excel Formula:
=CHOOSECOLS(SUBSTITUTE(TEXTSPLIT(TEXTSPLIT(SUBSTITUTE(SUBSTITUTE(A3," & ",CHAR(160)&"&"&CHAR(160))& ", , "," & ",", &"&CHAR(160))," ")," "),",",""),2,1,3)
 
Upvote 0
Solution
Awesome ... This works ..... Thank you very much
 
Upvote 0

Forum statistics

Threads
1,215,154
Messages
6,123,327
Members
449,098
Latest member
thnirmitha

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