Excel Formula to search part of

Posted on 2016-08-11
Last Modified: 2016-08-15
can you please help,
I'm trying to search part of text in one column and get results back from another sheet.
I tried below formulas, but not getting proper results.

=IFERROR(VLOOKUP("*"&LEFT($A2,15)&"*", Daily_Orders!$B:$S, 3,FALSE),"")

Example in Column A to lookup
TR: 909334288787
TR: 54998762445, 8796498126409,221421414

Question by:W.E.B
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
LVL 51

Expert Comment

ID: 41751922

Could you send a sample?

LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 41751927
What do you have in


Author Comment

ID: 41751964
Please see attached sample,

here's what I have,
I need to scan few hundred orders into Column A,
after I'm done,
In Column B,C,D,.....
 I need to search the tracking in the Daily_Orders tab.
And return
Columns b,c,d,e,.........

One Example,
if I scan 8796498126409, it should find it in the Daily_orders tab (Column S) --
TR: 54998762445, 8796498126409,221421414
And return
Columns b,c,d,e,.........
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

LVL 33

Accepted Solution

Rob Henson earned 500 total points
ID: 41751992
Try this:

Col B =INDEX(Daily_Orders!$B$2:$U$6,MATCH("*"&$A5&"*",Daily_Orders!$S$2:$S$6,0),1)
Col C =INDEX(Daily_Orders!$B$2:$U$6,MATCH("*"&$A5&"*",Daily_Orders!$S$2:$S$6,0),2)
Col D =INDEX(Daily_Orders!$B$2:$U$6,MATCH("*"&$A5&"*",Daily_Orders!$S$2:$S$6,0),3)
Col E =INDEX(Daily_Orders!$B$2:$U$6,MATCH("*"&$A5&"*",Daily_Orders!$S$2:$S$6,0),4)

Adjust "Daily_Orders!$B$2:$U$6" to the full range and "Daily_Orders!$S$2:$S$6" to the full height of column S.

VLOOKUP relies on the lookup value being in the leftmost column of your lookup area.
LVL 33

Expert Comment

by:Rob Henson
ID: 41751998
If your proper data has unique column headers, and they are the same across the source and the result tables, the column index at the end of the above formula can be adjusted to a MATCH formula to find the relevant column Header.

Author Comment

ID: 41752005
Hi Rob,
yes they have unique column headers,
And the same in both sheets.

Expert Comment

by:Christopher Jay Wolff
ID: 41752009
I'm wondering why the daily orders are put into the same cell in column S.  It might be a better practice to have a separate row for each of the daily orders, especially if there is a focus on searching and manipulating your data based on individual column S entries.

Would you be able to get column S to list a separate row for each datum in column S?

Then to try to rephrase to make sure we're thinking alike...

You would start with two worksheets.  One is the Daily Orders tab, the other worksheet is blank with a tab named Scan, and you scan into column A of the blank sheet a few hundred entries.  Then, miraculously, the data in the remaining columns of Scan tab is populated by transferred data from Daily Orders tab, for whatever row provides a match.  Is that correct?

Also, if searching data in Daily Orders tab, using the data from column A of Scan tab, are you only looking at column S of Daily Orders tab, or all the data in the Daily Orders tab?

Author Comment

ID: 41752012
I tried the formula,
it's working only on numbers.


not worling on below example (Getting #N/A)

Author Comment

ID: 41752015
Hi Chris,
the codes I'm scanning are not always to be found in Column S.
different clients, different columns to use.
So, I'll be looking through all columns (A-S)

LVL 33

Expert Comment

by:Rob Henson
ID: 41752024
Your last comment answers why you are getting #N/A for the entries starting M223.

They are not present in column S so the formula is not finding them.

All standard lookup formulas (INDEX, LOOKUP etc) rely on the lookup value being in one column; I suspect a multiple column scan can be achieved with VBA or a User Defined Function (effectively VBA embedded into a formula).

Author Closing Comment

ID: 41757215
Thanks Rob,
your formula worked like a charm , with some tweaks,

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

Suggested Solutions

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…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

752 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