I was wondering if it is possible to capture 5 letters off of a contacts full name based on its sequence? for example:

eg. Surname Jolie-Pitt, First Name An gie

Result: OLENG

Non-alphabetic characters (eg. Hyphens (as in Lee-Archer) apostrophes (as in O'Mara) or blank spaces (as in Eu Jin) should be ignored when counting the position of each character

1 Answer 1


Formulas don't provide any convenient way to strip a set of characters, but you can call SUBSTITUTE as many times as needed. I'd recommend putting this into a hidden field so you don't have to copy and paste it when finding your letters.

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LastName, " ", ""), "'", ""), ",", ""), "-", "")

RIGHT(LEFT(LastName_Stripped__c, 3), 2) & RIGHT(LEFT(LastName_Stripped__c, 5), 1)
& RIGHT(LEFT(FirstName_Stripped__c, 3), 2)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .