Compare text in one cell against a range

Posted on 2012-09-10
Last Modified: 2012-09-10
Hi guys, I need a formula that will look at cell A1 and compare it against column B, if it finds it, show that value, if not, show "not found".

Cell A1 contains clean text, but column B contains more than just the text I'm looking for.

For example,
A1: John Smith

B1: Customer Name, Michael Onslow of company A
B2: Customer Name, Peter Taylor of company L
B3: Customer Name,  John Smith of company D
B4: Customer Name, Amanda Ormond of company W

So in cell C1 I need it to look at A1, find it in column B and display the contents of that cell in column B.

Hope that makes sense.
Question by:amaru96
    LVL 85

    Accepted Solution

    =IF(ISNUMBER(MATCH("*"&A1&"*",B:B,0)),VLOOKUP("*"&A1&"*",B:B,1,FALSE),"Not found")

    if using 2007 or later you can shorten to:

    =IFERROR(VLOOKUP("*"&A1&"*",B:B,1,FALSE),"Not found")
    LVL 1

    Author Comment


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    executing macros from all files in a folder 5 24
    25th of every month 7 38
    VBA Help TT V-1.1 15 22
    Dynamic Bar chart in Excel 5 14
    This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
    Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
    Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
    This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

    731 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now