Public Sub FlagNonMatching()
Const FORMULA_CHECK As String = "SUMPRODUCT(--(B2:B<lastrow>+C2:C<lastrow>=D2:D<lastrow>))=COUNT(D2:D<lastrow>)"
Dim lastrow As Long
With ActiveSheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
With .Range("D2").Resize(lastrow - 1)
.FormatConditions.Add Type:=xlExpression, Formula1:="=D2<>B2+c2"
.FormatConditions(1).Interior.Color = vbRed
End With
If Not .Evaluate(Replace(FORMULA_CHECK, "<lastrow>", lastrow)) Then
MsgBox "Differences detected", vbOKOnly, "Check Am,ounts"
End If
End With
End Sub