Forum Discussion

kyrillkaz's avatar
kyrillkaz
Copper Contributor
Apr 07, 2021

IF with two REPLACE statements to move character in string

Hi,

 

I have a 40 character-long string in which I want to check if there is a C on the 23rd position and if so, move that C to the 37th position. Right now, I'm trying to do it with the following formula.

 

=IF((MID(B8;23;1)="C");AND(REPLACE(B8;23;1;" ");REPLACE(B8;37;1;"C"));FALSE)

 

This is unfortunately giving me #VALUE errors. 

 

Am I doing something wrong? And is there perhaps an easier way to resolve my use case?

3 Replies

Resources