Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
ShowAll Questionssorted byDate Posted
Roger-doger

# Help Splitting up Full Name field into First Name and Last Name

Hello

I have a field where a Full Name is entered - I need to split this into a First Name field and a Last Name field

I have created the fields - I need help on the formula

In many cases there are 4 entries

John abott-gacey

Mary Smith-Felch

Sam M. Wall

Thanks

Steve :-/

Okay for that you're gonna need to create a set of formulas that use a combination of FIND, MID, LEFT, RIGHT functions to parse out the different elements of the Name Field.

Here's some more info on those functions to help get you started ->

https://na2.salesforce.com/help/doc/en/salesforce_useful_formula_fields.pdf

Roger-doger

Thanks - Disarm the settlers!

Do you have any suggestions / examples of an actual formula that can work

I have played around with a nested If statement - it has limitations I cant break through - it works fine for the first name

This is what I have - for first name

LEFT( Name ,
if ( begins( mid( Name,2,1) ," "),1,
if ( begins( mid( Name,3,1) ," "),2,
if ( begins( mid( Name,4,1) ," "),3,
if ( begins( mid( Name,5,1) ," "),4,
if ( begins( mid( Name,6,1) ," "),5,
if ( begins( mid( Name,7,1) ," "),6,
if ( begins( mid( Name,8,1) ," "),7,
if ( begins( mid( Name,9,1) ," "),8,
if ( begins( mid( Name,10,1) ," "),9,
if ( begins( mid( Name,11,1) ," "),10,
if ( begins( mid( Name,12,1) ," "),11,
12
))))))))))))

the last name I need help!

Steve :-/

LOL!!!

Lemme see what I can dig up, I might have a parse formula that I can cannibalize.

PS.  I'm waiting for Sunday, four days after Wednesday...

Roger-doger

Thanks!

Btw - was at the NYEve show in NYC - classic

Steve :-/

On the "GBV Classic Lineup" reunion tour this past year?  The Boston Show was sold out before tickets even went on sale.  Seriously, the box office had none but people were already selling them on EBay and StubHub for 10X Face Value.

I have seen Tobin Sprout on his own a few times (and GBV probably about a dozen or more).

Anyway, still digging through me archives looking for that WFR (I've literally got TONS of them on my Developer SFDC Org)

Roger-doger

Hey

Toby is the best! The classic line up was amazing - we had to suck it up and get the tcks on stub hub - man the show was similar to a religous experience - i have never hugged and hi-fived so many strangers in my life!

Thanks again for the efforts

Steve :-/

I think I may have found some of that Name Parsing Code, just have to make sure I have the right ones.

Steve :-/

Okay, I was able to fine some of them.

First Name.

`LEFT( Text_1__c ,FIND(" ", Text_1__c ,1)-1)`

Middle Initial

` MID( Text_1__c,FIND(" ", Text_1__c,1)+1,((FIND(".", Text_1__c,1)-1)-FIND(" ", Text_1__c,1)))`

Last name (still looking)

The club is open!!!

Roger-doger

many thanks for this! These work perfectly

Anything you find on the last name is greatly appreciated!

The Club is definitely Open!

Thanks

JackieTravieso

Hey SteveMo!

I have a scenario and am wondering if/how your splitting solution could be applied.

I've created a new Create Contact button on the Account.

It creates the Contact and passes 6 pieces of data from the Account to the new Contact Record.

2nd Business Owner's Name field is text (50). I need this field to split into First Name and Last Name fields. It also needs to take into consideration hyphenated names or multiple names (i.e., Sun Ye Linn)

Is your splitting formula the right solution AND is this part of a field update WFR?

And, just in case no one has told you today... YOU ARE THE BEST!

jy

ArnoldFB

Hey Steve,

Looking for a slightly different spin on this.

I've got an email template that truncates the supplied name on cases so the user gets "Dear Steve"  instead of "Dear Steve Mo."

Except of course there's our double first name user eg  "Mary Ann"  vs simply "Ginger"  (That's a whole other formula, sorry to digress.)

Aaaaaanyway, I could customise the formula for her with Contains Mary Ann, but I'd rather figure out something that would work for all future two namers.

Fisrt name formula works fine: LEFT(SuppliedName, Find(" ",SuppliedName))

But I'm having trouble wrapping my head around using find to get the second space and parse out the middle name.

Any help appreciated.

Best,

AFB

P.S.  You can blame the button click admins for my seeking you out for this.  Thanks.

bgm1234

Hi, by using that as a formula field we only get middle name initial...

iam trying to to get full middle name??????? how??

will u please solve my issue

BrandonPitts
I found a formula that works for me on the Last Name field.

RIGHT(nameField,LEN(nameField)-FIND(" ",nameField))

Hope this helps everyone!
Sarah Stiffler
Did anyone find this for the last name.  In the event a person has a middle name like Sarah Marie Doe, I need to pull only Sarah in one field and Doe in another.  This works for first name: LEFT( Billing_Contact_Name2__c ,FIND(" ", Billing_Contact_Name2__c ,1)-1)
Last name is not working as its pulling the middle name and I don't want that.  This is what I am using for last name: RIGHT( Billing_Contact_Name2__c ,LEN(Billing_Contact_Name2__c)-FIND(" ",Billing_Contact_Name2__c))

Sarah
Sakura Suzuki
Hi there, I need help me with these instructions to code/create new formula so I can seperate the Account First and Last Name. Please call me. (415) 931-2294 Thank you.
usersfdc21
Hi Sakura,
condition: for custom object, we need to have lookup relationship for Account.
if you need Account first Name and Last Name as seperate fields to any object,  you can do as below: In custom object --> create a formula field --> return type as Text --> enter a formula as --> Account.FirstName. save it. For Last Name: enter a formula as --> Account.LastName. hope this works.
Sakura Suzuki
I still need help. Can someone please call me? Thank you. Best, Sakura ******************************** Sakura Suzuki Administrative Manager Kimochi, Inc. 1715 Buchanan Street San Francisco, CA 94115 Tel: (415) 931-2294 ext. 120 Fax: (415) 931-2299 ssuzuki@kimochi-inc.org Web: www.kimochi-inc.org ******************************** The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Roland van Essen
I found this one:

=RIGHT(B3,LEN(B3)-FIND("*",SUBSTITUTE(B3," ","*",LEN(B3)-LEN(SUBSTITUTE(B3," ","")))))

Looks for the number of spaces and uses that for the last space in the full name.
That last space then gets substitued with a *. After that * you will find the last name.
Sakura Suzuki
Hi Ray, Thank you for your email. I’m not sure if you understood my question. Can you give me a call when you get a chance? (415) 931-2294. Thank you. Best, Sakura ******************************** Sakura Suzuki Administrative Manager Kimochi, Inc. 1715 Buchanan Street San Francisco, CA 94115 Tel: (415) 931-2294 ext. 120 Fax: (415) 931-2299 ssuzuki@kimochi-inc.org Web: www.kimochi-inc.org ******************************** The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Tammy Schorr 11
LEFT(Account.Name, FIND( " ", Account.Name ) -1 )