Solved

Excel compare 2 cells...

Posted on 2013-11-07
10
232 Views
Last Modified: 2013-11-07
This is so unbelievable in comparing 2 cells not working.  I have tried =A1=O1, EXACTMATCH, COUNTBLANK and a number of other IF statements and none work.

It is super simple what I am trying to do.

Compare 2 cells that may or may not have null values.  If the text is identical, give me a "O" else give me an "X".

So if the cells are both null or both exact text matches I want a "O", otherwise an "X".

PLEASE HELP lol....I have been doing this for hours and nothing is working (shouldn't this be easy?)  :)
0
Comment
Question by:cyimxtck
10 Comments
 
LVL 21

Expert Comment

by:oleggold
ID: 39630566
i'd try search, also You may have blanks so You'll need to trim the values in both cells.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 39630577
=IF(A1=O1,"O","X")
0
 

Author Comment

by:cyimxtck
ID: 39630670
=IF(A1=O1,"O","X") doesn't work.  It evaluates to O for all values regardless if they are different or not.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:cyimxtck
ID: 39630672
null and text is a case in point.  A1 = null and O1 has text
0
 
LVL 33

Expert Comment

by:Norie
ID: 39630694
Strange if I try this with A1 empty (null) and O1 with text the result is X.

=IF(A1=O1, "O", "X")

What exactly do you have in A1 and O1?
0
 
LVL 26

Accepted Solution

by:
pony10us earned 500 total points
ID: 39630700
Have I missed something in your request?  This is what I get as a result:

eecaptuer.jpg
Using Excel 2007, formula in C1 and copied down through C6
0
 
LVL 26

Expert Comment

by:pony10us
ID: 39630718
If I put a space (blank character) in A7 and nothing in cell B7 then I get an X because they don't equal even though they look like they do.  That is the only option that I can think of that would cause this.
0
 

Author Comment

by:cyimxtck
ID: 39630828
MS Office Professional Plus 2010 here is what I get:

IF(A200=O200, "O", "X")

A200 = nothing
O200 = Interactive Data

X works and finds the correct answer.

IF(A203=O203, "O", "X")

Fails and gives me an X when both cells are blank.

IF(TRIM(A201)=TRIM(O201), "O", "X")

A201 = nothing
O201 = Spotfire

Fails and gives me a O.

See what I mean? this should be so simple but things are not working.  Is there a setting somewhere or something?
0
 

Author Comment

by:cyimxtck
ID: 39631101
Something is jacked with that other spreadsheet....I did the same test on my laptop and your above logic works....NO clue how that is possible but I have been pulling out what little hair I have left for no reason.

Maybe it is corrupt?

Thanks for the help and sanity test!
0
 
LVL 26

Expert Comment

by:pony10us
ID: 39631166
Thanks for letting us know.  I was starting to pull out what's left of my own hair.  I couldn't get it to fail and I have been trying all sorts of ways.  :)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel VBA User Form Help 21 28
VBA question, how many data set exists in the sheet 14 54
Excel VBA 4 26
Merging spreadsheets 8 37
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question