cancel
Showing results for 
Search instead for 
Did you mean: 

Formula to remove last part of string

jacobsson_axel
Participant
0 Kudos

As the following example states, i need to remove the last part of a string, the "ref" part, to match rows that doesnt have this part to show under same header when used as a section.

As this string can be different from time to time it needs to locate the exact pattern "ref." to pinpoint where to cut the string.

Thank you a lot in advance,

Axel

example:

15651, SIG, Inst of TFA, ref.75100

needs to be exactly this (no comma)

15651, SIG, Inst of TFA

Accepted Solutions (1)

Accepted Solutions (1)

amitrathi239
Active Contributor
0 Kudos

try this.String is the object which contain values.

=Substr([String];1;Pos([String];", ref")-1)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Axel,

Please use below code

=Substr([MainString];1;Pos([MainString];"ref")-3)

Where [MainString] is the formula having "15651, SIG, Inst of TFA, ref.75100"

Please be sure that this string always needs to follow this pattern only i.e should always have ", ref" in it.

Regards

Niraj