Insert a module to the VBA project and use code like:
Function Correct(Salary As Double, Tax As Double) As Boolean
If Abs(Tax - (Salary * 0.1)) < 0.001 Then
Correct = True
Else
Correct = False
End If
End Function
The function considers a difference between Tax and Salary * 10% of
less than 0.001 to mean equal. Due to the intrinsic rounding, it is
likely that the two values may be slightly different when they should,
in fact, be considered equal.
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
On Tue, 17 Feb 2009 10:02:11 -0800, FARAZ QURESHI
wrote:
How to develop a simple UDF like:
=Correct(Salary,Tax)
so as to return a TRUE if the argument Tax = Salary * 10%?
Thanx!