0

I have a few values:

5T-7T
7T-12T
12T-22T
22T-145T

I use that formula to get my last value:

TRIM(RIGHT(TEXT(Items__c), FIND("-", TEXT(Items__c))-1))

It works but when my second value starts at "1", it removes this "1". So I get:

7T
2T
22T
45T

How can I fix that? And how can I delete T too?

1 Answer 1

3

Use MID(text, start, len) to select text within boundries, you were using RIGHT(len) which selects the right size of the text, this caused you ill effects since you did not include the length of the string ie. LEN(text)

Here are a list of more TEXT functions:

https://help.salesforce.com/articleView?id=customize_functions.htm&type=5#text_operators

MID(
    TEXT(Items__c),
    FIND("-", TEXT(Items__c))+1,
    LEN(TEXT(Items__c))-FIND("-", TEXT(Items__c))
    )
1
  • 2
    Could you provide some educational commentary in your answer as to why this solves the original problem?
    – Mark Pond
    Oct 30, 2018 at 20:27

You must log in to answer this question.

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