Search code examples
excelstringreplaceformula

Excel - Can't Extract Partial String via known formulas


I know this has been beaten to death but I cannot get mine to work for the below example:

%B1234567^SMITH/MIKE^ABC123DEF456?;1234567=0111000?

A1 contains the above text data and I am trying to copy the string between "%B" and the first "^". I tried:

=mid(left(A1,find("%B",A1)-1),find("^",A1)+1,len(A1))

But no data appears in B1 (where the formula is placed). Any suggestions?

Thanks, Brendan


Solution

  • You could use:

    enter image description here

    Formula in B1:

    =MID(A1,FIND("%B",A1)+2,FIND("^",A1,FIND("%B",A1))-FIND("%B",A1)-2)