if statement does not work with = sign

B

BBinSimi

I am trying to use this function:
If(b44=b46, "Balance","Not balance"). b44 and b46 are exactly the same
dollar value. Both cells are formatted for currency. The cell that the text
is written is formatted as general. Both b44 and b46 are calculated cells
that add a column of numbers. Have tried using sum statement instead of
b44,46 etc. In the watch window both values are the same, but the b44=b46
statement is false.
Thanks for your help.
Bill
 
C

Chip Pearson

Bill,

Excel, like nearly all computer programs, use what is called
"double-precision floating point numbers", which are limited to
15 digits of precision. Cells that appear equal may differ by
some very small amount, the error introduced by rounding. See
www.cpearson.com/excel/rounding.htm for more details. You could
write your formula like

=IF(ABS(B44-B46)<0.00000001,"Balance","Not Balance")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top