• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Compare 2 excel cells

Hello,
I'm trying to do a simple compare between 2 cells.
I used
=IF(A1=B1,TRUE,FALSE)
=EXACT(A1,B1)
=MATCH(A1,B1)

Nothing seems to give me the correct answers.
Please see attached. (Cells contain numbers and texts).

Any help is appreciated.
sample-compare.xlsx
0
W.E.B
Asked:
W.E.B
  • 3
  • 2
  • 2
  • +3
5 Solutions
 
Shanan212Commented:
=IF(A1=B1,"TRUE","FALSE")

Open in new window


You are missing quotes
0
 
Jeff DarlingDeveloper AnalystCommented:
What kind of result do you want?

When I try the =IF(A1=B1,TRUE,FALSE) code in Cell C1 it returns TRUE.
0
 
W.E.BAuthor Commented:
Hello,
NOPE,  will not work,
try line 20 it should say false.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
fb1990Commented:
try this......

IF(A1=B1,"TRUE","FALSE")
0
 
hanklmCommented:
There's nothing wrong with your first formula:

=IF(A1=B1,TRUE,FALSE)

Shanan212's solution would give you text for true and false instead of boolean values which you may or may not want.

But, I think the real issue is that caculations are set to manual on your worksheet (far right of Formulas tab).  This means that you won't get the expected results until you recalculate the worksheet.

For typical use, it is fine to leave Excel in automatic calculation.  Exceptions would be high complexity, large data sets, or transient data.
0
 
fb1990Commented:
try this......

IF(A1=B1,"TRUE","FALSE")
sample-compare.xlsx
0
 
Jeff DarlingDeveloper AnalystCommented:
like this?

example1
0
 
Jeff DarlingDeveloper AnalystCommented:
@hanklm  - You got it.  It appears that the sheet is not calculating automatically.

If I go to the cell, press F2 to edit, then press enter, the value changes.  

either that, or just press F9
0
 
Shanan212Commented:
Ahh you have automatic calculations disabled

Goto formula Tab - Click on 'Calculation Options'

Then click on 'Automatic'
0
 
Saqib Husain, SyedEngineerCommented:
You can even simplify the formula to

=A1=B1
0
 
W.E.BAuthor Commented:
That was it,
the automatic calculations was disabled
thanks for all.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now