# Convert string manipulation formula from excel to CR

Hello everyone,

I have a formula that I am trying to convert to crystal syntax. In excel formula works. Basically, it outputs the string between two hyphen characters.

XXXXX-WHITE-1 >>>>>>> formula >>>>>>>> WHITE

Here is the formula that I use in excel:

=MID(A1,FIND("-",A1)+1,(FIND("-",A1,FIND("-",A1)+1))-FIND("-",A1)-1)

How can I convert this formula into something that crystal reports understand?

P.S. A1 is going to be ItemCode.

Any help is appreciated!

##### Tags:

##### Abhilash Kumar replied

Hi Korhan,

Try this please:

**local stringvar s := {A1};**

**local stringvar temp := Mid(s,Instr(s,'-')+1);**

**if instr(temp,'-') > 0 then**

** Mid(temp,1,Instr(temp,'-')-1);**

**-Abhilash**