Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Find something that is not an exact match

Posted on 2016-10-26
23
Medium Priority
?
73 Views
Last Modified: 2016-11-02
Is there a formula that will find items even though they are not exact. I tried using a variation of VLookup but failed miserably.

Lets say I have these on Sheet 1

272637 27FEB600304

SECURE TRUST B1016003 BS BMCE2


And these on Sheet2

SECURE TRUST B1016003

272637 27FEB600304 BS BMFSP  (2)

I am sure there is a way but only an expert will know the answer to that.

Here’s hoping
0
Comment
Question by:Jagwarman
[X]
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
  • 10
  • 7
  • 3
  • +2
23 Comments
 
LVL 9

Expert Comment

by:Koen
ID: 41859896
Microsoft offers an add-in for excel that can do 'fuzzy' lookups...

you can find it here
0
 
LVL 18

Expert Comment

by:xtermie
ID: 41859903
Vlookup could work if you don't use the TRUE;FALSE option/argument at the end (which is optional)
0
 
LVL 9

Expert Comment

by:Koen
ID: 41860100
Vlookup without true; false is dangerous when comparing strings.. you need your data to be sorted...so you depend on the classicall alphabetical sort, which with 'fuzzy' strings could result in two near equal strings to be miles apart.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 46

Expert Comment

by:aikimark
ID: 41862231
When there is a 'match', are the strings going to be identical in their leading (left-most) characters?
0
 

Author Comment

by:Jagwarman
ID: 41862413
Hi aikimark, yes they are
0
 
LVL 46

Expert Comment

by:aikimark
ID: 41862558
A function could easily do this, but you seem to have your heart set on a formula.

I was thinking there might be some way to combine the Left() and Len() functions, but I don't know if the Left() function can be used that way
0
 

Author Comment

by:Jagwarman
ID: 41862581
I would be happy to use a function aikmark
0
 
LVL 46

Expert Comment

by:aikimark
ID: 41862633
This will return the row in the lookuprange where the left-side-match is found.  A zero value is returned
Function Q_28978929(ByVal parmText As String, parmLookupRange As Range) As Long
    Dim rng As Range
    If Len(parmText) = 0 Then
        Exit Function
    End If
    For Each rng In parmLookupRange
        If Left(rng.Value, Len(parmText)) = parmText Then
            Q_28978929 = rng.Row - parmLookupRange.Rows(1).Row + 1
            Exit Function
        End If
    Next
End Function

Open in new window

0
 

Author Comment

by:Jagwarman
ID: 41862784
Ah now you've got me aikmark. I am obviously familiar with Sub but not function. How do I get that to run? Sorry for being so dumb
0
 
LVL 46

Expert Comment

by:aikimark
ID: 41862828
1. put it into a module in your workbook
2. create a formula in your worksheet that references a single cell (first parameter) and a range (second parameter)
0
 

Author Comment

by:Jagwarman
ID: 41862857
I am dumber than I thought I was :-(
0
 

Author Comment

by:Jagwarman
ID: 41867975
aikimark, sorry but I have tried to work this out, reading up on google how to kick start a function but cannot work it out.
0
 
LVL 27

Expert Comment

by:ProfessorJimJam
ID: 41868092
@Jagwarman

please open attached file. i have put the fuzzylook UDF originally written by Alan from MRExcel

you can see that in sheet1 column B the matched value is returned from Sheet2
EE.xlsm
0
 
LVL 46

Expert Comment

by:aikimark
ID: 41868170
@Jagwarman

1. Do you have a module in your VB project?
If not, Alt+F11 to get you into the VB environment.  Insert a new module.  Paste my function

2. What does your formula look like?
0
 

Author Comment

by:Jagwarman
ID: 41868474
aikimark I am using this formula

=RIGHT(CELL("filename",D2),LEN(CELL("filename",D2))-FIND("]",CELL("filename",D2)))
0
 

Author Comment

by:Jagwarman
ID: 41868503
also tried =IF(L1<=1,SUM(L1:M1))
0
 
LVL 46

Expert Comment

by:aikimark
ID: 41868659
I don't see any reference to the Q_28978929 function.
0
 
LVL 27

Expert Comment

by:ProfessorJimJam
ID: 41868667
0
 

Author Comment

by:Jagwarman
ID: 41868951
aikimark I'm sorry I don't know how to do that
0
 

Author Comment

by:Jagwarman
ID: 41868954
ProfessorJimJam I tried that it kinda works but I have 12000 lines and so many are invalid matches.
0
 
LVL 27

Assisted Solution

by:ProfessorJimJam
ProfessorJimJam earned 1000 total points
ID: 41869009
@Jagwarman

it did not work because we did not put the % of strength.  now i set that to 75% but putting .75 into the next argument of UDF.

you can increase it, but i am sure this will work.

please see attached.
EE.xlsm
0
 
LVL 46

Accepted Solution

by:
aikimark earned 1000 total points
ID: 41869064
Look at the formulas in the attached workbook
Q_28978929.xls
0
 

Author Closing Comment

by:Jagwarman
ID: 41869678
both of these are going to be able to help me so many thanks and thank you for sticking with me.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
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 will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

670 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