VBA:
Dim MyRow As Long
MyRow = 1
While Cells(MyRow, 1) <> ""
If Cells(MyRow, 1) = Cells(MyRow, 2) Then
If Cells(MyRow, 3) = "xxx" Then
Cells(MyRow, 4) = "是"
End If
Else
Cells(MyRow, 4) = "否"
End If
MyRow = MyRow + 1
Wend