Need to compare the string of two columns

Posted on 2013-01-23
Last Modified: 2013-01-23
Need to compare the string of two column and need the result as true/False.


A1 - suski,white A2 - Ward,William A3 - Wilson, Tony A4 - Denise ,Mary A5 - Jouswa, Stephen

B1 - Jouswa, Stephen B2 - Wilson,Tony B3 - Denise ,Mary B4 - Briggs, Matt B5 - Suski,White

Take the String in A1 and need to compare with all the string in the B column, if it present in B column .Then print True on C1.
Question by:Venugopal N
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
LVL 50

Accepted Solution

Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 175 total points
ID: 38808898

In column C, starting in C2, assuming row 1 has labels:




copy down

cheers, teylyn

Assisted Solution

by:Jignesh Thar
Jignesh Thar earned 75 total points
ID: 38808899
Put below in C1 and copy it down
LVL 50
ID: 38808902
jigneshthar, Vlookup will work, too, but will be slower than Match(). Countif() is probably the fastest function for this. Does not make much of a difference in small files, but for large datasets it might pay off to use a fast function.
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.


Expert Comment

by:Jignesh Thar
ID: 38808921
teylyn - I wan't aware about this. Do you know why that is? Doesn't vlookup end as soon it finds first exact match which is similar to Match loop?

Countif should be longest as it has to loop through entire column B to get the result.
LVL 50
ID: 38808925
Vlookup is slower because after finding the item it then needs to locate the column to return. This is another operation that cost a few nanoseconds. Match simply returns the row index.

Countif works in a completely different way and is super-fast.

Expert Comment

by:Jignesh Thar
ID: 38808967
teylyn - Very interesting!! Can you point me to some resources where it comparaes various functions from performance point of view?

If Vlookup is to return same column (B:B), it doesnt necessarily have to do another lookup - assuming it is smart enough. :-)
LVL 11

Author Closing Comment

by:Venugopal N
ID: 38808995
Thanks for the reply.
LVL 50
ID: 38809010
@Venurajav, sorry for the highjack. Maybe you get something out of it, too.

Some light reading. If you are interested in fast Excel, then read anything by Charles Williams.

Re Countif:
" If you cannot use two cells, use COUNTIF. It is generally faster than an exact match lookup:" source: (by Charles Williams)

And a discussion among Excel MVPs about what is faster: Vlookup or Index/Match (mind you, it turns out that Vlookup is faster, but they compare it with the Index/Match COMBO, where Match is nested in an Index function, and not with a simple Match on its own.

Also, there's code to time things, so if you want to give this a go ...

cheers, teylyn

Expert Comment

by:Jignesh Thar
ID: 38809019
@Venurajav, sorry about barrage of posts for simple solution!! :-) Am still learning and I see there is long way to go...

@teylyn, thanks for all the resources. Will certainly going to digest so that I can write performant formula / code. Thanks again!! :-)

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

734 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