excel compare to columns

Hi,

I have 2 columns in excel they both data in it but i need to find the differences and row numbers because one colums has 200 more records, they are not ordered in any particualr way either

Please help

Thanks,

R8VI
R8VIAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

magentoCommented:
Please send the sample i/p and o/p?
Arno KosterCommented:
assuming that the 2 columns are column A and column B, easiest way would be to sort both columns (one at a time) and to type the following formula in cell C1 :
=IF(A1<>B1, "difference", "")

Open in new window


you can then multiply the formula by dragging it downwards and apply a filter to hide all empty cells in the C column
Arno KosterCommented:
pay attention though that this approach will only give you the answers you need if entries in the rows are related to each other. When both columns are identical but one cell is missing, you will get a lot of differences !

if you could post an example sheet, we could come up with an answer suitable to your situation.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

R8VIAuthor Commented:
Hi,

Sorting is really not an option because there are about 3000 plus records and example data

1974635      3438418
3438418      3592898
3592898      7138356
7138356      7310161
7141481      7771217
7310161      1974635

on this data there is only 1 records that match both coloums I need to find all the differences

Thanks,

R8VI
kgerbChief EngineerCommented:
Hello R8VI,
Take a look at the example workbook.

It uses the following formula

=IF(ISERROR(MATCH(D5,MyRange,0)),"No Match",ROW(OFFSET(MyRange,0,0,1,1))+MATCH(D5,MyRange,0)-1)

Open in new window


The range MyRange is the shorter list.  The formula will return "No Match" is the item is not found in both lists.  Otherwise it will return the row number of the first match in the second list.

Kyle
Q-27379213-RevA.xlsx
Arno KosterCommented:
So for given example you would like to get all records on the left except for the 3438418 entry ?
Arno KosterCommented:
then use kgerb's function and filter all entries to show only those containing "No Match"
R8VIAuthor Commented:
Hi kgerb's

I have tried your example but still i dont think its right this is how I have changed it to


=IF(ISERROR(MATCH(C2,B2:B3908,0)),"No Match",ROW(OFFSET(B2:B3908,0,0,1,1))+MATCH(C2,B2:B3908,0)-1)

but I am getting more than 1000 records that dont match

when the big list has 3908 records and small list has 3642 records so there should only be about 260 odd that dont match or not there

and need to identfiy which row or which ones they are

Thanks,

R8VI
R8VIAuthor Commented:
Hi,

I looked at the first record in C  and it says no match
the record is 345444 I did a control find in B and its the 6 one down

Please help

Thanks,

R8VI
kgerbChief EngineerCommented:
I think the problem might be that you need to reference your short list absolutely.  Change B2:B3908 to $B$2:$B$3908.  If that doesn't work I'll need to see some data.  It's hard to know why the match function is not working correctly without seeing the actual data.  Can you paste the two columns of data into a new workbook and upload it?  

Also, my formula returns the row of the first match found in the short list.  Is that not what you want?  I attached a new workbook with the data you provided.

Kyle
Q-27379213-RevB.xlsx
R8VIAuthor Commented:
Hi Kyle,

I am not sure if this is what your solution does.

But what I want it that take everything from A and match To B and bring back row number or records that do not appear in B which is the smaller one

Thanks,

R8VI
kgerbChief EngineerCommented:
Ok, let's try this again.  Select the short list (column B I assume) from the first data entry to the last and name this range "MyRange".

In column C put the following formula:
=IF(ISERROR(MATCH(B3,MyRange,0)),ROW(B3),"")

Open in new window

This will indicate which values in column A are not found in column B.  Drag the formula all the way down to the bottom of the short list.  Name this range "BlanksRange" because the numbers are separated by blank cells.

Create another named range in column D right next to "BlanksRange" named "NoBlanksRange".  This range must be the same size as "BlanksRange".

In the first cell of "NoBlanksRange" put the following formula:
=IF(ROW()-ROW(NoBlanksRange)+1>ROWS(BlanksRange)-COUNTBLANK(BlanksRange),"",INDIRECT(ADDRESS(SMALL((IF(BlanksRange<>"",ROW(BlanksRange),ROW()+ROWS(BlanksRange))),ROW()-ROW(NoBlanksRange)+1),COLUMN(BlanksRange),4)))

Open in new window

NOTE:  THIS IS AN ARRAY FORMULA!!!!  You need to press CTRL+SHIFT+ENTER after you paste it into the cell.

Drag this formula all the way to the bottom of "NoBlanksRange".  It will list all the rows where no matches occur without the blanks cells.

I think this will get us where we want to be:).

I have attached a file for your reference as well as some pictures.

Kyle

 pic1 pic2 pic3Q-27379213-RevC.xlsx

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.