0

I have derived a file using two different methods; FoxPro and SQL. Because I am most familiar with it, I decided to compare the two end results in Excel to see if they are identical. 79,954 rows so needless to say, not going to do this line by line. First, I want to see if the company names are the same. I create a new tab and put the company name columns from each next to each other. From there, The first method that I used is

 =exact (B2,C2)

It returns a false value when I can see with my eyes is not true. Next I use a very simple IF statement,

 =if(b2=c2,0,1)

It returns a value of 1.

Is there a better method of doing this?

3 Answers 3

1

EXACT is case sensitive so you need to be sure you don't have any up/low letter mismatch.

You can also use equal which is NOT case sensitive:

=B2=C2

This formula will return TRUE or FALSE.

If it's still not working perhaps you have some spaces or other hidden characters. A solution would be to check if B2 includes C2 and opposite.

Sign up to request clarification or add additional context in comments.

2 Comments

I found that there were 18 to 20 extra spaces in the excel sheet that derived from sql. Used a trim function and got reasonable results after that.
The SQL column is most likely CHAR or NCHAR then, which retains trailing spaces on export, unlike VARCHAR and NVARCHAR.
1

=exact (B2,C2) does work, but you might have a space at the end some of your data which will return a false instead of a true because it compares the 2 and sees that "Test " does not equal "Test" because of the space be there.

Comments

0

In addition to hakela's answer, you could TRIM them first:

=(TRIM(B2)=TRIM(C2))

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.