Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have Field contains the values with '&'. This '&' could be anywhere in the string, but I want to extract the string between last and second last '&'
for eg. I have string like abc&xyz&pqr&ghi
I want the value pqr
something like this
= mid(Field, Index(Field,'&',-2)+1, Index(Field,'&',-1) -(Index(Field,'&',-2)+1))
something like this
= mid(Field, Index(Field,'&',-2)+1, Index(Field,'&',-1) -(Index(Field,'&',-2)+1))
You can also try this:
=SubField('abc&xyz&pqr&ghi', '&', Index(KeepChar('abc&xyz&pqr&ghi', '&'), '&', -1))
Output is pqr here
=SubField('abc&xyz&pqr&ghi','&',-2) -> pqr
thanks. all are working
I agree all solution are working, but I would suggest using ANTONIO's solution as it is the most straight forward of the three.
Best,
Sunny
Even I agree with sunindia , use AntonioTiman solution