Need a little formula help this morning please. - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Steve ConnellySteve Connelly 

Need a little formula help this morning please.

I need to create a new formula field that will extract the first four digits from another text field.

So if the source field is: 4209-59477-806

Then the new formula field will contain: 4209

How do I do that please?

Steve
Best Answer chosen by Steve Connelly
Eric PraudEric Praud
Hi Steve,

Just create a formual field returning text:
LEFT(SourceField__c,4)

All Answers

Eric PraudEric Praud
Hi Steve,

Just create a formual field returning text:
LEFT(SourceField__c,4)
This was selected as the best answer
Steve ConnellySteve Connelly
Perfect!

Thanks much.
Sc
Eric PraudEric Praud
By the way, if you want to use it as a number later, then change the return type of the formula to number and change the formula like so:
VALUE(LEFT(SourceField__c,4))