Approximate search in text data (Excel VBA, Excel SQL)

Posted on 2013-01-27
Last Modified: 2013-01-28
Hello, dear members and experts!

There are good (efficient) solutions for Approximate text seach in data (for Excel VBA, Excel with SQL-queries)?

The main task is: finding from external database (Excel's file) data corresponding to data in specified collumn in main Excel's sheet.

Second task: include approximate search into custom made improved_VLOOKUP function –

Thanks in advance!
Question by:Last_Free_Man
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
  • 3
  • 3
  • 2
LVL 26

Expert Comment

ID: 38824075

Could you be more specific about what approximate search means to you, please? Links to existing good solutions would be good!

LVL 92

Expert Comment

by:Patrick Matthews
ID: 38824198
Agreed with Brian: we need clarification on what an approximate match is.

Taking my approach from the last question, suppose you need "the Order Number for the 7th item from the top where the Manager's name starts with 'J'."

In that case, you could use this array formula:


Author Comment

ID: 38824729
I will try to explain my programmer's tasks.

I have two tables.

Table_A (XLSX file) containts column with projects names (text string with length equal 255 characters).
This data based on users input. Because of human factor projects names often have inaccuracy: double spaces, lack of spaces, mixed caps and small letters, lack of pointings and etc.

Table_B (XLSX file) containts column with project names too. But this field can have length more as 255 characters (and sometimes with NewLine symbols). Usually data in this column is more accurate than in Table_B but this is also result of users input and edit.

The task is find data in Table_B correspond to data in Table_A (with approximated search)

I need in solution based on VBA (as part of many checking and fixing subprograms).
SQL-queries (with ADO connection) are also good tool (I use it now in this current checking project).

The main plan is: use RegExp for throw off any characters in string except numbers and letters and then compare string with simplification.

Do you have any different ideas? - Good!

P.S. I have good programmers background: Perl, MySql, a little bit of JavaScript. But VBA and ADO is new languages and technologies for me. (Sorry! I'm newbe in English too!)
Help me please!
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

LVL 26

Expert Comment

ID: 38824746
Thanks,  Last_Free_Man.

You've got matthewspatrick involved and as he is exactly the right expert for this, I'm going to quietly leave!

LVL 92

Expert Comment

by:Patrick Matthews
ID: 38825168
Sample file(s) would be helpful :)

Author Comment

ID: 38828114
Example attached.

It contains cyrillic symbols.
If you can't read then please write here and I will make transliteration.

Thanks in advance!
LVL 92

Accepted Solution

Patrick Matthews earned 500 total points
ID: 38828564
I'm usually game for RegExp work; indeed, I wrote one of the definitive articles on using RegExp with Excel:

However, doing that with cyrillic characters is going to be over my head.

I think you should use Request Attention to ask the Mods to add more zones (Regular Expressions, Perl, and JavaScript make sense), and send out alerts for Designated Experts.


Author Comment

ID: 38829924
Dear Patrick!

Yours arcticle is brilliant!

Thank you very much!

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
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…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

726 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