Adjust cell format accordingly for decimal places and use this formula.


=IF(B2<A2,-B2/A2,(B2-A2)/B2)