Do you want a Cell Formula or a VBA user Defined Function?
If you want a UDF then
Code:
Public Function Check_Sum(rng1, rng2) As Variant
If WorksheetFunction.Sum(rng1) = WorksheetFunction.Sum(rng2) Then
Check_Sum = WorksheetFunction.Sum(rng2)
Else
Check_Sum = "Wrong"
End If
End Function
will work
To use it:
=Check_Sum(B3:C4,D3:D4)
Copy the code above and place it in a Code Module in VBA
Having supplied the code I'd now recommend against using this approach
This will slow down your model and make auditing more difficult
It can be just as easily achieved with a Function as you have already shown