Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing using "If" function
When I input =if(ab5=ab6,"yes","no")
I continually get a "no" because ab5 = 10.00001 and ab6 = 10.00002 Although I have both cells formatted for 0 (zero) decimal places, i.e. they both show a "10" in the spreadsheet, I wish this comparison to show a "yes" in its application. Various arithmetic progressions led to the decimal descrepancy. How do I correct my "if" comparison to show a "yes" given the above example?? Thanks, FLKulchar |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing using "If" function
Hi.
Pick some number of decimal places to round to, and then compare the rounded values. =if(round(ab5,5)=round(ab6,5),"yes","no") Alternatively, you could subtract one from the other and check the abs() of the result to see that it was less than some small number you picked.. =if(abs(ab5-ab6)<.00001,"yes","no") "F. Lawrence Kulchar" wrote: When I input =if(ab5=ab6,"yes","no") I continually get a "no" because ab5 = 10.00001 and ab6 = 10.00002 Although I have both cells formatted for 0 (zero) decimal places, i.e. they both show a "10" in the spreadsheet, I wish this comparison to show a "yes" in its application. Various arithmetic progressions led to the decimal descrepancy. How do I correct my "if" comparison to show a "yes" given the above example?? Thanks, FLKulchar |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing using "If" function
If you are using Integers only try this alternative....
=IF(INT(AB5)=INT(AB6),"Yes","No") Cheers Nigel "mark" wrote: Hi. Pick some number of decimal places to round to, and then compare the rounded values. =if(round(ab5,5)=round(ab6,5),"yes","no") Alternatively, you could subtract one from the other and check the abs() of the result to see that it was less than some small number you picked.. =if(abs(ab5-ab6)<.00001,"yes","no") "F. Lawrence Kulchar" wrote: When I input =if(ab5=ab6,"yes","no") I continually get a "no" because ab5 = 10.00001 and ab6 = 10.00002 Although I have both cells formatted for 0 (zero) decimal places, i.e. they both show a "10" in the spreadsheet, I wish this comparison to show a "yes" in its application. Various arithmetic progressions led to the decimal descrepancy. How do I correct my "if" comparison to show a "yes" given the above example?? Thanks, FLKulchar |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text "comparison" operator for "contains" used in an "IF" Function | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
function to return day in the form "Monday", "Tuesday" etc given . | Excel Worksheet Functions | |||
inserting a conditional "go to" command on a excel "if" function | Excel Worksheet Functions | |||
Please add a "sheet" function like "row" and "column" functions | Excel Programming |