10 Replies Latest reply on Apr 26, 2018 10:10 AM by Deepak Rai

# Trim String Calculation

I saw a post similar to what im trying to do but the wrong way around, please advise how I can do the below:

Dimension value is in a string like below:

"Bart Simpson - XXXXXX"

"Maggie Simpson - XXX"

I want a formula that will take the values from the right up to the space e.g XXXXXX and XXX

• ###### 1. Re: Trim String Calculation

Hi there,

Assuming the format you provide holds for all values, i.e. the character of interest will always be the third space, the following should work:

mid([String],FINDNTH([String], " ", 3)+1)

hope that helps.

Cheers
Vinnie

• ###### 2. Re: Trim String Calculation

Hi,

Thanks,

Navya

• ###### 3. Re: Trim String Calculation

To clarify, I don't want the name pieces I want the XXXXs at the end. Thanks

• ###### 4. Re: Trim String Calculation

The solution I gave you should return the XXXXXs

• ###### 5. Re: Trim String Calculation

Its not always going to be the 3rd space unfortunately so need it to take values from the right up to the 1st space, that is the constant part.

Thanks

• ###### 6. Re: Trim String Calculation

Try this....

SPLIT([string]," ",-1)

2 of 2 people found this helpful
• ###### 7. Re: Trim String Calculation

Thank you thats it!

• ###### 8. Re: Trim String Calculation

Here you go.

RIGHT([Name], LEN([Name])- FINDNTH([Name], "-", 1))

Thanks,

Navya

• ###### 9. Re: Trim String Calculation

You are welcome!

• ###### 10. Re: Trim String Calculation

Right(string, len(string)-Find(string,”-“,-1))