function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sumanth sasanapuri 18sumanth sasanapuri 18 

Trouble using Substitute function with Begins function in formula field

I am trying to use following syntax for removing prefix value "NDT/", and its working fine. 
IF((BEGINS(Client_Account__r.Name, "NDT/")),SUBSTITUTE(Client_Account__r.Name, "NDT/", ""),Client_Account__r.Name) 

Original value: NDT/Test 
Expected value: Test
Result: Test

Also Wondering, how to change the above syntax for values having prefix value as "ndt/" "Ndt/" or etc.,

Original value: ndt/Test, Ndt/Test, etc.,
Expected value: Test
Results i am getting with above syntax: ndt/Test, Ndt/Test

Your help is greatly appreciated!
Thank you!
Can you convert them to lower case and try to match. This ensures, whatever is the case, the prefix is matched. I have highlighted the portions I have changed. The syntax might not be correct. You might have to verify the syntax in salesforce.

IF((BEGINS(Lower(Client_Account__r.Name), "ndt/")),SUBSTITUTE(Client_Account__r.Name, "NDT/", ""),Client_Account__r.Name) 

Satish Kumar
Nishad KNishad K
Hi Sumanth,

Try this one, I think this will do the trick 
IF(SUBSTITUTE(Client_Account__r.Name, "NDT/", ""),SUBSTITUTE(Client_Account__r.Name, "NDT/", ""),
	IF(SUBSTITUTE(Client_Account__r.Name, "ndt/", ""),SUBSTITUTE(Client_Account__r.Name, "ndt/", ""),
		IF(SUBSTITUTE(Client_Account__r.Name, "Ndt/", ""),SUBSTITUTE(Client_Account__r.Name, "Ndt/", ""),Client_Account__r.Name)))
Let me know the outcomes 
Amit Singh 1Amit Singh 1
Hi Sumanth,

Try below formula and it will work as per your expectations.
IF((BEGINS(Lower(Name), "ndt/")),SUBSTITUTE(Lower(Name), "ndt/", ""),Name)

Cheers :)

Amit Singh.