1+(Sub(Str1,x,1)="B")->Z If its B, z=2, else, z=1... dont know how much this consolidates it, but it should work.... -joel