Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How to develop a simple UDF like:
=Correct(Salary,Tax) so as to return a TRUE if the argument Tax = Salary * 10%? Thanx! -- Best Regards, FARAZ A. QURESHI |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Function Correct(Salary,Tax)
if Tax = (.1 * Salary ) then Correct = True else Correct = False end if End Function "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! -- Best Regards, FARAZ A. QURESHI |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Function Correct(Salary As Double, Tax As Double) As Boolean
Correct = Abs(Tax - (Salary * 0.1)) < 0.001 End Function -- __________________________________ HTH Bob "FARAZ QURESHI" wrote in message ... How to develop a simple UDF like: =Correct(Salary,Tax) so as to return a TRUE if the argument Tax = Salary * 10%? Thanx! -- Best Regards, FARAZ A. QURESHI |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
=IF(test,true,false) only ever returns "true"? | Excel Worksheet Functions | |||
What's the best way to toggle between true and false in Excel? Hiall, My excel work involves a lot of toggling between true and false (booleantypes) ... and it's very repetitive... Is there a way to select a bunch ofcells, and press a key short-cu | Excel Discussion (Misc queries) | |||
Search for 2 true arguments and return true or false | Excel Discussion (Misc queries) | |||
Function to return True/False if all are validated as True by ISNU | Excel Worksheet Functions | |||
Reverse false and combine with true true value | Excel Worksheet Functions |