Link to home
Start Free TrialLog in
Avatar of aubie8
aubie8

asked on

Quick compare of two excel columns

I have two columns in excel.  Column one is roughly 2500 rows and column two is roughly 10,000 rows.  Column two is sorted in alphabetical order.

I am looking for the quickest way to compare the data in column one and see if it is in column two.

Would it matter if column one was also sorted?

Of course, I could just start at the top of column two and go down each time, but that takes way too long.

I would REALLY like to do this recursively if possible, but it has been quite a while since I have done that and would need some good code to look at.

I don't think this is HARD, but because of time limitations, I will reward alot of points for fast code, easy to understand and comes back here quickly.  And if allowed, bonus points if its recursive and enough explanation for an old programmer to follow it quickly.

Thanks you guys!

Chris
Avatar of MrNed
MrNed
Flag of Australia image

sorry, dont have time to write code. im not sure if the built in Excel functions are very fast. if it were me, i would write a binary search algorithm.

google on binary search and you should find heaps of examples. it is not recursive and you shouldnt need that anyway.
Avatar of Jacamar
Jacamar

It would definately help if both rows were in alphabetical order.  That way, after you check the first item in the list, you will beable to resume your search from where it was found in colum 2.  You will only have to go through the list of 10000 once and you will know if they are all there.

Jacamar.
ASKER CERTIFIED SOLUTION
Avatar of Jacamar
Jacamar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aubie8

ASKER

this was good even if hard for ME to follow...  I did figure out a way to do this for myself too.  Thanks for the help!