Solved

Excel find text within cell in a range of cells.

Posted on 2013-05-21
3
6,362 Views
Last Modified: 2013-05-21
I can't find an answer to my exact situation here or elsewhere.  It's pretty simple, here's an example:

(row 1 and col 1 are the spreadsheet row/column)

   A                         B
1 bird                     one
2 bird dog             two      
3
4 (text to lookup) (VLOOKUP function)


I would like to use a vlookup function in cell B4 to find text in cell A4 within the range A1:B2 and report the value in column B. For example if A4 contains the value "bird", and I enter in B4 VLOOKUP(A4,A1:B2,2,0) and it returns the value I need - in B1 "one". But if I enter VLOOKUP("dog",A1:B2,2,0), it returns the #N/A error instead what I need, which is the value in B2 "two". I need the latter function to report the value in B2 = "two". In other words, find the text string WITHIN the cells in column A, not just the matching value. Is there a formula that will get me there or does it have to involve a macro? I much prefer a formula...
0
Comment
Question by:orerockon
3 Comments
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 39185184
You can use wildcard character * with VLOOKUP

e.g.

in B4:

=VLOOKUP("*"&A4&"*",A1:B2,2,0)
0
 
LVL 11

Expert Comment

by:Guru Ji
ID: 39185196
You just put your cursor at the end of comma after two and you will see two options

One is TRUE Approximate Match and other is False (Exact Match).

Using this, you will get what you want.

=VLOOKUP(A4,A1:B2,2,)

There is also a nice tutorial on youtube to show what i am talking about above visually

http://www.youtube.com/watch?v=ApS9oAYJMQo
0
 

Author Closing Comment

by:orerockon
ID: 39185399
Fabulous THANK YOU!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

863 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

22 Experts available now in Live!

Get 1:1 Help Now