Try this as a start.
Sub test()
LR = Cells(Rows.Count, 1).End(xlUp).Row
Loop1:
Range("C2:C" & LR).FormulaR1C1 = _
"=IF(RC[-2]=RC[-1],0,IF(RC[-2]=R[-1]C[-1],1,IF(RC[-2]=R[1]C[-1],-1,0)))"
Set Z = Columns(3).Find(-1, LookIn:=xlValues, Lookat:=xlWhole)
If Z Is Nothing Then GoTo Loop2
Cells(Z.Row, 1).Insert
GoTo Loop1
Loop2:
Range("C2:C" & LR).FormulaR1C1 = _
"=IF(RC[-2]=RC[-1],0,IF(RC[-2]=R[-1]C[-1],1,IF(RC[-2]=R[1]C[-1],-1,0)))"
Set Z = Columns(3).Find(1, LookIn:=xlValues, Lookat:=xlWhole)
If Z Is Nothing Then GoTo Quit
Cells(Z.Row - 1, 2).Insert
GoTo Loop2
Quit:
End Sub
Bookmarks