Rearranging a formula

smalik

Board Regular
Joined
Oct 26, 2006
Messages
186
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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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