Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
function to return day in the form "Monday", "Tuesday" etc given . MTro Excel Worksheet Functions 2 October 3rd 07 09:49 AM
inserting a conditional "go to" command on a excel "if" function velasques Excel Worksheet Functions 5 March 10th 06 08:16 PM
Please add a "sheet" function like "row" and "column" functions Spreadsheet Monkey Excel Programming 2 November 8th 05 04:08 PM


All times are GMT +1. The time now is 09:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"