ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF statement does not work with "=" sign (https://www.excelbanter.com/excel-worksheet-functions/86196-if-statement-does-not-work-%3D-sign.html)

BBinSimi

IF statement does not work with "=" sign
 
I have a simple if statement:
=IF(B42=B44,"Balanced","Not Balanced")
B42 and B44 are exactly the same dollar amount but it says "not balanced".
Both b42 and b44 are formatted as dollar amounts. The cell in question with
this statement is formatted as 'general'. I tried using other cells etc. I
used a 'watch' window and it stated the values of B42 and B44 as the same.
Thanks
Bill

Toppers

IF statement does not work with "=" sign
 
They may appear the same but if they have been calculated they not match
exactly.

If they are dollar amounts (no cents) try:

If (int(b42)=int(b44),"Balanced","Not balanced")

or

If (Round(b42,0)=round((b44,0),"Balanced","Not balanced")

If cents required, multiply by 100.

HTH

"BBinSimi" wrote:

I have a simple if statement:
=IF(B42=B44,"Balanced","Not Balanced")
B42 and B44 are exactly the same dollar amount but it says "not balanced".
Both b42 and b44 are formatted as dollar amounts. The cell in question with
this statement is formatted as 'general'. I tried using other cells etc. I
used a 'watch' window and it stated the values of B42 and B44 as the same.
Thanks
Bill


Bob Phillips

IF statement does not work with "=" sign
 
If a dollar amount, more probably

=If (Round(b42,2)=round((b44,2),"Balanced","Not balanced")


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Toppers" wrote in message
...
They may appear the same but if they have been calculated they not match
exactly.

If they are dollar amounts (no cents) try:

If (int(b42)=int(b44),"Balanced","Not balanced")

or

If (Round(b42,0)=round((b44,0),"Balanced","Not balanced")

If cents required, multiply by 100.

HTH

"BBinSimi" wrote:

I have a simple if statement:
=IF(B42=B44,"Balanced","Not Balanced")
B42 and B44 are exactly the same dollar amount but it says "not

balanced".
Both b42 and b44 are formatted as dollar amounts. The cell in question

with
this statement is formatted as 'general'. I tried using other cells etc.

I
used a 'watch' window and it stated the values of B42 and B44 as the

same.
Thanks
Bill





All times are GMT +1. The time now is 11:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com